org.apache.hadoop.hive.metastore.api.Table.getCreationMetadata()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(181)

本文整理了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

Table.getCreationMetadata介绍

暂无

代码示例

代码示例来源:origin: apache/hive

  1. /**
  2. * @return the creation metadata (only for materialized views)
  3. */
  4. public CreationMetadata getCreationMetadata() {
  5. return tTable.getCreationMetadata();
  6. }

代码示例来源:origin: apache/hive

  1. if (tbl.getCreationMetadata() != null) {
  2. MCreationMetadata mcm = convertToMCreationMetadata(tbl.getCreationMetadata());
  3. pm.makePersistent(mcm);

代码示例来源:origin: apache/hive

  1. CreationMetadata cm = client.getTable(catName, dbName, tableNames[3]).getCreationMetadata();
  2. cm.addToTablesUsed(dbName + "." + tableNames[1]);
  3. cm.unsetMaterializationTime();

代码示例来源:origin: apache/hive

  1. return getCreationMetadata();

代码示例来源:origin: apache/hive

  1. @Test
  2. public void testAlterTable() throws Exception {
  3. Table originalTable = testTables[2];
  4. String originalTableName = originalTable.getTableName();
  5. String originalDatabase = originalTable.getDbName();
  6. Table newTable = getTableWithAllParametersSet();
  7. newTable.setTableName(originalTableName);
  8. newTable.setDbName(originalDatabase);
  9. // Partition keys can not be set, but getTableWithAllParametersSet is added one, so remove for
  10. // this test
  11. newTable.setPartitionKeys(originalTable.getPartitionKeys());
  12. client.alter_table(originalDatabase, originalTableName, newTable);
  13. Table alteredTable = client.getTable(originalDatabase, originalTableName);
  14. // The extra parameters will be added on server side, so check that the required ones are
  15. // present
  16. for(String key: newTable.getParameters().keySet()) {
  17. Assert.assertEquals("parameters are present", newTable.getParameters().get(key),
  18. alteredTable.getParameters().get(key));
  19. }
  20. // The parameters are checked manually, so do not check them
  21. newTable.setParameters(alteredTable.getParameters());
  22. // Some of the data is set on the server side, so reset those
  23. newTable.setCreateTime(alteredTable.getCreateTime());
  24. newTable.setCreationMetadata(alteredTable.getCreationMetadata());
  25. newTable.setWriteId(alteredTable.getWriteId());
  26. Assert.assertTrue(alteredTable.isSetId());
  27. alteredTable.unsetId();
  28. Assert.assertEquals("The table data should be the same", newTable, alteredTable);
  29. }

代码示例来源:origin: apache/hive

  1. table.setCreationMetadata(createdTable.getCreationMetadata());
  2. table.setWriteId(createdTable.getWriteId());

代码示例来源:origin: apache/hive

  1. Assert.assertNull("Comparing ViewExpandedText", createdTable.getViewExpandedText());
  2. Assert.assertEquals("Comparing TableType", "MANAGED_TABLE", createdTable.getTableType());
  3. Assert.assertTrue("Creation metadata should be empty", createdTable.getCreationMetadata() == null);

代码示例来源:origin: org.apache.hive/hive-standalone-metastore

  1. @Override
  2. public void createTable(Table tbl) throws InvalidObjectException, MetaException {
  3. boolean commited = false;
  4. try {
  5. openTransaction();
  6. MTable mtbl = convertToMTable(tbl);
  7. pm.makePersistent(mtbl);
  8. if (tbl.getCreationMetadata() != null) {
  9. MCreationMetadata mcm = convertToMCreationMetadata(tbl.getCreationMetadata());
  10. pm.makePersistent(mcm);
  11. }
  12. PrincipalPrivilegeSet principalPrivs = tbl.getPrivileges();
  13. List<Object> toPersistPrivObjs = new ArrayList<>();
  14. if (principalPrivs != null) {
  15. int now = (int)(System.currentTimeMillis()/1000);
  16. Map<String, List<PrivilegeGrantInfo>> userPrivs = principalPrivs.getUserPrivileges();
  17. putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, userPrivs, PrincipalType.USER, "SQL");
  18. Map<String, List<PrivilegeGrantInfo>> groupPrivs = principalPrivs.getGroupPrivileges();
  19. putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, groupPrivs, PrincipalType.GROUP, "SQL");
  20. Map<String, List<PrivilegeGrantInfo>> rolePrivs = principalPrivs.getRolePrivileges();
  21. putPersistentPrivObjects(mtbl, toPersistPrivObjs, now, rolePrivs, PrincipalType.ROLE, "SQL");
  22. }
  23. pm.makePersistentAll(toPersistPrivObjs);
  24. commited = commitTransaction();
  25. } finally {
  26. if (!commited) {
  27. rollbackTransaction();
  28. }
  29. }
  30. }

代码示例来源:origin: org.apache.hive/hive-standalone-metastore

  1. return getCreationMetadata();

相关文章

Table类方法