You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "jiraposter@reviews.apache.org (Commented) (JIRA)" <ji...@apache.org> on 2012/04/11 09:46:45 UTC

[jira] [Commented] (SQOOP-451) Add new options for format masks for date, time, and timestamp

    [ https://issues.apache.org/jira/browse/SQOOP-451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13251400#comment-13251400 ] 

jiraposter@reviews.apache.org commented on SQOOP-451:
-----------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4327/
-----------------------------------------------------------

(Updated 2012-04-11 07:45:48.994371)


Review request for Sqoop.


Changes
-------

Improve the patch.


Summary (updated)
-------

Add new options via which the user can specify format masks for date, time, and timestamp columns:

--date-mask
--time-mask
--timestamp-mask

To format text, I am using SimpleDateFormat.

The changes include:

1) Add the format mask options as Sqoop common options.
2) Update ClassWriter so that SimpleDateFormat format() call can be generated in the toString() method.
3) Update ClassWriter so that SimpleDateFormat parse() call can be generated in the __loadFromFields() method.
4) Add new tests for format to ManagerCompatTest.
5) Add new tests for parse to TestExport.

In addition, I removed all try-catch blocks from TestExport that used to handle various date/time formats in Oracle db. Instead, output texts are formatted by SimpleDateFormat so that they are no longer needed.

The patch is relatively big, but it is because many new tests are added. The actual changes for new options are not big.

I would be very grateful if someone could review this patch.


This addresses bug SQOOP-451.
    https://issues.apache.org/jira/browse/SQOOP-451


Diffs (updated)
-----

  /src/test/com/cloudera/sqoop/testutil/ManagerCompatTestCase.java 1311550 
  /src/test/com/cloudera/sqoop/manager/JdbcMySQLExportTest.java 1311550 
  /src/test/com/cloudera/sqoop/manager/MySQLCompatTest.java 1311550 
  /src/test/com/cloudera/sqoop/manager/OracleCompatTest.java 1311550 
  /src/test/com/cloudera/sqoop/manager/OracleExportTest.java 1311550 
  /src/test/com/cloudera/sqoop/manager/DirectMySQLExportTest.java 1311550 
  /src/test/com/cloudera/sqoop/TestExport.java 1311550 
  /src/java/org/apache/sqoop/tool/BaseSqoopTool.java 1311550 
  /src/java/org/apache/sqoop/orm/ClassWriter.java 1311550 
  /src/java/com/cloudera/sqoop/tool/BaseSqoopTool.java 1311550 
  /src/java/org/apache/sqoop/SqoopOptions.java 1311550 

Diff: https://reviews.apache.org/r/4327/diff


Testing (updated)
-------

- Tests in ManagerCompatTest ensure that date/time/timestamp data are formatted correctly when being imported.
- Tests in TestExport ensure that date/time/timestamp texts are parsed correctly when being exported.
- Ran ant test, ant test -Dthirdparty=true, and ant checkstyle.


Thanks,

Cheolsoo


                
> Add new options for format masks for date, time, and timestamp
> --------------------------------------------------------------
>
>                 Key: SQOOP-451
>                 URL: https://issues.apache.org/jira/browse/SQOOP-451
>             Project: Sqoop
>          Issue Type: Improvement
>            Reporter: Cheolsoo Park
>            Assignee: Cheolsoo Park
>            Priority: Minor
>
> Add new options via which the user can specify format masks for date, time, and timestamp columns.
> The propose is to add pattern matching code to the toString() method of SqoopRecord so that when the output is written to files, it can be modified accordingly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira