ZachDischner commented on code in PR #9731: URL: https://github.com/apache/iceberg/pull/9731#discussion_r1802300273
########## spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteManifestsSparkAction.java: ########## @@ -160,6 +172,32 @@ public RewriteManifestsSparkAction stagingLocation(String newStagingLocation) { return this; } + @Override + public RewriteManifestsSparkAction clusterBy(List<String> clusteringColumns) { + // Collect set of allowable partition columns to cluster on + Set<String> availablePartitionNames = + spec.fields().stream().map(PartitionField::name).collect(Collectors.toSet()); + + // Check if these partition fields are included in the spec + Preconditions.checkArgument( + clusteringColumns.stream().allMatch(availablePartitionNames::contains), + "Cannot use custom clustering to rewrite manifests '%s'. All partition columns must be " + + "defined in the current partition spec: %s. Choose from the available partitionable columns: %s", + clusteringColumns, + this.spec.specId(), Review Comment: Can change -- 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