Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Saving output of impala query to hdfs

Solved Go to solution
Highlighted

Saving output of impala query to hdfs

Explorer

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

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Saving output of impala query to hdfs

Expert Contributor

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

 

1 REPLY 1

Re: Saving output of impala query to hdfs

Expert Contributor

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

 

Don't have an account?
Coming from Hortonworks? Activate your account here