Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.8.1
-
None
-
None
-
Ubuntu 10.10
-
variable substitution
Description
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:
$ 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
...
But when we run hive with -h option, it doesn't work:
$ 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
The same will happen if you use --hivevar to pass variables.