RussellSpitzer commented on code in PR #9731:
URL: https://github.com/apache/iceberg/pull/9731#discussion_r1799748341
##########
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:
Why should the spec ID and not the spec?
I think this should probably be something like
```
"Cannot set manifest clustering because specified field(s) %s were not
found in current partition spec %s.",
missingFields,
this.spec
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]