diff options
author | zsxwing <zsxwing@gmail.com> | 2015-09-02 22:17:39 -0700 |
---|---|---|
committer | Andrew Or <andrew@databricks.com> | 2015-09-02 22:17:39 -0700 |
commit | 0349b5b4383cf813bea4e1053bcc4e0268603743 (patch) | |
tree | d482feaed29574d299c833fb5914a6663372ff62 /sql | |
parent | 62b4690d6b3016f41292b640ac28644ef31e299d (diff) | |
download | spark-0349b5b4383cf813bea4e1053bcc4e0268603743.tar.gz spark-0349b5b4383cf813bea4e1053bcc4e0268603743.tar.bz2 spark-0349b5b4383cf813bea4e1053bcc4e0268603743.zip |
[SPARK-10411] [SQL] Move visualization above explain output and hide explain by default
New screenshots after this fix:
<img width="627" alt="s1" src="https://cloud.githubusercontent.com/assets/1000778/9625782/4b2dba36-518b-11e5-9104-c713ff026e3d.png">
Default:
<img width="462" alt="s2" src="https://cloud.githubusercontent.com/assets/1000778/9625817/92366e50-518b-11e5-9981-cdfb774d66b8.png">
After clicking `+details`:
<img width="377" alt="s3" src="https://cloud.githubusercontent.com/assets/1000778/9625784/4ba24342-518b-11e5-8522-846a16a95d44.png">
Author: zsxwing <zsxwing@gmail.com>
Closes #8570 from zsxwing/SPARK-10411.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/execution/ui/ExecutionPage.scala | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/ExecutionPage.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/ExecutionPage.scala index f0b56c2eb7..a4dbd2e197 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/ExecutionPage.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/ExecutionPage.scala @@ -74,16 +74,14 @@ private[sql] class ExecutionPage(parent: SQLTab) extends WebUIPage("execution") }} </li> }} - <li> - <strong>Detail: </strong><br/> - <pre>{executionUIData.physicalPlanDescription}</pre> - </li> </ul> </div> val metrics = listener.getExecutionMetrics(executionId) - summary ++ planVisualization(metrics, executionUIData.physicalPlanGraph) + summary ++ + planVisualization(metrics, executionUIData.physicalPlanGraph) ++ + physicalPlanDescription(executionUIData.physicalPlanDescription) }.getOrElse { <div>No information to display for Plan {executionId}</div> } @@ -124,4 +122,23 @@ private[sql] class ExecutionPage(parent: SQLTab) extends WebUIPage("execution") private def jobURL(jobId: Long): String = "%s/jobs/job?id=%s".format(UIUtils.prependBaseUri(parent.basePath), jobId) + + private def physicalPlanDescription(physicalPlanDescription: String): Seq[Node] = { + <div> + <span style="cursor: pointer;" onclick="clickPhysicalPlanDetails();"> + <span id="physical-plan-details-arrow" class="arrow-closed"></span> + <a>Details</a> + </span> + </div> + <div id="physical-plan-details" style="display: none;"> + <pre>{physicalPlanDescription}</pre> + </div> + <script> + function clickPhysicalPlanDetails() {{ + $('#physical-plan-details').toggle(); + $('#physical-plan-details-arrow').toggleClass('arrow-open').toggleClass('arrow-closed'); + }} + </script> + <br/> + } } |