1. 程式人生 > >Hive查詢結果輸出檔案

Hive查詢結果輸出檔案

進入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

具體分隔符等定義再參考相關命令。