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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to