Open
Conversation
comphead
reviewed
Apr 20, 2026
Comment on lines
+139
to
+144
| return Err(exec_datafusion_err!( | ||
| "Spill file schema mismatch: expected {}, got {}. \ | ||
| The caller must use the same SpillManager that created the spill file to read it.", | ||
| expected_schema, | ||
| actual_schema | ||
| )); |
Contributor
There was a problem hiding this comment.
Suggested change
| return Err(exec_datafusion_err!( | |
| "Spill file schema mismatch: expected {}, got {}. \ | |
| The caller must use the same SpillManager that created the spill file to read it.", | |
| expected_schema, | |
| actual_schema | |
| )); | |
| return exec_err!( | |
| "Spill file schema mismatch: expected {}, got {}. \ | |
| The caller must use the same SpillManager that created the spill file to read it.", | |
| expected_schema, | |
| actual_schema | |
| ); |
comphead
approved these changes
Apr 20, 2026
Contributor
comphead
left a comment
There was a problem hiding this comment.
Thanks @2010YOUY01 makes sense
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
Rationale for this change
Follow-up to a review comment in : #21713 (comment)
Not a bug fix, this PR tries to be more defensive and catch potential bugs.
Before, when you write a spill file from a
SpillManager, then read with anotherSpillManagerof different schema, it would succeed. This is not a expected use pattern, an error will get propagated to the caller, and become harder to debug.This PR validates the schema when reading the first batch, and fail fast if the schema does not match.
Note it only validates the schema, if two
SpillManagers with the same schema do read and write, it's still allowed, but this is not a expected use pattern. Validating this case requires assigningSpillManagerUID, and add that to the Arrow IPC file metadata, can be tricky, so leave this as TODO for simplicity.What changes are included in this PR?
Are these changes tested?
UTs
Are there any user-facing changes?
No