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


##########
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:
   For left join, `left_preserved=true` and `on_left_preserved=false`.
   In current version of the code, nothing from `keep_predicates` and 
`join_conditions` can be inserted to the `left_push` since `on_left_preserved` 
flag is `false`. However,  if we use the flag `left_preserved` to decide 
whether we can insert  something from `keep_predicates`, into `left_push`. We 
could have inserted additional conditions to the `left_push`. In this sense, 
current code works correctly, however behaves suboptimal in some cases. 
   



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