一、描述
beeline连接hive1.2.1000.2.5.6.0-40,hive使用tez引擎,设置任务名称或者session id
二、分析
1、hive命令行通过--hiveconf hive.session.id=adx_test设置
hive --hiveconf hive.session.id=adx_test --hiveconf hive.server2.tez.default.queues=adx --hiveconf tez.queue.name=adx --hiveconf mapreduce.job.queuename=adx --hiveconf hadoop.proxyuser.hive.groups=* --hiveconf hadoop.proxyuser.hive.hosts=* --hiveconf hadoop.proxyuser.hcat.groups=* --hiveconf hadoop.proxyuser.hcat.hosts=*
生效了,但有个HIVE-前缀,如下
2、beeline通过--hiveconf hive.session.id=adx_test设置
beeline --hiveconf hive.server2.tez.default.queues=adx --hiveconf tez.queue.name=adx --hiveconf mapreduce.job.queuename=adx --hiveconf hadoop.proxyuser.hive.groups=* --hiveconf hadoop.proxyuser.hive.hosts=* --hiveconf hadoop.proxyuser.hcat.groups=* --hiveconf hadoop.proxyuser.hcat.hosts=* --hiveconf hive.session.id=adx_test
不生效,如下
3、beeline通过--hivevar hive.session.id=adx_test设置
beeline --hiveconf hive.server2.tez.default.queues=adx --hiveconf tez.queue.name=adx --hiveconf mapreduce.job.queuename=adx --hiveconf hadoop.proxyuser.hive.groups=* --hiveconf hadoop.proxyuser.hive.hosts=* --hiveconf hadoop.proxyuser.hcat.groups=* --hiveconf hadoop.proxyuser.hcat.hosts=* --hiveconf hive.session.id=adx_test --hivevar hive.session.id=adx_test
也不生效,如下
4、执行!set,查看配置,hiveconfvariables、hivevariables中的hive.session.id的值确是adx_test
0: jdbc:hive2://n17-06-02:2181,n17-07-04:2181> !set
authtype
autocommit false
autosave false
color false
delimiterfordsv |
entirelineascommand false
fastconnect true
force false
headerinterval 100
historyfile /home/sdev/.beeline/history
hiveconfvariables {hive.server2.tez.default.queues=adx, tez.queue.name=adx, hadoop.proxyuser.hcat.hosts=*, mapreduce.job.queuename=adx, hive.session.id=adx_test, hadoop.proxyuser.hive.groups=*, hadoop.proxyuser.hcat.groups=*, hadoop.proxyuser.hive.hosts=*}
hivevariables {hive.session.id=adx_test}
incremental false
initfile
isolation TRANSACTION_REPEATABLE_READ
lastconnectedurl jdbc:hive2://n17-06-02:2181,n17-07-04:2181,n17-08-04:2181,n17-09-02:2181,n17-09-03:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2
maxcolumnwidth 15
maxheight 55
maxwidth 270
nullemptystring false
numberformat default
outputformat table
scriptfile
showelapsedtime true
showheader true
shownestederrs false
showwarnings false
timeout -1
trimscripts true
truncatetable false
verbose false
5、执行如下设置
set hiveconf:hive.session.id=adx_test;
set hivevar:hive.session.id=adx_test;
再次执行,还是不行
6、将hive.session.id改为adx,看看hiveconfvariables、hivevariables中的hive.session.id的值会变吗,如下,不会
0: jdbc:hive2://n17-06-02:2181,n17-07-04:2181> set hiveconf:hive.session.id=adx;
No rows affected (0.004 seconds)
0: jdbc:hive2://n17-06-02:2181,n17-07-04:2181> set hivevar:hive.session.id=adx;
No rows affected (0.004 seconds)
0: jdbc:hive2://n17-06-02:2181,n17-07-04:2181> !set
authtype
autocommit false
autosave false
color false
delimiterfordsv |
entirelineascommand false
fastconnect true
force false
headerinterval 100
historyfile /home/sdev/.beeline/history
hiveconfvariables {hive.server2.tez.default.queues=adx, tez.queue.name=adx, hadoop.proxyuser.hcat.hosts=*, mapreduce.job.queuename=adx, hive.session.id=adx_test, hadoop.proxyuser.hive.groups=*, hadoop.proxyuser.hcat.groups=*, hadoop.proxyuser.hive.hosts=*}
hivevariables {hive.session.id=adx_test}
incremental false
initfile
isolation TRANSACTION_REPEATABLE_READ
lastconnectedurl jdbc:hive2://n17-06-02:2181,n17-07-04:2181,n17-08-04:2181,n17-09-02:2181,n17-09-03:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2
maxcolumnwidth 15
maxheight 55
maxwidth 270
nullemptystring false
numberformat default
outputformat table
scriptfile
showelapsedtime true
showheader true
shownestederrs false
showwarnings false
timeout -1
trimscripts true
truncatetable false
verbose false
7、执行引擎改为mr,也不行,如下
8、
注意:本文归作者所有,未经作者允许,不得转载