sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fero Szabo via Review Board <nore...@reviews.apache.org>
Subject Re: Review Request 64417: SQOOP-3153 Sqoop export with --as-<spec_file_format> error message could be more verbose
Date Fri, 08 Dec 2017 15:55:34 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated Dec. 8, 2017, 3:55 p.m.)

Review request for Sqoop, Boglarka Egyed and Szabolcs Vasas.


As discussed, I got rid of the initializer block.

Bugs: SQOOP-3153

Repository: sqoop-trunk


The errormessages are generated by the hasUnrecognizedArgs funciton, which is located in the
base class of every Tool: BaseSqoopTool. 

I overrided the hasUnrecognizedArgs function, in the subclass (i.e. the ExportTool class),
this calls the original function first and then checks whether the file formats were specified
and prints an additional hint / error message.

Example output:
2017-12-07 16:02:42,640 ERROR [main] tool.BaseSqoopTool (BaseSqoopTool.java:hasUnrecognizedArgs(335))
- Error parsing arguments for export:
2017-12-07 16:02:42,643 ERROR [main] tool.BaseSqoopTool (BaseSqoopTool.java:hasUnrecognizedArgs(338))
- Unrecognized argument: --as-parquetfile
2017-12-07 16:02:42,643 ERROR [main] tool.ExportTool (ExportTool.java:hasUnrecognizedArgs(405))
- Please note that the export tool detects the file format automatically and does not support
it as an argument: --as-parquetfile

Also, corrected a typo in the function javadoc.

- Please let me know if a different message would provide more clarity.
- The intention was to implement the decorator pattern here, please feel free to point it
out  if a different, simpler design would make more sense.

Diffs (updated)

  src/java/org/apache/sqoop/tool/BaseSqoopTool.java 6a4dcb09 
  src/java/org/apache/sqoop/tool/ExportTool.java cd6cdf32 

Diff: https://reviews.apache.org/r/64417/diff/2/

Changes: https://reviews.apache.org/r/64417/diff/1-2/


The following tests passed:
- Unit tests
- 3rd party integration tests

I haven't added a new test case since testHCatExportWithParquetFile in the TestHCatalogBasic
class already covers the code path and didn't require modification.


Fero Szabo

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message