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: 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

Reply via email to