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

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

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

Table.getOwner介绍

暂无

代码示例

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

  1. /**
  2. * @return the owner of the corresponding hive table
  3. */
  4. public Optional<String> getOwner() {
  5. return Optional.fromNullable(this.hivePartition.getTable().getOwner());
  6. }
  7. }

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

  1. private static void getTableMetaDataInformation(StringBuilder tableInfo, Table tbl,
  2. boolean isOutputPadded) {
  3. formatOutput("Database:", tbl.getDbName(), tableInfo);
  4. formatOutput("OwnerType:", (tbl.getOwnerType() != null) ? tbl.getOwnerType().name() : "null", tableInfo);
  5. formatOutput("Owner:", tbl.getOwner(), tableInfo);
  6. formatOutput("CreateTime:", formatDate(tbl.getTTable().getCreateTime()), tableInfo);
  7. formatOutput("LastAccessTime:", formatDate(tbl.getTTable().getLastAccessTime()), tableInfo);
  8. formatOutput("Retention:", Integer.toString(tbl.getRetention()), tableInfo);
  9. if (!tbl.isView()) {
  10. formatOutput("Location:", tbl.getDataLocation().toString(), tableInfo);
  11. }
  12. formatOutput("Table Type:", tbl.getTableType().name(), tableInfo);
  13. if (tbl.getParameters().size() > 0) {
  14. tableInfo.append("Table Parameters:").append(LINE_DELIM);
  15. displayAllParameters(tbl.getParameters(), tableInfo, false, isOutputPadded);
  16. }
  17. }

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

  1. String owner = tbl.getOwner();
  2. List<FieldSchema> cols = tbl.getCols();
  3. String ddlCols = MetaStoreUtils.getDDLFromFieldSchema("columns", cols);

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

  1. builder.put("owner", tbl.getOwner());
  2. builder.put("location", tblLoc);
  3. builder.put("inputFormat", inputFormattCls);

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

  1. String owner = tbl.getOwner();
  2. List<FieldSchema> cols = tbl.getCols();
  3. String ddlCols = MetaStoreUtils.getDDLFromFieldSchema("columns", cols);

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

  1. private static void executeDropTableQuery(HiveDataset hiveDataset, Properties properties)
  2. throws IOException {
  3. String dbName = hiveDataset.getTable().getDbName();
  4. String tableName = hiveDataset.getTable().getTableName();
  5. Optional<String> datasetOwner = Optional.fromNullable(hiveDataset.getTable().getOwner());
  6. try (HiveProxyQueryExecutor hiveProxyQueryExecutor = ProxyUtils
  7. .getQueryExecutor(new State(properties), datasetOwner)) {
  8. hiveProxyQueryExecutor.executeQuery(HivePurgerQueryTemplate.getDropTableQuery(dbName, tableName), datasetOwner);
  9. } catch (SQLException e) {
  10. throw new IOException(e);
  11. }
  12. }

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

  1. private static void getTableMetaDataInformation(StringBuilder tableInfo, Table tbl,
  2. boolean isOutputPadded) {
  3. formatOutput("Database:", tbl.getDbName(), tableInfo);
  4. formatOutput("Owner:", tbl.getOwner(), tableInfo);
  5. formatOutput("CreateTime:", formatDate(tbl.getTTable().getCreateTime()), tableInfo);
  6. formatOutput("LastAccessTime:", formatDate(tbl.getTTable().getLastAccessTime()), tableInfo);
  7. formatOutput("Retention:", Integer.toString(tbl.getRetention()), tableInfo);
  8. if (!tbl.isView()) {
  9. formatOutput("Location:", tbl.getDataLocation().toString(), tableInfo);
  10. }
  11. formatOutput("Table Type:", tbl.getTableType().name(), tableInfo);
  12. if (tbl.getParameters().size() > 0) {
  13. tableInfo.append("Table Parameters:").append(LINE_DELIM);
  14. displayAllParameters(tbl.getParameters(), tableInfo, false, isOutputPadded);
  15. }
  16. }

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

  1. builder.put("owner", tbl.getOwner());
  2. builder.put("location", tblLoc);
  3. builder.put("inputFormat", inputFormattCls);

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

  1. .getTableName(), ft.getTableName());
  2. assertEquals("Table owners didn't match for table: " + tableName, tbl
  3. .getOwner(), ft.getOwner());
  4. assertEquals("Table retention didn't match for table: " + tableName,
  5. tbl.getRetention(), ft.getRetention());

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

  1. public static String getTableOwner(Table table) {
  2. return table.getTTable() != null ? (table.getOwner()): "";
  3. }

