LantaoJin commented on a change in pull request #29021:
URL: https://github.com/apache/spark/pull/29021#discussion_r451427649
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/OptimizeSkewedJoin.scala
##########
@@ -130,20 +131,45 @@ case class OptimizeSkewedJoin(conf: SQLConf) extends
Rule[SparkPlan] {
}
}
- private def canSplitLeftSide(joinType: JoinType) = {
- joinType == Inner || joinType == Cross || joinType == LeftSemi ||
- joinType == LeftAnti || joinType == LeftOuter
+ private def canSplitLeftSide(joinType: JoinType, plan: SparkPlan) = {
+ (joinType == Inner || joinType == Cross || joinType == LeftSemi ||
+ joinType == LeftAnti || joinType == LeftOuter) &&
!containsAggregateExec(plan)
}
- private def canSplitRightSide(joinType: JoinType) = {
- joinType == Inner || joinType == Cross || joinType == RightOuter
+ private def canSplitRightSide(joinType: JoinType, plan: SparkPlan) = {
+ (joinType == Inner || joinType == Cross ||
+ joinType == RightOuter) && !containsAggregateExec(plan)
+ }
+
+ private def containsAggregateExec(plan: SparkPlan) = {
Review comment:
Maybe we need a whitelist instead of blacklist to make it safety
----------------------------------------------------------------
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]