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

sarutak pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 46440a4a542 [MINOR][UI] Simplify columnDefs in stagepage.js
46440a4a542 is described below

commit 46440a4a542148bc05b8c0f80d1860e6380efdb6
Author: Kent Yao <y...@apache.org>
AuthorDate: Sat Jul 22 17:12:07 2023 +0900

    [MINOR][UI] Simplify columnDefs in stagepage.js
    
    ### What changes were proposed in this pull request?
    
    Simplify `columnDefs` in stagepage.js
    
    ### Why are the changes needed?
    
    Reduce hardcode in stagepage.js and potential inconsistency for hidden/show 
in future changes.
    
    ### Does this PR introduce _any_ user-facing change?
    
    no
    
    ### How was this patch tested?
    
    Locally verified.
    
    <img width="1761" alt="image" 
src="https://github.com/apache/spark/assets/8326978/3b3595a4-7825-47d5-8c28-30ec916321e6";>
    
    Closes #42101 from yaooqinn/m.
    
    Authored-by: Kent Yao <y...@apache.org>
    Signed-off-by: Kousuke Saruta <saru...@apache.org>
---
 .../org/apache/spark/ui/static/stagepage.js        | 35 ++++++----------------
 1 file changed, 9 insertions(+), 26 deletions(-)

diff --git a/core/src/main/resources/org/apache/spark/ui/static/stagepage.js 
b/core/src/main/resources/org/apache/spark/ui/static/stagepage.js
index 50bf959d3aa..a8792593bf2 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/stagepage.js
+++ b/core/src/main/resources/org/apache/spark/ui/static/stagepage.js
@@ -235,11 +235,7 @@ function 
createDataTableForTaskSummaryMetricsTable(taskSummaryMetricsTable) {
         }
       ],
       "columnDefs": [
-        { "type": "duration", "targets": 1 },
-        { "type": "duration", "targets": 2 },
-        { "type": "duration", "targets": 3 },
-        { "type": "duration", "targets": 4 },
-        { "type": "duration", "targets": 5 }
+        { "type": "duration", "targets": [1, 2, 3, 4, 5] }
       ],
       "paging": false,
       "info": false,
@@ -592,22 +588,16 @@ $(document).ready(function () {
                 // The targets: $id represents column id which comes from 
stagespage-template.html
                 // #summary-executor-table.If the relative position of the 
columns in the table
                 // #summary-executor-table has changed,please be careful to 
adjust the column index here
-                // Input Size / Records
-                {"type": "size", "targets": 9},
-                // Output Size / Records
-                {"type": "size", "targets": 10},
-                // Shuffle Read Size / Records
-                {"type": "size", "targets": 11},
-                // Shuffle Write Size / Records
-                {"type": "size", "targets": 12},
+                // Input Size / Records - 9
+                // Output Size / Records - 10
+                // Shuffle Read Size / Records - 11
+                // Shuffle Write Size / Records - 12
+                {"type": "size", "targets": [9, 10, 11, 12]},
                 // Peak JVM Memory OnHeap / OffHeap
-                {"visible": false, "targets": 15},
                 // Peak Execution Memory OnHeap / OffHeap
-                {"visible": false, "targets": 16},
                 // Peak Storage Memory OnHeap / OffHeap
-                {"visible": false, "targets": 17},
                 // Peak Pool Memory Direct / Mapped
-                {"visible": false, "targets": 18}
+                {"visible": false, "targets": executorOptionalColumns},
               ],
               "deferRender": true,
               "order": [[0, "asc"]],
@@ -1079,15 +1069,8 @@ $(document).ready(function () {
             }
           ],
           "columnDefs": [
-            { "visible": false, "targets": 11 },
-            { "visible": false, "targets": 12 },
-            { "visible": false, "targets": 13 },
-            { "visible": false, "targets": 14 },
-            { "visible": false, "targets": 15 },
-            { "visible": false, "targets": 16 },
-            { "visible": false, "targets": 17 },
-            { "visible": false, "targets": 18 },
-            { "visible": false, "targets": 21 }
+            { "visible": false, "targets": optionalColumns },
+            { "visible": false, "targets": 18 }, // accumulators
           ],
           "deferRender": true
         };


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

Reply via email to