waruto210 commented on code in PR #12471: URL: https://github.com/apache/datafusion/pull/12471#discussion_r1764333078
########## datafusion/core/src/datasource/physical_plan/parquet/mod.rs: ########## @@ -739,7 +739,17 @@ impl ExecutionPlan for ParquetExec { } fn statistics(&self) -> Result<Statistics> { - Ok(self.projected_statistics.clone()) + // When filters are pushed down, we have no way of knowing the exact statistics. + // Note that pruning predicate is also a kind of filter pushdown. + let stats = if self.pruning_predicate.is_some() + || self.page_pruning_predicate.is_some() + || (self.predicate.is_some() && self.pushdown_filters()) + { + Statistics::new_unknown(&self.schema()) Review Comment: Using `Inexact` is also acceptable. I'm just concerned that when the filter's selectivity is very low, it might lead to wasteful memory allocation. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org