GitHub user clockfly opened a pull request:
https://github.com/apache/spark/pull/13535
[SPARK-15792][SQL] Allows operator to change the verbosity in explain output
## What changes were proposed in this pull request?
This PR allows customization of verbosity in explain output.
After change, `dataframe.explain()` and `dataframe.explain(true)` has
different verbosity output for physical plan.
**For dataframe.explain(extended = false):**
`output=[count(a)#85L]` is **NOT** displayed for physical plan.
```
scala> Seq((1,2,3)).toDF("a", "b", "c").createTempView("df2")
scala> spark.sql("select count(a) from df2").explain()
== Physical Plan ==
*HashAggregate(key=[], functions=[count(1)])
+- Exchange SinglePartition
+- *HashAggregate(key=[], functions=[partial_count(1)])
+- LocalTableScan
```
**For dataframe.explain(extended = true):**
`output=[count(a)#85L]` is displayed for physical plan.
```
scala> spark.sql("select count(a) from df2").explain(true) //
"output=[count(a)#85L]" is added
...
== Physical Plan ==
*HashAggregate(key=[], functions=[count(1)], output=[count(a)#85L])
+- Exchange SinglePartition
+- *HashAggregate(key=[], functions=[partial_count(1)],
output=[count#87L])
+- LocalTableScan
```
## How was this patch tested?
Manual test.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/clockfly/spark verbose_breakdown_2
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/13535.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #13535
----
commit 1e1e4418003cc13b0e2a118a315f6aa2422c3f14
Author: Sean Zhong <[email protected]>
Date: 2016-05-27T18:54:36Z
Improve the aggregate output.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]