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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org