From f5ac7952267daafc62a38120d7d708edebf5ce1f Mon Sep 17 00:00:00 2001 From: Eduard Karacharov Date: Tue, 7 Nov 2023 09:35:52 +0300 Subject: [PATCH] set filter statistics as inexact input if unknown --- datafusion/physical-plan/src/filter.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/datafusion/physical-plan/src/filter.rs b/datafusion/physical-plan/src/filter.rs index 59f9928d0e21..a8cd24dd6a3f 100644 --- a/datafusion/physical-plan/src/filter.rs +++ b/datafusion/physical-plan/src/filter.rs @@ -204,10 +204,11 @@ impl ExecutionPlan for FilterExec { let predicate = self.predicate(); let schema = self.schema(); + let input_stats = self.input.statistics()?; + if !check_support(predicate, &schema) { - return Ok(Statistics::new_unknown(&schema)); + return Ok(input_stats.into_inexact()); } - let input_stats = self.input.statistics()?; let num_rows = input_stats.num_rows; let total_byte_size = input_stats.total_byte_size;