hive 导出数据的几种方式

1.使用insert导出

这种方式的优点在于既可以导出到hdfs上还可以导出到本地目录

下面以导出emp表中数据为例

 insert overwrite local directory "/opt/module/data/export/emp" 如果去除local,则是导出到hdfs上

row format delimited fields terminated by "\t"   (格式,可选)

 select * from emp;

导出结果

 

2.使用export导出

这种方式只能导出到hdfs上

export table emp to "/emp";

但是速度比较快

 

posted @ 2018-10-27 14:44  tele  阅读(1456)  评论(0编辑  收藏  举报