use of com.airbnb.airpal.presto.hive.HivePartition.HivePartitionItem in project airpal by airbnb.
the class TablesResource method getPartitionsWithMetaData.
private List<HivePartitionItem> getPartitionsWithMetaData(PartitionedTable table) throws ExecutionException {
List<HivePartition> partitions = columnCache.getPartitions(table.getSchema(), table.getTable());
ImmutableList.Builder<HivePartitionItem> partitionItems = ImmutableList.builder();
for (HivePartition partition : partitions) {
for (Object value : partition.getValues()) {
PartitionedTable partitionedTable = table.withPartitionName(HivePartition.getPartitionId(partition.getName(), value));
DateTime updatedAt = null;
partitionItems.add(new HivePartitionItem(partition.getName(), partition.getType(), value, updatedAt));
}
}
return partitionItems.build();
}
Aggregations