I have a hive query that has an echo command to print something. Below is a sample HQL file
!echo 'Total records';
use testDB;
select count(*) from tempTable;
After executing the query from hive using the command hive -f sample.hql > op.txt
I would get the below output in the op.txt file.
Total records
231
What I want to know is how to achieve the same from beeline. If I run the same sample.hql file from beeline using the command beeline -u jdbc:hive2://localhost:10000/ --silent=true -f hive.hql > op.txt
it fails. Below is the error I have received
Unknown command: echo 'Total records';
Do anyone know how to fix this problem?