首页 > 技术文章 > hive 导出数据的几种方式

tele-share 2018-10-27 14:44 原文

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";

但是速度比较快

 

推荐阅读