代码示例来源:origin: com.facebook.presto.hive/hive-apache

  1. String owner = tbl.getOwner();
  2. List<FieldSchema> cols = tbl.getCols();
  3. String ddlCols = MetaStoreUtils.getDDLFromFieldSchema("columns", cols);

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

  1. lineageProcess.set("inputs", sourceList);
  2. lineageProcess.set("outputs", targetList);
  3. lineageProcess.set("userName", table.getOwner());
  4. lineageProcess.set("startTime", new Date(System.currentTimeMillis()));
  5. lineageProcess.set("endTime", new Date(System.currentTimeMillis()));

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

  1. private static void getTableMetaDataInformation(StringBuilder tableInfo, Table tbl) {
  2. formatOutput("Database:", tbl.getDbName(), tableInfo);
  3. formatOutput("Owner:", tbl.getOwner(), tableInfo);
  4. formatOutput("CreateTime:", formatDate(tbl.getTTable().getCreateTime()), tableInfo);
  5. formatOutput("LastAccessTime:", formatDate(tbl.getTTable().getLastAccessTime()), tableInfo);
  6. String protectMode = tbl.getProtectMode().toString();
  7. formatOutput("Protect Mode:", protectMode == null ? "None" : protectMode, tableInfo);
  8. formatOutput("Retention:", Integer.toString(tbl.getRetention()), tableInfo);
  9. if (!tbl.isView()) {
  10. formatOutput("Location:", tbl.getDataLocation().toString(), tableInfo);
  11. }
  12. formatOutput("Table Type:", tbl.getTableType().name(), tableInfo);
  13. if (tbl.getParameters().size() > 0) {
  14. tableInfo.append("Table Parameters:").append(LINE_DELIM);
  15. displayAllParameters(tbl.getParameters(), tableInfo);
  16. }
  17. }

代码示例来源:origin: com.facebook.presto.hive/hive-apache

  1. private static void getTableMetaDataInformation(StringBuilder tableInfo, Table tbl) {
  2. formatOutput("Database:", tbl.getDbName(), tableInfo);
  3. formatOutput("Owner:", tbl.getOwner(), tableInfo);
  4. formatOutput("CreateTime:", formatDate(tbl.getTTable().getCreateTime()), tableInfo);
  5. formatOutput("LastAccessTime:", formatDate(tbl.getTTable().getLastAccessTime()), tableInfo);
  6. String protectMode = tbl.getProtectMode().toString();
  7. formatOutput("Protect Mode:", protectMode == null ? "None" : protectMode, tableInfo);
  8. formatOutput("Retention:", Integer.toString(tbl.getRetention()), tableInfo);
  9. if (!tbl.isView()) {
  10. formatOutput("Location:", tbl.getDataLocation().toString(), tableInfo);
  11. }
  12. formatOutput("Table Type:", tbl.getTableType().name(), tableInfo);
  13. if (tbl.getParameters().size() > 0) {
  14. tableInfo.append("Table Parameters:").append(LINE_DELIM);
  15. displayAllParameters(tbl.getParameters(), tableInfo);
  16. }
  17. }

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

  1. protected List<AtlasEntity> getColumnEntities(AtlasObjectId tableId, Table table, List<FieldSchema> fieldSchemas) {
  2. List<AtlasEntity> ret = new ArrayList<>();
  3. boolean isKnownTable = tableId.getGuid() == null;
  4. int columnPosition = 0;
  5. for (FieldSchema fieldSchema : fieldSchemas) {
  6. String colQualifiedName = getQualifiedName(table, fieldSchema);
  7. AtlasEntity column = context.getEntity(colQualifiedName);
  8. if (column == null) {
  9. column = new AtlasEntity(HIVE_TYPE_COLUMN);
  10. // if column's table was sent in an earlier notification, set 'guid' to null - which will:
  11. // - result in this entity to be not included in 'referredEntities'
  12. // - cause Atlas server to resolve the entity by its qualifiedName
  13. if (isKnownTable) {
  14. column.setGuid(null);
  15. }
  16. column.setAttribute(ATTRIBUTE_TABLE, tableId);
  17. column.setAttribute(ATTRIBUTE_QUALIFIED_NAME, colQualifiedName);
  18. column.setAttribute(ATTRIBUTE_NAME, fieldSchema.getName());
  19. column.setAttribute(ATTRIBUTE_OWNER, table.getOwner());
  20. column.setAttribute(ATTRIBUTE_COL_TYPE, fieldSchema.getType());
  21. column.setAttribute(ATTRIBUTE_COL_POSITION, columnPosition++);
  22. column.setAttribute(ATTRIBUTE_COMMENT, fieldSchema.getComment());
  23. context.putEntity(colQualifiedName, column);
  24. }
  25. ret.add(column);
  26. }
  27. return ret;
  28. }

