cloud-fan commented on a change in pull request #29431: URL: https://github.com/apache/spark/pull/29431#discussion_r470620144
########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListener.scala ########## @@ -212,25 +212,30 @@ class SQLAppStatusListener( val maxMetricsFromAllStages = new mutable.HashMap[Long, Array[Long]]() taskMetrics.foreach { case (id, values) => Review comment: to reduce code diff, how about `taskMetrics.filter(m => metricTypes.contains(m.id)).foreach...` ########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListener.scala ########## @@ -212,25 +212,30 @@ class SQLAppStatusListener( val maxMetricsFromAllStages = new mutable.HashMap[Long, Array[Long]]() taskMetrics.foreach { case (id, values) => - val prev = allMetrics.getOrElse(id, null) - val updated = if (prev != null) { - prev ++ values - } else { - values + if (metricTypes.contains(id)) { + val prev = allMetrics.getOrElse(id, null) + val updated = if (prev != null) { + prev ++ values + } else { + values + } + allMetrics(id) = updated } - allMetrics(id) = updated } // Find the max for each metric id between all stages. maxMetrics.foreach { case (id, value, taskId, stageId, attemptId) => Review comment: ditto ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org