Github user LantaoJin commented on a diff in the pull request:
https://github.com/apache/spark/pull/22612#discussion_r228830146
--- Diff: core/src/main/scala/org/apache/spark/util/JsonProtocol.scala ---
@@ -394,9 +394,15 @@ private[spark] object JsonProtocol {
/** Convert executor metrics to JSON. */
def executorMetricsToJson(executorMetrics: ExecutorMetrics): JValue = {
- val metrics = ExecutorMetricType.values.map{ metricType =>
- JField(metricType.name, executorMetrics.getMetricValue(metricType))
- }
+ val metrics = for {
+ (m, _) <- ExecutorMetricType.definedMetricsAndOffset.toSeq
--- End diff --
`definedMetricsAndOffset.toSeq` causes generated JSON with a random order.
Some UTs in `JsonProtocalSuite` will fail.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]