You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Propagate orderings through struct-producing projections #21217
Is your feature request related to a problem or challenge?
When a projection wraps columns into a struct via named_struct (e.g., named_struct('ticker', ticker, ...) AS details), the optimizer loses track of the input column's ordering because ProjectionMapping maps the entire named_struct(...) expression to col("details").
Notably, there is no field-level decomposition, so it can't prove that get_field(details, "ticker") actually preserves the ordering of the input ticker column. This means ORDER BY details['ticker'] will require a SortExec, even when the input is already sorted by ticker.
Describe the solution you'd like
Add ScalarUDFImpl::struct_field_mapping that struct-producing UDFs can implement to declare their field-to-input-arg relationships, which ProjectionMapping then uses to add field-level entries so EquivalenceProperties can propagate orderings through the struct boundary.
Activity
rkrishn7 commentedon Mar 28, 2026
take
feat: Propagate orderings through struct-producing projections (#21218)
feat: Propagate orderings through struct-producing projections (apach…
feat: Propagate orderings through struct-producing projections (apach…