Created 10-19-2016 10:52 AM
I want to insert the table more than 100. Is it possible to do it in for loop in hql. if yes, please share it
Created 10-19-2016 04:48 PM
Just add the records to a file and LOAD the file to Hive.
Created 10-21-2016 06:16 AM
HI,
Please refer below example.
With a little bash we can loop through all our tables, appending the results to a file: #get a list of the files
hive -e "show tables;" > hivetables.txt
Now — cool stuff:
for line in $(cat hivetables.txt) ; do results=$(hive -hiveconf tablename=$line -f test.hql) echo $results >> tablecounts.txt
done
Hope this will be helpful.
Thanks,
Mahesh
Created 01-07-2017 04:25 PM
what is the purpose of test.hql? logic behind it?
Created 12-22-2016 01:47 PM
Thanks its working fine now. sorry for the delay reply
Created 12-22-2016 04:20 PM
@Anbu Eswaran please select the best answer as we don't know which answer helped most.