Reply
Explorer
Posts: 40
Registered: ‎02-01-2017
Accepted Solution

Saving output of impala query to hdfs

Is it possible to save the output of an impala query to hdfs .

 

Sample query 

 

impala-shell --ssl -i "${load_balancer}" -f  "${2}" -o "${3}"

Would like to have it saved not to local but to hdfs.

 

Thanks

Expert Contributor
Posts: 123
Registered: ‎07-17-2017

Re: Saving output of impala query to hdfs

[ Edited ]

Hi @gimp077

I think there is two ways to do it:

1- You can put the output of impala-query in HDFS after you get it in a system file with PUT HDFS command:

sudo -u hdfs hdfs dfs -put "${3}" hdfs_path


2- You can use a directe insert into a result_table (stored in HDFS) just before your select statement:

INSERT INTO result_tables YOUR_QUERY

 

Announcements