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

扫描二维码关注公众号,回复: 3750439 查看本文章

但是速度比较快

猜你喜欢

转载自www.cnblogs.com/tele-share/p/9861151.html