@@ -50,13 +50,19 @@ async fn check_stats_precision_with_filter_pushdown() {
5050 let ( _, _, state) = get_cache_runtime_state ( ) ;
5151 // Scan without filter, stats are exact
5252 let exec = table. scan ( & state, None , & [ ] , None ) . await . unwrap ( ) ;
53- assert_eq ! ( exec. statistics( ) . unwrap( ) . num_rows, Precision :: Exact ( 8 ) ) ;
53+ assert_eq ! (
54+ exec. partition_statistics( None ) . unwrap( ) . num_rows,
55+ Precision :: Exact ( 8 )
56+ ) ;
5457
5558 // Scan with filter pushdown, stats are inexact
5659 let filter = Expr :: gt ( col ( "id" ) , lit ( 1 ) ) ;
5760
5861 let exec = table. scan ( & state, None , & [ filter] , None ) . await . unwrap ( ) ;
59- assert_eq ! ( exec. statistics( ) . unwrap( ) . num_rows, Precision :: Inexact ( 8 ) ) ;
62+ assert_eq ! (
63+ exec. partition_statistics( None ) . unwrap( ) . num_rows,
64+ Precision :: Inexact ( 8 )
65+ ) ;
6066}
6167
6268#[ tokio:: test]
@@ -79,9 +85,12 @@ async fn load_table_stats_with_session_level_cache() {
7985 assert_eq ! ( get_static_cache_size( & state1) , 0 ) ;
8086 let exec1 = table1. scan ( & state1, None , & [ ] , None ) . await . unwrap ( ) ;
8187
82- assert_eq ! ( exec1. statistics( ) . unwrap( ) . num_rows, Precision :: Exact ( 8 ) ) ;
8388 assert_eq ! (
84- exec1. statistics( ) . unwrap( ) . total_byte_size,
89+ exec1. partition_statistics( None ) . unwrap( ) . num_rows,
90+ Precision :: Exact ( 8 )
91+ ) ;
92+ assert_eq ! (
93+ exec1. partition_statistics( None ) . unwrap( ) . total_byte_size,
8594 // TODO correct byte size: https://github.com/apache/datafusion/issues/14936
8695 Precision :: Exact ( 671 ) ,
8796 ) ;
@@ -91,9 +100,12 @@ async fn load_table_stats_with_session_level_cache() {
91100 //check session 1 cache result not show in session 2
92101 assert_eq ! ( get_static_cache_size( & state2) , 0 ) ;
93102 let exec2 = table2. scan ( & state2, None , & [ ] , None ) . await . unwrap ( ) ;
94- assert_eq ! ( exec2. statistics( ) . unwrap( ) . num_rows, Precision :: Exact ( 8 ) ) ;
95103 assert_eq ! (
96- exec2. statistics( ) . unwrap( ) . total_byte_size,
104+ exec2. partition_statistics( None ) . unwrap( ) . num_rows,
105+ Precision :: Exact ( 8 )
106+ ) ;
107+ assert_eq ! (
108+ exec2. partition_statistics( None ) . unwrap( ) . total_byte_size,
97109 // TODO correct byte size: https://github.com/apache/datafusion/issues/14936
98110 Precision :: Exact ( 671 ) ,
99111 ) ;
@@ -103,9 +115,12 @@ async fn load_table_stats_with_session_level_cache() {
103115 //check session 1 cache result not show in session 2
104116 assert_eq ! ( get_static_cache_size( & state1) , 1 ) ;
105117 let exec3 = table1. scan ( & state1, None , & [ ] , None ) . await . unwrap ( ) ;
106- assert_eq ! ( exec3. statistics( ) . unwrap( ) . num_rows, Precision :: Exact ( 8 ) ) ;
107118 assert_eq ! (
108- exec3. statistics( ) . unwrap( ) . total_byte_size,
119+ exec3. partition_statistics( None ) . unwrap( ) . num_rows,
120+ Precision :: Exact ( 8 )
121+ ) ;
122+ assert_eq ! (
123+ exec3. partition_statistics( None ) . unwrap( ) . total_byte_size,
109124 // TODO correct byte size: https://github.com/apache/datafusion/issues/14936
110125 Precision :: Exact ( 671 ) ,
111126 ) ;
0 commit comments