How to execute HQL commands using .hql files How to execute HQL commands using .hql files hadoop hadoop

How to execute HQL commands using .hql files


As mentioned by @rajshukla4696, both hive -f filename.hql or beeline -f filename will work.

You can also execute queries from the command line via "-e":

hive -e "select * from my_table"

There are plenty of useful command line arguments for Hive that can be found here: Hive Command line Options


hive -f filepath;example-hive -f /home/Nitin/Desktop/Hive/script1.hql;


Use hive -f filename.hql;

Remember to terminate your command with ;