openinx commented on a change in pull request #3271: URL: https://github.com/apache/iceberg/pull/3271#discussion_r740029408
########## File path: flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java ########## @@ -684,12 +713,139 @@ public void alterPartitionColumnStatistics(ObjectPath tablePath, CatalogPartitio @Override public List<CatalogPartitionSpec> listPartitions(ObjectPath tablePath, CatalogPartitionSpec partitionSpec) + throws TableNotExistException, TableNotPartitionedException, CatalogException, PartitionSpecInvalidException { + Preconditions.checkNotNull(tablePath, "Table path cannot be null"); + Preconditions.checkNotNull(partitionSpec, "CatalogPartitionSpec cannot be null"); + + Table table = loadIcebergTable(tablePath); + ensurePartitionedTable(tablePath, table); + Optional<PartitionSpec> matchingPartitionSpec = getMatchingPartitionSpec(partitionSpec, table.specs()); + if (!matchingPartitionSpec.isPresent()) { + throw new PartitionSpecInvalidException(getName(), + table.specs().values().stream() + .map(spec -> spec.fields().stream() + .map(PartitionField::name) + .collect(Collectors.joining(",", "{", "}"))) Review comment: Q: Should we wrap the partition key name with an extra `{` and `}` for the argument `List<String> partitionKeys` in the `PartitionSpecInvalidException` constructor. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org