Hive

创建表

select '111' vin,'20170117' start_time,'20170811' end_time,'1.5T' displacement,'15670' sample_running_mile,'206' sample_days,'0.104' target_value,'fuel_filter' sample_sign from dual union all select '2222' vin,'20161117' start_time,'20170810' end_time,'1.5T' displacement,'15680' sample_running_mile,'266' sample_days,'0.096' target_value,'fuel_filter' sample_sign from dual union all select '3333' vin,'20161129' start_time,'20170811' end_time,'1.5T' displacement,'20100' sample_running_mile,'255' sample_days,'0.115' target_value,'fuel_filter' sample_sign from dual union all

分区表

a、单分区建表语句:create table test_table (id int, content string) partitioned by (dt string);
单分区表,按天分区,在表结构中存在id,content,dt三列。

b、双分区建表语句:create table test_table_2 (id int, content string) partitioned by (dt string, hour string);
双分区表,按天和小时分区,在表结构中新增加了dt和hour两列。

删除表内所有内容

truncate table

你可能感兴趣的:(Hive)