qinghui-xu commented on code in PR #16280:
URL: https://github.com/apache/iceberg/pull/16280#discussion_r3375152273
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/data/TestHelpers.java:
##########
@@ -895,7 +896,13 @@ public static class CustomizedDeleteFilter extends
DeleteFilter<InternalRow> {
protected CustomizedDeleteFilter(
boolean hasDeletes, Schema tableSchema, Schema projectedSchema) {
- super("", List.of(), tableSchema::findField, projectedSchema, new
DeleteCounter(), true);
+ super(
+ "",
+ List.of(),
+ ids -> TypeUtil.project(tableSchema, ids),
Review Comment:
As you are using the "default" function, why not directly use the
constructor providing it?
##########
data/src/main/java/org/apache/iceberg/data/DeleteFilter.java:
##########
@@ -73,13 +72,19 @@ protected DeleteFilter(
Schema expectedSchema,
DeleteCounter counter,
boolean needRowPosCol) {
- this(filePath, deletes, tableSchema::findField, expectedSchema, counter,
needRowPosCol);
+ this(
+ filePath,
+ deletes,
+ ids -> TypeUtil.project(tableSchema, ids),
+ expectedSchema,
+ counter,
+ needRowPosCol);
}
protected DeleteFilter(
String filePath,
List<DeleteFile> deletes,
- Function<Integer, Types.NestedField> fieldLookup,
+ Function<Set<Integer>, Schema> missingSchemaResolver,
Review Comment:
I've some thoughts on this:
- Name is a bit confusing.
- For me this should not be an argument to the constructor, instead it's
better to have it as a method that can be overridden in a subclass.
--
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]