Review Board 1.7.22


SQOOP-820 Escape table name in export job only if it's required by connector

Review Request #8891 - Created Jan. 8, 2013 and submitted

Jarek Cecho
SQOOP-820
Reviewers
Sqoop
sqoop-trunk
I've added new method to ConnManager that will return boolean value to see if Sqoop common code should automatically escape table  on export. This method returns false by default.
* Unit tests seems to be passing
* I've verified using PostgreSQL and Microsoft SQL Server third party tests that this change will not break custom schema support introduced in SQOOP-601 and SQOOP-540.
src/java/org/apache/sqoop/manager/ConnManager.java
Revision 21eea93 New Change
[20] 448 lines
[+20] [+] public String escapeColName(String colName) {
449
  public String escapeTableName(String tableName) {
449
  public String escapeTableName(String tableName) {
450
    return tableName;
450
    return tableName;
451
  }
451
  }
452

    
   
452

   
453
  /**
453
  /**

    
   
454
   * Return true if Sqoop common code should automatically escape table name

    
   
455
   * when saving it to mapreduce configuration object when during export.

    
   
456
   *

    
   
457
   * @return True if table name should be escaped

    
   
458
   */

    
   
459
  public boolean escapeTableNameOnExport() {

    
   
460
    return false;

    
   
461
  }

    
   
462

   

    
   
463
  /**
454
   * Perform any shutdown operations on the connection.
464
   * Perform any shutdown operations on the connection.
455
   */
465
   */
456
  public abstract void close() throws SQLException;
466
  public abstract void close() throws SQLException;
457

    
   
467

   
458
  /**
468
  /**
[+20] [20] 120 lines
src/java/org/apache/sqoop/manager/PostgresqlManager.java
Revision 7e6284e New Change
 
src/java/org/apache/sqoop/manager/SQLServerManager.java
Revision 0c39599 New Change
 
src/java/org/apache/sqoop/mapreduce/JdbcExportJob.java
Revision 7c52110 New Change
 
  1. src/java/org/apache/sqoop/manager/ConnManager.java: Loading...
  2. src/java/org/apache/sqoop/manager/PostgresqlManager.java: Loading...
  3. src/java/org/apache/sqoop/manager/SQLServerManager.java: Loading...
  4. src/java/org/apache/sqoop/mapreduce/JdbcExportJob.java: Loading...