建表
hadoop fs -put data.txt hdfs_path drop table tablename; CREATE TABLE tablename ( column1 string, column2 string ) partitioned by (column2 string,columns4 string) row format delimited fields terminated by ',' stored as textfile ; load data inpath 'hdfs_path/data.txt' into table tablename;
添加表字段
use 库名;
alter table table_name add columns(column1 int, column2 int);
alter table table_name add columns(column1 int, column2 int);
显示列名:Set hive.cli.print.header = true;
返回星期几(0~6):pmod(datediff(date, '1920-01-01') - 3, 7