diff options
author | Michael Armbrust <michael@databricks.com> | 2015-02-10 17:32:42 -0800 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2015-02-10 17:32:42 -0800 |
commit | 6195e2473b98253ccc9edc3d624ba2bf59ffc398 (patch) | |
tree | 33afc671375362f703028c8c96521198cb57cc17 /sql/hive | |
parent | aaf50d05c7616e4f8f16654b642500ae06cdd774 (diff) | |
download | spark-6195e2473b98253ccc9edc3d624ba2bf59ffc398.tar.gz spark-6195e2473b98253ccc9edc3d624ba2bf59ffc398.tar.bz2 spark-6195e2473b98253ccc9edc3d624ba2bf59ffc398.zip |
[SQL] Add an exception for analysis errors.
Also start from the bottom so we show the first error instead of the top error.
Author: Michael Armbrust <michael@databricks.com>
Closes #4439 from marmbrus/analysisException and squashes the following commits:
45862a0 [Michael Armbrust] fix hive test
a773bba [Michael Armbrust] Merge remote-tracking branch 'origin/master' into analysisException
f88079f [Michael Armbrust] update more cases
fede90a [Michael Armbrust] newline
fbf4bc3 [Michael Armbrust] move to sql
6235db4 [Michael Armbrust] [SQL] Add an exception for analysis errors.
Diffstat (limited to 'sql/hive')
-rw-r--r-- | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveResolutionSuite.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveResolutionSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveResolutionSuite.scala index ff8130ae5f..ab5f9cdddf 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveResolutionSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveResolutionSuite.scala @@ -17,6 +17,7 @@ package org.apache.spark.sql.hive.execution +import org.apache.spark.sql.AnalysisException import org.apache.spark.sql.hive.test.TestHive.{sparkContext, jsonRDD, sql} import org.apache.spark.sql.hive.test.TestHive.implicits._ @@ -40,7 +41,7 @@ class HiveResolutionSuite extends HiveComparisonTest { """{"a": [{"b": 1, "B": 2}]}""" :: Nil)).registerTempTable("nested") // there are 2 filed matching field name "b", we should report Ambiguous reference error - val exception = intercept[RuntimeException] { + val exception = intercept[AnalysisException] { sql("SELECT a[0].b from nested").queryExecution.analyzed } assert(exception.getMessage.contains("Ambiguous reference to fields")) |