-
Notifications
You must be signed in to change notification settings - Fork 2k
[Kernel] Add basic support for checkpointProtection by throwing exception on checkpoint
#5917
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
base: master
Are you sure you want to change the base?
Conversation
| spark.sql(s"CREATE TABLE delta.`$tablePath` (id INT) USING delta " + | ||
| "TBLPROPERTIES ('delta.feature.checkpointProtection' = 'supported')") | ||
|
|
||
| // Add some data to create commits | ||
| for (_ <- 0 to 3) { | ||
| spark.sql(s"INSERT INTO delta.`$tablePath` VALUES (1), (2), (3)") | ||
| } |
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.
do you need to use delta-spark? Couldn't you use kernel to create the table? and look at other tests for how we append/insert data?
| val ex = intercept[Exception] { | ||
| kernelCheckpoint(tc, tablePath, checkpointVersion = 4) | ||
| } | ||
| assert(ex.getMessage.contains("checkpointProtection")) |
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.
Assert more of the error message please. this makes reading this single test even cleaner.
scottsand-db
left a comment
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.
Awesome! Nice and short and simple. Thank you! A few comments on the test -- After those are addressed, will stamp 🚀
checkpointProtectioncheckpointProtection by throwing exception on checkpoint
Thanks for the suggestions, really good points! Fixed the test, still pending the discussion about a corner case |
Which Delta project/connector is this regarding?
Description
Add basic support for
checkpointProtectiontable feature in Kernel. When a table hascheckpointProtectionenabled, Kernel throws an exception when attempting to checkpoint.How was this patch tested?
Added tests
Does this PR introduce any user-facing changes?
No