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 2022/03/18 15:10:49 UTC

[GitHub] [spark] mridulm commented on a change in pull request #35884: [SPARK-38579][SQL][WEBUI]Requesting Restful API can cause NullPointerException

mridulm commented on a change in pull request #35884:
URL: https://github.com/apache/spark/pull/35884#discussion_r830061045



##########
File path: sql/core/src/main/scala/org/apache/spark/status/api/v1/sql/SqlResource.scala
##########
@@ -94,7 +95,15 @@ private[v1] class SqlResource extends BaseAppResource {
 
     val duration = exec.completionTime.getOrElse(new Date()).getTime - exec.submissionTime
     val planDetails = if (planDescription) exec.physicalPlanDescription else ""
-    val nodes = if (details) printableMetrics(graph.allNodes, exec.metricValues) else Seq.empty
+    val nodes = if (details) {
+      if (exec.metricValues != null) {
+        printableMetrics(graph.allNodes, exec.metricValues)
+      } else {
+        printableMetrics(graph.allNodes, new HashMap[Long, String])
+      }

Review comment:
       `Option(exec.metricValues).getOrElse(Map())` instead




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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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