sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cheolsoo Park" <cheol...@cloudera.com>
Subject Review Request: SQOOP-451 Add new options for format masks for date, time, and timestamp
Date Sat, 17 Mar 2012 00:18:04 GMT

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

Review request for Sqoop.


Summary
-------

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

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

To manipulate text from/to the DB, I am using SimpleDateFormat.

The changes include:

1) Add 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 import format to ManagerCompatTest and its subclasses.
5) Add new tests for export parse to TestExport and its subclasses.
6) Introduce regular expressions into OracleExportTest to get rid of try-catch blocks.
   (The format mask options do not format direct output from JDBC drivers.)
7) Fix a minor bug in MySQLCompatTest regarding discarded fractional seconds.


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


Diffs
-----

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

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


Testing
-------

- Various format mask tests for import jobs are added to ManagerCompatTest.
- Various format mask tests for export jobs are added to TestExport.
- Ran ant test, ant test -Dthirdparty=true, and ant checkstyle.


Thanks,

Cheolsoo


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