aokolnychyi commented on code in PR #5131:
URL: https://github.com/apache/iceberg/pull/5131#discussion_r907774867
##########
core/src/main/java/org/apache/iceberg/util/SortOrderUtil.java:
##########
@@ -74,6 +101,28 @@ public static SortOrder buildSortOrder(Schema schema,
PartitionSpec spec, SortOr
return builder.build();
}
+ private static Map<Pair<Transform<?, ?>, Integer>, PartitionField>
requiredClusteringFields(PartitionSpec spec) {
+ Map<Pair<Transform<?, ?>, Integer>, PartitionField>
requiredClusteringFields = Maps.newLinkedHashMap();
+ for (PartitionField partField : spec.fields()) {
+ if (!partField.transform().toString().equals("void")) {
Review Comment:
What's our preferred way to check if its a void transform? Here is what we
have in `Partitioning`:
```
field.transform().equals(Transforms.alwaysNull())
```
##########
core/src/main/java/org/apache/iceberg/util/SortOrderUtil.java:
##########
@@ -74,6 +101,28 @@ public static SortOrder buildSortOrder(Schema schema,
PartitionSpec spec, SortOr
return builder.build();
}
+ private static Map<Pair<Transform<?, ?>, Integer>, PartitionField>
requiredClusteringFields(PartitionSpec spec) {
+ Map<Pair<Transform<?, ?>, Integer>, PartitionField>
requiredClusteringFields = Maps.newLinkedHashMap();
+ for (PartitionField partField : spec.fields()) {
+ if (!partField.transform().toString().equals("void")) {
+ requiredClusteringFields.put(Pair.of(partField.transform(),
partField.sourceId()), partField);
+ }
+ }
+
+ // remove any partition fields that are satisfied by another partition
field, like days(ts) and hours(ts)
+ for (PartitionField partField : spec.fields()) {
+ for (PartitionField field : spec.fields()) {
Review Comment:
nit: `field/otherField` or `partField/otherPartField` instead of
`partField/field`?
--
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]