cloud-fan commented on a change in pull request #28109:
URL: https://github.com/apache/spark/pull/28109#discussion_r415645175
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/CustomShuffleReaderExec.scala
##########
@@ -121,12 +122,22 @@ case class CustomShuffleReaderExec private(
driverAccumUpdates += (numPartitionsMetric.id ->
partitionSpecs.length.toLong)
if (hasSkewedPartition) {
- val skewedMetric = metrics("numSkewedPartitions")
- val numSkewedPartitions = partitionSpecs.collect {
- case p: PartialReducerPartitionSpec => p.reducerIndex
- }.distinct.length
- skewedMetric.set(numSkewedPartitions)
- driverAccumUpdates += (skewedMetric.id -> numSkewedPartitions.toLong)
+ val skewedSpecs = partitionSpecs.collect {
+ case p: PartialReducerPartitionSpec => p
+ }
+
+ val skewedPartitions = metrics("numSkewedPartitions")
+ val skewedSplits = metrics("numSkewedSplits")
+
+ val numSkewedPartitions = skewedSpecs.map(_.reducerIndex).distinct.length
+ val numSplits = skewedSpecs.length
+
+ skewedPartitions.set(numSkewedPartitions)
+ driverAccumUpdates += (skewedPartitions.id -> numSkewedPartitions)
+
+ // Set sum value to "skewedSplits" metric.
Review comment:
this comment is not needed any more.
----------------------------------------------------------------
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]