Hive
  1. Hive
  2. HIVE-6652

Beeline gives evasive error message for any unrecognized command line arguement

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.11.0, 0.12.0, 0.13.0
    • Fix Version/s: 0.14.0
    • Component/s: None
    • Labels:
      None

      Description

      For any unrecognized command line argument, Beeline emits a warning message that's evasive and meaningless. For instance:

      beeline abc
      abc (No such file or directory)
      Beeline version 0.14.0-SNAPSHOT by Apache Hive
      ...
      beeline -hh
      -hh (No such file or directory)
      

      The error seeming suggests that Beeline accepts an argument as a file name. However, neither Beeline doc nor command line help indicates there is such an option.

      beeline --help
      Usage: java org.apache.hive.cli.beeline.BeeLine 
         -u <database url>               the JDBC URL to connect to
         -n <username>                   the username to connect as
         -p <password>                   the password to connect as
         -d <driver class>               the driver class to use
         -e <query>                      query that should be executed
         -f <file>                       script file that should be executed
         --hiveconf property=value       Use value for given property
         --hivevar name=value            hive variable name and value
                                         This is Hive specific settings in which variables
                                         can be set at session level and referenced in Hive
                                         commands or queries.
         --color=[true/false]            control whether color is used for display
         --showHeader=[true/false]       show column names in query results
         --headerInterval=ROWS;          the interval between which heades are displayed
         --fastConnect=[true/false]      skip building table/column list for tab-completion
         --autoCommit=[true/false]       enable/disable automatic transaction commit
         --verbose=[true/false]          show verbose error messages and debug info
         --showWarnings=[true/false]     display connection warnings
         --showNestedErrs=[true/false]   display nested errors
         --numberFormat=[pattern]        format numbers using DecimalFormat pattern
         --force=[true/false]            continue running script even after errors
         --maxWidth=MAXWIDTH             the maximum width of the terminal
         --maxColumnWidth=MAXCOLWIDTH    the maximum width to use when displaying columns
         --silent=[true/false]           be more silent
         --autosave=[true/false]         automatically save preferences
         --outputformat=[table/vertical/csv/tsv]   format mode for result display
         --isolation=LEVEL               set the transaction isolation level
         --nullemptystring=[true/false]  set to true to get historic behavior of printing null as empty string
         --help                          display this message
      

      Further research shows that this is a residual from SQLLine from which Beeline is derived, which allows user to specify a property file based on which SQLLine can make a DB connection.

      While this might be useful, this isn't documented and has caused a lot of confusions. And it's the root cause for quite a few problems such as those described in HIVE-5677. HIVE-6173 had the same symptom, which uncovered another problem.

      Thus, I'd suggest we disable this option. If it's desirable to have this option, then we need at least corresponding documentation plus better error message.

        Issue Links

          Activity

          Hide
          Thejas M Nair added a comment -

          This has been fixed in 0.14 release. Please open new jira if you see any issues.

          Show
          Thejas M Nair added a comment - This has been fixed in 0.14 release. Please open new jira if you see any issues.
          Hide
          Xuefu Zhang added a comment -

          I don't think we need to document this, as it's never documented or officially supported.

          Show
          Xuefu Zhang added a comment - I don't think we need to document this, as it's never documented or officially supported.
          Hide
          Lefty Leverenz added a comment -

          this is a residual from SQLLine from which Beeline is derived, which allows user to specify a property file based on which SQLLine can make a DB connection. . . . I'd suggest we disable this option. If it's desirable to have this option, then we need at least corresponding documentation plus better error message.

          Should the wiki mention this change from SQLLine behavior (with a version 0.14 note)?

          Show
          Lefty Leverenz added a comment - this is a residual from SQLLine from which Beeline is derived, which allows user to specify a property file based on which SQLLine can make a DB connection. . . . I'd suggest we disable this option. If it's desirable to have this option, then we need at least corresponding documentation plus better error message. Should the wiki mention this change from SQLLine behavior (with a version 0.14 note)? Beeline – New Command Line Shell
          Hide
          Ashutosh Chauhan added a comment -

          Committted to trunk. Thanks, Xuefu!

          Show
          Ashutosh Chauhan added a comment - Committted to trunk. Thanks, Xuefu!
          Hide
          Ashutosh Chauhan added a comment -

          +1

          Show
          Ashutosh Chauhan added a comment - +1
          Hide
          Xuefu Zhang added a comment -
          Show
          Xuefu Zhang added a comment - RB: https://reviews.apache.org/r/19251/
          Hide
          Xuefu Zhang added a comment -

          The above test failure is unrelated. The patch is ready for review.

          Show
          Xuefu Zhang added a comment - The above test failure is unrelated. The patch is ready for review.
          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/12634505/HIVE-6652.patch

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

          org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_auto_sortmerge_join_16
          

          Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1784/testReport
          Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1784/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: 12634505

          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/12634505/HIVE-6652.patch ERROR: -1 due to 1 failed/errored test(s), 5406 tests executed Failed tests: org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_auto_sortmerge_join_16 Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1784/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1784/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: 12634505
          Hide
          Szehon Ho added a comment -

          It also doesn't make sense to me, that its treating all un-recognized argument as db-property file and connecting one after another. Looks like a good usability change to me, if not being used now.

          One minor thought, as the property file does seem useful, we can consider supporting property file with another -propertyfile argument if needed

          Show
          Szehon Ho added a comment - It also doesn't make sense to me, that its treating all un-recognized argument as db-property file and connecting one after another. Looks like a good usability change to me, if not being used now. One minor thought, as the property file does seem useful, we can consider supporting property file with another -propertyfile argument if needed
          Hide
          Xuefu Zhang added a comment -

          With the attached patch, Beeline will emit:

          beeline abc
          Unrecognized argument: abc
          Usage: java org.apache.hive.cli.beeline.BeeLine 
             -u <database url>               the JDBC URL to connect to
             -n <username>                   the username to connect as
             -p <password>                   the password to connect as
             -d <driver class>               the driver class to use
             -e <query>                      query that should be executed
             -f <file>                       script file that should be executed
             --hiveconf property=value       Use value for given property
             --hivevar name=value            hive variable name and value
                                             This is Hive specific settings in which variables
                                             can be set at session level and referenced in Hive
                                             commands or queries.
             --color=[true/false]            control whether color is used for display
             --showHeader=[true/false]       show column names in query results
             --headerInterval=ROWS;          the interval between which heades are displayed
             --fastConnect=[true/false]      skip building table/column list for tab-completion
             --autoCommit=[true/false]       enable/disable automatic transaction commit
             --verbose=[true/false]          show verbose error messages and debug info
             --showWarnings=[true/false]     display connection warnings
             --showNestedErrs=[true/false]   display nested errors
             --numberFormat=[pattern]        format numbers using DecimalFormat pattern
             --force=[true/false]            continue running script even after errors
             --maxWidth=MAXWIDTH             the maximum width of the terminal
             --maxColumnWidth=MAXCOLWIDTH    the maximum width to use when displaying columns
             --silent=[true/false]           be more silent
             --autosave=[true/false]         automatically save preferences
             --outputformat=[table/vertical/csv/tsv]   format mode for result display
             --isolation=LEVEL               set the transaction isolation level
             --nullemptystring=[true/false]  set to true to get historic behavior of printing null as empty string
             --help                          display this message
          
          Show
          Xuefu Zhang added a comment - With the attached patch, Beeline will emit: beeline abc Unrecognized argument: abc Usage: java org.apache.hive.cli.beeline.BeeLine -u <database url> the JDBC URL to connect to -n <username> the username to connect as -p <password> the password to connect as -d <driver class> the driver class to use -e <query> query that should be executed -f <file> script file that should be executed --hiveconf property=value Use value for given property --hivevar name=value hive variable name and value This is Hive specific settings in which variables can be set at session level and referenced in Hive commands or queries. --color=[ true / false ] control whether color is used for display --showHeader=[ true / false ] show column names in query results --headerInterval=ROWS; the interval between which heades are displayed --fastConnect=[ true / false ] skip building table/column list for tab-completion --autoCommit=[ true / false ] enable/disable automatic transaction commit --verbose=[ true / false ] show verbose error messages and debug info --showWarnings=[ true / false ] display connection warnings --showNestedErrs=[ true / false ] display nested errors --numberFormat=[pattern] format numbers using DecimalFormat pattern --force=[ true / false ] continue running script even after errors --maxWidth=MAXWIDTH the maximum width of the terminal --maxColumnWidth=MAXCOLWIDTH the maximum width to use when displaying columns --silent=[ true / false ] be more silent --autosave=[ true / false ] automatically save preferences --outputformat=[table/vertical/csv/tsv] format mode for result display --isolation=LEVEL set the transaction isolation level --nullemptystring=[ true / false ] set to true to get historic behavior of printing null as empty string --help display this message

            People

            • Assignee:
              Xuefu Zhang
              Reporter:
              Xuefu Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development