diff options
author | Cheng Lian <lian.cs.zju@gmail.com> | 2014-07-03 23:41:54 -0700 |
---|---|---|
committer | Reynold Xin <rxin@apache.org> | 2014-07-03 23:41:54 -0700 |
commit | 544880457de556d1ad52e8cb7e1eca19da95f517 (patch) | |
tree | c8be1b1595362ca6ee15dc71eddf9926c6d0cce8 /repl/src/main/scala/org | |
parent | 97a0bfe1c0261384f09d53f9350de52fb6446d59 (diff) | |
download | spark-544880457de556d1ad52e8cb7e1eca19da95f517.tar.gz spark-544880457de556d1ad52e8cb7e1eca19da95f517.tar.bz2 spark-544880457de556d1ad52e8cb7e1eca19da95f517.zip |
[SPARK-2059][SQL] Don't throw TreeNodeException in `execution.ExplainCommand`
This is a fix for the problem revealed by PR #1265.
Currently `HiveComparisonSuite` ignores output of `ExplainCommand` since Catalyst query plan is quite different from Hive query plan. But exceptions throw from `CheckResolution` still breaks test cases. This PR catches any `TreeNodeException` and reports it as part of the query explanation.
After merging this PR, PR #1265 can also be merged safely.
For a normal query:
```
scala> hql("explain select key from src").foreach(println)
...
[Physical execution plan:]
[HiveTableScan [key#9], (MetastoreRelation default, src, None), None]
```
For a wrong query with unresolved attribute(s):
```
scala> hql("explain select kay from src").foreach(println)
...
[Error occurred during query planning: ]
[Unresolved attributes: 'kay, tree:]
[Project ['kay]]
[ LowerCaseSchema ]
[ MetastoreRelation default, src, None]
```
Author: Cheng Lian <lian.cs.zju@gmail.com>
Closes #1294 from liancheng/safe-explain and squashes the following commits:
4318911 [Cheng Lian] Don't throw TreeNodeException in `execution.ExplainCommand`
Diffstat (limited to 'repl/src/main/scala/org')
0 files changed, 0 insertions, 0 deletions