Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15301#discussion_r81286160
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala ---
    @@ -168,6 +178,100 @@ class CatalogImpl(sparkSession: SparkSession) extends 
Catalog {
       }
     
       /**
    +   * Find the database with the specified name. This throws an 
[[AnalysisException]] when no
    +   * [[Database]] can be found.
    +   */
    +  override def findDatabase(dbName: String): Database = {
    +    if (sessionCatalog.databaseExists(dbName)) {
    +      makeDatabase(sessionCatalog.getDatabaseMetadata(dbName))
    +    } else {
    +      throw new AnalysisException(s"The specified database $dbName does 
not exist.")
    --- End diff --
    
    How about throwing `NoSuchDatabaseException`? We also have the other 
NoSuchXYZ exceptions. Then, when writing the test cases, we can check these 
specific exception types instead of the general `AnalysisException`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to