一、查询结果->hdfs
INSERT OVERWRITE DIRECTORY ‘output’ sql
select * from test;
(output:结果输出hdfs路径,sql:查询语句,字段间隔符:默认)
二、查询结果->hdfs,执行结果以‘\t’分割
insert overwrite directory ‘/home/wyp/Documents/result’
row format delimited fields terminated by ‘\t’
select * from test;
三、查询结果->服务器本地路径
insert overwrite local directory ‘/home/wyp/Documents/result’
row format delimited fields terminated by ‘\t’
select * from test;
四、将hdfs路径下文件映射hive表:
LOAD DATA INPATH ‘/hdfspath/test.txt’ INTO TABLE table_test
五、将本地文件映射进hive表
LOAD DATA local INPATH ‘/hdfspath/test.txt’ INTO TABLE table_test partition (pdate=’2016-06-21’)