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

yao 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 6ab9428ffb23 [SPARK-55880][UI] Link SQL plan metric stage IDs to stage 
detail page
6ab9428ffb23 is described below

commit 6ab9428ffb2399e43bcd5015f6e7d326bec9a97e
Author: Kent Yao <[email protected]>
AuthorDate: Sun Mar 15 00:07:51 2026 +0800

    [SPARK-55880][UI] Link SQL plan metric stage IDs to stage detail page
    
    ### What changes were proposed in this pull request?
    
    Make stage IDs in the SQL plan visualization metric detail panel clickable 
links to the corresponding stage detail page.
    
    When the "Show Stage ID and Task ID" checkbox is enabled on the SQL 
execution page, each metric row in the side panel shows a Stage column. 
Previously this was plain text like `3.0`. Now it renders as a hyperlink to 
`/stages/stage/?id=3&attempt=0`.
    
    ### Why are the changes needed?
    
    Navigating from a SQL plan node metric to the corresponding stage requires 
manually copying the stage ID and navigating to the Stages tab. A direct link 
improves workflow efficiency.
    
    ### Does this PR introduce _any_ user-facing change?
    
    Yes — Stage IDs in the SQL plan metric detail panel are now clickable links.
    
    ### How was this patch tested?
    
    Manual testing. The change is JS-only (no Scala changes).
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Yes, co-authored with GitHub Copilot.
    
    Closes #54785 from yaooqinn/SPARK-55880.
    
    Authored-by: Kent Yao <[email protected]>
    Signed-off-by: Kent Yao <[email protected]>
---
 .../apache/spark/sql/execution/ui/static/spark-sql-viz.js   | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git 
a/sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js
 
b/sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js
index b34cab71bd9e..ac266bd63d08 100644
--- 
a/sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js
+++ 
b/sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* global $, d3, dagreD3, graphlibDot */
+/* global $, d3, dagreD3, graphlibDot, uiRoot, appBasePath */
 
 var PlanVizConstants = {
   svgMarginX: 16,
@@ -385,12 +385,21 @@ function buildStatTable(total, min, med, maxVal,
   h += "<td>" + min + "</td><td>" + med +
     "</td><td>" + maxVal + "</td>";
   if (showStageTask) {
-    h += "<td>" + stageId + "</td><td>" + taskId + "</td>";
+    h += "<td>" + stageLink(stageId) + "</td><td>" + taskId + "</td>";
   }
   h += "</tr></tbody></table>";
   return h;
 }
 
+function stageLink(stageId) {
+  if (!stageId) return "";
+  var parts = stageId.split(".");
+  var id = parts[0];
+  var attempt = parts.length > 1 ? parts[1] : "0";
+  var url = uiRoot + appBasePath + "/stages/stage/?id=" + id + "&attempt=" + 
attempt;
+  return '<a href="' + url + '">' + stageId + '</a>';
+}
+
 /*
  * Update the detail side panel with the selected node's information.
  */


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to