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