adriangb commented on code in PR #25348:
URL: https://github.com/apache/datafusion/pull/25348#discussion_r4020520348


##########
datafusion/core/src/physical_planner.rs:
##########
@@ -1604,6 +1604,17 @@ impl DefaultPhysicalPlanner {
                     && session_state.config().repartition_joins()
                     && !*null_aware;
 
+                // Only `HashJoinExec` implements null-aware semantics, and it
+                // needs equi-join keys to do so. Without them the join would 
be
+                // planned as a nested loop (or piecewise merge) join, which
+                // silently ignores the flag and returns wrong results for
+                // `NOT IN` over a nullable subquery. Fail loudly instead.
+                if *null_aware && join_on.is_empty() {

Review Comment:
   Not sure how I feel about this. I guess if a user has their own join 
implementation that supports this they need custom physical planning. It seems 
in line with the rest of the code in this module, so maybe it's okay.



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