Reputation: 106
How to execute hive commands directly from .hql file?
Upvotes: 7
Views: 32621
Reputation: 1
hive -f filepath;
example
hive -f /home/Nitin/Desktop/Hive/script1.hql;
Upvotes: 0
Reputation: 215
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
Upvotes: 8