viirya opened a new pull request, #3665:
URL: https://github.com/apache/iceberg-rust/pull/3665

   ## Which issue does this PR close?
   
   - Closes #3664.
   
   ## What changes are included in this PR?
   
   When `UpdateSchemaAction` adds columns on a table that has 
`schema.name-mapping.default`, the commit now also carries a `SetProperties` 
update with the updated mapping, matching Java's 
`SchemaUpdate.applyChangesToMetadata` / `MappingUtil.update`:
   
   - each added column gets an entry, with entries for its nested fields 
(`element`, `key`, `value` for lists and maps), appended under its parent's 
entry;
   - an existing entry in the same struct loses a name that an added column 
takes, so a column dropped and re-added under the same name maps to the new id;
   - deleted columns keep their entries;
   - no property means no change, and a mapping that fails to parse is logged 
and left as is, without failing the schema update.
   
   `UpdateSchemaAction` has no rename yet, so there is no alias handling here. 
When there are no additions, no property update is emitted (Java rewrites the 
property unchanged).
   
   ## Are these changes tested?
   
   Yes, unit tests in `update_schema.rs`: adding a root column; adding to a 
struct, a map value struct, and root map and list-of-struct columns; drop and 
re-add of the same name; delete only (no property update); and an unparsable 
mapping.
   
   ## AI Disclosure
   
   Written with an AI assistant (Claude). Please check:
   - The property update has no requirement of its own and relies on 
`CurrentSchemaIdMatch`, so a concurrent commit that changes only the mapping 
would be overwritten. Java's `UpdateRequirements` sends the same requirements 
to a REST catalog for this commit.
   - Logging and continuing on an unparsable mapping (instead of failing) 
follows Java; confirm that's wanted.
   
   This pull request and its description were written by Isaac.
   


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