huaxingao commented on code in PR #14199:
URL: https://github.com/apache/iceberg/pull/14199#discussion_r2409119315
##########
data/src/main/java/org/apache/iceberg/data/DeleteFilter.java:
##########
@@ -291,16 +291,15 @@ private static Schema fileProjection(
return requestedSchema;
}
- // TODO: support adding nested columns. this will currently fail when
finding nested columns to
- // add
+ // Add missing columns required for delete operations, including nested
columns
List<Types.NestedField> columns =
Lists.newArrayList(requestedSchema.columns());
for (int fieldId : missingIds) {
if (fieldId == MetadataColumns.ROW_POSITION.fieldId()
|| fieldId == MetadataColumns.IS_DELETED.fieldId()) {
continue; // add _pos and _deleted at the end
}
- Types.NestedField field = tableSchema.asStruct().field(fieldId);
+ Types.NestedField field = getFieldFromTableSchema(tableSchema, fieldId);
Review Comment:
It looks incorrect to me to append a nested field directly to the top-level
schema. For missing nested IDs, I think we need to preserve their full path,
not promote the leaf to top level.
--
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]