本文整理汇总了Java中com.cloudera.sqoop.mapreduce.db.DateSplitter类的典型用法代码示例。如果您正苦于以下问题:Java DateSplitter类的具体用法?Java DateSplitter怎么用?Java DateSplitter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DateSplitter类属于com.cloudera.sqoop.mapreduce.db包,在下文中一共展示了DateSplitter类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSplitter
import com.cloudera.sqoop.mapreduce.db.DateSplitter; //导入依赖的package包/类
/**
* @return the DBSplitter implementation to use to divide the table/query
* into InputSplits.
*/
protected DBSplitter getSplitter(int sqlDataType) {
switch (sqlDataType) {
case Types.NUMERIC:
case Types.DECIMAL:
return new BigDecimalSplitter();
case Types.BIT:
case Types.BOOLEAN:
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:
return new FloatSplitter();
case Types.CHAR:
case Types.VARCHAR:
case Types.LONGVARCHAR:
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.
return null;
}
}
示例2: getSplitter
import com.cloudera.sqoop.mapreduce.db.DateSplitter; //导入依赖的package包/类
/**
* @return the DBSplitter implementation to use to divide the table/query
* into InputSplits.
*/
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;
}
}