GitHub user maropu opened a pull request:
https://github.com/apache/spark/pull/20247
[SPARK-23021][SQL] AnalysisBarrier should override innerChildren to print
correct explain output
## What changes were proposed in this pull request?
`AnalysisBarrier` in the current master cuts off explain results for parsed
logical plans;
```
scala> Seq((1, 1)).toDF("a",
"b").groupBy("a").count().sample(0.1).explain(true)
== Parsed Logical Plan ==
Sample 0.0, 0.1, false, -7661439431999668039
+- AnalysisBarrier Aggregate [a#5], [a#5, count(1) AS count#14L]
```
To fix this, `AnalysisBarrier` needs to override `innerChildren` and this
pr changed the output to;
```
== Parsed Logical Plan ==
Sample 0.0, 0.1, false, -5086223488015741426
+- AnalysisBarrier
+- Aggregate [a#5], [a#5, count(1) AS count#14L]
+- Project [_1#2 AS a#5, _2#3 AS b#6]
+- LocalRelation [_1#2, _2#3]
```
## How was this patch tested?
Added tests in `DataFrameSuite`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/maropu/spark SPARK-23021-2
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/20247.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 #20247
----
commit 7692099c42907682a5ca10fa6a800fcb1a6e745d
Author: Takeshi Yamamuro <yamamuro@...>
Date: 2018-01-12T14:30:40Z
AnalysisBarrier should not cut off explain output for parsed logical plans
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]