fix(proto): preserve empty projection when ser/de MemoryScanExec - #24084
Closed
Dandandan wants to merge 1 commit into
Closed
fix(proto): preserve empty projection when ser/de MemoryScanExec#24084Dandandan wants to merge 1 commit into
Dandandan wants to merge 1 commit into
Conversation
`MemorySourceConfig`'s projection is encoded as a bare `repeated uint32`, so `Some(vec![])` — project away every column — serializes exactly like `None` and decodes back as `None`. The decoded scan then reports every column again, which silently changes the plan's output schema and breaks parents that compare schemas, e.g. a sibling `UnionExec` branch failing with "UnionExec/InterleaveExec requires all inputs to have the same number of fields". Encode an empty projection with the same `[u32::MAX]` sentinel `HashJoinExec` and `NestedLoopJoinExec` already use (apache#23082); `FilterExec` was fixed separately in apache#21885. This was the last physical plan node with an ambiguous projection.
Dandandan
added a commit
to coralogix/arrow-datafusion
that referenced
this pull request
Aug 4, 2026
Follow-up to the two cherry-picks: `MemorySourceConfig`'s projection has the same problem the joins and `FilterExec` had. `Some(vec![])` — project away every column — serializes exactly like `None` and decodes back as `None`, restoring every column and silently changing the plan's output schema. Use the same `[u32::MAX]` sentinel the joins use. Still unfixed upstream; sent as apache#24084. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #24084 +/- ##
==========================================
- Coverage 80.89% 80.89% -0.01%
==========================================
Files 1102 1102
Lines 376111 376107 -4
Branches 376111 376107 -4
==========================================
- Hits 304251 304246 -5
+ Misses 53753 53750 -3
- Partials 18107 18111 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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?
Finishes the work started in #23082 (
HashJoinExec,NestedLoopJoinExec) and #21885 (FilterExec) —MemoryScanExecwas the last physical plan node left with an ambiguous projection.Rationale for this change
MemorySourceConfig's projection isOption<Vec<usize>>but is encoded as a barerepeated uint32:So
Some(vec![])— project away every column — serializes exactly likeNoneand always decodes back asNone, and the decoded scan reports every column again.What changes are included in this PR?
Encode an empty projection with the single-element
[u32::MAX]sentinel — the same conventionHashJoinExecandNestedLoopJoinExecalready use — and decode it back toSome(vec![]). Every other state is unchanged on the wire, soNoneand non-empty projections round-trip exactly as before.Are these changes tested?
Yes
Are there any user-facing changes?
No API change. The wire format changes only for the previously-unrepresentable
Some(vec![])case, matching what the joins already do.