本文整理了Java中org.apache.hadoop.hive.metastore.api.Table.getCreationMetadata()
方法的一些代码示例,展示了Table.getCreationMetadata()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getCreationMetadata()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.metastore.api.Table
类名称:Table
方法名:getCreationMetadata
暂无
代码示例来源:origin: apache/hive
/**
* @return the creation metadata (only for materialized views)
*/
public CreationMetadata getCreationMetadata() {
return tTable.getCreationMetadata();
}
代码示例来源:origin: apache/hive
if (tbl.getCreationMetadata() != null) {
MCreationMetadata mcm = convertToMCreationMetadata(tbl.getCreationMetadata());
pm.makePersistent(mcm);
代码示例来源:origin: apache/hive
CreationMetadata cm = client.getTable(catName, dbName, tableNames[3]).getCreationMetadata();
cm.addToTablesUsed(dbName + "." + tableNames[1]);
cm.unsetMaterializationTime();
代码示例来源:origin: apache/hive
return getCreationMetadata();
代码示例来源:origin: apache/hive
@Test
public void testAlterTable() throws Exception {
Table originalTable = testTables[2];
String originalTableName = originalTable.getTableName();
String originalDatabase = originalTable.getDbName();
Table newTable = getTableWithAllParametersSet();
newTable.setTableName(originalTableName);
newTable.setDbName(originalDatabase);
// Partition keys can not be set, but getTableWithAllParametersSet is added one, so remove for
// this test
newTable.setPartitionKeys(originalTable.getPartitionKeys());
client.alter_table(originalDatabase, originalTableName, newTable);
Table alteredTable = client.getTable(originalDatabase, originalTableName);
// The extra parameters will be added on server side, so check that the required ones are
// present
for(String key: newTable.getParameters().keySet()) {
Assert.assertEquals("parameters are present", newTable.getParameters().get(key),
alteredTable.getParameters().get(key));
}
// The parameters are checked manually, so do not check them
newTable.setParameters(alteredTable.getParameters());
// Some of the data is set on the server side, so reset those
newTable.setCreateTime(alteredTable.getCreateTime());
newTable.setCreationMetadata(alteredTable.getCreationMetadata());
newTable.setWriteId(alteredTable.getWriteId());
Assert.assertTrue(alteredTable.isSetId());
alteredTable.unsetId();
Assert.assertEquals("The table data should be the same", newTable, alteredTable);
}
代码示例来源:origin: apache/hive
table.setCreationMetadata(createdTable.getCreationMetadata());
table.setWriteId(createdTable.getWriteId());
代码示例来源:origin: apache/hive
Assert.assertNull("Comparing ViewExpandedText", createdTable.getViewExpandedText());
Assert.assertEquals("Comparing TableType", "MANAGED_TABLE", createdTable.getTableType());
Assert.assertTrue("Creation metadata should be empty", createdTable.getCreationMetadata() == null);
代码示例来源:origin: org.apache.hive/hive-standalone-metastore
@Override
public void createTable(Table tbl) throws InvalidObjectException, MetaException {
boolean commited = false;
try {
openTransaction();
MTable mtbl = convertToMTable(tbl);
pm.makePersistent(mtbl);
if (tbl.getCreationMetadata() != null) {
MCreationMetadata mcm = convertToMCreationMetadata(tbl.getCreationMetadata());
pm.makePersistent(mcm);
}
PrincipalPrivilegeSet principalPrivs = tbl.getPrivileges();
List<Object> toPersistPrivObjs = new ArrayList<>();
if (principalPrivs != null) {
int now = (int)(System.currentTimeMillis()/1000);
Map<String, List<PrivilegeGrantInfo>> userPrivs = principalPrivs.getUserPrivileges();
putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, userPrivs, PrincipalType.USER, "SQL");
Map<String, List<PrivilegeGrantInfo>> groupPrivs = principalPrivs.getGroupPrivileges();
putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, groupPrivs, PrincipalType.GROUP, "SQL");
Map<String, List<PrivilegeGrantInfo>> rolePrivs = principalPrivs.getRolePrivileges();
putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, rolePrivs, PrincipalType.ROLE, "SQL");
}
pm.makePersistentAll(toPersistPrivObjs);
commited = commitTransaction();
} finally {
if (!commited) {
rollbackTransaction();
}
}
}
代码示例来源:origin: org.apache.hive/hive-standalone-metastore
return getCreationMetadata();
内容来源于网络,如有侵权,请联系作者删除!