neilconway commented on code in PR #23566:
URL: https://github.com/apache/datafusion/pull/23566#discussion_r3603579321


##########
datafusion/optimizer/src/eliminate_join.rs:
##########
@@ -394,6 +406,30 @@ fn rewrite_join(
 
     let (visible_left, visible_right) = split_join_output_columns(&join, live);
 
+    // A LEFT JOIN preserves every left row, so when nothing above the join
+    // references the right side's columns and the right side cannot multiply
+    // left rows (the ancestors are duplicate-insensitive, or the right side
+    // is unique on the join keys), the join has no observable effect and can
+    // be replaced by its left input. A join filter cannot prevent this: it
+    // only decides whether a left row is matched or null-padded, and either
+    // way the row is emitted.
+    if join.join_type == JoinType::Left

Review Comment:
   I'm not sure there's a rush to land left-join support super fast 😊 But sure, 
if you'd prefer to split this into two PRs, that's fine with me.



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

Reply via email to