Uploaded image for project: 'Sqoop'
  1. Sqoop
  2. SQOOP-3135

Not enough error message for debugging when parameters missing

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.6
    • Fix Version/s: 1.4.7
    • Component/s: None
    • Labels:
      None

      Description

      Run the following sqoop command:

      sqoop job --create test -- import --connect jdbc:mysql://localhost/test --username root --password $pass --target-dir /tmp/test10 -m 1 --driver com.mysql.jdbc.Driver  --table test
      

      Due to $pass is not set, command will fail with the following error:

      16/12/21 05:48:32 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7-SNAPSHOT
      16/12/21 05:48:33 ERROR tool.JobTool: Error parsing arguments to the job-specific tool.
      16/12/21 05:48:33 ERROR tool.JobTool: See 'sqoop help <tool>' for usage.
      

      This is not informative, by checking the code in JobTool class:

          // Now feed the arguments into the tool itself.
          try {
            childOptions = childTool.parseArguments(parseableChildArgv,
                null, childOptions, false);
            childTool.appendArgs(extraChildArgv);
            childTool.validateOptions(childOptions);
          } catch (ParseException pe) {
            LOG.error("Error parsing arguments to the job-specific tool.");
            LOG.error("See 'sqoop help <tool>' for usage.");
            return 1;
          } catch (SqoopOptions.InvalidOptionsException e) {
            System.err.println(e.getMessage());
            return 1;
          }
      

      The ParseException pe's message has been dropped, we should print out the message in the exception so that more meaningful message will be printed.

        Attachments

        1. SQOOP-3135.patch
          0.7 kB
          Eric Lin
        2. SQOOP-3135.2.patch
          0.7 kB
          Eric Lin

          Activity

            People

            • Assignee:
              ericlin Eric Lin
              Reporter:
              ericlin Eric Lin
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: