nuno-faria commented on code in PR #20447:
URL: https://github.com/apache/datafusion/pull/20447#discussion_r2855318822


##########
datafusion/physical-plan/src/joins/hash_join/exec.rs:
##########
@@ -738,8 +738,10 @@ impl HashJoinExec {
     }
 
     fn allow_join_dynamic_filter_pushdown(&self, config: &ConfigOptions) -> 
bool {
-        if self.join_type != JoinType::Inner
-            || !config.optimizer.enable_join_dynamic_filter_pushdown
+        if !matches!(
+            self.join_type,
+            JoinType::Inner | JoinType::Left | JoinType::LeftSemi
+        ) || !config.optimizer.enable_join_dynamic_filter_pushdown

Review Comment:
   I think it would also work with `LeftAnti`, but it doesn't need to be 
included in this PR.
   
   Also, it would be interesting to explore `RightSemi` as well, since some 
queries will opt to use it if the statistics are not accurate. For example:
   
   ```sql
   -- t1 >> t2
   
   -- uses LeftSemi: dynamic filter added
   select *
   from t1
   where t1.k in (select k from t2)
       and t1.v2 in (123);
   
   -- uses RightSemi: no dynamic filter
   select *
   from t1
   where t1.k in (select k from t2)
       and t1.v2 in (123, 456);
   ```
   
   Once again, both cases can be considered in a future 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: [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