From 4ea704231acae8d99aa5d3005271c51a93d083b5 Mon Sep 17 00:00:00 2001 From: zhangjunfan Date: Fri, 17 Jan 2020 16:23:47 +0800 Subject: [PATCH] [SPARK-30540] --- .../main/resources/org/apache/spark/ui/static/historypage.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/org/apache/spark/ui/static/historypage.js b/core/src/main/resources/org/apache/spark/ui/static/historypage.js index 4df5f07f077d7..039b95a20f896 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/historypage.js +++ b/core/src/main/resources/org/apache/spark/ui/static/historypage.js @@ -130,7 +130,7 @@ $(document).ready(function() { if (app["attempts"].length > 1) { hasMultipleAttempts = true; } - var num = app["attempts"].length; + var defaultNum = 1; for (var j in app["attempts"]) { var attempt = app["attempts"][j]; attempt["startTime"] = formatTimeMillis(attempt["startTimeEpoch"]); @@ -140,7 +140,8 @@ $(document).ready(function() { (attempt.hasOwnProperty("attemptId") ? attempt["attemptId"] + "/" : "") + "logs"; attempt["durationMillisec"] = attempt["duration"]; attempt["duration"] = formatDuration(attempt["duration"]); - var app_clone = {"id" : id, "name" : name, "version": version, "num" : num, "attempts" : [attempt]}; + var attempId = attempt.hasOwnProperty("attemptId") ? attempt["attemptId"] : defaultNum; + var app_clone = {"id" : id, "name" : name, "version": version, "num" : attempId, "attempts" : [attempt]}; array.push(app_clone); } }