Copilot commented on code in PR #3665:
URL: https://github.com/apache/iceberg-rust/pull/3665#discussion_r4526966430


##########
crates/iceberg/src/transaction/update_schema.rs:
##########
@@ -458,11 +530,35 @@ impl StatelessAction for UpdateSchemaAction {
             .with_identifier_field_ids(base_schema.identifier_field_ids())
             .build()?;
 
-        let updates = vec![
+        let mut updates = vec![
             TableUpdate::AddSchema { schema },
             TableUpdate::SetCurrentSchema { schema_id: -1 },
         ];

Review Comment:
   Deleting `person` while adding `person.name` is accepted, but the rebuilt 
schema drops the subtree while this mapping update assigns the historical name 
to a new ID. Because that ID is absent from the committed schema, it may be 
reused by a later addition, allowing historical id-less data to resolve to an 
unrelated column. Filter additions against the rebuilt schema before updating 
the mapping, and add a regression test for additions beneath deleted ancestors.



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