Review Board 1.7.22


SQOOP-1130: Sqoop2: Sqoop MapReduce Job Failed when max and min boundary are both null

Review Request #12449 - Created July 10, 2013 and submitted

Mengwei Ding
SQOOP-1130
Reviewers
Sqoop
jarcec
sqoop-sqoop2
commit e5488360666077b527282e517369fd8f5cdf5341
Author: Mengwei Ding <mengwei.ding@gmail.com>
Date:   Wed Jul 10 11:47:07 2013 -0700

    SQOOP-1130: Sqoop2: Sqoop MapReduce Job Failed when max and min boundary are both null

:100644 100644 4401800... 7792c57... M	connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportPartitioner.java
Have done a manual test, in which I successfully import a table with all null values in partition column.
connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportPartitioner.java
Revision 4401800 New Change
This file contains only whitespace changes.
[20] 54 lines
[+20] [+] public class GenericJdbcImportPartitioner extends Partitioner<ConnectionConfiguration, ImportJobConfiguration> {
55
    partitionMaxValue = context.getString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE);
55
    partitionMaxValue = context.getString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE);
56

    
   
56

   
57
    if (partitionMinValue == null && partitionMaxValue == null) {
57
    if (partitionMinValue == null && partitionMaxValue == null) {
58
      List<Partition> partitions = new LinkedList<Partition>();
58
      List<Partition> partitions = new LinkedList<Partition>();
59
      GenericJdbcImportPartition partition = new GenericJdbcImportPartition();
59
      GenericJdbcImportPartition partition = new GenericJdbcImportPartition();
60
      partition.setConditions(partitionColumnName + "IS NULL");
60
      partition.setConditions(partitionColumnName + " IS NULL");
61
      partitions.add(partition);
61
      partitions.add(partition);
62
      return partitions;
62
      return partitions;
63
    }
63
    }
64

    
   
64

   
65
    switch (partitionColumnType) {
65
    switch (partitionColumnType) {
[+20] [20] 527 lines
  1. connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportPartitioner.java: Loading...