Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TableMetadataBuilder::assign_current_snapshot_id #713

Closed

Conversation

SergeiPatiakin
Copy link
Contributor

TableMetadataBuilder::from_table_creation initializes current_snapshot_id to None. This PR adds a builder method that allows different values.

@c-thiel
Copy link
Collaborator

c-thiel commented Nov 22, 2024

Thanks @SergeiPatiakin for your PR!

Assigning the current snapshot id is a bit more complex than what you have in your PR.
Here is the extract from the spec: https://iceberg.apache.org/spec/#table-metadata-fields
current-snapshot-id: ID of the current table snapshot; must be the same as the current ID of the main branch in refs.

The logic you are looking for is already implemented in #587 which is currently under review. I am optimistic that we can include it in the next release.

Could you check if #587 serves your usecase? Check the set_ref method:
https://github.com/apache/iceberg-rust/pull/587/files#diff-464f76c3b76da41490c8fac47aa4aef4287fffdd0ca0766ae431c4829d59aa30R462

If so, would it be OK to close this PR?

@SergeiPatiakin
Copy link
Contributor Author

Thanks! You are right, I think I'll be able to use TableMetadataBuilder::set_ref from #587 . Closing this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants