Hive
  1. Hive
  2. HIVE-2887

Var Substitution not working when connecting to a remote hive

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.8.1
    • Fix Version/s: None
    • Component/s: CLI, Server Infrastructure
    • Labels:
      None
    • Environment:

      Ubuntu 10.10

    • Tags:
      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.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Albert Zhong
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development