cloud-fan commented on a change in pull request #32685:
URL: https://github.com/apache/spark/pull/32685#discussion_r640348467
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/OptimizeSkewedJoin.scala
##########
@@ -174,20 +175,20 @@ object OptimizeSkewedJoin extends CustomShuffleReaderRule
{
|${getSizeInfo(rightMedSize, rightSizes)}
""".stripMargin)
- val canSplitLeft = canSplitLeftSide(joinType)
- val canSplitRight = canSplitRightSide(joinType)
- val leftTargetSize = targetSize(leftSizes, leftMedSize)
- val rightTargetSize = targetSize(rightSizes, rightMedSize)
+ val leftSkewThreshold = getSkewThreshold(leftMedSize)
+ val rightSkewThreshold = getSkewThreshold(rightMedSize)
+ val leftTargetSize = targetSize(leftSizes, leftSkewThreshold)
+ val rightTargetSize = targetSize(rightSizes, rightSkewThreshold)
val leftSidePartitions = mutable.ArrayBuffer.empty[ShufflePartitionSpec]
val rightSidePartitions = mutable.ArrayBuffer.empty[ShufflePartitionSpec]
var numSkewedLeft = 0
var numSkewedRight = 0
for (partitionIndex <- 0 until numPartitions) {
val leftSize = leftSizes(partitionIndex)
- val isLeftSkew = isSkewed(leftSize, leftMedSize) && canSplitLeft
+ val isLeftSkew = canSplitLeft && leftSize > leftSkewThreshold
Review comment:
now we don't need to call `isSkewed` repeatedly
--
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]