gengliangwang commented on a change in pull request #28208:
URL: https://github.com/apache/spark/pull/28208#discussion_r411874450



##########
File path: 
sql/core/src/main/scala/org/apache/spark/status/api/v1/sql/SqlResource.scala
##########
@@ -84,18 +119,40 @@ private[v1] class SqlResource extends BaseAppResource {
     }
 
     val duration = exec.completionTime.getOrElse(new Date()).getTime - 
exec.submissionTime
-    val planDetails = if (details) exec.physicalPlanDescription else ""
-    val metrics = if (details) printableMetrics(exec.metrics, 
exec.metricValues) else Seq.empty
+    val planDetails = if (details && planDescription) 
exec.physicalPlanDescription else ""
+    val metrics =
+      if (details) printableMetrics(exec.metrics, exec.metricValues, 
nodeIdAndWSCGIdMap)
+      else Seq.empty
     new ExecutionData(
       exec.executionId,
       status,
       exec.description,
       planDetails,
-      metrics,
       new Date(exec.submissionTime),
       duration,
       running,
       completed,
-      failed)
+      failed,
+      metrics)
   }
+
+  private def getNodeIdAndWSCGIdMap(graph: SparkPlanGraph): Map[Long, 
Option[Long]] = {

Review comment:
       how about just return 
   ```Map[Long, Long]```
   to make it simpler?




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

Reply via email to