aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorDavies Liu <davies@databricks.com>2016-01-25 12:44:20 -0800
committerDavies Liu <davies.liu@gmail.com>2016-01-25 12:44:20 -0800
commit7d877c3439d872ec2a9e07d245e9c96174c0cf00 (patch)
treecede221aefec11aeb375784ed1151ad749540c87 /core
parentc037d25482ea63430fb42bfd86124c268be5a4a4 (diff)
downloadspark-7d877c3439d872ec2a9e07d245e9c96174c0cf00.tar.gz
spark-7d877c3439d872ec2a9e07d245e9c96174c0cf00.tar.bz2
spark-7d877c3439d872ec2a9e07d245e9c96174c0cf00.zip
[SPARK-12902] [SQL] visualization for generated operators
This PR brings back visualization for generated operators, they looks like: ![sql](https://cloud.githubusercontent.com/assets/40902/12460920/0dc7956a-bf6b-11e5-9c3f-8389f452526e.png) ![stage](https://cloud.githubusercontent.com/assets/40902/12460923/11806ac4-bf6b-11e5-9c72-e84a62c5ea93.png) Note: SQL metrics are not supported right now, because they are very slow, will be supported once we have batch mode. Author: Davies Liu <davies@databricks.com> Closes #10828 from davies/viz_codegen.
Diffstat (limited to 'core')
-rw-r--r--core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js2
-rw-r--r--core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala6
2 files changed, 6 insertions, 2 deletions
diff --git a/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js b/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
index 83dbea40b6..4337c42087 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
+++ b/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js
@@ -284,7 +284,7 @@ function renderDot(dot, container, forJob) {
renderer(container, g);
// Find the stage cluster and mark it for styling and post-processing
- container.selectAll("g.cluster[name*=\"Stage\"]").classed("stage", true);
+ container.selectAll("g.cluster[name^=\"Stage \"]").classed("stage", true);
}
/* -------------------- *
diff --git a/core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala b/core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala
index 06da74f1b6..003c218aad 100644
--- a/core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala
+++ b/core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala
@@ -130,7 +130,11 @@ private[ui] object RDDOperationGraph extends Logging {
}
}
// Attach the outermost cluster to the root cluster, and the RDD to the innermost cluster
- rddClusters.headOption.foreach { cluster => rootCluster.attachChildCluster(cluster) }
+ rddClusters.headOption.foreach { cluster =>
+ if (!rootCluster.childClusters.contains(cluster)) {
+ rootCluster.attachChildCluster(cluster)
+ }
+ }
rddClusters.lastOption.foreach { cluster => cluster.attachChildNode(node) }
}
}