alamb commented on code in PR #15906:
URL: https://github.com/apache/datafusion/pull/15906#discussion_r2069766950
##########
datafusion/optimizer/src/push_down_filter.rs:
##########
@@ -1382,6 +1386,73 @@ fn contain(e: &Expr, check_map: &HashMap<String, Expr>)
-> bool {
is_contain
}
+/// Infers new predicates by substituting equalities.
+/// For example, with predicates `t2.b = 3` and `t1.b > t2.b`,
+/// we can infer `t1.b > 3`.
+fn infer_predicates_from_equalities(predicates: Vec<Expr>) ->
Result<Vec<Expr>> {
Review Comment:
I think this might be a special case of the range analysis code in
https://docs.rs/datafusion/latest/datafusion/physical_expr/intervals/cp_solver/index.html
In other words, instead of this special case maybe we could use the
cp_solver to create a more general framework for introducing inferred
predicates 🤔
Now that we have predicate pushdown for ExecutionPlans maybe it is more
realistic to do this
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]