Review Board 1.7.22


Incremental import using lastmodified mode always assumes column type to be timestamp, this patch fixes that

Review Request #12032 - Created June 26, 2013 and submitted

Raghav Gautam
SQOOP-906
Reviewers
Sqoop
sqoop-trunk
Incremental import using lastmodified mode always assumes column type to be TIMESTAMP which is causing issues with Oracle Connector. This patch fixes that.
Unit tests & oracle third party tests are passing. Also tested manually.
src/java/org/apache/sqoop/manager/ConnManager.java
Revision c84c859 New Change
[20] 718 lines
[+20] [+] public String timestampToQueryString(Timestamp ts) {
719
  /**
719
  /**
720
   * Given a date/time, return the quoted string that can
720
   * Given a date/time, return the quoted string that can
721
   * be inserted into a SQL statement, representing that date/time.
721
   * be inserted into a SQL statement, representing that date/time.
722
   */
722
   */
723
  public String datetimeToQueryString(String datetime, int columnType) {
723
  public String datetimeToQueryString(String datetime, int columnType) {

    
   
724
    if (columnType != Types.TIMESTAMP && columnType != Types.DATE) {

    
   
725
      String msg = "Column type is neither timestamp nor date!";

    
   
726
      LOG.error(msg);

    
   
727
      throw new RuntimeException(msg);

    
   
728
    }
724
    return "'" + datetime + "'";
729
    return "'" + datetime + "'";
725
  }
730
  }
726

    
   
731

   
727
  /**
732
  /**
728
   * This method allows the ConnManager to override the creation of an
733
   * This method allows the ConnManager to override the creation of an
[+20] [20] 44 lines
src/java/org/apache/sqoop/manager/OracleManager.java
Revision 686bc19 New Change
 
src/java/org/apache/sqoop/tool/ImportTool.java
Revision cb800b6 New Change
 
src/test/com/cloudera/sqoop/TestIncrementalImport.java
Revision 02080df New Change
 
src/test/com/cloudera/sqoop/TestMerge.java
Revision 5010cf2 New Change
 
src/test/com/cloudera/sqoop/ThirdPartyTests.java
Revision ada5c72 New Change
 
src/test/com/cloudera/sqoop/testutil/BaseSqoopTestCase.java
Revision 877d7f8 New Change
 
src/test/org/apache/sqoop/manager/oracle/OracleIncrementalImportTest.java
New File
 
  1. src/java/org/apache/sqoop/manager/ConnManager.java: Loading...
  2. src/java/org/apache/sqoop/manager/OracleManager.java: Loading...
  3. src/java/org/apache/sqoop/tool/ImportTool.java: Loading...
  4. src/test/com/cloudera/sqoop/TestIncrementalImport.java: Loading...
  5. src/test/com/cloudera/sqoop/TestMerge.java: Loading...
  6. src/test/com/cloudera/sqoop/ThirdPartyTests.java: Loading...
  7. src/test/com/cloudera/sqoop/testutil/BaseSqoopTestCase.java: Loading...
  8. src/test/org/apache/sqoop/manager/oracle/OracleIncrementalImportTest.java: Loading...