diff --git a/common/utils/src/main/resources/error/error-conditions.json b/common/utils/src/main/resources/error/error-conditions.json index f9cdeb7e3fafa..68ccf7244cc39 100644 --- a/common/utils/src/main/resources/error/error-conditions.json +++ b/common/utils/src/main/resources/error/error-conditions.json @@ -3477,6 +3477,12 @@ }, "sqlState" : "XX000" }, + "MISSING_DATABASE_FOR_V1_SESSION_CATALOG" : { + "message" : [ + "Database name is not specified in the v1 session catalog. Please ensure to provide a valid database name when interacting with the v1 catalog." + ], + "sqlState" : "3F000" + }, "MISSING_GROUP_BY" : { "message" : [ "The query does not include a GROUP BY clause. Add GROUP BY or turn it into the window functions using OVER clauses." @@ -6157,11 +6163,6 @@ "Cannot rename a table with ALTER VIEW. Please use ALTER TABLE instead." ] }, - "_LEGACY_ERROR_TEMP_1125" : { - "message" : [ - "Database from v1 session catalog is not specified." - ] - }, "_LEGACY_ERROR_TEMP_1126" : { "message" : [ "Nested databases are not supported by v1 session catalog: ." diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala index acee5c2a86e10..8332d82b7a7b8 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala @@ -1607,7 +1607,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase with Compilat def databaseFromV1SessionCatalogNotSpecifiedError(): Throwable = { new AnalysisException( - errorClass = "_LEGACY_ERROR_TEMP_1125", + errorClass = "MISSING_DATABASE_FOR_V1_SESSION_CATALOG", messageParameters = Map.empty) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala index 001267a37d382..92bea4d8655c5 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala @@ -102,7 +102,7 @@ trait ShowTablesSuiteBase extends command.ShowTablesSuiteBase with command.Tests exception = intercept[AnalysisException] { sql(showTableCmd) }, - condition = "_LEGACY_ERROR_TEMP_1125", + condition = "MISSING_DATABASE_FOR_V1_SESSION_CATALOG", parameters = Map.empty ) }