Skip to content

Commit cea5b05

Browse files
committed
Implement code review comments
1 parent 0c68926 commit cea5b05

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,8 @@ private[hive] class SparkSQLCLIDriver extends CliDriver with Logging {
313313
// For analysis exception, only the error is printed out to the console.
314314
rc.getException() match {
315315
case e : AnalysisException =>
316-
console.printError(
317-
s"""Failed with exception ${e.getClass.getName}: ${e.getMessage}""")
318-
case _ => {
319-
console.printError(rc.getErrorMessage())
320-
}
316+
console.printError(s"""Error in query: ${e.getMessage}""")
317+
case _ => console.printError(rc.getErrorMessage())
321318
}
322319
driver.close()
323320
return ret

sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,11 @@ class CliSuite extends SparkFunSuite with BeforeAndAfter with Logging {
219219
-> "OK"
220220
)
221221
}
222+
223+
test("SPARK-11188: Analysis error reporting") {
224+
runCliWithin(2.minute)(
225+
"select * from nonexistent_table;"
226+
-> "Error in query: no such table nonexistent_table;"
227+
)
228+
}
222229
}

0 commit comments

Comments
 (0)