amogh-jahagirdar commented on code in PR #15514:
URL: https://github.com/apache/iceberg/pull/15514#discussion_r2897542978
##########
data/src/main/java/org/apache/iceberg/data/DeleteFilter.java:
##########
@@ -210,7 +211,12 @@ private List<Predicate<T>> applyEqDeletes() {
Set<Integer> ids = entry.getKey();
Iterable<DeleteFile> deletes = entry.getValue();
- Schema deleteSchema = TypeUtil.select(requiredSchema, ids);
+ // Canonicalize the delete schema by sorting fields by ID so that the
same set of equality
+ // field IDs always produces the same schema, regardless of
requiredSchema column ordering.
+ Schema selectedSchema = TypeUtil.select(requiredSchema, ids);
+ List<Types.NestedField> sortedFields =
Lists.newArrayList(selectedSchema.columns());
+ sortedFields.sort(Comparator.comparingInt(Types.NestedField::fieldId));
+ Schema deleteSchema = new Schema(sortedFields);
Review Comment:
+1 I think I'd just expect a `selectInIDOrder` API to abstract this?
--
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]