1insert导出
1.1将查询结果导出到本地
insert overwrite local directory '/opt/hive/export/student' select * from student;
1.2将查询结果格式化导出到本地
insert overwrite local directory '/opt/hive/export/student1' row format delimited fields terminated by '\t' select * from student;
1.3将查询结果导出到HDFS上
insert overwrite directory '/usr/hive/student2' row format delimited fields terminated by '\t' select * from student;
2hadoop命令导出到本地
hadoop fs -get hdfs路径 本地路径;
3hive命令
hive -e 'select * from default.test;' >> test.txt
4export导出到hdfs上
export table default.student to '/usr/hive/warehouse/export/student';
导出的信息包括元数据信息以及表数据。