roczei commented on code in PR #37679: URL: https://github.com/apache/spark/pull/37679#discussion_r979762248
########## sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala: ########## @@ -1932,6 +1932,13 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase { new UnsupportedOperationException(s"$nodeName does not implement doExecuteBroadcast") } + def defaultDatabaseNotExistsError(defaultDatabase: String): Throwable = { + new SparkDefaultDatabaseNotExistsException( Review Comment: Done ########## sql/core/src/main/scala/org/apache/spark/sql/internal/SharedState.scala: ########## @@ -148,13 +148,19 @@ private[sql] class SharedState( val externalCatalog = SharedState.reflect[ExternalCatalog, SparkConf, Configuration]( SharedState.externalCatalogClassName(conf), conf, hadoopConf) - val defaultDbDefinition = CatalogDatabase( - SessionCatalog.DEFAULT_DATABASE, - "default database", - CatalogUtils.stringToURI(conf.get(WAREHOUSE_PATH)), - Map()) // Create default database if it doesn't exist - if (!externalCatalog.databaseExists(SessionCatalog.DEFAULT_DATABASE)) { + // If database name not equals 'default', throw exception + if (!externalCatalog.databaseExists(SQLConf.get.defaultDatabase)) { + if (SessionCatalog.DEFAULT_DATABASE != SQLConf.get.defaultDatabase) { Review Comment: Done -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org