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