08-20-2014 06:57 PM
Try below syntax. Remove -k if your environment is not kerberosized -
impala-shell -k -i servername:portname -B -q 'select * from table' -o filename '--output_delimiter=\001'
03-31-2017 05:49 AM - edited 03-31-2017 08:47 AM
I was trying to out put a query to a file after ssh into the server where impala was running. This is the query that i used impala-shell -B -q 'select * from requests limit 1' -o query_result.txt '--output_delimiter=,'
Here is the another way to have a complex query/queries(delimited by ;) in a file and output result to a file
impala-shell -B -f my-query.txt -o query_result.txt '--output_delimiter=,'
adding headers to the output data
impala-shell -B -f my-query.txt -o query_result.txt --print_header '--output_delimiter=,'