常用的hive操作

查询结果加一列序号

select row_number() over(partition by 1) as rowNum,
ta.*
from tableA ta;

 

查询结果增加字段relationship,内容为friendship

select ta.*,
'friend' as relationship
from tableA ta;

 

创建一个textfile表

create table if not exist databaseA.tableB as
select * from tableA

 

创建一个parquet表

create table if not exist databaseA.tableB stored as parquet as
select * from tableA

创建一个分区表

查询表的信息

 

你可能感兴趣的:(大数据,hive,hive,建表,查询)