I’m running a bash script on AWS EMR that does something like:
for i in (‘tab1’ ‘tab2’ ‘tab3’ ‘tab4’)
do
nrow=$(hive -e “select count(*) from $i”)
done
This takes time as for each count a new hive session have to be setup. Is there a way to keep the session open throughout the loop?