簡體   English   中英

如何使用直線游俠將 hive 查詢寫入 csv 文件

[英]How to write hive queries to csv file using Beeline ranger

I am new to hive and I am trying to run a hive query using Putty and I want the output in CSV format without over writing files in the directory. 我使用了以下查詢

echo `beeline-ranger --outputformat=tsv2 -e 'select distinct xyz from database.table;' > /C:/Users/name/Documents/TBA /sample_${TODAY}.tsv` 

我正在嘗試在膩子 hive 環境中運行它,但出現以下錯誤

ParseException line 1:59 character '<EOF>' not supported here

代碼有什么問題,提前謝謝。

    This can help you with a solution

    beeline -u 'jdbc:hive2://[databaseaddress]' --outputformat=csv2 -e 'select * from table' > theFileWhereToStoreTheData.csv

OR

    beeline -u 'jdbc:hive2://[databaseaddress]' --outputformat=csv2 -f yourSQlFile.sql > theFileWhereToStoreTheData.csv

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM