本文整理汇总了Java中org.apache.hcatalog.data.schema.HCatFieldSchema类的典型用法代码示例。如果您正苦于以下问题:Java HCatFieldSchema类的具体用法?Java HCatFieldSchema怎么用?Java HCatFieldSchema使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HCatFieldSchema类属于org.apache.hcatalog.data.schema包,在下文中一共展示了HCatFieldSchema类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: validateHCatFieldAndTajoSchema
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
private static void validateHCatFieldAndTajoSchema(HCatFieldSchema fieldSchema) throws CatalogException {
try {
HCatFieldSchema.Type fieldType = fieldSchema.getType();
switch (fieldType) {
case ARRAY:
throw new HCatException("Tajo cannot support array field type.");
case STRUCT:
throw new HCatException("Tajo cannot support struct field type.");
case MAP:
throw new HCatException("Tajo cannot support map field type.");
}
} catch (HCatException e) {
throw new CatalogException("incompatible hcatalog types when assigning to tajo type. - " +
"HCatFieldSchema:" + fieldSchema);
}
}
开发者ID:apache,项目名称:incubator-tajo,代码行数:17,代码来源:HCatalogUtil.java
示例2: convertToHCatRecord
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
private HCatRecord convertToHCatRecord(SqoopRecord sqr)
throws IOException {
Map<String, Object> fieldMap = sqr.getFieldMap();
HCatRecord result = new DefaultHCatRecord(fieldCount);
for (Map.Entry<String, Object> entry : fieldMap.entrySet()) {
String key = entry.getKey();
Object val = entry.getValue();
String hfn = key.toLowerCase();
if (staticPartitionKey != null && staticPartitionKey.equals(hfn)) {
continue;
}
HCatFieldSchema hfs = hCatFullTableSchema.get(hfn);
if (debugHCatImportMapper) {
LOG.debug("SqoopRecordVal: field = " + key + " Val " + val
+ " of type " + (val == null ? null : val.getClass().getName())
+ ", hcattype " + hfs.getTypeString());
}
Object hCatVal = toHCat(val, hfs.getType(), hfs.getTypeString());
result.set(hfn, hCatFullTableSchema, hCatVal);
}
return result;
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:26,代码来源:SqoopHCatImportMapper.java
示例3: converDateTypes
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
private Object converDateTypes(Object val,
HCatFieldSchema.Type hfsType) {
if (val instanceof java.sql.Date) {
if (hfsType == HCatFieldSchema.Type.BIGINT) {
return ((Date) val).getTime();
} else if (hfsType == HCatFieldSchema.Type.STRING) {
return val.toString();
}
} else if (val instanceof java.sql.Time) {
if (hfsType == HCatFieldSchema.Type.BIGINT) {
return ((Time) val).getTime();
} else if (hfsType == HCatFieldSchema.Type.STRING) {
return val.toString();
}
} else if (val instanceof java.sql.Timestamp) {
if (hfsType == HCatFieldSchema.Type.BIGINT) {
return ((Timestamp) val).getTime();
} else if (hfsType == HCatFieldSchema.Type.STRING) {
return val.toString();
}
}
return null;
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:24,代码来源:SqoopHCatImportMapper.java
示例4: convertBooleanTypes
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
private Object convertBooleanTypes(Object val,
HCatFieldSchema.Type hfsType) {
Boolean b = (Boolean) val;
if (hfsType == HCatFieldSchema.Type.BOOLEAN) {
return b;
} else if (hfsType == HCatFieldSchema.Type.TINYINT) {
return (byte) (b ? 1 : 0);
} else if (hfsType == HCatFieldSchema.Type.SMALLINT) {
return (short) (b ? 1 : 0);
} else if (hfsType == HCatFieldSchema.Type.INT) {
return (int) (b ? 1 : 0);
} else if (hfsType == HCatFieldSchema.Type.BIGINT) {
return (long) (b ? 1 : 0);
} else if (hfsType == HCatFieldSchema.Type.FLOAT) {
return (float) (b ? 1 : 0);
} else if (hfsType == HCatFieldSchema.Type.DOUBLE) {
return (double) (b ? 1 : 0);
} else if (hfsType == HCatFieldSchema.Type.STRING) {
return val.toString();
}
return null;
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:23,代码来源:SqoopHCatImportMapper.java
示例5: validateHCatTableFieldTypes
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
public void validateHCatTableFieldTypes() throws IOException {
StringBuilder sb = new StringBuilder();
boolean hasComplexFields = false;
for (HCatFieldSchema hfs : projectedSchema.getFields()) {
if (hfs.isComplex()) {
sb.append('.').append(hfs.getName());
hasComplexFields = true;
}
}
if (hasComplexFields) {
String unsupportedFields = sb.substring(1);
throw new IOException("The HCatalog table provided "
+ getQualifiedHCatTableName() + " has complex field types ("
+ unsupportedFields + "). They are currently not supported");
}
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:19,代码来源:SqoopHCatUtilities.java
示例6: validateStaticPartitionKey
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
private void validateStaticPartitionKey() throws IOException {
// check the static partition key from command line
List<HCatFieldSchema> partFields = hCatPartitionSchema.getFields();
if (hCatStaticPartitionKey != null) {
boolean found = false;
for (HCatFieldSchema hfs : partFields) {
if (hfs.getName().equals(hCatStaticPartitionKey)) {
found = true;
break;
}
}
if (!found) {
throw new IOException("The provided hive partition key "
+ hCatStaticPartitionKey + " is not part of the partition "
+ " keys for table " + getQualifiedHCatTableName());
}
}
hCatDynamicPartitionKeys = new ArrayList<String>();
hCatDynamicPartitionKeys.addAll(hCatPartitionSchema.getFieldNames());
if (hCatStaticPartitionKey != null) {
hCatDynamicPartitionKeys.remove(hCatStaticPartitionKey);
}
configuration.set(HCAT_STATIC_PARTITION_KEY_PROP,
hCatStaticPartitionKey == null ? "" : hCatStaticPartitionKey);
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:27,代码来源:SqoopHCatUtilities.java
示例7: testIntTypes
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
public void testIntTypes() throws Exception {
final int TOTAL_RECORDS = 1 * 10;
String table = getTableName().toUpperCase();
ColumnGenerator[] cols = new ColumnGenerator[] {
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
"boolean", Types.BOOLEAN, HCatFieldSchema.Type.BOOLEAN,
Boolean.TRUE, Boolean.TRUE, KeyType.NOT_A_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(1),
"tinyint", Types.INTEGER, HCatFieldSchema.Type.INT, 10,
10, KeyType.NOT_A_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(2),
"smallint", Types.INTEGER, HCatFieldSchema.Type.INT, 100,
100, KeyType.NOT_A_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(3),
"int", Types.INTEGER, HCatFieldSchema.Type.INT, 1000,
1000, KeyType.NOT_A_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(4),
"bigint", Types.BIGINT, HCatFieldSchema.Type.BIGINT, 10000L,
10000L, KeyType.NOT_A_KEY),
};
List<String> addlArgsArray = new ArrayList<String>();
setExtraArgs(addlArgsArray);
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, null);
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:25,代码来源:HCatalogImportTest.java
示例8: testFloatTypes
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
public void testFloatTypes() throws Exception {
final int TOTAL_RECORDS = 1 * 10;
String table = getTableName().toUpperCase();
ColumnGenerator[] cols = new ColumnGenerator[] {
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
"float", Types.FLOAT, HCatFieldSchema.Type.FLOAT, 10.0F,
10.F, KeyType.NOT_A_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(1),
"real", Types.FLOAT, HCatFieldSchema.Type.FLOAT, 20.0F,
20.0F, KeyType.NOT_A_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(2),
"double", Types.DOUBLE, HCatFieldSchema.Type.DOUBLE, 30.0D,
30.0D, KeyType.NOT_A_KEY),
};
List<String> addlArgsArray = new ArrayList<String>();
setExtraArgs(addlArgsArray);
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, null);
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:19,代码来源:HCatalogImportTest.java
示例9: testDateTypes
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
public void testDateTypes() throws Exception {
final int TOTAL_RECORDS = 1 * 10;
String table = getTableName().toUpperCase();
ColumnGenerator[] cols = new ColumnGenerator[] {
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
"date", Types.DATE, HCatFieldSchema.Type.STRING, "2013-12-31",
new Date(113, 11, 31), KeyType.NOT_A_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(1),
"time", Types.TIME, HCatFieldSchema.Type.STRING, "10:11:12",
new Time(10, 11, 12), KeyType.NOT_A_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(2),
"timestamp", Types.TIMESTAMP, HCatFieldSchema.Type.STRING,
"2013-12-31 10:11:12.0", new Timestamp(113, 11, 31, 10, 11, 12, 0),
KeyType.NOT_A_KEY),
};
List<String> addlArgsArray = new ArrayList<String>();
setExtraArgs(addlArgsArray);
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, null);
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:20,代码来源:HCatalogImportTest.java
示例10: testDateTypesToBigInt
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
public void testDateTypesToBigInt() throws Exception {
final int TOTAL_RECORDS = 1 * 10;
long offset = TimeZone.getDefault().getRawOffset();
String table = getTableName().toUpperCase();
ColumnGenerator[] cols = new ColumnGenerator[] {
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
"date", Types.DATE, HCatFieldSchema.Type.BIGINT, 0 - offset,
new Date(70, 0, 1), KeyType.NOT_A_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(1),
"time", Types.TIME, HCatFieldSchema.Type.BIGINT, 36672000L - offset,
new Time(10, 11, 12), KeyType.NOT_A_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(2),
"timestamp", Types.TIMESTAMP, HCatFieldSchema.Type.BIGINT,
36672000L - offset, new Timestamp(70, 0, 1, 10, 11, 12, 0),
KeyType.NOT_A_KEY),
};
List<String> addlArgsArray = new ArrayList<String>();
addlArgsArray.add("--map-column-hive");
addlArgsArray.add("COL0=bigint,COL1=bigint,COL2=bigint");
setExtraArgs(addlArgsArray);
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, null);
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:23,代码来源:HCatalogImportTest.java
示例11: testBinaryTypes
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
public void testBinaryTypes() throws Exception {
ByteBuffer bb = ByteBuffer.wrap(new byte[] { 0, 1, 2 });
final int TOTAL_RECORDS = 1 * 10;
String table = getTableName().toUpperCase();
ColumnGenerator[] cols = new ColumnGenerator[] {
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
"binary(10)", Types.BINARY, HCatFieldSchema.Type.BINARY,
bb.array(), bb.array(), KeyType.NOT_A_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(1),
"longvarbinary", Types.BINARY, HCatFieldSchema.Type.BINARY,
bb.array(), bb.array(), KeyType.NOT_A_KEY),
};
List<String> addlArgsArray = new ArrayList<String>();
setExtraArgs(addlArgsArray);
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, null);
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:17,代码来源:HCatalogImportTest.java
示例12: testColumnProjection
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
public void testColumnProjection() throws Exception {
final int TOTAL_RECORDS = 1 * 10;
String table = getTableName().toUpperCase();
ColumnGenerator[] cols = new ColumnGenerator[] {
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING,
null, null, KeyType.NOT_A_KEY),
};
List<String> addlArgsArray = new ArrayList<String>();
List<String> cfgParams = new ArrayList<String>();
cfgParams.add("-D");
cfgParams.add(SqoopHCatUtilities.DEBUG_HCAT_IMPORT_MAPPER_PROP
+ "=true");
setConfigParams(cfgParams);
String[] colNames = new String[] { "ID", "MSG" };
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, colNames);
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:18,代码来源:HCatalogImportTest.java
示例13: testColumnProjectionMissingPartKeys
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
public void testColumnProjectionMissingPartKeys() throws Exception {
final int TOTAL_RECORDS = 1 * 10;
String table = getTableName().toUpperCase();
ColumnGenerator[] cols = new ColumnGenerator[] {
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING,
null, null, KeyType.DYNAMIC_KEY),
};
List<String> addlArgsArray = new ArrayList<String>();
List<String> cfgParams = new ArrayList<String>();
cfgParams.add("-D");
cfgParams.add(SqoopHCatUtilities.DEBUG_HCAT_IMPORT_MAPPER_PROP
+ "=true");
setConfigParams(cfgParams);
String[] colNames = new String[] { "ID", "MSG" };
try {
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, colNames);
fail("Column projection with missing dynamic partition keys must fail");
} catch (Throwable t) {
LOG.info("Job fails as expected : " + t);
StringWriter sw = new StringWriter();
t.printStackTrace(new PrintWriter(sw));
LOG.info("Exception stack trace = " + sw);
}
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:26,代码来源:HCatalogImportTest.java
示例14: testStaticPartitioning
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
public void testStaticPartitioning() throws Exception {
final int TOTAL_RECORDS = 1 * 10;
String table = getTableName().toUpperCase();
ColumnGenerator[] cols = new ColumnGenerator[] {
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING,
"1", "1", KeyType.STATIC_KEY),
};
List<String> addlArgsArray = new ArrayList<String>();
addlArgsArray.add("--hive-partition-key");
addlArgsArray.add("col0");
addlArgsArray.add("--hive-partition-value");
addlArgsArray.add("1");
setExtraArgs(addlArgsArray);
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, null);
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:17,代码来源:HCatalogImportTest.java
示例15: testStaicAndDynamicPartitioning
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
public void testStaicAndDynamicPartitioning() throws Exception {
final int TOTAL_RECORDS = 1 * 10;
String table = getTableName().toUpperCase();
ColumnGenerator[] cols = new ColumnGenerator[] {
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING,
"1", "1", KeyType.STATIC_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(1),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING,
"2", "2", KeyType.DYNAMIC_KEY),
};
List<String> addlArgsArray = new ArrayList<String>();
addlArgsArray.add("--hive-partition-key");
addlArgsArray.add("col0");
addlArgsArray.add("--hive-partition-value");
addlArgsArray.add("1");
setExtraArgs(addlArgsArray);
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, null);
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:20,代码来源:HCatalogImportTest.java
示例16: testSequenceFile
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
/**
* Test other file formats.
*/
public void testSequenceFile() throws Exception {
final int TOTAL_RECORDS = 1 * 10;
String table = getTableName().toUpperCase();
ColumnGenerator[] cols = new ColumnGenerator[] {
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING, "1",
"1", KeyType.STATIC_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(1),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING, "2",
"2", KeyType.DYNAMIC_KEY), };
List<String> addlArgsArray = new ArrayList<String>();
addlArgsArray.add("--hive-partition-key");
addlArgsArray.add("col0");
addlArgsArray.add("--hive-partition-value");
addlArgsArray.add("1");
setExtraArgs(addlArgsArray);
utils.setStorageInfo(HCatalogTestUtils.STORED_AS_SEQFILE);
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, null);
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:23,代码来源:HCatalogImportTest.java
示例17: testTextFile
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
public void testTextFile() throws Exception {
final int TOTAL_RECORDS = 1 * 10;
String table = getTableName().toUpperCase();
ColumnGenerator[] cols = new ColumnGenerator[] {
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING,
"1", "1", KeyType.STATIC_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(1),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING,
"2", "2", KeyType.DYNAMIC_KEY),
};
List<String> addlArgsArray = new ArrayList<String>();
addlArgsArray.add("--hive-partition-key");
addlArgsArray.add("col0");
addlArgsArray.add("--hive-partition-value");
addlArgsArray.add("1");
setExtraArgs(addlArgsArray);
utils.setStorageInfo(HCatalogTestUtils.STORED_AS_TEXT);
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, null);
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:21,代码来源:HCatalogImportTest.java
示例18: testTableCreation
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
public void testTableCreation() throws Exception {
final int TOTAL_RECORDS = 1 * 10;
String table = getTableName().toUpperCase();
ColumnGenerator[] cols = new ColumnGenerator[] {
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING,
"1", "1", KeyType.STATIC_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(1),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING,
"2", "2", KeyType.DYNAMIC_KEY),
};
List<String> addlArgsArray = new ArrayList<String>();
addlArgsArray.add("--create-hcatalog-table");
setExtraArgs(addlArgsArray);
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, null, true);
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:17,代码来源:HCatalogImportTest.java
示例19: testTableCreationWithPartition
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
public void testTableCreationWithPartition() throws Exception {
final int TOTAL_RECORDS = 1 * 10;
String table = getTableName().toUpperCase();
ColumnGenerator[] cols = new ColumnGenerator[] {
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING,
"1", "1", KeyType.NOT_A_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(1),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING,
"2", "2", KeyType.STATIC_KEY),
};
List<String> addlArgsArray = new ArrayList<String>();
addlArgsArray.add("--hive-partition-key");
addlArgsArray.add("col1");
addlArgsArray.add("--hive-partition-value");
addlArgsArray.add("2");
addlArgsArray.add("--create-hcatalog-table");
setExtraArgs(addlArgsArray);
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, null, true);
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:21,代码来源:HCatalogImportTest.java
示例20: testTableCreationWithStorageStanza
import org.apache.hcatalog.data.schema.HCatFieldSchema; //导入依赖的package包/类
public void testTableCreationWithStorageStanza() throws Exception {
final int TOTAL_RECORDS = 1 * 10;
String table = getTableName().toUpperCase();
ColumnGenerator[] cols = new ColumnGenerator[] {
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING,
"1", "1", KeyType.NOT_A_KEY),
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(1),
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING,
"2", "2", KeyType.STATIC_KEY),
};
List<String> addlArgsArray = new ArrayList<String>();
addlArgsArray.add("--hive-partition-key");
addlArgsArray.add("col1");
addlArgsArray.add("--hive-partition-value");
addlArgsArray.add("2");
addlArgsArray.add("--create-hcatalog-table");
addlArgsArray.add("--hcatalog-storage-stanza");
addlArgsArray.add(HCatalogTestUtils.STORED_AS_TEXT);
setExtraArgs(addlArgsArray);
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols, null, true);
}
开发者ID:unicredit,项目名称:zSqoop,代码行数:23,代码来源:HCatalogImportTest.java
注:本文中的org.apache.hcatalog.data.schema.HCatFieldSchema类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论