进入hive执行:
insert overwrite local directory '/tmp/ftp0803/' select * from tmp_ftp where userno='XX' order by starttime;
在/tmp/ftp0803/目录下看到文件。
或者直接执行:
hive -e 'select f28 from tmp_fjs_dba' >> /tmp/dbasql.txt
具体分隔符等定义再参考相关命令。
本文介绍如何使用Hive SQL将指定条件的数据导出到本地文件系统的方法,包括覆盖写入目录和追加到文本文件两种方式。
进入hive执行:
insert overwrite local directory '/tmp/ftp0803/' select * from tmp_ftp where userno='XX' order by starttime;
在/tmp/ftp0803/目录下看到文件。
或者直接执行:
hive -e 'select f28 from tmp_fjs_dba' >> /tmp/dbasql.txt
具体分隔符等定义再参考相关命令。

被折叠的 条评论
为什么被折叠?
