Repository navigation
Preserve field metadata through physical CASE expressions - #26158
Draft
osipovartem wants to merge 8 commits into
Draft
osipovartem wants to merge 8 commits into
osipovartem wants to merge 8 commits into
Conversation
osipovartem
marked this pull request as draft
October 9, 2026 14:04
(cherry picked from commit d05bc23)
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #26158 +/- ##
==========================================
- Coverage 82.77% 82.76% -0.01%
==========================================
Files 1147 1147
Lines 450909 451585 +676
Branches 450909 451585 +676
==========================================
+ Hits 373252 373776 +524
- Misses 54934 55007 +73
- Partials 22723 22802 +79 ☔ 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?
Part of #24860. The SQL logical field change is in #26145. Keep this PR draft until the logical and physical contracts can land together.
Rationale for this change
Physical
CaseExpr::return_fielddrops Arrow field metadata even when all result branches agree. This breaks metadata-aware consumers and Arrow extension types. Physical lowering can also erase logical metadata context (for example aliases, scalar variables, andNOT), so physical branch inspection alone cannot always reproduce the logical field.What changes are included in this PR?
PhysicalCaseNode. Previously encoded plans still decode without a pin.What is the testing strategy for this PR?
cargo +stable test -p datafusion-physical-expr --features proto --lib --quiet: 1,803 passed, 2 ignored on this branch.NOT, child rewrites, and protobuf encode/decode.cargo +stable fmt --all --checkand focused Clippy passed locally. The local Clippy invocation used allowances for two unrelated pre-existing lints in this toolchain.Are there any user-facing changes?
Physical CASE result fields retain agreed Arrow metadata. The protobuf schema change is additive; older readers will not retain the new optional logical-field pin. End-to-end SQL metadata requires #26145.