(feature): Improve error messages in SnapshotManager.getLogSegmentFor… #5329
+32
−9
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.
…Version
Which Delta project/connector is this regarding?
Description
Resolves #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."