本文整理了Java中org.apache.hadoop.hive.metastore.api.Table.addToPartitionKeys()
方法的一些代码示例,展示了Table.addToPartitionKeys()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.addToPartitionKeys()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.metastore.api.Table
类名称:Table
方法名:addToPartitionKeys
暂无
代码示例来源:origin: apache/incubator-gobblin
public Table createTestAvroTable(String dbName, String tableName, String tableSdLoc,
Optional<String> partitionFieldName, boolean ignoreDbCreation) throws Exception {
if (!ignoreDbCreation) {
createTestDb(dbName);
}
Table tbl = org.apache.hadoop.hive.ql.metadata.Table.getEmptyTable(dbName, tableName);
tbl.getSd().setLocation(tableSdLoc);
tbl.getSd().getSerdeInfo().setSerializationLib(AvroSerDe.class.getName());
tbl.getSd().getSerdeInfo().setParameters(ImmutableMap.of(HiveAvroSerDeManager.SCHEMA_URL, "/tmp/dummy"));
if (partitionFieldName.isPresent()) {
tbl.addToPartitionKeys(new FieldSchema(partitionFieldName.get(), "string", "some comment"));
}
this.localMetastoreClient.createTable(tbl);
return tbl;
}
代码示例来源:origin: apache/hive
@Test(expected = InvalidOperationException.class)
public void testAlterTableInvalidStorageDescriptorAddPartitionColumns() throws Exception {
Table originalTable = testTables[0];
Table newTable = originalTable.deepCopy();
newTable.addToPartitionKeys(new FieldSchema("new_part", "int", "comment"));
client.alter_table(originalTable.getDbName(), originalTable.getTableName(), newTable);
}
代码示例来源:origin: apache/incubator-gobblin
public Table createTestAvroTable(String dbName, String tableName, String tableSdLoc,
List<String> partitionFieldNames, boolean ignoreDbCreation)
throws Exception {
if (!ignoreDbCreation) {
createTestDb(dbName);
}
Table tbl = org.apache.hadoop.hive.ql.metadata.Table.getEmptyTable(dbName, tableName);
tbl.getSd().setLocation(tableSdLoc);
tbl.getSd().getSerdeInfo().setParameters(ImmutableMap.of(HiveAvroSerDeManager.SCHEMA_URL, "/tmp/dummy"));
for (String partitionFieldName : partitionFieldNames) {
tbl.addToPartitionKeys(new FieldSchema(partitionFieldName, "string", "some comment"));
}
this.localMetastoreClient.createTable(tbl);
return tbl;
}
内容来源于网络,如有侵权,请联系作者删除!