fix(spec): clean up -1 snapshot ID sentinel usage and add deserialization test#2294
Merged
blackmwk merged 1 commit intoapache:mainfrom Mar 31, 2026
Merged
Conversation
blackmwk
reviewed
Mar 30, 2026
Contributor
blackmwk
left a comment
There was a problem hiding this comment.
Thanks @geserdugarov for this pr, there is one mistake to fix, others LGTM
| pub struct ManifestWriterBuilder { | ||
| output: OutputFile, | ||
| snapshot_id: Option<i64>, | ||
| snapshot_id: i64, |
Contributor
There was a problem hiding this comment.
This is incorrect. Manifest file's snapshot id could be empty, and in this case it's inherited.
Contributor
Author
| output: OutputFile, | ||
|
|
||
| snapshot_id: Option<i64>, | ||
| snapshot_id: i64, |
c712df4 to
172a3d0
Compare
ac4c67a to
88a1546
Compare
blackmwk
approved these changes
Mar 31, 2026
Contributor
blackmwk
left a comment
There was a problem hiding this comment.
Thanks @geserdugarov for this fix!
toutane
pushed a commit
to DataDog/iceberg-rust
that referenced
this pull request
Apr 30, 2026
…tion test (apache#2294) ## Which issue does this PR close? - Closes apache#352. ## What changes are included in this PR? - Replaces hardcoded `-1` with `EMPTY_SNAPSHOT_ID` constant in table metadata deserialization. - Adds `test_empty_snapshot_id_is_normalized_to_none` to verify that the Java-style `-1` sentinel for `current-snapshot-id` is normalized to `None` during deserialization. - Removes the public `UNASSIGNED_SNAPSHOT_ID` constant and moving it to a private constant scoped to the manifest writer module. ## Are these changes tested? Adds a test `test_empty_snapshot_id_is_normalized_to_none` verifying the deserialization normalization. (cherry picked from commit 14f2e14)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Nullinstead of-1#352.What changes are included in this PR?
-1withEMPTY_SNAPSHOT_IDconstant in table metadata deserialization.test_empty_snapshot_id_is_normalized_to_noneto verify that the Java-style-1sentinel forcurrent-snapshot-idis normalized toNoneduring deserialization.UNASSIGNED_SNAPSHOT_IDconstant and moving it to a private constant scoped to the manifest writer module.Are these changes tested?
Adds a test
test_empty_snapshot_id_is_normalized_to_noneverifying the deserialization normalization.