Hive initialization file .hiverc


Does the .hiverc execute globally or is there a .hiverc file for each user?

I would like to set the folllowing variables for my Hive sessions

set hive.cli.print.current.db=true; --print current database in prompt
set hive.cli.print.header=true; --print column headers in query’s

if there is no .hiverc for each user is there a way to execute a script from the hive> prompt?

Thank you;

.hiverc is user specific. For global, you have to use hive-site.xml.

You can safely set it for your user .hiverc.

Also you can launch using -hiveconf like this hive -hiveconf hive.cli.print.current.db=true