peter-toth opened a new pull request #27309: [SPARK-30598][SQL] Detect 
equijoins better
URL: https://github.com/apache/spark/pull/27309
 
 
   # What changes were proposed in this pull request?
   The change in this PR can extract equalities from join conditions so that we 
can recognise implicit equijoins.
   E.g. this query:
   ```
   SELECT * FROM t1 FULL OUTER JOIN t2 ON t1.c2 = 2 AND t2.c2 = 2
   ```
   before this PR:
   ```
   BroadcastNestedLoopJoin BuildRight, FullOuter, ((c2#226 = 2) AND (c2#237 = 
2))
   :- *(1) Project [_1#220 AS c#225, _2#221 AS c2#226]
   :  +- *(1) LocalTableScan [_1#220, _2#221]
   +- BroadcastExchange IdentityBroadcastMode, [id=#146]
      +- *(2) Project [_1#231 AS c#236, _2#232 AS c2#237]
         +- *(2) LocalTableScan [_1#231, _2#232]
   ```
   after this PR:
   ```
   SortMergeJoin [c#225], [c#236], FullOuter, ((c2#226 = 2) AND (c2#237 = 2))
   :- *(2) Sort [c#225 ASC NULLS FIRST], false, 0
   :  +- Exchange hashpartitioning(c#225, 5), true, [id=#101]
   :     +- *(1) Project [_1#220 AS c#225, _2#221 AS c2#226]
   :        +- *(1) LocalTableScan [_1#220, _2#221]
   +- *(4) Sort [c#236 ASC NULLS FIRST], false, 0
      +- Exchange hashpartitioning(c#236, 5), true, [id=#106]
         +- *(3) Project [_1#231 AS c#236, _2#232 AS c2#237]
            +- *(3) LocalTableScan [_1#231, _2#232]
   ```
   
   ### Why are the changes needed?
   Improve performance.
   
   ### Does this PR introduce any user-facing change?
   No.
   
   ### How was this patch tested?
   Existing and new UTs.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to