UBarney commented on code in PR #16210: URL: https://github.com/apache/datafusion/pull/16210#discussion_r2144121144
########## datafusion/physical-plan/src/joins/nested_loop_join.rs: ########## @@ -178,6 +187,18 @@ pub struct NestedLoopJoinExec { metrics: ExecutionPlanMetricsSet, /// Cache holding plan properties like equivalences, output partitioning etc. cache: PlanProperties, + /// Null matching behavior: If `null_equals_null` is true, rows that have + /// `null`s in both left and right equijoin columns will be matched. + /// Otherwise, rows that have `null`s in the join columns will not be + /// matched and thus will not appear in the output. + null_equals_null: bool, + /// Set of equijoin columns from the relations: `(left_col, right_col)` + /// + /// This is optional as a nested loop join can be passed a 'on' clause + /// in the case that a Hash Join cost is more expensive than a + /// nested loop join or when a user would like to pick nested loop + /// join by hint + on: Option<Vec<(PhysicalExprRef, PhysicalExprRef)>>, Review Comment: Let's just skip `ExtractEquijoinPredicate` if we prefer NLJ. https://github.com/apache/datafusion/blob/8d79bddeda71bc415ba9bf85e77476ab1784c665/datafusion/optimizer/src/extract_equijoin_predicate.rs#L30-L43 I assume we achieve the behavior of `null_equals_null` by using `<=>`. For example: `select t1.value from range(6) t1 join range(6) t2 on t1.value <=> t2.value;`. The current spaceship operator can already handle this. https://github.com/apache/datafusion/blob/916ccc39f2af1aa3fb01f1c7e406fbcdbc03cc13/datafusion/sqllogictest/test_files/expr.slt#L1595-L1612 -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org