You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cxzl25 (via GitHub)" <gi...@apache.org> on 2026/07/15 12:22:00 UTC
Re: [PR] [SPARK-56048][UI] Add copy plan text and share link buttons to SQL execution page [spark]
cxzl25 commented on code in PR #54886:
URL: https://github.com/apache/spark/pull/54886#discussion_r3587163299
##########
sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/spark-sql-viz.js:
##########
@@ -699,6 +676,32 @@ document.addEventListener("DOMContentLoaded", function () {
if (shouldRenderPlanViz()) {
renderPlanViz();
}
+
+ // Copy physical plan text to clipboard
+ var copyPlanBtn = document.getElementById("copy-plan-btn");
+ if (copyPlanBtn) {
+ copyPlanBtn.addEventListener("click", function () {
+ var planEl = document.getElementById("physical-plan-details");
+ var text = planEl ? planEl.textContent : "";
+ navigator.clipboard.writeText(text.trim()).then(function () {
Review Comment:
```
spark-sql-viz.js:1089 Uncaught TypeError: Cannot read properties of undefined (reading 'writeText')
at HTMLButtonElement.<anonymous> (spark-sql-viz.js:1089:27)
```
writeText can only work under https. If the ui is accessed using http, it cannot be copied normally.
https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText
https://stackoverflow.com/a/71876238
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org