@@ -43,8 +43,8 @@ use datafusion_common::config::ConfigOptions;
4343use datafusion_physical_optimizer:: PhysicalOptimizerRule ;
4444use datafusion_physical_optimizer:: filter_pushdown:: FilterPushdown ;
4545use datafusion_physical_plan:: ExecutionPlan ;
46- use datafusion_physical_plan:: compute_statistics;
4746use datafusion_physical_plan:: filter:: FilterExec ;
47+ use datafusion_physical_plan:: statistics:: StatisticsArgs ;
4848use tempfile:: tempdir;
4949
5050#[ tokio:: test]
@@ -64,7 +64,9 @@ async fn check_stats_precision_with_filter_pushdown() {
6464 // Scan without filter, stats are exact
6565 let exec = table. scan ( & state, None , & [ ] , None ) . await . unwrap ( ) ;
6666 assert_eq ! (
67- compute_statistics( exec. as_ref( ) , None ) . unwrap( ) . num_rows,
67+ exec. statistics_with_args( & StatisticsArgs :: new( None ) )
68+ . unwrap( )
69+ . num_rows,
6870 Precision :: Exact ( 8 ) ,
6971 "Stats without filter should be exact"
7072 ) ;
@@ -96,7 +98,8 @@ async fn check_stats_precision_with_filter_pushdown() {
9698 ) ;
9799 // Scan with filter pushdown, stats are inexact
98100 assert_eq ! (
99- compute_statistics( optimized_exec. as_ref( ) , None )
101+ optimized_exec
102+ . statistics_with_args( & StatisticsArgs :: new( None ) )
100103 . unwrap( )
101104 . num_rows,
102105 Precision :: Inexact ( 8 ) ,
@@ -126,11 +129,15 @@ async fn load_table_stats_with_session_level_cache() {
126129 let exec1 = table1. scan ( & state1, None , & [ ] , None ) . await . unwrap ( ) ;
127130
128131 assert_eq ! (
129- compute_statistics( exec1. as_ref( ) , None ) . unwrap( ) . num_rows,
132+ exec1
133+ . statistics_with_args( & StatisticsArgs :: new( None ) )
134+ . unwrap( )
135+ . num_rows,
130136 Precision :: Exact ( 8 )
131137 ) ;
132138 assert_eq ! (
133- compute_statistics( exec1. as_ref( ) , None )
139+ exec1
140+ . statistics_with_args( & StatisticsArgs :: new( None ) )
134141 . unwrap( )
135142 . total_byte_size,
136143 // Byte size is absent because we cannot estimate the output size
@@ -144,11 +151,15 @@ async fn load_table_stats_with_session_level_cache() {
144151 assert_eq ! ( get_static_cache_size( & state2) , 0 ) ;
145152 let exec2 = table2. scan ( & state2, None , & [ ] , None ) . await . unwrap ( ) ;
146153 assert_eq ! (
147- compute_statistics( exec2. as_ref( ) , None ) . unwrap( ) . num_rows,
154+ exec2
155+ . statistics_with_args( & StatisticsArgs :: new( None ) )
156+ . unwrap( )
157+ . num_rows,
148158 Precision :: Exact ( 8 )
149159 ) ;
150160 assert_eq ! (
151- compute_statistics( exec2. as_ref( ) , None )
161+ exec2
162+ . statistics_with_args( & StatisticsArgs :: new( None ) )
152163 . unwrap( )
153164 . total_byte_size,
154165 // Absent because the data contains variable length columns
@@ -161,11 +172,15 @@ async fn load_table_stats_with_session_level_cache() {
161172 assert_eq ! ( get_static_cache_size( & state1) , 1 ) ;
162173 let exec3 = table1. scan ( & state1, None , & [ ] , None ) . await . unwrap ( ) ;
163174 assert_eq ! (
164- compute_statistics( exec3. as_ref( ) , None ) . unwrap( ) . num_rows,
175+ exec3
176+ . statistics_with_args( & StatisticsArgs :: new( None ) )
177+ . unwrap( )
178+ . num_rows,
165179 Precision :: Exact ( 8 )
166180 ) ;
167181 assert_eq ! (
168- compute_statistics( exec3. as_ref( ) , None )
182+ exec3
183+ . statistics_with_args( & StatisticsArgs :: new( None ) )
169184 . unwrap( )
170185 . total_byte_size,
171186 // Absent because the data contains variable length columns
0 commit comments