Repository navigation
Core,API: Set 503: added_snapshot_id as required - #11626
Merged
Merged
Conversation
Fokko
force-pushed
the
fd-make-503-required
branch
from
November 22, 2024 10:17
c771cbe to
bea92b6
Compare
`503: added_snapshot_id` field should be written as a required field, but currently it is written as optional. As the reference implementation should produce metadata that is as close to the spec as possible. For reading, this isn't a problem with the current Java implementation as it will still read optional fields as required, but only thrown an error when it encounters a `null` value.
Fokko
force-pushed
the
fd-make-503-required
branch
from
November 22, 2024 10:19
bea92b6 to
a74e76e
Compare
Fokko
commented
Nov 22, 2024
Comment on lines
+170
to
+176
| try { | ||
| this.length = toCopy.length(); | ||
| } catch (UnsupportedOperationException e) { | ||
| // Can be removed when embedded manifests are dropped | ||
| // DummyFileIO does not support .length() | ||
| this.length = null; | ||
| } |
Contributor
Author
There was a problem hiding this comment.
See
iceberg/core/src/main/java/org/apache/iceberg/SnapshotParser.java
Lines 179 to 218 in a52afdc
rdblue
reviewed
Nov 27, 2024
| GenericManifestFile.copyOf( | ||
| new GenericManifestFile(localInput("file:/tmp/manifest1.avro"), 0)) | ||
| .withSnapshotId(snapshotId) | ||
| .build(), |
Contributor
There was a problem hiding this comment.
Minor: it looks like this is done quite a bit. What about making it easier either with a test helper or a better builder?
rdblue
approved these changes
Nov 27, 2024
rdblue
left a comment
Contributor
There was a problem hiding this comment.
Overall looks good. I'm trying to think if there was a reason why the spec requires snapshot ID but we didn't write it that way. I can't think of what might have caused this. Good catch!
Contributor
Author
|
Great suggestion @rdblue, thanks for the review! |
zachdisc
pushed a commit
to zachdisc/iceberg
that referenced
this pull request
Dec 23, 2024
* Core,API: Set `503: added_snapshot_id` as required `503: added_snapshot_id` field should be written as a required field, but currently it is written as optional. As the reference implementation should produce metadata that is as close to the spec as possible. For reading, this isn't a problem with the current Java implementation as it will still read optional fields as required, but only thrown an error when it encounters a `null` value. * Improve constructor instead
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.
503: added_snapshot_idfield should be written as a required field, but currently it is written as optional.As the reference implementation should produce metadata that is as close to the spec as possible.
For reading, this isn't a problem with the current Java implementation as it will still read optional fields as required, but only thrown an error when it encounters a
nullvalue.