jonahgao commented on code in PR #15055:
URL: https://github.com/apache/datafusion/pull/15055#discussion_r1984343133


##########
datafusion/expr/src/logical_plan/plan.rs:
##########
@@ -906,28 +906,43 @@ impl LogicalPlan {
                 let equi_expr_count = on.len();
                 assert!(expr.len() >= equi_expr_count);
 
+                let col_pair_count =
+                    expr.iter().filter(|e| matches!(e, 
Expr::Column(_))).count() / 2;

Review Comment:
   The filter can also be a column expression if it's a boolean column. And the 
on expression may not be a column expr, e.g. ` select * from t1 join t2 on 
t1.a+2 = t2.a+1 where t2.b`.
   
   I think we don't need to match expr types; we just extract them according to 
the format returned by `apply_expressions()`, where the first `on.len() * 2` 
elements are the on-expression pairs, and the last one is the filter expression.



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