You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by Eric Lin <er...@cloudera.com> on 2017/02/16 01:03:07 UTC
Review Request 56737: SQOOP-3135 - Not enough error message for
debugging when parameters missing
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56737/
-----------------------------------------------------------
Review request for Sqoop and Attila Szabo.
Bugs: SQOOP-3135
https://issues.apache.org/jira/browse/SQOOP-3135
Repository: sqoop-trunk
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.
Diffs
-----
src/java/org/apache/sqoop/tool/JobTool.java 8e1669c
Diff: https://reviews.apache.org/r/56737/diff/
Testing
-------
Manual test and confirmed the output.
Thanks,
Eric Lin
Re: Review Request 56737: SQOOP-3135 - Not enough error message for
debugging when parameters missing
Posted by Eric Lin <er...@cloudera.com>.
> On Feb. 17, 2017, 3:39 p.m., Boglarka Egyed wrote:
> > src/java/org/apache/sqoop/tool/JobTool.java, line 129
> > <https://reviews.apache.org/r/56737/diff/1/?file=1636572#file1636572line129>
> >
> > I would include the stack trace too here, i.e. I would add pe here not jut pe.toString.
>
> Eric Lin wrote:
> Hi Bogi,
>
> Thanks for your feedback. Did you mean just below?
>
> LOG.error("Error parsing arguments to the job-specific tool: " + pe);
>
> This will convert pe to string anyway, so the output in the log will be the same, won't have any stack trace. Or if I mis-understood you, please let me know.
>
> Thanks
> Eric
Hi Bogi,
I understand what you are saying now, I have updated the patch. Please review.
Thanks
- Eric
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56737/#review165941
-----------------------------------------------------------
On Feb. 16, 2017, 1:03 a.m., Eric Lin wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56737/
> -----------------------------------------------------------
>
> (Updated Feb. 16, 2017, 1:03 a.m.)
>
>
> Review request for Sqoop and Attila Szabo.
>
>
> Bugs: SQOOP-3135
> https://issues.apache.org/jira/browse/SQOOP-3135
>
>
> Repository: sqoop-trunk
>
>
> 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.
>
>
> Diffs
> -----
>
> src/java/org/apache/sqoop/tool/JobTool.java 8e1669c
>
> Diff: https://reviews.apache.org/r/56737/diff/
>
>
> Testing
> -------
>
> Manual test and confirmed the output.
>
>
> Thanks,
>
> Eric Lin
>
>
Re: Review Request 56737: SQOOP-3135 - Not enough error message for
debugging when parameters missing
Posted by Eric Lin <er...@cloudera.com>.
> On Feb. 17, 2017, 3:39 p.m., Boglarka Egyed wrote:
> > src/java/org/apache/sqoop/tool/JobTool.java, line 129
> > <https://reviews.apache.org/r/56737/diff/1/?file=1636572#file1636572line129>
> >
> > I would include the stack trace too here, i.e. I would add pe here not jut pe.toString.
Hi Bogi,
Thanks for your feedback. Did you mean just below?
LOG.error("Error parsing arguments to the job-specific tool: " + pe);
This will convert pe to string anyway, so the output in the log will be the same, won't have any stack trace. Or if I mis-understood you, please let me know.
Thanks
Eric
- Eric
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56737/#review165941
-----------------------------------------------------------
On Feb. 16, 2017, 1:03 a.m., Eric Lin wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56737/
> -----------------------------------------------------------
>
> (Updated Feb. 16, 2017, 1:03 a.m.)
>
>
> Review request for Sqoop and Attila Szabo.
>
>
> Bugs: SQOOP-3135
> https://issues.apache.org/jira/browse/SQOOP-3135
>
>
> Repository: sqoop-trunk
>
>
> 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.
>
>
> Diffs
> -----
>
> src/java/org/apache/sqoop/tool/JobTool.java 8e1669c
>
> Diff: https://reviews.apache.org/r/56737/diff/
>
>
> Testing
> -------
>
> Manual test and confirmed the output.
>
>
> Thanks,
>
> Eric Lin
>
>
Re: Review Request 56737: SQOOP-3135 - Not enough error message for
debugging when parameters missing
Posted by Boglarka Egyed <eg...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56737/#review165941
-----------------------------------------------------------
Fix it, then Ship it!
Hi Eric,
It's a good improvement point, I have just a minor comment to make it more effective.
Thanks,
Bogi
src/java/org/apache/sqoop/tool/JobTool.java (line 129)
<https://reviews.apache.org/r/56737/#comment237789>
I would include the stack trace too here, i.e. I would add pe here not jut pe.toString.
- Boglarka Egyed
On Feb. 16, 2017, 1:03 a.m., Eric Lin wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56737/
> -----------------------------------------------------------
>
> (Updated Feb. 16, 2017, 1:03 a.m.)
>
>
> Review request for Sqoop and Attila Szabo.
>
>
> Bugs: SQOOP-3135
> https://issues.apache.org/jira/browse/SQOOP-3135
>
>
> Repository: sqoop-trunk
>
>
> 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.
>
>
> Diffs
> -----
>
> src/java/org/apache/sqoop/tool/JobTool.java 8e1669c
>
> Diff: https://reviews.apache.org/r/56737/diff/
>
>
> Testing
> -------
>
> Manual test and confirmed the output.
>
>
> Thanks,
>
> Eric Lin
>
>
Re: Review Request 56737: SQOOP-3135 - Not enough error message for
debugging when parameters missing
Posted by Boglarka Egyed <eg...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56737/#review166499
-----------------------------------------------------------
Ship it!
Ship It!
- Boglarka Egyed
On Feb. 23, 2017, 1:16 a.m., Eric Lin wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56737/
> -----------------------------------------------------------
>
> (Updated Feb. 23, 2017, 1:16 a.m.)
>
>
> Review request for Sqoop and Attila Szabo.
>
>
> Bugs: SQOOP-3135
> https://issues.apache.org/jira/browse/SQOOP-3135
>
>
> Repository: sqoop-trunk
>
>
> 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.
>
>
> Diffs
> -----
>
> src/java/org/apache/sqoop/tool/JobTool.java 8e1669c
>
> Diff: https://reviews.apache.org/r/56737/diff/
>
>
> Testing
> -------
>
> Manual test and confirmed the output.
>
>
> Thanks,
>
> Eric Lin
>
>
Re: Review Request 56737: SQOOP-3135 - Not enough error message for
debugging when parameters missing
Posted by Attila Szabo <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56737/#review166651
-----------------------------------------------------------
Ship it!
Ship It!
- Attila Szabo
On Feb. 23, 2017, 1:16 a.m., Eric Lin wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56737/
> -----------------------------------------------------------
>
> (Updated Feb. 23, 2017, 1:16 a.m.)
>
>
> Review request for Sqoop and Attila Szabo.
>
>
> Bugs: SQOOP-3135
> https://issues.apache.org/jira/browse/SQOOP-3135
>
>
> Repository: sqoop-trunk
>
>
> 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.
>
>
> Diffs
> -----
>
> src/java/org/apache/sqoop/tool/JobTool.java 8e1669c
>
> Diff: https://reviews.apache.org/r/56737/diff/
>
>
> Testing
> -------
>
> Manual test and confirmed the output.
>
>
> Thanks,
>
> Eric Lin
>
>
Re: Review Request 56737: SQOOP-3135 - Not enough error message for
debugging when parameters missing
Posted by Eric Lin <er...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/56737/
-----------------------------------------------------------
(Updated Feb. 23, 2017, 1:16 a.m.)
Review request for Sqoop and Attila Szabo.
Changes
-------
Also log Exception messages
Bugs: SQOOP-3135
https://issues.apache.org/jira/browse/SQOOP-3135
Repository: sqoop-trunk
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.
Diffs (updated)
-----
src/java/org/apache/sqoop/tool/JobTool.java 8e1669c
Diff: https://reviews.apache.org/r/56737/diff/
Testing
-------
Manual test and confirmed the output.
Thanks,
Eric Lin