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

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


The following commit(s) were added to refs/heads/branch-4.3 by this push:
     new 782a55941676 [SPARK-60204][UI] Use UI root when fetching CSS for SQL 
plan SVG download
782a55941676 is described below

commit 782a55941676633e181b2a6f412a3bd05ef7073f
Author: Yahya Kisana <[email protected]>
AuthorDate: Mon Oct 19 11:37:30 2026 -0700

    [SPARK-60204][UI] Use UI root when fetching CSS for SQL plan SVG download
    
    ### What changes were proposed in this pull request?
    CSS for SQL plan SVG download now uses UI root.
    This fixes [SPARK-60204](https://issues.apache.org/jira/browse/SPARK-60204)
    
    ### Why are the changes needed?
    
    the download handler, added by 
[SPARK-51629](https://issues.apache.org/jira/browse/SPARK-51629), inlines 
spark-sql-viz.css into the SVG so the file is self-contained, but fetches it 
from an absolute root path
    
    ### Does this PR introduce _any_ user-facing change?
    Yes, download plan.svg now gives correct svg.
    
    ### How was this patch tested?
    
    Manually tested
    
    <img width="2000" height="1486" alt="image" 
src="https://github.com/user-attachments/assets/2c668fe7-a7c0-47c4-8410-d00ef48d3fc5";
 />
    
    ### Was this patch authored or co-authored using generative AI tooling?
    Generated-by: Claude Opus 5.5
    
    Closes #59412 from ykisana/SPARK-60204.
    
    Authored-by: Yahya Kisana <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
    (cherry picked from commit b2c6f51268d7b94b0f82096262fc5381cd9cf0f9)
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 .../resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 320172a17aa8..b4740b185bf1 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
@@ -612,7 +612,7 @@ 
document.getElementById("plan-viz-download-btn").addEventListener("click", async
     const svg = planVizContainer().select("svg").node().cloneNode(true);
     let css = "";
     try {
-      css = await fetch("/static/sql/spark-sql-viz.css").then((resp) => 
resp.text());
+      css = await fetch(uiRoot + "/static/sql/spark-sql-viz.css").then((resp) 
=> resp.text());
     } catch (e) {
       console.error("Failed to fetch CSS for SVG download", e);
     }


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

Reply via email to