wangyum commented on a change in pull request #31113:
URL: https://github.com/apache/spark/pull/31113#discussion_r595755856
##########
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:
Do you mean only push down distinct when CBO is enabled and all column
stats are exist and there are duplicate values?
----------------------------------------------------------------
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]