wankunde opened a new pull request #33702:
URL: https://github.com/apache/spark/pull/33702


   …in EliminateOuterJoin
   
   ### What changes were proposed in this pull request?
   
   For query
   ```
   spark.range(200L).selectExpr("id AS a").createTempView("t1")
   spark.range(300L).selectExpr("id AS b").createTempView("t2")
   spark.sql("SELECT DISTINCT a FROM t1 LEFT JOIN t2 ON a = b").explain(true)
   ```
   
   Before PR
   ```
   == Optimized Logical Plan ==
   Aggregate [b#3L], [b#3L, max(c#4L) AS c#20L]
   +- Project [b#3L, c#4L]
      +- Join LeftOuter, (a#2L = a#10L)
         :- Project [id#0L AS a#2L, id#0L AS b#3L, id#0L AS c#4L]
         :  +- Range (0, 200, step=1, splits=Some(1))
         +- Project [id#8L AS a#10L]
            +- Range (0, 300, step=1, splits=Some(1))
   ```
   
   After PR
   ```
   == Optimized Logical Plan ==
   Aggregate [b#277L], [b#277L, max(c#278L) AS c#290L]
   +- Project [id#274L AS b#277L, id#274L AS c#278L]
      +- Range (0, 200, step=1, splits=Some(2))
   ```
   
   ### Why are the changes needed?
   
   Enhance EliminateOuterJoin rule
   
   ### Does this PR introduce any user-facing change?
   
   No
   
   ### How was this patch tested?
   
   Add 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.

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