Expression function = functionCall("max", value);
selectList.add(new SingleColumn(function, column.getName()));
wrappedList.add(unaliasedName(column.getName()));
}
Query query = new Query(
Optional.<With>absent(),
new QuerySpecification(
selectAll(selectList.build()),
table(QualifiedName.of(table.getCatalogName(), TABLE_INTERNAL_PARTITIONS.getSchemaName(), TABLE_INTERNAL_PARTITIONS.getTableName())),
Optional.of(logicalAnd(
equal(nameReference("table_schema"), new StringLiteral(table.getSchemaName())),
equal(nameReference("table_name"), new StringLiteral(table.getTableName())))),
ImmutableList.of(nameReference("partition_number")),
Optional.<Expression>absent(),
ImmutableList.<SortItem>of(),
Optional.<String>absent()),
ImmutableList.<SortItem>of(),
Optional.<String>absent());
query = new Query(
Optional.<With>absent(),
new QuerySpecification(
selectAll(wrappedList.build()),
subquery(query),
showPartitions.getWhere(),