amogh-jahagirdar commented on code in PR #15514:
URL: https://github.com/apache/iceberg/pull/15514#discussion_r2897641561
##########
api/src/main/java/org/apache/iceberg/types/TypeUtil.java:
##########
@@ -102,6 +103,19 @@ public static Schema select(Schema schema, Set<Integer>
fieldIds) {
return new Schema(ImmutableList.of(), schema.getAliases());
}
+ /**
+ * Selects fields from a schema by ID and returns them ordered by field ID.
+ *
+ * <p>Unlike {@link #select(Schema, Set)}, which preserves the field
ordering of the input schema,
+ * this method always returns columns sorted by field ID.
+ */
+ public static Schema selectOrdered(Schema schema, Set<Integer> fieldIds) {
Review Comment:
Minor: selectInIdOrder?
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/source/TestSparkReaderDeletes.java:
##########
@@ -738,6 +741,75 @@ public void testEqualityDeleteWithSchemaEvolution() throws
IOException {
assertThat(actual).hasSize(expectedRecordCount);
}
+ /**
+ * Covers a bug where equality deletes columns are appended to the required
schema in a different
+ * order than the table schema, which can cause different deleteSchema
orderings, poisoning the
+ * cache.
+ */
+ @TestTemplate
Review Comment:
Yeah it looks like we currently don't have a great place for testing out
just the logic within `DeleteFilter`. I think in the current structure, we'd
have to have our own implementation of `DeleteFilter` for the test and as
@RussellSpitzer said by the time we do all that it's basically just
re-implementing what we have in the engine integrations like Spark. I think I
agree with the current split of tests, but maybe the fact that we want to test
DeleteFilter in isolation means we need to do some refactoring.
--
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]