You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "mingmwang (via GitHub)" <gi...@apache.org> on 2023/03/17 15:11:55 UTC

[GitHub] [arrow-datafusion] mingmwang commented on a diff in pull request #5593: Add OuterReferenceColumn to Expr to represent correlated expression

mingmwang commented on code in PR #5593:
URL: https://github.com/apache/arrow-datafusion/pull/5593#discussion_r1140362566


##########
datafusion/optimizer/src/utils.rs:
##########
@@ -291,46 +293,52 @@ pub fn find_join_exprs(
     let mut joins = vec![];
     let mut others = vec![];
     for filter in exprs.iter() {
-        let (left, op, right) = match filter {
-            Expr::BinaryExpr(BinaryExpr { left, op, right }) => {
-                (*left.clone(), *op, *right.clone())
-            }
-            _ => {
-                others.push((*filter).clone());
-                continue;
-            }
-        };
-        let left = match left {
-            Expr::Column(c) => c,
-            _ => {
+        // If the expression contains correlated predicates, add it to join filters
+        if filter.contains_outer() {
+            joins.push(strip_outer_reference((*filter).clone()));
+        } else {
+            // TODO remove the logic

Review Comment:
   In the original decorrelation rules, there was complex logic to find out join columns, this is unnecessary after this PR.
   I will clean up the code in the next PR.



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org