diff options
author | Dongjoon Hyun <dongjoon@apache.org> | 2016-04-03 15:33:29 +0200 |
---|---|---|
committer | Herman van Hovell <hvanhovell@questtec.nl> | 2016-04-03 15:33:29 +0200 |
commit | 1f0c5dcebba1f9d1149043a496e0175f78252bae (patch) | |
tree | a6633b2866a48801b05bc8428d4cfd0f60d69de6 /sql/hive/compatibility/src/test | |
parent | 2262a93358c2f6d4cfb73645c4ebc963c5640ec8 (diff) | |
download | spark-1f0c5dcebba1f9d1149043a496e0175f78252bae.tar.gz spark-1f0c5dcebba1f9d1149043a496e0175f78252bae.tar.bz2 spark-1f0c5dcebba1f9d1149043a496e0175f78252bae.zip |
[SPARK-14350][SQL] EXPLAIN output should be in a single cell
## What changes were proposed in this pull request?
EXPLAIN output should be in a single cell.
**Before**
```
scala> sql("explain select 1").collect()
res0: Array[org.apache.spark.sql.Row] = Array([== Physical Plan ==], [WholeStageCodegen], [: +- Project [1 AS 1#1]], [: +- INPUT], [+- Scan OneRowRelation[]])
```
**After**
```
scala> sql("explain select 1").collect()
res1: Array[org.apache.spark.sql.Row] =
Array([== Physical Plan ==
WholeStageCodegen
: +- Project [1 AS 1#4]
: +- INPUT
+- Scan OneRowRelation[]])
```
Or,
```
scala> sql("explain select 1").head
res1: org.apache.spark.sql.Row =
[== Physical Plan ==
WholeStageCodegen
: +- Project [1 AS 1#5]
: +- INPUT
+- Scan OneRowRelation[]]
```
Please note that `Spark-shell(Scala-shell)` trims long string output. So, you may need to use `println` to get full strings.
```
scala> println(sql("explain codegen select 'a' as a group by 1").head)
[Found 2 WholeStageCodegen subtrees.
== Subtree 1 / 2 ==
WholeStageCodegen
...
/* 059 */ }
/* 060 */ }
]
```
## How was this patch tested?
Pass the Jenkins tests. (Testcases are updated.)
Author: Dongjoon Hyun <dongjoon@apache.org>
Closes #12137 from dongjoon-hyun/SPARK-14350.
Diffstat (limited to 'sql/hive/compatibility/src/test')
0 files changed, 0 insertions, 0 deletions