要导入的文件格式
create table T(name string,age int,id int) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',';
LOAD DATA LOCAL INPATH '/usr/local/hive-1.2.1/conf/hive_input/' into table T
LOAD DATA INPATH 'hdfs://mycluster/hive_input/' into table T
load命令将hdfs中的数据加载到表数据文件中后,会将源数据删除
先创建表E create table E like T; 将查询结果插入表E insert into E select * from T; 可以多次追加导入 insert into E select * from T where name='dd';
创建表W 并从表E中导入数据 create table W as select * from E;