@@ -31,7 +31,7 @@ use crate::filter_pushdown::{
3131 FilterPushdownPropagation , PushedDownPredicate ,
3232} ;
3333use crate :: metrics:: { ExecutionPlanMetricsSet , MetricsSet } ;
34- use crate :: statistics_context:: StatisticsContext ;
34+ use crate :: statistics_context:: StatisticsArgs ;
3535use crate :: {
3636 DisplayFormatType , Distribution , ExecutionPlan , InputOrderMode ,
3737 SendableRecordBatchStream , Statistics , check_if_same_properties,
@@ -1644,15 +1644,8 @@ impl ExecutionPlan for AggregateExec {
16441644 Some ( self . metrics . clone_inner ( ) )
16451645 }
16461646
1647- fn partition_statistics_with_context (
1648- & self ,
1649- partition : Option < usize > ,
1650- ctx : & StatisticsContext ,
1651- ) -> Result < Arc < Statistics > > {
1652- let child_statistics = match partition {
1653- Some ( _) => ctx. compute_child_statistics ( self . input . as_ref ( ) , partition) ?,
1654- None => Arc :: clone ( & ctx. child_stats ( ) [ 0 ] ) ,
1655- } ;
1647+ fn statistics_with_args ( & self , args : & StatisticsArgs ) -> Result < Arc < Statistics > > {
1648+ let child_statistics = args. child_stats_for ( 0 , self . input . as_ref ( ) ) ?;
16561649 Ok ( Arc :: new ( self . statistics_inner ( & child_statistics) ?) )
16571650 }
16581651
@@ -2801,12 +2794,8 @@ mod tests {
28012794 Ok ( Box :: pin ( stream) )
28022795 }
28032796
2804- fn partition_statistics_with_context (
2805- & self ,
2806- partition : Option < usize > ,
2807- _ctx : & StatisticsContext ,
2808- ) -> Result < Arc < Statistics > > {
2809- if partition. is_some ( ) {
2797+ fn statistics_with_args ( & self , args : & StatisticsArgs ) -> Result < Arc < Statistics > > {
2798+ if args. partition ( ) . is_some ( ) {
28102799 return Ok ( Arc :: new ( Statistics :: new_unknown ( self . schema ( ) . as_ref ( ) ) ) ) ;
28112800 }
28122801 let ( _, batches) = some_data ( ) ;
0 commit comments