Support Questions

Find answers, ask questions, and share your expertise

Beeline Configuration hiveconf Equivalent


Need to set hive configuration options from Beeline CLI command. The below code, for example, doesn't work.

--hiveconf hive.execution.engine=tez

--hiveconf and --property-file both don't appear to be making the session take the settings.

Here it is in full usage:

beeline -n $user -p $password -u "$jdbc_url" -f $script --verbose true --property-file "" --fastConnect

Is the only way to make it work to include the options in the JDBC URL as arguments? Like hive.execution.engine=tez;next;next ?


Super Guru

you can use set hive.execution.engine=tez; while in a session or beeline --hiveconf hive.execution.engine=tez should work. what version of hive are you using? Are you setting any other value for --hiveconf?

Another option is the sel set hive.execution.engine=tez; inside your hive script or have --hivevar has parameter into your hive script to set execution engine

beeline -u jdbc:hive2://hostname:10000 -n xxxx -p xxxx -f /home/hdfs/scripts/hive/myscript.hql --hivevar engine=tez

Then use ${engine} variable inside your script.


Using a set works fine, correct. However, that requires that I do that for every script I try to automate. My goal is to make these values a default part of this base command, and just change what SQL I throw at it. Global values, if you will.

This should be remedied by the use of --hiveconf or --property-file, but neither results in it taking the values. Here's an example:


beeline -n $user -p $password -u "$jdbc_url" -f $script --verbose true --property-file "" --fastConnect


The job shows up in the 'default' queue when it should show up in the 'di' queue. When I use a set command, it does in fact show up in the 'di' queue.

Super Guru

what version of hive are you using?


Hive-Hcatalog 1.2.1

Super Guru

I just tried --hiveconf and it did not set the execution engine. Digging why it didn't take.

Super Guru

I got it working now. Here is what I did

[LAKE] [smanjee@lake1 ~]# beeline -u "jdbc:hive2://,,example:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2" --hiveconf hive.execution.engine=mr

and it worked. I was missing the " " around the jdbc

0: jdbc:hive2://> set hive.execution.engine;
|            set            |
| hive.execution.engine=mr  |
1 row selected (0.192 seconds)
0: jdbc:hive2://>



Set the options in your JDBC URL. So your URL goes from this...