diff --git a/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala b/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
index 477b9ce7f7848..7e6cc4297d6b1 100644
--- a/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
+++ b/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
@@ -843,7 +843,7 @@ private[ui] class TaskPagedTable(
{UIUtils.formatDate(task.launchTime)} |
- {formatDuration(task.duration)} |
+ {formatDuration(task.taskMetrics.map(_.executorRunTime))} |
{UIUtils.formatDuration(AppStatusUtils.schedulerDelay(task))}
|
@@ -996,7 +996,9 @@ private[ui] object ApiHelper {
HEADER_EXECUTOR -> TaskIndexNames.EXECUTOR,
HEADER_HOST -> TaskIndexNames.HOST,
HEADER_LAUNCH_TIME -> TaskIndexNames.LAUNCH_TIME,
- HEADER_DURATION -> TaskIndexNames.DURATION,
+ // SPARK-26109: Duration of task as executorRunTime to make it consistent with the
+ // aggregated tasks summary metrics table and the previous versions of Spark.
+ HEADER_DURATION -> TaskIndexNames.EXEC_RUN_TIME,
HEADER_SCHEDULER_DELAY -> TaskIndexNames.SCHEDULER_DELAY,
HEADER_DESER_TIME -> TaskIndexNames.DESER_TIME,
HEADER_GC_TIME -> TaskIndexNames.GC_TIME,