/** * Converts from s3 table info to storage info. * @param table table info * @return table info */ StorageInfo toStorageInfo(final Table table) { StorageInfo result = null; final Location location = table.getLocation(); if (location != null) { final Map<String, String> infoParameters = Maps.newHashMap(); result = new StorageInfo(); result.setUri(location.getUri()); final Info info = location.getInfo(); if (info != null) { result.setOwner(info.getOwner()); result.setInputFormat(info.getInputFormat()); result.setOutputFormat(info.getOutputFormat()); result.setSerializationLib(info.getSerializationLib()); if (info.getParameters() != null) { infoParameters.putAll(info.getParameters()); } } result.setSerdeInfoParameters(infoParameters); result.setParameters(Maps.newHashMap()); } return result; }
final String serializationLib = rs.getString("slib"); final StorageInfo storageInfo = new StorageInfo(); storageInfo.setUri(uri); storageInfo.setInputFormat(inputFormat); storageInfo.setOutputFormat(outputFormat);
final String serializationLib = rs.getString("slib"); final StorageInfo storageInfo = new StorageInfo(); storageInfo.setUri(uri); storageInfo.setInputFormat(inputFormat); storageInfo.setOutputFormat(outputFormat);
partitionInfo.getSerde().setUri(location); if (doFileSystemCalls) { registry.counter(registry.createId(HiveMetrics.CounterHivePartitionFileSystemCall.getMetricName())
partitionInfo.getSerde().setUri(location); if (doFileSystemCalls) { registry.counter(registry.createId(HiveMetrics.CounterHivePartitionFileSystemCall.getMetricName())
partitionInfo.getSerde().setUri(existingPartitionUri);
partitionInfo.getSerde().setUri(existingPartitionUri);
@Override public PartitionInfo toPartitionInfo(final TableInfo tableInfo, final Partition partition) { final QualifiedName tableName = tableInfo.getName(); final StorageInfo storageInfo = tableInfo.getSerde(); storageInfo.setUri(partition.getUri()); final AuditInfo auditInfo = AuditInfo.builder().createdDate(partition.getCreatedDate()) .lastModifiedDate(partition.getLastUpdatedDate()) .build(); final AuditInfo tableAuditInfo = tableInfo.getAudit(); if (tableAuditInfo != null) { auditInfo.setCreatedBy(tableAuditInfo.getCreatedBy()); auditInfo.setLastModifiedBy(tableAuditInfo.getLastModifiedBy()); } return PartitionInfo.builder() .name(QualifiedName.ofPartition(tableName.getCatalogName(), tableName.getDatabaseName(), tableName.getTableName(), partition.getName())) .serde(storageInfo) .auditInfo(auditInfo) .build(); }
/** * Returns a partition info. * @param tableName table name * @param table s3 table * @param partition partition * @return partition info */ PartitionInfo toPartitionInfo(final QualifiedName tableName, final Table table, final Partition partition) { final StorageInfo storageInfo = toStorageInfo(table); storageInfo.setUri(partition.getUri()); final AuditInfo auditInfo = AuditInfo.builder().createdDate(partition.getCreatedDate()) .lastModifiedDate(partition.getLastUpdatedDate()) .build(); final AuditInfo tableAuditInfo = toAuditInfo(table); if (tableAuditInfo != null) { auditInfo.setCreatedBy(tableAuditInfo.getCreatedBy()); auditInfo.setLastModifiedBy(tableAuditInfo.getLastModifiedBy()); } return PartitionInfo.builder() .name(QualifiedName.ofPartition(tableName.getCatalogName(), tableName.getDatabaseName(), tableName.getTableName(), partition.getName())) .serde(storageInfo) .auditInfo(auditInfo) .build(); }