其他分享
首页 > 其他分享> > 数据导出

数据导出

作者:互联网

1.insert 将查询结果直接导出到本地

insert overwrite local directory "kg/qiaoruihua/hive/emp" select * from student; 
insert overwrite local directory "kg/qiaoruihua/hive/emp2" row format delimited fields terminated by "," select * from student; 

2.insert 将查询结果导出hdfs

insert overwrite  directory "/user/hive/warehouse/emp" select * from student; 
insert overwrite  directory "/user/hive/warehouse/emp2" row format delimited fields terminated by "," select * from student; 

3.利用shell命令导出

hive -e "select * from student" > "/opt/module/datas/student.txt"

4.利用hadoop导出到本地

dfs -get  /user/hive/warehouse/student/student.txt /opt/module/datas/student.txt

5.利用export导出

export table student to "/user/hive/warehouse/export/student";

 

标签:insert,导出,hive,overwrite,student,数据,select
来源: https://www.cnblogs.com/hapyygril/p/14089974.html