[kernel] Improve error messages in SnapshotManager.getLogSegmentFor…
…Version
Which Delta project/connector is this regarding?
- [ ] Spark
- [ ] Standalone
- [ ] Flink
- [x] Kernel
- [ ] Other (fill in here)
Description
Resolves https://github.com/delta-io/delta/issues/2283
How was this patch tested?
Unit tests in SnapshotManagerSuite.scala.
[info] Run completed in 1 minute, 46 seconds. [info] Total number of tests run: 37 [info] Suites: completed 1, aborted 0 [info] Tests: succeeded 37, failed 0, canceled 0, ignored 0, pending 0 [info] All tests passed.
Does this PR introduce any user-facing changes?
Yes, the PR provides better error logging for users in the SnapshotManager.getLogSegmentforVersion method.
Error name: Missing Delta File at Checkpoint Version (Line 422): Before: "Missing delta file for version %s" After: "Missing delta file for version %d. Every checkpoint must have a corresponding delta file at the same version."
Error name: Missing Delta File Version (Lines 452-456): Before: "Cannot compute snapshot. Missing delta file version %d." After: "Cannot compute snapshot. Missing delta file version %d. Expected delta files to start from version %d after checkpoint version %d, but found delta file at version %d."
Corrupted Checkpoint Files (Lines 490-500): Before: "Seems like the checkpoint is corrupted. Failed in getting the file information for:\n%s\namong\n%s" After: "Checkpoint at version %d appears to be corrupted. Expected to find %d checkpoint files but only found %d. Missing files:\n%s\nAvailable checkpoint files:\n%s"
Non-Contiguous Delta Versions (Lines 154-155): Before: "Missing delta files: versions are not contiguous: (%s)" After: "Missing delta files: versions are not contiguous. Expected version %d after version %d, but found version %d. All versions: %s"
No Complete Checkpoint and No Delta Files (Line 410): Before: "No complete checkpoint found and no delta files found" After: "No complete checkpoint found and no delta files found. This may indicate a corrupted or incomplete Delta table."
@allisonport-db can I get a review on the PR please?
Hey, can you look into why the CI tests are failing?
Hey, can you look into why the CI tests are failing?
Sure thing, sorry for the delay. Will look into it.
Hey, can you look into why the CI tests are failing?
Sure thing, sorry for the delay. Will look into it.
@allisonport-db, I believe the CI tests are looking good now. Can you please review? Thanks again.
@allisonport-db, just following up on the PR to see if you needed anything else from me.
@harishkesavarao can you fix the failing tests?
@allisonport-db thank you for letting me know about the tests and for approving the PR. The tests hadn't reflected the recent code revert I did. The tests are passing now. Thanks again!
@allisonport-db just wanted to check in again to see if the PR looks good to merge. Thank you!