本文整理了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
暂无
代码示例来源:origin: apache/incubator-gobblin
/**
* @return the owner of the corresponding hive table
*/
public Optional<String> getOwner() {
return Optional.fromNullable(this.hivePartition.getTable().getOwner());
}
}
代码示例来源:origin: apache/hive
private static void getTableMetaDataInformation(StringBuilder tableInfo, Table tbl,
boolean isOutputPadded) {
formatOutput("Database:", tbl.getDbName(), tableInfo);
formatOutput("OwnerType:", (tbl.getOwnerType() != null) ? tbl.getOwnerType().name() : "null", tableInfo);
formatOutput("Owner:", tbl.getOwner(), tableInfo);
formatOutput("CreateTime:", formatDate(tbl.getTTable().getCreateTime()), tableInfo);
formatOutput("LastAccessTime:", formatDate(tbl.getTTable().getLastAccessTime()), tableInfo);
formatOutput("Retention:", Integer.toString(tbl.getRetention()), tableInfo);
if (!tbl.isView()) {
formatOutput("Location:", tbl.getDataLocation().toString(), tableInfo);
}
formatOutput("Table Type:", tbl.getTableType().name(), tableInfo);
if (tbl.getParameters().size() > 0) {
tableInfo.append("Table Parameters:").append(LINE_DELIM);
displayAllParameters(tbl.getParameters(), tableInfo, false, isOutputPadded);
}
}
代码示例来源:origin: apache/hive
String owner = tbl.getOwner();
List<FieldSchema> cols = tbl.getCols();
String ddlCols = MetaStoreUtils.getDDLFromFieldSchema("columns", cols);
代码示例来源:origin: apache/hive
builder.put("owner", tbl.getOwner());
builder.put("location", tblLoc);
builder.put("inputFormat", inputFormattCls);
代码示例来源:origin: apache/drill
String owner = tbl.getOwner();
List<FieldSchema> cols = tbl.getCols();
String ddlCols = MetaStoreUtils.getDDLFromFieldSchema("columns", cols);
代码示例来源:origin: apache/incubator-gobblin
private static void executeDropTableQuery(HiveDataset hiveDataset, Properties properties)
throws IOException {
String dbName = hiveDataset.getTable().getDbName();
String tableName = hiveDataset.getTable().getTableName();
Optional<String> datasetOwner = Optional.fromNullable(hiveDataset.getTable().getOwner());
try (HiveProxyQueryExecutor hiveProxyQueryExecutor = ProxyUtils
.getQueryExecutor(new State(properties), datasetOwner)) {
hiveProxyQueryExecutor.executeQuery(HivePurgerQueryTemplate.getDropTableQuery(dbName, tableName), datasetOwner);
} catch (SQLException e) {
throw new IOException(e);
}
}
代码示例来源:origin: apache/drill
private static void getTableMetaDataInformation(StringBuilder tableInfo, Table tbl,
boolean isOutputPadded) {
formatOutput("Database:", tbl.getDbName(), tableInfo);
formatOutput("Owner:", tbl.getOwner(), tableInfo);
formatOutput("CreateTime:", formatDate(tbl.getTTable().getCreateTime()), tableInfo);
formatOutput("LastAccessTime:", formatDate(tbl.getTTable().getLastAccessTime()), tableInfo);
formatOutput("Retention:", Integer.toString(tbl.getRetention()), tableInfo);
if (!tbl.isView()) {
formatOutput("Location:", tbl.getDataLocation().toString(), tableInfo);
}
formatOutput("Table Type:", tbl.getTableType().name(), tableInfo);
if (tbl.getParameters().size() > 0) {
tableInfo.append("Table Parameters:").append(LINE_DELIM);
displayAllParameters(tbl.getParameters(), tableInfo, false, isOutputPadded);
}
}
代码示例来源:origin: apache/drill
builder.put("owner", tbl.getOwner());
builder.put("location", tblLoc);
builder.put("inputFormat", inputFormattCls);
代码示例来源:origin: apache/hive
.getTableName(), ft.getTableName());
assertEquals("Table owners didn't match for table: " + tableName, tbl
.getOwner(), ft.getOwner());
assertEquals("Table retention didn't match for table: " + tableName,
tbl.getRetention(), ft.getRetention());
代码示例来源:origin: apache/atlas
public static String getTableOwner(Table table) {
return table.getTTable() != null ? (table.getOwner()): "";
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
String owner = tbl.getOwner();
List<FieldSchema> cols = tbl.getCols();
String ddlCols = MetaStoreUtils.getDDLFromFieldSchema("columns", cols);
代码示例来源:origin: apache/incubator-atlas
lineageProcess.set("inputs", sourceList);
lineageProcess.set("outputs", targetList);
lineageProcess.set("userName", table.getOwner());
lineageProcess.set("startTime", new Date(System.currentTimeMillis()));
lineageProcess.set("endTime", new Date(System.currentTimeMillis()));
代码示例来源:origin: org.apache.hadoop.hive/hive-exec
private static void getTableMetaDataInformation(StringBuilder tableInfo, Table tbl) {
formatOutput("Database:", tbl.getDbName(), tableInfo);
formatOutput("Owner:", tbl.getOwner(), tableInfo);
formatOutput("CreateTime:", formatDate(tbl.getTTable().getCreateTime()), tableInfo);
formatOutput("LastAccessTime:", formatDate(tbl.getTTable().getLastAccessTime()), tableInfo);
String protectMode = tbl.getProtectMode().toString();
formatOutput("Protect Mode:", protectMode == null ? "None" : protectMode, tableInfo);
formatOutput("Retention:", Integer.toString(tbl.getRetention()), tableInfo);
if (!tbl.isView()) {
formatOutput("Location:", tbl.getDataLocation().toString(), tableInfo);
}
formatOutput("Table Type:", tbl.getTableType().name(), tableInfo);
if (tbl.getParameters().size() > 0) {
tableInfo.append("Table Parameters:").append(LINE_DELIM);
displayAllParameters(tbl.getParameters(), tableInfo);
}
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
private static void getTableMetaDataInformation(StringBuilder tableInfo, Table tbl) {
formatOutput("Database:", tbl.getDbName(), tableInfo);
formatOutput("Owner:", tbl.getOwner(), tableInfo);
formatOutput("CreateTime:", formatDate(tbl.getTTable().getCreateTime()), tableInfo);
formatOutput("LastAccessTime:", formatDate(tbl.getTTable().getLastAccessTime()), tableInfo);
String protectMode = tbl.getProtectMode().toString();
formatOutput("Protect Mode:", protectMode == null ? "None" : protectMode, tableInfo);
formatOutput("Retention:", Integer.toString(tbl.getRetention()), tableInfo);
if (!tbl.isView()) {
formatOutput("Location:", tbl.getDataLocation().toString(), tableInfo);
}
formatOutput("Table Type:", tbl.getTableType().name(), tableInfo);
if (tbl.getParameters().size() > 0) {
tableInfo.append("Table Parameters:").append(LINE_DELIM);
displayAllParameters(tbl.getParameters(), tableInfo);
}
}
代码示例来源:origin: apache/atlas
protected List<AtlasEntity> getColumnEntities(AtlasObjectId tableId, Table table, List<FieldSchema> fieldSchemas) {
List<AtlasEntity> ret = new ArrayList<>();
boolean isKnownTable = tableId.getGuid() == null;
int columnPosition = 0;
for (FieldSchema fieldSchema : fieldSchemas) {
String colQualifiedName = getQualifiedName(table, fieldSchema);
AtlasEntity column = context.getEntity(colQualifiedName);
if (column == null) {
column = new AtlasEntity(HIVE_TYPE_COLUMN);
// if column's table was sent in an earlier notification, set 'guid' to null - which will:
// - result in this entity to be not included in 'referredEntities'
// - cause Atlas server to resolve the entity by its qualifiedName
if (isKnownTable) {
column.setGuid(null);
}
column.setAttribute(ATTRIBUTE_TABLE, tableId);
column.setAttribute(ATTRIBUTE_QUALIFIED_NAME, colQualifiedName);
column.setAttribute(ATTRIBUTE_NAME, fieldSchema.getName());
column.setAttribute(ATTRIBUTE_OWNER, table.getOwner());
column.setAttribute(ATTRIBUTE_COL_TYPE, fieldSchema.getType());
column.setAttribute(ATTRIBUTE_COL_POSITION, columnPosition++);
column.setAttribute(ATTRIBUTE_COMMENT, fieldSchema.getComment());
context.putEntity(colQualifiedName, column);
}
ret.add(column);
}
return ret;
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
builder.put("owner", tbl.getOwner());
builder.put("location", tblLoc);
builder.put("inputFormat", inputFormattCls);
代码示例来源:origin: org.apache.lens/lens-cube
public static XNativeTable nativeTableFromMetaTable(Table table) {
XNativeTable xtable = XCF.createXNativeTable();
xtable.setColumns(new XColumns());
xtable.setName(table.getTableName());
xtable.setDbname(table.getDbName());
xtable.setOwner(table.getOwner());
xtable.setCreatetime(table.getTTable().getCreateTime());
xtable.setLastAccessTime(table.getTTable().getLastAccessTime());
xtable.getColumns().getColumn().addAll(columnsFromFieldSchemaList(table.getCols()));
xtable.setStorageDescriptor(getStorageTableDescFromHiveTable(table));
xtable.setTableType(table.getTableType().name());
return xtable;
}
代码示例来源:origin: apache/lens
public static XNativeTable nativeTableFromMetaTable(Table table) {
XNativeTable xtable = XCF.createXNativeTable();
xtable.setColumns(new XColumns());
xtable.setName(table.getTableName());
xtable.setDbname(table.getDbName());
xtable.setOwner(table.getOwner());
xtable.setCreatetime(table.getTTable().getCreateTime());
xtable.setLastAccessTime(table.getTTable().getLastAccessTime());
xtable.getColumns().getColumn().addAll(columnsFromFieldSchemaList(table.getCols()));
xtable.setStorageDescriptor(getStorageTableDescFromHiveTable(table));
xtable.setTableType(table.getTableType().name());
return xtable;
}
代码示例来源:origin: apache/incubator-atlas
tableReference.set(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, tableQualifiedName);
tableReference.set(AtlasClient.NAME, hiveTable.getTableName().toLowerCase());
tableReference.set(AtlasClient.OWNER, hiveTable.getOwner());
代码示例来源:origin: apache/atlas
ret.setAttribute(ATTRIBUTE_QUALIFIED_NAME, tblQualifiedName);
ret.setAttribute(ATTRIBUTE_NAME, table.getTableName().toLowerCase());
ret.setAttribute(ATTRIBUTE_OWNER, table.getOwner());
ret.setAttribute(ATTRIBUTE_CREATE_TIME, createTime);
ret.setAttribute(ATTRIBUTE_LAST_ACCESS_TIME, lastAccessTime);
内容来源于网络,如有侵权,请联系作者删除!