You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sa...@apache.org on 2021/04/22 12:01:09 UTC

[spark] branch branch-3.1 updated: [SPARK-35127][UI] When we switch between different stage-detail pages, the entry item in the newly-opened page may be blank

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

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


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 60a2dd4  [SPARK-35127][UI] When we switch between different stage-detail pages, the entry item in the newly-opened page may be blank
60a2dd4 is described below

commit 60a2dd403ae6b736ba18d0ebd4789e4b15a8643d
Author: kyoty <ec...@gmail.com>
AuthorDate: Thu Apr 22 21:00:04 2021 +0900

    [SPARK-35127][UI] When we switch between different stage-detail pages, the entry item in the newly-opened page may be blank
    
    ### What changes were proposed in this pull request?
    
    To make sure that pageSize shoud not be shared between different stage pages.
    The screenshots of the problem are placed in the attachment of [JIRA](https://issues.apache.org/jira/browse/SPARK-35127)
    
    ### Why are the changes needed?
    fix the bug.
    
    according to reference:`https://datatables.net/reference/option/lengthMenu`
    `-1` represents display all rows, but now we use `totalTasksToShow`, it will cause the select item show as empty when we swich between different stage-detail pages.
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    manual test, it is a small io problem, and the modification does not affect the function, but just an adjustment of js configuration
    
    the gif below shows how the problem can be reproduced:
    ![reproduce](https://user-images.githubusercontent.com/52202080/115204351-f7060f80-a12a-11eb-8900-a009ad0c8870.gif)
    
    ![微信截图_20210419162849](https://user-images.githubusercontent.com/52202080/115205675-629cac80-a12c-11eb-9cb8-1939c7450e99.png)
    
    the gif below shows the result after modified:
    
    ![after_modified](https://user-images.githubusercontent.com/52202080/115204886-91fee980-a12b-11eb-9ccb-d5900a99095d.gif)
    
    Closes #32223 from kyoty/stages-task-empty-pagesize.
    
    Authored-by: kyoty <ec...@gmail.com>
    Signed-off-by: Kousuke Saruta <sa...@oss.nttdata.com>
    (cherry picked from commit 7242d7f774b821cbcb564c8afeddecaf6664d159)
    Signed-off-by: Kousuke Saruta <sa...@oss.nttdata.com>
---
 core/src/main/resources/org/apache/spark/ui/static/stagepage.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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 91bf274..06e28c7 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
@@ -746,7 +746,7 @@ $(document).ready(function () {
                     "paging": true,
                     "info": true,
                     "processing": true,
-                    "lengthMenu": [[20, 40, 60, 100, totalTasksToShow], [20, 40, 60, 100, "All"]],
+                    "lengthMenu": [[20, 40, 60, 100, -1], [20, 40, 60, 100, "All"]],
                     "orderMulti": false,
                     "bAutoWidth": false,
                     "ajax": {
@@ -762,6 +762,9 @@ $(document).ready(function () {
                             data.numTasks = totalTasksToShow;
                             data.columnIndexToSort = columnIndexToSort;
                             data.columnNameToSort = columnNameToSort;
+                            if (data.length === -1) {
+                                data.length = totalTasksToShow;
+                            }
                         },
                         "dataSrc": function (jsons) {
                             var jsonStr = JSON.stringify(jsons);

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