This is an automated email from the ASF dual-hosted git repository.

yangjie01 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 0a6fff18db6b [SPARK-54492][SQL] Rename _LEGACY_ERROR_TEMP_1201 and add 
sqlState
0a6fff18db6b is described below

commit 0a6fff18db6b9cf47aa37577b94d5dce8fb84dbc
Author: Ubuntu <[email protected]>
AuthorDate: Fri Nov 28 19:24:13 2025 +0800

    [SPARK-54492][SQL] Rename _LEGACY_ERROR_TEMP_1201 and add sqlState
    
    ### What changes were proposed in this pull request?
    
    I rename _LEGACY_ERROR_TEMP_1201 to more understandable name 
(UNRESOLVED_COLUMN_AMONG_FIELD_NAMES) and add sqlState
    
    ### Why are the changes needed?
    
    This is a frequent error that is not classified
    
    ### Does this PR introduce _any_ user-facing change?
    
    No
    
    ### How was this patch tested?
    
    This is a small refactoring, tests are already there
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No
    
    Closes #53197 from aleksandr-chernousov-db/le_1201.
    
    Authored-by: Ubuntu <[email protected]>
    Signed-off-by: yangjie01 <[email protected]>
---
 common/utils/src/main/resources/error/error-conditions.json   | 11 ++++++-----
 .../org/apache/spark/sql/errors/QueryCompilationErrors.scala  |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/common/utils/src/main/resources/error/error-conditions.json 
b/common/utils/src/main/resources/error/error-conditions.json
index 2017f1fc331e..8da9896ead8e 100644
--- a/common/utils/src/main/resources/error/error-conditions.json
+++ b/common/utils/src/main/resources/error/error-conditions.json
@@ -6284,6 +6284,12 @@
     },
     "sqlState" : "42703"
   },
+  "UNRESOLVED_COLUMN_AMONG_FIELD_NAMES" : {
+    "message" : [
+      "Cannot resolve column name \"<colName>\" among (<fieldNames>)."
+    ],
+    "sqlState" : "42703"
+  },
   "UNRESOLVED_FIELD" : {
     "message" : [
       "A field with name <fieldName> cannot be resolved with the struct-type 
column <columnPath>."
@@ -8150,11 +8156,6 @@
       "Invalid bound function '<bound>: there are <argsLen> arguments but 
<inputTypesLen> parameters returned from 'inputTypes()'."
     ]
   },
-  "_LEGACY_ERROR_TEMP_1201" : {
-    "message" : [
-      "Cannot resolve column name \"<colName>\" among (<fieldNames>)."
-    ]
-  },
   "_LEGACY_ERROR_TEMP_1205" : {
     "message" : [
       "Expected only partition pruning predicates: 
<nonPartitionPruningPredicates>."
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 77b775f6c49f..6ec16b8eaa3a 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
@@ -2475,7 +2475,7 @@ private[sql] object QueryCompilationErrors extends 
QueryErrorsBase with Compilat
   def cannotResolveColumnNameAmongAttributesError(
       colName: String, fieldNames: String): Throwable = {
     new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1201",
+      errorClass = "UNRESOLVED_COLUMN_AMONG_FIELD_NAMES",
       messageParameters = Map(
         "colName" -> colName,
         "fieldNames" -> fieldNames))


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

Reply via email to