You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "ozankabak (via GitHub)" <gi...@apache.org> on 2024/07/02 17:10:04 UTC

Re: [PR] fix: Incorrect LEFT JOIN evaluation result on OR conditions [datafusion]

ozankabak commented on code in PR #11203:
URL: https://github.com/apache/datafusion/pull/11203#discussion_r1662486115


##########
datafusion/optimizer/src/push_down_filter.rs:
##########
@@ -441,11 +442,11 @@ fn push_down_all_join(
 
     // Extract from OR clause, generate new predicates for both side of join if possible.
     // We only track the unpushable predicates above.
-    if left_preserved {
+    if on_left_preserved {
         left_push.extend(extract_or_clauses_for_join(&keep_predicates, left_schema));
         left_push.extend(extract_or_clauses_for_join(&join_conditions, left_schema));
     }
-    if right_preserved {
+    if on_right_preserved {

Review Comment:
   We could be missing something but it seems like `keep_predicates` and `join_conditions` should be using `preserved` vs. `on_preserved` (respectively) since the former applies as a post-join filter.



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org