- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Convert select query output to CSV from beeline or impala-shell
- Labels:
-
Apache Hive
-
Apache Impala
Created ‎10-20-2020 01:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
We are using a beeline or impala-shell to extract data from hive tables as per requirement from the end-user. However, the request for data extraction is for high records for more than 1000 or sometimes more than 3000. It is very tedious to extract using the select query and dump to excel sheet.
Is there any alternative way to take the output in a CSV file?.
Like the output of select query moves to CSV file.
Please suggest.
Created ‎10-20-2020 10:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
impala-shell -i <hostlb/impaladhost>:<impala-shell port> -d <db-name> -k -q
--ssl --ca_cert=<ca-cert path>
"query" -o /path/to/file.csv -B
//Sample shell command from my test bed
impala-shell -i host-10-17-102-166.coe.cloudera.com:25003 -d test_database -k --ssl --ca_cert=/opt/cloudera/security/cacert.pem -q "select * from salerecord limit 20" -o output.txt -B
Can you try the above with the updated configurations from your environment and let me know if this addresses your query.
Created ‎10-20-2020 10:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
impala-shell -i <hostlb/impaladhost>:<impala-shell port> -d <db-name> -k -q
--ssl --ca_cert=<ca-cert path>
"query" -o /path/to/file.csv -B
//Sample shell command from my test bed
impala-shell -i host-10-17-102-166.coe.cloudera.com:25003 -d test_database -k --ssl --ca_cert=/opt/cloudera/security/cacert.pem -q "select * from salerecord limit 20" -o output.txt -B
Can you try the above with the updated configurations from your environment and let me know if this addresses your query.
Created ‎10-24-2020 11:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tushar
Thanks a lot for your quick reply. The resolution you provided has worked. I am accepting it as a solution.
Thanks once again.
