hive命令

hive数据导入:

创建表 
hive> CREATE TABLE pokes (foo INT, bar STRING);
从本地文件加载数据 
hive> LOAD DATA LOCAL INPATH '/home/hadoop/input/ncdc/micro-tab/sample.txt' OVERWRITE INTO TABLE records;
从hdfs文件加载数据 
hive> LOAD DATA INPATH '/home/hadoop/input/ncdc/micro-tab/sample.txt' OVERWRITE INTO TABLE records;
 
创建分区表
hive> create table logs(ts bigint,line string) partitioned by (dt String,country String);
加载分区表数据

hive> load data local inpath '/home/hadoop/input/hive/partitions/file1' into table logs partition (dt='2001-01-01',country='GB');

 

 

 

 

 

你可能感兴趣的:(hive)