findepi commented on code in PR #16362: URL: https://github.com/apache/datafusion/pull/16362#discussion_r2139519852
########## datafusion/optimizer/src/push_down_filter.rs: ########## @@ -778,6 +779,16 @@ impl OptimizerRule for PushDownFilter { return Ok(Transformed::no(plan)); }; + let predicate = split_conjunction_owned(filter.predicate.clone()); + let old_predicate_len = predicate.len(); + let new_predicates = simplify_predicates(predicate)?; Review Comment: `new_predicates` operates on `col comparison_operator literal` sometimes these are tied in conjuncts: `a > -5 AND a < 5` or disjuncts: `a < -5 OR a > 5` would it make sense to be able to process per-column predicates in both forms? To do that we could have a function Expr -> captured per-column predicates and then be able to combine such functions on AND and on OR This might be related https://github.com/trinodb/trino/blob/232916b75d415a5eb643cf922492eb8513d99aae/core/trino-main/src/main/java/io/trino/sql/planner/DomainTranslator.java#L365 -- 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