Search code examples
hivehiveqlbeeline

Logging messages in Hive .hql file


I have some insert statements to run in Hive. I am planning to put them in .hql file and run it through beeline -f option. Is there a way I can echo some log messages in between inserts so that I know the progress. Like :

echo "Starting the inserts ........." insert1

echo "Insert 1 complete"

insert2

echo "Insert script is complete"

I tried putting echo statements by using linux shell command echo as !echo ""

But it's not recognizing echo as a command


Solution

  • !sh echo ...


    !sh echo "Starting the inserts ........."      
    
    insert ...
    
    !sh echo "Insert 1 complete"
    
    insert ...
    
    !sh echo "Insert script is complete"