Review Board 1.7.22


SQOOP-1124: Direct export to PostgreSQL with PGBulkloadManager fails without explicit port number settings

Review Request #12269 - Created July 4, 2013 and updated

Masatake Iwasaki
trunk
SQOOP-1124
Reviewers
Sqoop
sqoop-trunk
Attached patch includes following changes:
1. handling for the case JdbcUrl.getPort returns -1 is added to PGBulkloadExportMapper,
2. settings for PGBulkloadManagerManualTest such as database, and username ,tablespace and path of pg_bulkload are made configurable via system property,
3. using not Configuration but JobConf in PGBulkloadManagerManualTest to follow changes in DBConfiguration.
passed PGBulkloadManagerManualTest on PostgreSQL 9.2.4 and pg_bulkload 3.1.3.
build.xml
Revision ef657e3 New Change
[20] 251 lines
[+20]
252
            value="jdbc:mysql://localhost/"/>
252
            value="jdbc:mysql://localhost/"/>
253

    
   
253

   
254
  <property name="sqoop.test.postgresql.connectstring.host_url"
254
  <property name="sqoop.test.postgresql.connectstring.host_url"
255
            value="jdbc:postgresql://localhost/"/>
255
            value="jdbc:postgresql://localhost/"/>
256

    
   
256

   

    
   
257
  <property name="sqoop.test.postgresql.database"

    
   
258
            value="sqooptest" />

    
   
259

   

    
   
260
  <property name="sqoop.test.postgresql.tablespace"

    
   
261
            value="sqooptest" />

    
   
262

   

    
   
263
  <property name="sqoop.test.postgresql.username"

    
   
264
            value="sqooptest" />

    
   
265

   

    
   
266
  <property name="sqoop.test.postgresql.pg_bulkload"

    
   
267
            value="pg_bulkload" />

    
   
268

   
257
  <property name="sqoop.test.sqlserver.connectstring.host_url"
269
  <property name="sqoop.test.sqlserver.connectstring.host_url"
258
            value="jdbc:sqlserver://sqlserverhost:1433"/>
270
            value="jdbc:sqlserver://sqlserverhost:1433"/>
259

    
   
271

   
260
  <property name="java.security.krb5.realm"
272
  <property name="java.security.krb5.realm"
261
            value="OX.AC.UK"/>
273
            value="OX.AC.UK"/>
[+20] [20] 554 lines
[+20]
816
                   value="${sqoop.test.mysql.connectstring.host_url}"/>
828
                   value="${sqoop.test.mysql.connectstring.host_url}"/>
817

    
   
829

   
818
      <sysproperty key="sqoop.test.postgresql.connectstring.host_url"
830
      <sysproperty key="sqoop.test.postgresql.connectstring.host_url"
819
                   value="${sqoop.test.postgresql.connectstring.host_url}"/>
831
                   value="${sqoop.test.postgresql.connectstring.host_url}"/>
820

    
   
832

   

    
   
833
      <sysproperty key="sqoop.test.postgresql.database"

    
   
834
                   value="${sqoop.test.postgresql.database}" />

    
   
835

   

    
   
836
      <sysproperty key="sqoop.test.postgresql.tablespace"

    
   
837
                   value="${sqoop.test.postgresql.tablespace}" />

    
   
838

   

    
   
839
      <sysproperty key="sqoop.test.postgresql.username"

    
   
840
                   value="${sqoop.test.postgresql.username}" />

    
   
841

   

    
   
842
      <sysproperty key="sqoop.test.postgresql.pg_bulkload"

    
   
843
                   value="${sqoop.test.postgresql.pg_bulkload}" />

    
   
844

   
821
      <sysproperty key="sqoop.test.sqlserver.connectstring.host_url"
845
      <sysproperty key="sqoop.test.sqlserver.connectstring.host_url"
822
                   value="${sqoop.test.sqlserver.connectstring.host_url}"/>
846
                   value="${sqoop.test.sqlserver.connectstring.host_url}"/>
823

    
   
847

   
824
      <sysproperty key="sqoop.test.msserver.connector.factory"
848
      <sysproperty key="sqoop.test.msserver.connector.factory"
825
                   value="${sqoop.test.msserver.connector.factory}"/>
849
                   value="${sqoop.test.msserver.connector.factory}"/>
[+20] [20] 485 lines
src/java/org/apache/sqoop/mapreduce/postgresql/PGBulkloadExportJob.java
Revision 79fb7da New Change
 
src/java/org/apache/sqoop/mapreduce/postgresql/PGBulkloadExportMapper.java
Revision 333546f New Change
 
src/test/com/cloudera/sqoop/manager/PGBulkloadManagerManualTest.java
Revision 0403614 New Change
 
  1. build.xml: Loading...
  2. src/java/org/apache/sqoop/mapreduce/postgresql/PGBulkloadExportJob.java: Loading...
  3. src/java/org/apache/sqoop/mapreduce/postgresql/PGBulkloadExportMapper.java: Loading...
  4. src/test/com/cloudera/sqoop/manager/PGBulkloadManagerManualTest.java: Loading...