This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-3.5
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.5 by this push:
     new 2fe253e2f137 [SPARK-46704][CORE][UI] Fix `MasterPage` to sort `Running 
Drivers` table by `Duration` column correctly
2fe253e2f137 is described below

commit 2fe253e2f137dc901fd81a79c65019a8ea2312ed
Author: Dongjoon Hyun <dh...@apple.com>
AuthorDate: Fri Jan 12 12:54:29 2024 -0800

    [SPARK-46704][CORE][UI] Fix `MasterPage` to sort `Running Drivers` table by 
`Duration` column correctly
    
    ### What changes were proposed in this pull request?
    
    This PR aims to fix `MasterPage` to sort `Running Drivers` table by 
`Duration` column correctly.
    
    ### Why are the changes needed?
    
    Since Apache Spark 3.0.0, `MasterPage` shows `Duration` column of `Running 
Drivers`.
    
    **BEFORE**
    <img width="111" 
src="https://github.com/apache/spark/assets/9700541/50276e34-01be-4474-803d-79066e06cb2c";>
    
    **AFTER**
    <img width="111" 
src="https://github.com/apache/spark/assets/9700541/a427b2e6-eab0-4d73-9114-1d8ff9d052c2";>
    
    ### Does this PR introduce _any_ user-facing change?
    
    Yes, this is a bug fix of UI.
    
    ### How was this patch tested?
    
    Manual.
    
    Run a Spark standalone cluster.
    ```
    $ SPARK_MASTER_OPTS="-Dspark.master.rest.enabled=true 
-Dspark.deploy.maxDrivers=2" sbin/start-master.sh
    $ sbin/start-worker.sh spark://$(hostname):7077
    ```
    
    Submit multiple jobs via REST API.
    ```
    $ curl -s -k -XPOST http://localhost:6066/v1/submissions/create \
        --header "Content-Type:application/json;charset=UTF-8" \
        --data '{
          "appResource": "",
          "sparkProperties": {
            "spark.master": "spark://localhost:7077",
            "spark.app.name": "Test 1",
            "spark.submit.deployMode": "cluster",
            "spark.jars": 
"/Users/dongjoon/APACHE/spark-merge/examples/target/scala-2.13/jars/spark-examples_2.13-4.0.0-SNAPSHOT.jar"
          },
          "clientSparkVersion": "",
          "mainClass": "org.apache.spark.examples.SparkPi",
          "environmentVariables": {},
          "action": "CreateSubmissionRequest",
          "appArgs": [ "10000" ]
        }'
    ```
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #44711 from dongjoon-hyun/SPARK-46704.
    
    Authored-by: Dongjoon Hyun <dh...@apple.com>
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
    (cherry picked from commit 25c680cfd4dc63aeb9d16a673ee431c57188b80d)
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
 .../src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala 
b/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala
index e7e90aa0a37d..d8753a0ffcb5 100644
--- a/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala
+++ b/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala
@@ -354,7 +354,9 @@ private[ui] class MasterPage(parent: MasterWebUI) extends 
WebUIPage("") {
       <td>{formatResourcesAddresses(driver.resources)}</td>
       <td>{driver.desc.command.arguments(2)}</td>
       {if (showDuration) {
-        <td>{UIUtils.formatDuration(System.currentTimeMillis() - 
driver.startTime)}</td>
+        <td sorttable_customkey={(-driver.startTime).toString}>
+          {UIUtils.formatDuration(System.currentTimeMillis() - 
driver.startTime)}
+        </td>
       }}
     </tr>
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to