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
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
Hope this will be helpful.