jayzhan211 commented on code in PR #27222:
URL: https://github.com/apache/datafusion/pull/27222#discussion_r4513806114
##########
datafusion/optimizer/src/extract_equijoin_predicate.rs:
##########
@@ -75,7 +84,10 @@ impl OptimizerRule for ExtractEquijoinPredicate {
// Nested Loop Join, resulting in better performance.
//
// Only convert when there are NO equijoin predicates, to be
conservative.
- if on.is_empty()
+ // Note: Joins are initially constructed with `on: []` and
default `NullEqualsNothing`.
+ // Explicitly guard against re-scanning if the join was
already converted to `NullEqualsNull`.
Review Comment:
Optional cleanup: joins built by `USING`, `INTERSECT`/`EXCEPT` or the
DataFrame API start with a non-empty `on`, and `INTERSECT` is already
`NullEqualsNull`. Maybe say instead why the scan is skipped:
```suggestion
// A `NullEqualsNull` join already moved its `IS NOT
DISTINCT FROM`
// predicates into `on` in the split above, so nothing is
left to convert.
```
--
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]