Commit 14f2e14
authored
fix(spec): clean up -1 snapshot ID sentinel usage and add deserialization test (#2294)
## Which issue does this PR close?
- Closes #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.1 parent 6ee5e71 commit 14f2e14
4 files changed
Lines changed: 26 additions & 9 deletions
File tree
- crates/iceberg/src/spec
- manifest
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
765 | 768 | | |
766 | 769 | | |
767 | 770 | | |
768 | | - | |
769 | | - | |
| 771 | + | |
| 772 | + | |
770 | 773 | | |
771 | 774 | | |
772 | 775 | | |
| |||
950 | 953 | | |
951 | 954 | | |
952 | 955 | | |
953 | | - | |
| 956 | + | |
954 | 957 | | |
955 | 958 | | |
956 | 959 | | |
| |||
1063 | 1066 | | |
1064 | 1067 | | |
1065 | 1068 | | |
1066 | | - | |
| 1069 | + | |
1067 | 1070 | | |
1068 | 1071 | | |
1069 | 1072 | | |
| |||
1170 | 1173 | | |
1171 | 1174 | | |
1172 | 1175 | | |
1173 | | - | |
| 1176 | + | |
1174 | 1177 | | |
1175 | 1178 | | |
1176 | 1179 | | |
| |||
3300 | 3303 | | |
3301 | 3304 | | |
3302 | 3305 | | |
| 3306 | + | |
| 3307 | + | |
| 3308 | + | |
| 3309 | + | |
| 3310 | + | |
| 3311 | + | |
| 3312 | + | |
| 3313 | + | |
| 3314 | + | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
3303 | 3318 | | |
3304 | 3319 | | |
3305 | 3320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
573 | | - | |
| 573 | + | |
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
| |||
0 commit comments