asolimando commented on code in PR #21815:
URL: https://github.com/apache/datafusion/pull/21815#discussion_r3268885583
##########
datafusion/physical-plan/src/filter.rs:
##########
@@ -576,9 +577,17 @@ impl ExecutionPlan for FilterExec {
/// The output statistics of a filtering operation can be estimated if the
/// predicate's selectivity value can be determined for the incoming data.
- fn partition_statistics(&self, partition: Option<usize>) ->
Result<Arc<Statistics>> {
- let input_stats =
- Arc::unwrap_or_clone(self.input.partition_statistics(partition)?);
+ fn partition_statistics_with_context(
+ &self,
+ partition: Option<usize>,
+ ctx: &StatisticsContext,
+ ) -> Result<Arc<Statistics>> {
+ let input_stats = match partition {
+ Some(_) => Arc::unwrap_or_clone(
+ ctx.compute_child_statistics(self.input.as_ref(), partition)?,
+ ),
+ None => Arc::unwrap_or_clone(Arc::clone(&ctx.child_stats()[0])),
+ };
Review Comment:
Makes total sense and, as suggested, `StatisticsArgs` proved to be a good
location for this. We now have:
- `args.child_stats_for(self.input.as_ref())`, which replaces the match
block across all partition-preserving operators
- `args.child_stats_of(child)`, for partition-merging operators
Addressed in bc32cf2
--
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]