cloud-fan commented on a change in pull request #35173:
URL: https://github.com/apache/spark/pull/35173#discussion_r782644742



##########
File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/client/VersionsSuite.scala
##########
@@ -275,6 +275,16 @@ class VersionsSuite extends SparkFunSuite with Logging {
 
     test(s"$version: dropDatabase") {
       assert(client.databaseExists("temporary"))
+      client.createTable(table("temporary", tableName = "tbl"), ignoreIfExists 
= false)
+      try {
+        client.dropDatabase("temporary", ignoreIfNotExists = false, cascade = 
false)
+        assert(false, "dropDatabase should throw HiveException")
+      } catch {
+        case ex: Throwable =>
+          
assert(ex.getClass.getName.equals("org.apache.hadoop.hive.ql.metadata.HiveException"))
+          assert(ex.getMessage.contains("Database temporary is not empty"))

Review comment:
       I'm wondering if we should translate the exception in `HiveClientImpl`, 
so that the test can check the exception directly, instead of repeating the 
production code here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to