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/03/26 18:51:39 UTC

[GitHub] [spark] sarutak commented on a change in pull request #28037: [SPARK-31271][UI] fix web ui for driver side SQL metrics

sarutak commented on a change in pull request #28037: [SPARK-31271][UI] fix web ui for driver side SQL metrics
URL: https://github.com/apache/spark/pull/28037#discussion_r398812067
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala
 ##########
 @@ -180,18 +178,18 @@ object SQLMetrics {
       numberFormat.format(values.sum)
     } else if (metricsType == AVERAGE_METRIC) {
       val validValues = values.filter(_ > 0)
-      val Seq(min, med, max) = {
-        val metric = if (validValues.isEmpty) {
-          val zeros = Seq.fill(3)(0L)
-          zeros.map(v => toNumberFormat(v))
-        } else {
+      if (validValues.length <= 1) {
+        toNumberFormat(validValues.headOption.getOrElse(0))
 
 Review comment:
   It's not obvious that this is for the case of driver so can we leave a comment for the readability?

----------------------------------------------------------------
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