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

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

本文整理了Java中org.apache.hadoop.hive.metastore.api.Table.getOwner()方法的一些代码示例,展示了Table.getOwner()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getOwner()方法的具体详情如下:
包路径:org.apache.hadoop.hive.metastore.api.Table
类名称:Table
方法名:getOwner

Table.getOwner介绍

暂无

代码示例

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

  1. /**
  2. * @return The owner of the table.
  3. * @see org.apache.hadoop.hive.metastore.api.Table#getOwner()
  4. */
  5. public String getOwner() {
  6. return tTable.getOwner();
  7. }

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

  1. convertToMStorageDescriptor(tbl.getSd()), tbl.getOwner(), ownerType, tbl
  2. .getCreateTime(), tbl.getLastAccessTime(), tbl.getRetention(),
  3. convertToMFieldSchemas(tbl.getPartitionKeys()), tbl.getParameters(),

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

  1. /**
  2. * @return The owner of the table.
  3. * @see org.apache.hadoop.hive.metastore.api.Table#getOwner()
  4. */
  5. public String getOwner() {
  6. return tTable.getOwner();
  7. }

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

  1. return getOwner();

代码示例来源:origin: prestodb/presto

  1. default boolean isTableOwner(String user, String databaseName, String tableName)
  2. {
  3. // a table can only be owned by a user
  4. Optional<Table> table = getTable(databaseName, tableName);
  5. return table.isPresent() && user.equals(table.get().getOwner());
  6. }

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

  1. Assert.assertEquals("Owner of table was not altered", newTbl1.getOwner(), alteredTable.getOwner());
  2. Assert.assertEquals("Owner type of table was not altered", newTbl1.getOwnerType(), alteredTable.getOwnerType());

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

  1. UserGroupInformation ugi = UserGroupInformation.createProxyUser(t.getOwner(),
  2. UserGroupInformation.getLoginUser());
  3. ugi.doAs(new PrivilegedExceptionAction<Object>() {
  4. ") or table owner(" + t.getOwner() + "), giving up");
  5. throw new IOException("Unable to stat file: " + p);

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

  1. tbl = objectStore.getTable(DEFAULT_CATALOG_NAME, dbName, tblName);
  2. Assert.assertEquals("Owner of the table did not change.", tblOwner, tbl.getOwner());
  3. Assert.assertEquals("Owner type of the table did not change", PrincipalType.ROLE, tbl.getOwnerType());

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

  1. UserGroupInformation ugi = UserGroupInformation.createProxyUser(t.getOwner(),
  2. UserGroupInformation.getLoginUser());
  3. ugi.doAs(new PrivilegedExceptionAction<Object>() {
  4. ") or table owner(" + t.getOwner() + "), giving up");
  5. throw new IOException("Unable to stat file: " + p);

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

  1. Assert.assertNull("Comparing OwnerName", createdTable.getOwner());
  2. Assert.assertNotEquals("Comparing CreateTime", 0, createdTable.getCreateTime());
  3. Assert.assertEquals("Comparing LastAccessTime", 0, createdTable.getLastAccessTime());

代码示例来源:origin: prestodb/presto

  1. public static Table fromMetastoreApiTable(org.apache.hadoop.hive.metastore.api.Table table, List<FieldSchema> schema)
  2. {
  3. StorageDescriptor storageDescriptor = table.getSd();
  4. if (storageDescriptor == null) {
  5. throw new PrestoException(HIVE_INVALID_METADATA, "Table is missing storage descriptor");
  6. }
  7. Table.Builder tableBuilder = Table.builder()
  8. .setDatabaseName(table.getDbName())
  9. .setTableName(table.getTableName())
  10. .setOwner(nullToEmpty(table.getOwner()))
  11. .setTableType(table.getTableType())
  12. .setDataColumns(schema.stream()
  13. .map(ThriftMetastoreUtil::fromMetastoreApiFieldSchema)
  14. .collect(toList()))
  15. .setPartitionColumns(table.getPartitionKeys().stream()
  16. .map(ThriftMetastoreUtil::fromMetastoreApiFieldSchema)
  17. .collect(toList()))
  18. .setParameters(table.getParameters() == null ? ImmutableMap.of() : table.getParameters())
  19. .setViewOriginalText(Optional.ofNullable(emptyToNull(table.getViewOriginalText())))
  20. .setViewExpandedText(Optional.ofNullable(emptyToNull(table.getViewExpandedText())));
  21. fromMetastoreApiStorageDescriptor(storageDescriptor, tableBuilder.getStorageBuilder(), table.getTableName());
  22. return tableBuilder.build();
  23. }

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

  1. HCatTable(Table hiveTable) throws HCatException {
  2. tableName = hiveTable.getTableName();
  3. dbName = hiveTable.getDbName();
  4. tableType = hiveTable.getTableType();
  5. isExternal = hiveTable.getTableType().equals(TableType.EXTERNAL_TABLE.toString());
  6. sd = hiveTable.getSd();
  7. for (FieldSchema colFS : sd.getCols()) {
  8. cols.add(HCatSchemaUtils.getHCatFieldSchema(colFS));
  9. }
  10. partCols = new ArrayList<HCatFieldSchema>();
  11. for (FieldSchema colFS : hiveTable.getPartitionKeys()) {
  12. partCols.add(HCatSchemaUtils.getHCatFieldSchema(colFS));
  13. }
  14. if (hiveTable.getParameters() != null) {
  15. tblProps.putAll(hiveTable.getParameters());
  16. }
  17. if (StringUtils.isNotBlank(tblProps.get("comment"))) {
  18. comment = tblProps.get("comment");
  19. }
  20. owner = hiveTable.getOwner();
  21. }

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

  1. throwGetObjErr(e, hivePrivObject);
  2. return userName.equals(thriftTableObj.getOwner());

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

  1. runJobAsSelf(runAs) ? runAs : t.getOwner());
  2. final CompactorMR mr = new CompactorMR();
  3. launchedJob = true;
  4. mr.run(conf, jobName.toString(), t, sd, txns, ci, su, txnHandler);
  5. } else {
  6. UserGroupInformation ugi = UserGroupInformation.createProxyUser(t.getOwner(),
  7. UserGroupInformation.getLoginUser());
  8. ugi.doAs(new PrivilegedExceptionAction<Object>() {

代码示例来源:origin: apache/incubator-gobblin

  1. private static State getTableProps(Table table) {
  2. State tableProps = new State();
  3. for (Map.Entry<String, String> entry : table.getParameters().entrySet()) {
  4. tableProps.setProp(entry.getKey(), entry.getValue());
  5. }
  6. if (table.isSetCreateTime()) {
  7. tableProps.setProp(HiveConstants.CREATE_TIME, table.getCreateTime());
  8. }
  9. if (table.isSetLastAccessTime()) {
  10. tableProps.setProp(HiveConstants.LAST_ACCESS_TIME, table.getCreateTime());
  11. }
  12. if (table.isSetOwner()) {
  13. tableProps.setProp(HiveConstants.OWNER, table.getOwner());
  14. }
  15. if (table.isSetTableType()) {
  16. tableProps.setProp(HiveConstants.TABLE_TYPE, table.getTableType());
  17. }
  18. if (table.isSetRetention()) {
  19. tableProps.setProp(HiveConstants.RETENTION, table.getRetention());
  20. }
  21. return tableProps;
  22. }

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

  1. throwGetObjErr(e, hivePrivObject);
  2. return userName.equals(thriftTableObj.getOwner());

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

  1. final StatsUpdater su = StatsUpdater.init(ci, msc.findColumnsWithStats(
  2. CompactionInfo.compactionInfoToStruct(ci)), conf,
  3. runJobAsSelf(ci.runAs) ? ci.runAs : t.getOwner());
  4. final CompactorMR mr = new CompactorMR();
  5. launchedJob = true;
  6. mr.run(conf, jobName.toString(), t, p, sd, tblValidWriteIds, ci, su, msc);
  7. } else {
  8. UserGroupInformation ugi = UserGroupInformation.createProxyUser(t.getOwner(),
  9. UserGroupInformation.getLoginUser());
  10. final Partition fp = p;

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

  1. builder.setSdInputFormat(table.getSd().getInputFormat());
  2. builder.setSdOutputFormat(table.getSd().getOutputFormat());
  3. builder.setOwner(table.getOwner());
  4. builder.setLastAccessTime(table.getLastAccessTime());
  5. builder.setTableType(table.getTableType());

代码示例来源:origin: KylinOLAP/Kylin

  1. map.put(MetadataConstants.TABLE_EXD_IF, table.getSd().getInputFormat());
  2. map.put(MetadataConstants.TABLE_EXD_OF, table.getSd().getOutputFormat());
  3. map.put(MetadataConstants.TABLE_EXD_OWNER, table.getOwner());
  4. map.put(MetadataConstants.TABLE_EXD_LAT, String.valueOf(table.getLastAccessTime()));
  5. map.put(MetadataConstants.TABLE_EXD_PC, partitionColumnString.toString());

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

  1. /**
  2. * @return The owner of the table.
  3. * @see org.apache.hadoop.hive.metastore.api.Table#getOwner()
  4. */
  5. public String getOwner() {
  6. return tTable.getOwner();
  7. }

相关文章

Table类方法