cloud-fan commented on a change in pull request #27226: [SPARK-30524] [SQL]
Disable OptimizeSkewedJoin rule when introducing additional shuffle
URL: https://github.com/apache/spark/pull/27226#discussion_r367228616
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/OptimizeSkewedJoin.scala
##########
@@ -171,16 +208,20 @@ case class OptimizeSkewedJoin(conf: SQLConf) extends
Rule[SparkPlan] {
left, partitionId, leftMapIdStartIndices(i), leftEndMapId)
val rightSkewedReader = SkewedPartitionReaderExec(right,
partitionId,
rightMapIdStartIndices(j), rightEndMapId)
+ val skewedLeft = reOptimizeChild(leftSkewedReader, leftPlan)
+ val skewedRight = reOptimizeChild(rightSkewedReader, rightPlan)
subJoins += SortMergeJoinExec(leftKeys, rightKeys, joinType,
condition,
- s1.copy(child = leftSkewedReader), s2.copy(child =
rightSkewedReader))
+ skewedLeft, skewedRight)
}
}
}
logDebug(s"number of skewed partitions is ${skewedPartitions.size}")
if (skewedPartitions.nonEmpty) {
+ val visitedStages = HashSet.empty[Int]
val optimizedSmj = smj.transformDown {
Review comment:
how about `transformUp`? Then we don't need the `visitedStages`
----------------------------------------------------------------
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]