-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Spark][Version Checksum] Read Protocol, Metadata, and ICT directly from the Checksum during Snapshot construction #3920
Conversation
e868303
to
3d69df7
Compare
2551290
to
af9c14c
Compare
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.
Couple nits, but code itself LGTM
if (spark.sessionState.conf.getConf( | ||
DeltaSQLConf.USE_PROTOCOL_AND_METADATA_FROM_CHECKSUM_ENABLED)) { |
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.
Is it useful/important to make this check conditional, where it was previously unconditional?
What is the rationale?
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 thought about this again, and this does not make much sense. Removed
log"protocol:${MDC(DeltaLogKeys.PROTOCOL, protocolStr)} " + | ||
log"metadata:${MDC(DeltaLogKeys.DELTA_METADATA, metadataStr)}") |
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 is the one called PROTOCOL
but the other DELTA_METADATA
? Why not just METADATA
?
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.
update: There are already several METADATA_xxx
keys, I guess this avoids ambiguity?
// Make sure that we don't retrieve the time from the CRC. | ||
withSQLConf(DeltaSQLConf.DELTA_WRITE_CHECKSUM_ENABLED.key -> "false") { | ||
withTempDir { tempDir => |
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.
odd (lack of) indentation here?
(several more below)
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.
Fixed the indentation. I wanted to keep the diff cleaner but given that the content itself has been reviewed, that should not matter anymore
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.
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.
8336241
to
445d4e7
Compare
445d4e7
to
b7f4845
Compare
Which Delta project/connector is this regarding?
Description
Stacked over #3907.
This PR makes the Checksum (if available) the source of truth for Protocol, Metadata, ICT during snapshot construction. This helps us avoid a Spark query and improves performance.
How was this patch tested?
Added some test cases to existing suites
Does this PR introduce any user-facing changes?
No