mbutrovich commented on code in PR #1395: URL: https://github.com/apache/datafusion-comet/pull/1395#discussion_r1953445991
########## native/core/src/execution/planner.rs: ########## @@ -992,14 +994,25 @@ impl PhysicalPlanner { let predicate = self.create_expr(filter.predicate.as_ref().unwrap(), child.schema())?; - let filter = Arc::new(FilterExec::try_new( - predicate, - Arc::clone(&child.native_plan), - )?); - Ok(( - scans, - Arc::new(SparkPlan::new(spark_plan.plan_id, filter, vec![child])), - )) + if filter.use_datafusion_filter { Review Comment: If someone can show me how to do a ternary or match here, that would be awesome. I don't like the duplicated code. I tried to do `let filter = if use_datafusion_filter`... but because I was possibly assigning one of two different types (`DataFusionFilterExec` or `CometFilterExec`) the compiler wasn't happy when I went to pass that into the `SparkPlan::new` call. -- 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