protected DBSplitter getSplitter()

in odps-sqoop/src/java/org/apache/sqoop/mapreduce/db/DataDrivenDBInputFormat.java [87:145]


  protected DBSplitter getSplitter(int sqlDataType, long splitLimit) {
    switch (sqlDataType) {
    case Types.NUMERIC:
    case Types.DECIMAL:
      if(splitLimit >= 0) {
        throw new IllegalArgumentException("split-limit is supported only with Integer and Date columns");
      }
      return new BigDecimalSplitter();

    case Types.BIT:
    case Types.BOOLEAN:
      if(splitLimit >= 0) {
        throw new IllegalArgumentException("split-limit is supported only with Integer and Date columns");
      }
      return new BooleanSplitter();

    case Types.INTEGER:
    case Types.TINYINT:
    case Types.SMALLINT:
    case Types.BIGINT:
      return new IntegerSplitter();

    case Types.REAL:
    case Types.FLOAT:
    case Types.DOUBLE:
      if(splitLimit >= 0) {
        throw new IllegalArgumentException("split-limit is supported only with Integer and Date columns");
      }
      return new FloatSplitter();

    case Types.NVARCHAR:
    case Types.NCHAR:
      if(splitLimit >= 0) {
        throw new IllegalArgumentException("split-limit is supported only with Integer and Date columns");
      }
      return new NTextSplitter();

    case Types.CHAR:
    case Types.VARCHAR:
    case Types.LONGVARCHAR:
      if(splitLimit >= 0) {
         throw new IllegalArgumentException("split-limit is supported only with Integer and Date columns");
      }
      return new TextSplitter();

    case Types.DATE:
    case Types.TIME:
    case Types.TIMESTAMP:
      return new DateSplitter();

    default:
      // TODO: Support BINARY, VARBINARY, LONGVARBINARY, DISTINCT, CLOB,
      // BLOB, ARRAY, STRUCT, REF, DATALINK, and JAVA_OBJECT.
      if(splitLimit >= 0) {
        throw new IllegalArgumentException("split-limit is supported only with Integer and Date columns");
      }
      return null;
    }
  }