osipovartem opened a new pull request, #26156:
URL: https://github.com/apache/datafusion/pull/26156

   ## 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 through `to_field()`. Since `metadata()` itself calls 
`to_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 --check`
   - `cargo clippy --all-targets --all-features -- -D warnings`
   - `cargo test -p datafusion-expr --lib` (282 passed)
   - Full documented extended workspace command with initialized test-data 
submodules and Arrow/Parquet fixtures (passed)
   - Independent read-only review: approved with no blocking findings.
   
   ## Are there any user-facing changes?
   
   No schema or API behavior change; this reduces planning cost.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to