xudong963 commented on code in PR #23651: URL: https://github.com/apache/datafusion/pull/23651#discussion_r3627627154
########## docs/source/library-user-guide/upgrading/55.0.0.md: ########## @@ -381,6 +374,43 @@ let stats = plan.partition_statistics(None)?; let stats = StatisticsContext::new().compute(plan.as_ref(), &StatisticsArgs::new())?; ``` +### `datafusion.optimizer.use_statistics_registry` is deprecated and ignored Review Comment: [StatisticsRegistry::compute and compute_base](https://github.com/apache/datafusion/blob/dd79d6f3d44717e943e2ab3be5d3e789a527b2d4/datafusion/physical-plan/src/operator_statistics/mod.rs#L388-L420) are deprecated, do we need to document them? ########## datafusion/physical-plan/src/statistics.rs: ########## @@ -182,35 +230,245 @@ impl StatisticsContext { requests.len(), children.len() ); - let child_stats = children + let child_statistics: Vec<Arc<Statistics>> = children Review Comment: Now child statistics are resolved exclusively from `plan.child_stats_requests()`. The provider is then called with those results. Previously, `StatisticsRegistry::compute `recursively computed every child before invoking providers. Now an operator whose built-in implementation returns ChildStats::Skip supplies unknown placeholders—even when a custom provider needs real child statistics. The test change exposes the regression: [CustomExec had to gain child_stats_requests](https://github.com/apache/datafusion/blob/dd79d6f3d44717e943e2ab3be5d3e789a527b2d4/datafusion/physical-plan/src/operator_statistics/mod.rs#L1263-L1272) solely to keep its provider working. Downstream providers targeting existing built-in operators such as UnnestExec cannot add this method to DataFusion’s type, so they have no correct way to obtain enhanced child statistics. This violates the registry’s core purpose: overriding existing operators without changing them. -- 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]
