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.
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
Fixing snapshot creation for earlier versions than the latest checkpoint #322
Fixing snapshot creation for earlier versions than the latest checkpoint #322
Changes from 1 commit
016dfc2
5270ea7
4f6b1d6
1a8f8fe
576a136
45bd64e
8d2754c
8cb6544
f0ae2b9
c67af78
83459ea
dda9911
96765ba
c820895
a940266
2af625e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside: @nicklan -- This file is getting pretty large. I wonder what the rust best practice is for where unit tests should live?
My experience from non-rust projects is that bulky unit tests should generally live in separate (test-only) source files -- especially tests that only use public interfaces. In-file testing would make more sense for exercising private/internal code that isn't accessible outside the source file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why commented out, out of curiosity? Is the byte count wrong and needs to be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting a
None
result forcheckpoint_meta.size_in_bytes
; hence, the test is failing. I commented the code so that I first focus on the snapshot versioning bug! I'm looking into this one, too, now.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The root cause of the issue is a mismatch between the casing conventions used in the JSON data and the struct definition. The struct is expecting camelCase (e.g.,
sizeInBytes
) due to the#[serde(rename_all = "camelCase")]
attribute, but the actual JSON data is using snake_case (size_in_bytes
).Your short-term fix of adding an alias is a good temporary solution:
However, for a long-term solution, we need to address the inconsistency between the Delta protocol specification and the implementation in delta-rs (I built my test data from
delta-rs,
assuming that the other test data was also created using the same, including the last_checkpoint file).According to the Delta protocol documentation, the last checkpoint file schema should indeed use camelCase for field names. The fact that delta-rs is writing the metadata in snake_case suggests a deviation from the protocol specification.
The long-term solution should involve:
CheckpointMetadata
struct to expect camelCase without needing aliases.It would be worth investigating why delta-rs is writing the metadata in snake_case contrary to the protocol specification.
What are your thoughts @scovich ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a new issue to move this conversation #326 . Would love to know your thoughts on the issue link.