cloud-fan commented on a change in pull request #31113:
URL: https://github.com/apache/spark/pull/31113#discussion_r589321776



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1663,8 +1663,12 @@ object ReplaceDeduplicateWithAggregate extends 
Rule[LogicalPlan] {
 /**
  * Replaces logical [[Intersect]] operator with a left-semi [[Join]] operator.
  * {{{
- *   SELECT a1, a2 FROM Tab1 INTERSECT SELECT b1, b2 FROM Tab2
- *   ==>  SELECT DISTINCT a1, a2 FROM Tab1 LEFT SEMI JOIN Tab2 ON a1<=>b1 AND 
a2<=>b2

Review comment:
       This seems like we push down the aggregate operator through the join 
operator. It's usually beneficial, but can cause perf regression if the join 
children do not have many duplications and the aggregate operator can't reduce 
the data volume.




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



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

Reply via email to