use of io.prestosql.plugin.hive.HivePartitionKey in project boostkit-bigdata by kunpengcompute.
the class PageSourceUtil method buildColumn.
private static Column buildColumn(HiveColumnHandle columnHandle, TypeManager typeManager, List<HivePartitionKey> partitionKeys, OptionalInt bucketNumber, Path path) {
Type columnType = typeManager.getType(columnHandle.getTypeSignature());
if (!columnHandle.getColumnType().equals(PARTITION_KEY)) {
return new Column(columnHandle.getHiveColumnIndex(), columnHandle.getColumnName(), columnType);
}
Map<String, HivePartitionKey> partitionKeysMap = uniqueIndex(partitionKeys, HivePartitionKey::getName);
String prefilledValue = HiveUtil.getPrefilledColumnValue(columnHandle, partitionKeysMap.get(columnHandle.getName()), path, bucketNumber);
Object columnValue = HiveUtil.typedPartitionKey(prefilledValue, columnType, prefilledValue);
return new Column(columnHandle.getHiveColumnIndex(), columnHandle.getColumnName(), columnType, true, columnValue);
}
Aggregations