Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-19022

Hive Beeline can not read user define environment variables

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3.2
    • Fix Version/s: None
    • Component/s: Beeline, HiveServer2, JDBC
    • Labels:
      None

      Description

      we found that user can not get exported environment variables in Hive beeline.

      how to reproduce:
      1. start hiveserver2 service
      2. beeline embedded mode:
      [root@bdw-master hive232]# export AAA=aaa
      [root@bdw-master ~]# echo $HADOOP_HOME
      /opt/hive_package/hadoop273
      [root@bdw-master hive232]# bin/beeline -u 'jdbc:hive2://localhost:10000' -n root -p 123456
      0: jdbc:hive2://localhost:10000> set env:AAA;
      Error: Error while processing statement: null (state=,code=1)

      but we found that we can get HADOOP_HOME JAVA_HOME etc. variables:

      0: jdbc:hive2://localhost:10000> set env:HADOOP_HOME;
      --------------------------------------------------

      set

      --------------------------------------------------

      env:HADOOP_HOME=/opt/hive_package/hadoop273

      --------------------------------------------------
      1 row selected (0.097 seconds)

      0: jdbc:hive2://localhost:10000> set env:JAVA_HOME;
      ---------------------------------------

      set

      ---------------------------------------

      env:JAVA_HOME=/usr/java/jdk1.8.0_131

      ---------------------------------------
      1 row selected (0.09 seconds)

      Below is hive.log:

      2018-03-22T11:12:01,708 WARN [HiveServer2-Handler-Pool: Thread-94] thrift.ThriftCLIService: Error executing statement:
      org.apache.hive.service.cli.HiveSQLException: Error while processing statement: null
      at org.apache.hive.service.cli.operation.Operation.toSQLException(Operation.java:380) ~[hive-service-2.3.2.jar:2.3.2]
      at org.apache.hive.service.cli.operation.HiveCommandOperation.runInternal(HiveCommandOperation.java:118) ~[hive-service-2.3.2.jar:2.3.2]
      at org.apache.hive.service.cli.operation.Operation.run(Operation.java:320) ~[hive-service-2.3.2.jar:2.3.2]
      at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementInternal(HiveSessionImpl.java:530) ~[hive-service-2.3.2.jar:2.3.2]
      at org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementAsync(HiveSessionImpl.java:517) ~[hive-service-2.3.2.jar:2.3.2]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_131]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
      at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
      at org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:78) ~[hive-service-2.3.2.jar:2.3.2]
      at org.apache.hive.service.cli.session.HiveSessionProxy.access$000(HiveSessionProxy.java:36) ~[hive-service-2.3.2.jar:2.3.2]

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              KaiXu KaiXu
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: