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

beeline throws exceptions with parsing hive config when using !sh statement

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.0
    • 2.1.1, 2.2.0
    • None
    • None

    Description

      When beeline has a connection to a server, in some env it has following problem:

      0: jdbc:hive2://localhost> !verbose
      verbose: on
      0: jdbc:hive2://localhost> !sh id
      java.lang.ArrayIndexOutOfBoundsException: 1
      at org.apache.hive.beeline.Commands.addConf(Commands.java:758)
      at org.apache.hive.beeline.Commands.getHiveConf(Commands.java:704)
      at org.apache.hive.beeline.Commands.sh(Commands.java:1002)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.hive.beeline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:52)
      at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1081)
      at org.apache.hive.beeline.BeeLine.execute(BeeLine.java:917)
      at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:845)
      at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:482)
      at org.apache.hive.beeline.BeeLine.main(BeeLine.java:465)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
      0: jdbc:hive2://localhost> !sh echo hello
      java.lang.ArrayIndexOutOfBoundsException: 1
      at org.apache.hive.beeline.Commands.addConf(Commands.java:758)
      at org.apache.hive.beeline.Commands.getHiveConf(Commands.java:704)
      at org.apache.hive.beeline.Commands.sh(Commands.java:1002)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.hive.beeline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:52)
      at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1081)
      at org.apache.hive.beeline.BeeLine.execute(BeeLine.java:917)
      at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:845)
      at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:482)
      at org.apache.hive.beeline.BeeLine.main(BeeLine.java:465)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
      0: jdbc:hive2://localhost>
      

      Also it breaks if there is no connection established:

      beeline> !sh id
      java.lang.NullPointerException
      at org.apache.hive.beeline.BeeLine.createStatement(BeeLine.java:1897)
      at org.apache.hive.beeline.Commands.getConfInternal(Commands.java:724)
      at org.apache.hive.beeline.Commands.getHiveConf(Commands.java:702)
      at org.apache.hive.beeline.Commands.sh(Commands.java:1002)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.hive.beeline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:52)
      at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1081)
      at org.apache.hive.beeline.BeeLine.execute(BeeLine.java:917)
      at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:845)
      at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:482)
      at org.apache.hive.beeline.BeeLine.main(BeeLine.java:465)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
      
      

      Attachments

        1. HIVE-14538.1.patch
          3 kB
          Yongzhi Chen
        2. HIVE-14538.2.patch
          3 kB
          Yongzhi Chen
        3. HIVE-14538.2-branch-2.1.patch
          3 kB
          Peter Vary

        Activity

          People

            ychena Yongzhi Chen
            ychena Yongzhi Chen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: