asolimando commented on code in PR #21815:
URL: https://github.com/apache/datafusion/pull/21815#discussion_r3291395951
##########
datafusion/physical-plan/src/execution_plan.rs:
##########
@@ -563,6 +566,22 @@ pub trait ExecutionPlan: Any + Debug + DisplayAs + Send +
Sync {
Ok(Arc::new(Statistics::new_unknown(&self.schema())))
}
+ /// Returns statistics for a specific partition of this `ExecutionPlan`
node.
+ /// If statistics are not available, should return
[`Statistics::new_unknown`]
+ /// (the default), not an error.
+ /// If `partition` is `None`, it returns statistics for the entire plan.
+ ///
+ /// [`StatisticsArgs`] carries the partition index, pre-computed child
+ /// statistics, and a shared cache. See [`compute_statistics`] for the
+ /// top-level entry point that builds the args automatically.
+ ///
+ /// [`StatisticsArgs`]: crate::statistics_context::StatisticsArgs
+ /// [`compute_statistics`]: crate::statistics_context::compute_statistics
+ fn statistics_with_args(&self, args: &StatisticsArgs) ->
Result<Arc<Statistics>> {
+ #[expect(deprecated)]
+ self.partition_statistics(args.partition())
Review Comment:
At this stage I am mostly concerned with backwards compatibility and I have
kept the fallback for this reason: for downstream operators overriding
`partition_statistics`, if I am not wrong they would silently get
`Statistics::new_unknown` instead of their custom stats if we removed the
fallback. The deprecation warning nudges them to migrate, at that point we can
"port" the implementation as @alamb suggests. WDYT?
--
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]