asubiotto opened a new issue, #27557:
URL: https://github.com/apache/datafusion/issues/27557

   ### Is your feature request related to a problem or challenge?
   
   Planning builds an unbounded range for every column an expression refers to, 
through `Interval::make_unbounded` → `ScalarValue::try_new_null`. For a struct, 
this allocates a null child array for every field. Optimizer passes rebuild 
projections and filters many times, so the work repeats. In our workload, a 
query over three structs of about 5,000 fields each spends hundreds of 
milliseconds in physical planning on this.
   
   #26879 reuses a column's range within one projection, but not across 
rebuilds.
   
   ### Describe the solution you'd like
   
   A null struct row never reads its children, so children of equal type can 
share one null array. The result is equal to what `new_null_array` builds, but 
takes a few allocations instead of one per field.
   
   ### Describe alternatives you've considered
   
   - Caching null values across calls: this adds state and keeps the arrays 
alive.
   - Using untyped (`DataType::Null`) ranges for structs: this changes what 
expression hooks see (see #25967).
   
   ### Additional context
   
   Related: #26065 (slow comparison of null struct scalars).
   
   AI disclosure: written with the help of Claude Code and reviewed by me.
   
   ### Willingness to contribute
   
   I plan to contribute to this feature independently
   


-- 
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