From 3096befa8156b9f323193d7d8513e7cf293bad81 Mon Sep 17 00:00:00 2001 From: JineHelin404 <605188046@qq.com> Date: Fri, 5 May 2023 11:42:51 +0800 Subject: [PATCH] change error class _LEGACY_ERROR_TEMP_1206 to COLUMN_NOT_DEFINED --- core/src/main/resources/error/error-classes.json | 2 +- .../org/apache/spark/sql/errors/QueryCompilationErrors.scala | 2 +- .../org/apache/spark/sql/execution/command/DDLSuite.scala | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/resources/error/error-classes.json b/core/src/main/resources/error/error-classes.json index 4eea5f9684e94..f15ef3ec134f9 100644 --- a/core/src/main/resources/error/error-classes.json +++ b/core/src/main/resources/error/error-classes.json @@ -3136,7 +3136,7 @@ "Expected only partition pruning predicates: ." ] }, - "_LEGACY_ERROR_TEMP_1206" : { + "COLUMN_NOT_DEFINED" : { "message" : [ " column is not defined in table , defined table columns are: ." ] 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 e1a09a4f84389..37b58634bc32c 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 @@ -2115,7 +2115,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase { def columnNotDefinedInTableError( colType: String, colName: String, tableName: String, tableCols: Seq[String]): Throwable = { new AnalysisException( - errorClass = "_LEGACY_ERROR_TEMP_1206", + errorClass = "COLUMN_NOT_DEFINED", messageParameters = Map( "colType" -> colType, "colName" -> colName, diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala index 88f22023e34ef..85474e1a925bf 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala @@ -534,7 +534,7 @@ abstract class DDLSuite extends QueryTest with DDLSuiteBase { exception = intercept[AnalysisException] { sql("CREATE TABLE tbl(a int, b string) USING json PARTITIONED BY (c)") }, - errorClass = "_LEGACY_ERROR_TEMP_1206", + errorClass = "COLUMN_NOT_DEFINED", parameters = Map( "colType" -> "partition", "colName" -> "c", @@ -547,7 +547,7 @@ abstract class DDLSuite extends QueryTest with DDLSuiteBase { exception = intercept[AnalysisException] { sql("CREATE TABLE tbl(a int, b string) USING json CLUSTERED BY (c) INTO 4 BUCKETS") }, - errorClass = "_LEGACY_ERROR_TEMP_1206", + errorClass = "COLUMN_NOT_DEFINED", parameters = Map( "colType" -> "bucket", "colName" -> "c",