Hive
  1. Hive
  2. HIVE-6685

Beeline throws ArrayIndexOutOfBoundsException for mismatched arguments

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.12.0
    • Fix Version/s: None
    • Component/s: CLI
    • Labels:
      None

      Description

      Noticed that there is an ugly ArrayIndexOutOfBoundsException for mismatched arguments in beeline prompt. It would be nice to cleanup.

      Example:

      beeline -u szehon -p
      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
      	at org.apache.hive.beeline.BeeLine.initArgs(BeeLine.java:560)
      	at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:628)
      	at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:366)
      	at org.apache.hive.beeline.BeeLine.main(BeeLine.java:349)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
      
      1. HIVE-6685.patch
        2 kB
        Szehon Ho
      2. HIVE-6685.4.patch
        13 kB
        Szehon Ho
      3. HIVE-6685.3.patch
        13 kB
        Szehon Ho
      4. HIVE-6685.2.patch
        14 kB
        Szehon Ho

        Issue Links

          Activity

          Hide
          Szehon Ho added a comment -

          Attaching a simple fix. Review board is not responding for me, will try again later.

          Show
          Szehon Ho added a comment - Attaching a simple fix. Review board is not responding for me, will try again later.
          Hide
          Szehon Ho added a comment -

          Added review board.

          Show
          Szehon Ho added a comment - Added review board.
          Hide
          Xuefu Zhang added a comment -

          Szehon Ho Thanks for working on this. I have some review comments on review board for your consideration.

          Show
          Xuefu Zhang added a comment - Szehon Ho Thanks for working on this. I have some review comments on review board for your consideration.
          Hide
          Szehon Ho added a comment -

          Thanks for the review and suggestion. I refactored Beeline to use the GNU Parser, it is a much cleaner solution.

          Show
          Szehon Ho added a comment - Thanks for the review and suggestion. I refactored Beeline to use the GNU Parser, it is a much cleaner solution.
          Hide
          Hive QA added a comment -

          Overall: -1 no tests executed

          Here are the results of testing the latest attachment:
          https://issues.apache.org/jira/secure/attachment/12635452/HIVE-6685.2.patch

          Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1877/testReport
          Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1877/console

          Messages:

          Executing org.apache.hive.ptest.execution.PrepPhase
          Tests exited with: NonZeroExitCodeException
          Command 'bash /data/hive-ptest/working/scratch/source-prep.sh' failed with exit status 1 and output '+ [[ -n '' ]]
          + export 'ANT_OPTS=-Xmx1g -XX:MaxPermSize=256m '
          + ANT_OPTS='-Xmx1g -XX:MaxPermSize=256m '
          + export 'M2_OPTS=-Xmx1g -XX:MaxPermSize=256m -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128'
          + M2_OPTS='-Xmx1g -XX:MaxPermSize=256m -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128'
          + cd /data/hive-ptest/working/
          + tee /data/hive-ptest/logs/PreCommit-HIVE-Build-1877/source-prep.txt
          + [[ false == \t\r\u\e ]]
          + mkdir -p maven ivy
          + [[ svn = \s\v\n ]]
          + [[ -n '' ]]
          + [[ -d apache-svn-trunk-source ]]
          + [[ ! -d apache-svn-trunk-source/.svn ]]
          + [[ ! -d apache-svn-trunk-source ]]
          + cd apache-svn-trunk-source
          + svn revert -R .
          ++ awk '{print $2}'
          ++ egrep -v '^X|^Performing status on external'
          ++ svn status --no-ignore
          + rm -rf target datanucleus.log ant/target shims/target shims/0.20/target shims/0.20S/target shims/0.23/target shims/aggregator/target shims/common/target shims/common-secure/target packaging/target hbase-handler/target testutils/target jdbc/target metastore/target itests/target itests/hcatalog-unit/target itests/test-serde/target itests/qtest/target itests/hive-unit/target itests/custom-serde/target itests/util/target hcatalog/target hcatalog/storage-handlers/hbase/target hcatalog/server-extensions/target hcatalog/core/target hcatalog/webhcat/svr/target hcatalog/webhcat/java-client/target hcatalog/hcatalog-pig-adapter/target hwi/target common/target common/src/gen service/target contrib/target serde/target beeline/target odbc/target cli/target ql/dependency-reduced-pom.xml ql/target
          + svn update
          
          Fetching external item into 'hcatalog/src/test/e2e/harness'
          External at revision 1579927.
          
          At revision 1579927.
          + patchCommandPath=/data/hive-ptest/working/scratch/smart-apply-patch.sh
          + patchFilePath=/data/hive-ptest/working/scratch/build.patch
          + [[ -f /data/hive-ptest/working/scratch/build.patch ]]
          + chmod +x /data/hive-ptest/working/scratch/smart-apply-patch.sh
          + /data/hive-ptest/working/scratch/smart-apply-patch.sh /data/hive-ptest/working/scratch/build.patch
          The patch does not appear to apply with p0, p1, or p2
          + exit 1
          '
          

          This message is automatically generated.

          ATTACHMENT ID: 12635452

          Show
          Hive QA added a comment - Overall : -1 no tests executed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12635452/HIVE-6685.2.patch Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1877/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1877/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Tests exited with: NonZeroExitCodeException Command 'bash /data/hive-ptest/working/scratch/source-prep.sh' failed with exit status 1 and output '+ [[ -n '' ]] + export 'ANT_OPTS=-Xmx1g -XX:MaxPermSize=256m ' + ANT_OPTS='-Xmx1g -XX:MaxPermSize=256m ' + export 'M2_OPTS=-Xmx1g -XX:MaxPermSize=256m -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128' + M2_OPTS='-Xmx1g -XX:MaxPermSize=256m -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128' + cd /data/hive-ptest/working/ + tee /data/hive-ptest/logs/PreCommit-HIVE-Build-1877/source-prep.txt + [[ false == \t\r\u\e ]] + mkdir -p maven ivy + [[ svn = \s\v\n ]] + [[ -n '' ]] + [[ -d apache-svn-trunk-source ]] + [[ ! -d apache-svn-trunk-source/.svn ]] + [[ ! -d apache-svn-trunk-source ]] + cd apache-svn-trunk-source + svn revert -R . ++ awk '{print $2}' ++ egrep -v '^X|^Performing status on external' ++ svn status --no-ignore + rm -rf target datanucleus.log ant/target shims/target shims/0.20/target shims/0.20S/target shims/0.23/target shims/aggregator/target shims/common/target shims/common-secure/target packaging/target hbase-handler/target testutils/target jdbc/target metastore/target itests/target itests/hcatalog-unit/target itests/test-serde/target itests/qtest/target itests/hive-unit/target itests/custom-serde/target itests/util/target hcatalog/target hcatalog/storage-handlers/hbase/target hcatalog/server-extensions/target hcatalog/core/target hcatalog/webhcat/svr/target hcatalog/webhcat/java-client/target hcatalog/hcatalog-pig-adapter/target hwi/target common/target common/src/gen service/target contrib/target serde/target beeline/target odbc/target cli/target ql/dependency-reduced-pom.xml ql/target + svn update Fetching external item into 'hcatalog/src/test/e2e/harness' External at revision 1579927. At revision 1579927. + patchCommandPath=/data/hive-ptest/working/scratch/smart-apply-patch.sh + patchFilePath=/data/hive-ptest/working/scratch/build.patch + [[ -f /data/hive-ptest/working/scratch/build.patch ]] + chmod +x /data/hive-ptest/working/scratch/smart-apply-patch.sh + /data/hive-ptest/working/scratch/smart-apply-patch.sh /data/hive-ptest/working/scratch/build.patch The patch does not appear to apply with p0, p1, or p2 + exit 1 ' This message is automatically generated. ATTACHMENT ID: 12635452
          Hide
          Szehon Ho added a comment -

          As this change became a refactoring, will need a rebase as the code has changed. Will take a look a bit later.

          Show
          Szehon Ho added a comment - As this change became a refactoring, will need a rebase as the code has changed. Will take a look a bit later.
          Hide
          Szehon Ho added a comment -

          Rebasing and incorporating HIVE-6652 fix in the refactored code.

          Xuefu Zhang can you take a look when you get the chance? Thanks.

          Show
          Szehon Ho added a comment - Rebasing and incorporating HIVE-6652 fix in the refactored code. Xuefu Zhang can you take a look when you get the chance? Thanks.
          Hide
          Xuefu Zhang added a comment -

          The patch looks good for me. I left a minor comment for consideration.

          Show
          Xuefu Zhang added a comment - The patch looks good for me. I left a minor comment for consideration.
          Hide
          Szehon Ho added a comment -

          Good catch, addressing the comment.

          Show
          Szehon Ho added a comment - Good catch, addressing the comment.
          Hide
          Xuefu Zhang added a comment -

          +1

          Show
          Xuefu Zhang added a comment - +1
          Hide
          Hive QA added a comment -

          Overall: -1 at least one tests failed

          Here are the results of testing the latest attachment:
          https://issues.apache.org/jira/secure/attachment/12636996/HIVE-6685.4.patch

          ERROR: -1 due to 1 failed/errored test(s), 5499 tests executed
          Failed tests:

          org.apache.hadoop.hive.cli.TestNegativeMinimrCliDriver.testNegativeCliDriver_mapreduce_stack_trace_hadoop20
          

          Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1980/testReport
          Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1980/console

          Messages:

          Executing org.apache.hive.ptest.execution.PrepPhase
          Executing org.apache.hive.ptest.execution.ExecutionPhase
          Executing org.apache.hive.ptest.execution.ReportingPhase
          Tests exited with: TestsFailedException: 1 tests failed
          

          This message is automatically generated.

          ATTACHMENT ID: 12636996

          Show
          Hive QA added a comment - Overall : -1 at least one tests failed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12636996/HIVE-6685.4.patch ERROR: -1 due to 1 failed/errored test(s), 5499 tests executed Failed tests: org.apache.hadoop.hive.cli.TestNegativeMinimrCliDriver.testNegativeCliDriver_mapreduce_stack_trace_hadoop20 Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1980/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1980/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 1 tests failed This message is automatically generated. ATTACHMENT ID: 12636996
          Hide
          Xuefu Zhang added a comment -

          Patch committed to trunk. Thanks to Szehon for the contribution!

          Show
          Xuefu Zhang added a comment - Patch committed to trunk. Thanks to Szehon for the contribution!

            People

            • Assignee:
              Szehon Ho
              Reporter:
              Szehon Ho
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development