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

   ### Is your feature request related to a problem or challenge?
   
   `JoinSelection`'s internal stats helpers (`get_stats`, 
`should_swap_join_order`,
   `supports_collect_by_thresholds`) take `Option<&StatisticsRegistry>` and
   `&ConfigOptions` pre-extracted from the `PhysicalOptimizerContext`. Every new
   session-scoped input added to the context for cost-based estimation forces a
   signature change across all three helpers and their call sites.
   
   ### Describe the solution you'd like
   
   Pass `&dyn PhysicalOptimizerContext` to these helpers instead; they read
   `statistics_registry()` / `config_options()` off it. New context inputs then 
need
   no helper-signature changes.
   
   This is also the pattern any future physical optimizer rule implementing CBO
   should follow: take the `PhysicalOptimizerContext` and read what it needs 
off it,
   rather than threading individual extracted inputs.
   
   ### Describe alternatives you've considered
   
   - Keep threading individual params — every new input churns all three 
signatures.
   - Pass `SessionState` directly — not possible; 
`datafusion-physical-optimizer`
     can't depend on `datafusion-core`, which is why `PhysicalOptimizerContext`
     exists.
   
   ### Additional context
   
   Non-breaking, mechanical: the helpers are crate-internal (`get_stats` /
   `supports_collect_by_thresholds` private, `should_swap_join_order` 
`pub(crate)`),
   no cross-crate callers, public `PhysicalOptimizerRule` methods unchanged.
   


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