Repository navigation
perf: resolve aliased field once during metadata inference - #26156
Open
osipovartem wants to merge 1 commit into
Open
osipovartem wants to merge 1 commit into
osipovartem wants to merge 1 commit into
Conversation
This was referenced Oct 9, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26156 +/- ##
==========================================
- Coverage 82.77% 82.77% -0.01%
==========================================
Files 1147 1147
Lines 450909 450940 +31
Branches 450909 450940 +31
==========================================
+ Hits 373252 373267 +15
- Misses 54934 54946 +12
- Partials 22723 22727 +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?
Related to #24264. This isolates the alias single-resolution optimization from the broader, closed #24316.
Rationale for this change
Deriving a field for nested aliases resolves each child twice: once through
metadata()and once throughto_field(). Sincemetadata()itself callsto_field(), the work grows exponentially with alias depth. This affects schema inference and planning; no row execution path changes.What changes are included in this PR?
Resolve the aliased child field once and read its metadata from that same field before applying explicit alias metadata. A 12-level regression test records 4,096 source-field lookups before the change and one after it, while checking metadata override, preserved metadata, output name, type, and nullability.
What is the testing strategy for this PR?
cargo fmt --all --checkcargo clippy --all-targets --all-features -- -D warningscargo test -p datafusion-expr --lib(282 passed)Are there any user-facing changes?
No schema or API behavior change; this reduces planning cost.