You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/04/10 04:27:49 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #28175: [SPARK-31253][SQL][FOLLOW-UP] Improve the partition data size metrics in CustomShuffleReaderExec

cloud-fan commented on a change in pull request #28175: [SPARK-31253][SQL][FOLLOW-UP] Improve the partition data size metrics in CustomShuffleReaderExec
URL: https://github.com/apache/spark/pull/28175#discussion_r406596906
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/CustomShuffleReaderExec.scala
 ##########
 @@ -124,6 +104,24 @@ case class CustomShuffleReaderExec private(
     Map("numSkewedPartitions" -> metrics)
   }
 
+  private def sendPartitionDataSizeMetrics(executionId: String): Unit = {
+    val mapStats = shuffleStage.get.mapStats.bytesByPartitionId
+    partitionSpecs.foreach {
+      case CoalescedPartitionSpec(startReducerIndex, endReducerIndex) =>
+        val dataSize = startReducerIndex.until(endReducerIndex).map(mapStats(_)).sum
+        metrics("partitionDataSize").set(dataSize)
 
 Review comment:
   we should call `add`, not `set`. The SQL metrics itself should contain the sum value.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org