/** * @return the owner of the corresponding hive table */ public Optional<String> getOwner() { return Optional.fromNullable(this.hivePartition.getTable().getOwner()); } }
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); } }
String owner = tbl.getOwner(); List<FieldSchema> cols = tbl.getCols(); String ddlCols = MetaStoreUtils.getDDLFromFieldSchema("columns", cols);
builder.put("owner", tbl.getOwner()); builder.put("location", tblLoc); builder.put("inputFormat", inputFormattCls);
String owner = tbl.getOwner(); List<FieldSchema> cols = tbl.getCols(); String ddlCols = MetaStoreUtils.getDDLFromFieldSchema("columns", cols);
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); } }
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); } }
builder.put("owner", tbl.getOwner()); builder.put("location", tblLoc); builder.put("inputFormat", inputFormattCls);
public static String getTableOwner(Table table) { return table.getTTable() != null ? (table.getOwner()): ""; }
String owner = tbl.getOwner(); List<FieldSchema> cols = tbl.getCols(); String ddlCols = MetaStoreUtils.getDDLFromFieldSchema("columns", cols);
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()));
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); } }
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); } }
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; }
builder.put("owner", tbl.getOwner()); builder.put("location", tblLoc); builder.put("inputFormat", inputFormattCls);
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; }
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; }
tableReference.set(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, tableQualifiedName); tableReference.set(AtlasClient.NAME, hiveTable.getTableName().toLowerCase()); tableReference.set(AtlasClient.OWNER, hiveTable.getOwner());
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);