@@ -182,11 +182,11 @@ impl ExecutionPlan for StatisticsValidation {
182182 unimplemented ! ( "This plan only serves for testing statistics" )
183183 }
184184
185- fn partition_statistics ( & self , partition : Option < usize > ) -> Result < Statistics > {
185+ fn partition_statistics ( & self , partition : Option < usize > ) -> Result < Arc < Statistics > > {
186186 if partition. is_some ( ) {
187- Ok ( Statistics :: new_unknown ( & self . schema ) )
187+ Ok ( Arc :: new ( Statistics :: new_unknown ( & self . schema ) ) )
188188 } else {
189- Ok ( self . stats . clone ( ) )
189+ Ok ( Arc :: new ( self . stats . clone ( ) ) )
190190 }
191191 }
192192
@@ -255,7 +255,7 @@ async fn sql_basic() -> Result<()> {
255255 let physical_plan = df. create_physical_plan ( ) . await . unwrap ( ) ;
256256
257257 // the statistics should be those of the source
258- assert_eq ! ( stats, physical_plan. partition_statistics( None ) ?) ;
258+ assert_eq ! ( stats, * physical_plan. partition_statistics( None ) ?) ;
259259
260260 Ok ( ( ) )
261261}
@@ -295,7 +295,7 @@ async fn sql_limit() -> Result<()> {
295295 . collect( ) ,
296296 total_byte_size: Precision :: Absent
297297 } ,
298- physical_plan. partition_statistics( None ) ?
298+ * physical_plan. partition_statistics( None ) ?
299299 ) ;
300300
301301 let df = ctx
@@ -304,7 +304,7 @@ async fn sql_limit() -> Result<()> {
304304 . unwrap ( ) ;
305305 let physical_plan = df. create_physical_plan ( ) . await . unwrap ( ) ;
306306 // when the limit is larger than the original number of lines, statistics remain unchanged
307- assert_eq ! ( stats, physical_plan. partition_statistics( None ) ?) ;
307+ assert_eq ! ( stats, * physical_plan. partition_statistics( None ) ?) ;
308308
309309 Ok ( ( ) )
310310}
@@ -324,7 +324,7 @@ async fn sql_window() -> Result<()> {
324324 let result = physical_plan. partition_statistics ( None ) ?;
325325
326326 assert_eq ! ( stats. num_rows, result. num_rows) ;
327- let col_stats = result. column_statistics ;
327+ let col_stats = & result. column_statistics ;
328328 assert_eq ! ( 2 , col_stats. len( ) ) ;
329329 assert_eq ! ( stats. column_statistics[ 1 ] , col_stats[ 0 ] ) ;
330330
0 commit comments