代码示例来源:origin: com.facebook.presto.hive/hive-apache

  1. builder.put("owner", tbl.getOwner());
  2. builder.put("location", tblLoc);
  3. builder.put("inputFormat", inputFormattCls);

代码示例来源:origin: org.apache.lens/lens-cube

  1. public static XNativeTable nativeTableFromMetaTable(Table table) {
  2. XNativeTable xtable = XCF.createXNativeTable();
  3. xtable.setColumns(new XColumns());
  4. xtable.setName(table.getTableName());
  5. xtable.setDbname(table.getDbName());
  6. xtable.setOwner(table.getOwner());
  7. xtable.setCreatetime(table.getTTable().getCreateTime());
  8. xtable.setLastAccessTime(table.getTTable().getLastAccessTime());
  9. xtable.getColumns().getColumn().addAll(columnsFromFieldSchemaList(table.getCols()));
  10. xtable.setStorageDescriptor(getStorageTableDescFromHiveTable(table));
  11. xtable.setTableType(table.getTableType().name());
  12. return xtable;
  13. }

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

  1. public static XNativeTable nativeTableFromMetaTable(Table table) {
  2. XNativeTable xtable = XCF.createXNativeTable();
  3. xtable.setColumns(new XColumns());
  4. xtable.setName(table.getTableName());
  5. xtable.setDbname(table.getDbName());
  6. xtable.setOwner(table.getOwner());
  7. xtable.setCreatetime(table.getTTable().getCreateTime());
  8. xtable.setLastAccessTime(table.getTTable().getLastAccessTime());
  9. xtable.getColumns().getColumn().addAll(columnsFromFieldSchemaList(table.getCols()));
  10. xtable.setStorageDescriptor(getStorageTableDescFromHiveTable(table));
  11. xtable.setTableType(table.getTableType().name());
  12. return xtable;
  13. }

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

  1. tableReference.set(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, tableQualifiedName);
  2. tableReference.set(AtlasClient.NAME, hiveTable.getTableName().toLowerCase());
  3. tableReference.set(AtlasClient.OWNER, hiveTable.getOwner());

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

  1. ret.setAttribute(ATTRIBUTE_QUALIFIED_NAME, tblQualifiedName);
  2. ret.setAttribute(ATTRIBUTE_NAME, table.getTableName().toLowerCase());
  3. ret.setAttribute(ATTRIBUTE_OWNER, table.getOwner());
  4. ret.setAttribute(ATTRIBUTE_CREATE_TIME, createTime);
  5. ret.setAttribute(ATTRIBUTE_LAST_ACCESS_TIME, lastAccessTime);

相关文章

Table类方法