diff options
author | Dilip Biswal <dbiswal@us.ibm.com> | 2015-10-29 18:29:50 +0100 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2015-10-29 18:29:50 +0100 |
commit | 8185f038c13c72e1bea7b0921b84125b7a352139 (patch) | |
tree | 3f476d7a339db0d25f3132f0d51205b899d9b7ff /sql/hive-thriftserver/src/test | |
parent | f7a51deebad1b4c3b970a051f25d286110b94438 (diff) | |
download | spark-8185f038c13c72e1bea7b0921b84125b7a352139.tar.gz spark-8185f038c13c72e1bea7b0921b84125b7a352139.tar.bz2 spark-8185f038c13c72e1bea7b0921b84125b7a352139.zip |
[SPARK-11188][SQL] Elide stacktraces in bin/spark-sql for AnalysisExceptions
Only print the error message to the console for Analysis Exceptions in sql-shell.
Author: Dilip Biswal <dbiswal@us.ibm.com>
Closes #9194 from dilipbiswal/spark-11188.
Diffstat (limited to 'sql/hive-thriftserver/src/test')
-rw-r--r-- | sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala index 76d1591a23..3fa5c8528b 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala @@ -58,7 +58,7 @@ class CliSuite extends SparkFunSuite with BeforeAndAfter with Logging { * @param timeout maximum time for the commands to complete * @param extraArgs any extra arguments * @param errorResponses a sequence of strings whose presence in the stdout of the forked process - * is taken as an immediate error condition. That is: if a line beginning + * is taken as an immediate error condition. That is: if a line containing * with one of these strings is found, fail the test immediately. * The default value is `Seq("Error:")` * @@ -104,7 +104,7 @@ class CliSuite extends SparkFunSuite with BeforeAndAfter with Logging { } } else { errorResponses.foreach { r => - if (line.startsWith(r)) { + if (line.contains(r)) { foundAllExpectedAnswers.tryFailure( new RuntimeException(s"Failed with error line '$line'")) } @@ -219,4 +219,12 @@ class CliSuite extends SparkFunSuite with BeforeAndAfter with Logging { -> "OK" ) } + + test("SPARK-11188 Analysis error reporting") { + runCliWithin(timeout = 2.minute, + errorResponses = Seq("AnalysisException"))( + "select * from nonexistent_table;" + -> "Error in query: Table not found: nonexistent_table;" + ) + } } |