xudong963 commented on code in PR #15503:
URL: https://github.com/apache/datafusion/pull/15503#discussion_r2030735470
##########
datafusion/physical-plan/src/execution_plan.rs:
##########
@@ -427,6 +427,16 @@ pub trait ExecutionPlan: Debug + DisplayAs + Send + Sync {
Ok(Statistics::new_unknown(&self.schema()))
}
+ /// Returns statistics for each partition of this `ExecutionPlan` node.
+ /// If statistics are not available, returns an array of
+ /// [`Statistics::new_unknown`] for each partition.
+ fn statistics_by_partition(&self) -> Result<Vec<Statistics>> {
+ Ok(vec![
+ Statistics::new_unknown(&self.schema());
+ self.properties().partitioning.partition_count()
+ ])
Review Comment:
I noticed the original default implementation from you; it's a bit risky if
a node doesn't have a specific implementation for the API, and I also think
most of the nodes' partition statistics don't follow the "repeating the global
statistics for each partition". So out of safety, I change it to `unknown
statistics`.
--
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]