@@ -322,31 +322,23 @@ impl FilterExec {
322322 ) -> Result < Statistics > {
323323 let eq_columns = collect_equality_columns ( predicate) ;
324324
325- let ( num_rows, total_byte_size, mut column_statistics) =
325+ let num_rows = input_stats. num_rows ;
326+ let total_byte_size = input_stats. total_byte_size ;
327+
328+ let ( selectivity, mut column_statistics) =
326329 if !check_support ( predicate, schema) {
327- let selectivity = default_selectivity as f64 / 100.0 ;
328- let stats = input_stats. to_inexact ( ) ;
329330 (
330- stats. num_rows . with_estimated_selectivity ( selectivity) ,
331- stats
332- . total_byte_size
333- . with_estimated_selectivity ( selectivity) ,
334- stats. column_statistics ,
331+ default_selectivity as f64 / 100.0 ,
332+ input_stats. to_inexact ( ) . column_statistics ,
335333 )
336334 } else {
337- let num_rows = input_stats. num_rows ;
338- let total_byte_size = input_stats. total_byte_size ;
339335 let input_analysis_ctx = AnalysisContext :: try_from_statistics (
340336 schema,
341337 & input_stats. column_statistics ,
342338 ) ?;
343-
344339 let analysis_ctx = analyze ( predicate, input_analysis_ctx, schema) ?;
345-
346- let selectivity = analysis_ctx. selectivity . unwrap_or ( 1.0 ) ;
347340 (
348- num_rows. with_estimated_selectivity ( selectivity) ,
349- total_byte_size. with_estimated_selectivity ( selectivity) ,
341+ analysis_ctx. selectivity . unwrap_or ( 1.0 ) ,
350342 collect_new_statistics (
351343 schema,
352344 & input_stats. column_statistics ,
@@ -355,6 +347,9 @@ impl FilterExec {
355347 )
356348 } ;
357349
350+ let num_rows = num_rows. with_estimated_selectivity ( selectivity) ;
351+ let total_byte_size = total_byte_size. with_estimated_selectivity ( selectivity) ;
352+
358353 for idx in & eq_columns {
359354 if * idx < column_statistics. len ( )
360355 && column_statistics[ * idx] . distinct_count != Precision :: Exact ( 0 )
0 commit comments