[ https://issues.apache.org/jira/browse/HIVE-2887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13236107#comment-13236107 ]
Edward Capriolo commented on HIVE-2887: --------------------------------------- -d and -hivevar are evaluated by the CLI. --hiveconf as well. To make this happen I think we will pyhsically need to convert these to 'set' commands. So they process on the thrift side. > Var Substitution not working when connecting to a remote hive > ------------------------------------------------------------- > > Key: HIVE-2887 > URL: https://issues.apache.org/jira/browse/HIVE-2887 > Project: Hive > Issue Type: Bug > Components: CLI, Server Infrastructure > Affects Versions: 0.8.1 > Environment: Ubuntu 10.10 > Reporter: Albert Zhong > > When we use '-h' option to connect to a remove hive, var substitution will > not work. > More exactly, it seemed that the variables passed in the command line with > -d/--define and/or --hivevar do not correctly set to hive cli's configuration > variables. > For example, we run hive without -h option, it works fine: > {code} > $ hive -S -d K=123 > hive> SELECT * FROM foo; > 123 abc > 456 def > hive> SELECT * FROM foo WHERE r1="${K}"; > 123 abc > hive> SET -v; > ... > hive.zookeeper.session.timeout=600000 > hivevar:K=123 > io.bytes.per.checksum=512 > ... > {code} > But when we run hive with -h option, it doesn't work: > {code} > $ hive -S -d K=123 -h localhost > hive> SELECT * FROM foo; > 123 abc > 456 def > hive> SELECT * FROM foo WHERE r1="${K}"; > hive> SET -v; > ... > hive.zookeeper.session.timeout=600000 > io.bytes.per.checksum=512 > ... > hive> SET hivevar:K=123; > hive> SET -v; > ... > hive.zookeeper.session.timeout=600000 > hivevar:K=123 > io.bytes.per.checksum=512 > ... > hive> SELECT * FROM foo WHERE r1="${K}"; > 123 abc > {code} > The same will happen if you use --hivevar to pass variables. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira