Skip to content

Conversation

@liancheng
Copy link
Contributor

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]

@liancheng liancheng changed the title Don't throw TreeNodeException in execution.ExplainCommand [SPARK-2059][SQL] Don't throw TreeNodeException in execution.ExplainCommand Jul 3, 2014
@AmplabJenkins
Copy link

Merged build triggered.

@AmplabJenkins
Copy link

Merged build started.

@AmplabJenkins
Copy link

Merged build finished.

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16314/

@rxin
Copy link
Contributor

rxin commented Jul 3, 2014

Can you paste the error messages thrown by this?

@liancheng
Copy link
Contributor Author

Added example error message in the PR description. Maybe I should just merge #1265 here so that you can merge them altogether?

@rxin
Copy link
Contributor

rxin commented Jul 4, 2014

It's probably ok to break them into two.

Jenkins, retest this please.

@rxin
Copy link
Contributor

rxin commented Jul 4, 2014

Jenkins, retest this please.

@AmplabJenkins
Copy link

Merged build triggered.

@AmplabJenkins
Copy link

Merged build started.

@AmplabJenkins
Copy link

Merged build finished. All automated tests passed.

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16336/

@rxin
Copy link
Contributor

rxin commented Jul 4, 2014

Thanks. I'm merging this in master and branch-1.0.

asfgit pushed a commit that referenced this pull request Jul 4, 2014
…Command`

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 <[email protected]>

Closes #1294 from liancheng/safe-explain and squashes the following commits:

4318911 [Cheng Lian] Don't throw TreeNodeException in `execution.ExplainCommand`

(cherry picked from commit 5448804)
Signed-off-by: Reynold Xin <[email protected]>
@asfgit asfgit closed this in 5448804 Jul 4, 2014
asfgit pushed a commit that referenced this pull request Jul 4, 2014
…Command`

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 <[email protected]>

Closes #1294 from liancheng/safe-explain and squashes the following commits:

4318911 [Cheng Lian] Don't throw TreeNodeException in `execution.ExplainCommand`

(cherry picked from commit 5448804)
Signed-off-by: Reynold Xin <[email protected]>
@liancheng liancheng deleted the safe-explain branch July 6, 2014 02:21
xiliu82 pushed a commit to xiliu82/spark that referenced this pull request Sep 4, 2014
…Command`

This is a fix for the problem revealed by PR apache#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 apache#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 <[email protected]>

Closes apache#1294 from liancheng/safe-explain and squashes the following commits:

4318911 [Cheng Lian] Don't throw TreeNodeException in `execution.ExplainCommand`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants