adriangb commented on code in PR #15959: URL: https://github.com/apache/datafusion/pull/15959#discussion_r2075050030
########## datafusion/physical-plan/src/filter.rs: ########## @@ -554,25 +554,37 @@ impl ExecutionPlan for FilterExec { ) }) .collect::<Vec<_>>(); - Arc::new(ProjectionExec::try_new(proj_exprs, filter_input)?) - as Arc<dyn ExecutionPlan> + Some(Arc::new(ProjectionExec::try_new(proj_exprs, filter_input)?) + as Arc<dyn ExecutionPlan>) } None => { // No projection needed, just return the input - filter_input + Some(filter_input) } } + } else if new_predicate.eq(&self.predicate) { + // The new predicate is the same as our current predicate + None } else { // Create a new FilterExec with the new predicate - Arc::new( - FilterExec::try_new(new_predicate, filter_input)? - .with_default_selectivity(self.default_selectivity())? - .with_projection(self.projection().cloned())?, Review Comment: Each one of these calls `compute_properties` again... -- 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