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

   ## Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and 
enhancements and this helps us generate change logs for our releases. You can 
link an issue to this PR using the GitHub syntax. For example `Closes #123` 
indicates that this PR will close issue #123.
   -->
   
   - Working towards https://github.com/apache/iceberg-rust/issues/3056
   
   ## What changes are included in this PR?
   
   Adds a `assign_fresh_ids` schema utility, modeled on Java’s 
[`[AssignFreshIds](https://github.com/apache/iceberg/blob/main/api/src/main/java/org/apache/iceberg/types/AssignFreshIds.java)`](https://github.com/apache/iceberg/blob/main/api/src/main/java/org/apache/iceberg/types/AssignFreshIds.java)
 and 
[`[TypeUtil.assignFreshIds](https://github.com/apache/iceberg/blob/main/api/src/main/java/org/apache/iceberg/types/TypeUtil.java#L332-L346)`](https://github.com/apache/iceberg/blob/main/api/src/main/java/org/apache/iceberg/types/TypeUtil.java#L332-L346).
   
   Fields present in the base schema keep their IDs by full field name, 
including nested fields. New fields receive increasing IDs from the supplied 
starting point, using the same struct, list, and map assignment order as Java. 
The reassigned schema retains its structure, defaults, identifier fields, 
aliases, and schema ID.
   
   <!--
   Provide a summary of the modifications in this PR. List the main changes 
such as new features, bug fixes, refactoring, or any other updates.
   -->
   
   ## Are these changes tested?
   
   Yes. The unit tests port Java’s 
[`[testAssignFreshIds](https://github.com/apache/iceberg/blob/main/api/src/test/java/org/apache/iceberg/types/TestTypeUtil.java#L712-L744)`](https://github.com/apache/iceberg/blob/main/api/src/test/java/org/apache/iceberg/types/TestTypeUtil.java#L712-L744)
 and 
[`[testAssignFreshIdsWithType](https://github.com/apache/iceberg/blob/main/api/src/test/java/org/apache/iceberg/types/TestTypeUtil.java#L808-L817)`](https://github.com/apache/iceberg/blob/main/api/src/test/java/org/apache/iceberg/types/TestTypeUtil.java#L808-L817)
 for the equivalent types currently supported by iceberg-rust. Additional tests 
cover full-name reuse, schema metadata, and Java-compatible nested struct, 
list, and map ID ordering.
   
   <!--
   Specify what test covers (unit test, integration test, etc.).
   
   If tests are not included in your PR, please explain why (for example, are 
they covered by existing tests)?
   -->
   
   ## AI Disclosure
   
   Used to review and write tests
   
   <!--
   
https://iceberg.apache.org/contribute/#guidelines-for-ai-assisted-contributions
   -->


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