shangxinli commented on code in PR #14199:
URL: https://github.com/apache/iceberg/pull/14199#discussion_r2425077282


##########
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:
   You are right. Fix it. The new change will 1) Merge requested schema fields 
with missing IDs (excluding metadata columns), 2) Convert field IDs to full 
column names to preserve nested field paths, 3) Use Schema.select() to create a 
projection that preserves the full nested structure from the table schema. 
Finally the metadata schema will append (no change). 



-- 
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]

Reply via email to