Weijun-H opened a new issue, #26878: URL: https://github.com/apache/datafusion/issues/26878
### Is your feature request related to a problem or challenge? `EquivalenceProperties::project` gets slow for a projection that reads many fields of one wide struct column, for example flattening a parsed JSON document with `get_field`. `projected_orderings` computes the properties of every projection source, including sources that do not refer to an ordered column. For each `Column` it meets, `get_expr_properties` calls `Interval::make_unbounded(&data_type)`. For a nested type, that materializes a null array of the whole type, and it does so once per source. So projecting 230 fields of a 300-field `Struct` builds the same 300-field null array about 230 times per call. A benchmark that projects 230 `get_field` expressions over a 300-field struct, plus one ordered column, takes about 10 ms per `project` call on `main` locally. ### Describe the solution you'd like Build each column's unbounded range once per `projected_orderings` call and reuse it across that call's sources. The derived orderings do not change. ### Describe alternatives you've considered Skipping the property computation for sources that refer to no ordered column. This changes more behaviour, because an expression can declare an ordering by itself through `get_properties`. ### Additional context _No response_ ### 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]
