Skip to content

Commit 0a6fff1

Browse files
UbuntuLuciferYang
authored andcommitted
[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 <aleksandr.chernousov@your.hostname.com> Signed-off-by: yangjie01 <yangjie01@baidu.com>
1 parent 830ac65 commit 0a6fff1

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

common/utils/src/main/resources/error/error-conditions.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6284,6 +6284,12 @@
62846284
},
62856285
"sqlState" : "42703"
62866286
},
6287+
"UNRESOLVED_COLUMN_AMONG_FIELD_NAMES" : {
6288+
"message" : [
6289+
"Cannot resolve column name \"<colName>\" among (<fieldNames>)."
6290+
],
6291+
"sqlState" : "42703"
6292+
},
62876293
"UNRESOLVED_FIELD" : {
62886294
"message" : [
62896295
"A field with name <fieldName> cannot be resolved with the struct-type column <columnPath>."
@@ -8150,11 +8156,6 @@
81508156
"Invalid bound function '<bound>: there are <argsLen> arguments but <inputTypesLen> parameters returned from 'inputTypes()'."
81518157
]
81528158
},
8153-
"_LEGACY_ERROR_TEMP_1201" : {
8154-
"message" : [
8155-
"Cannot resolve column name \"<colName>\" among (<fieldNames>)."
8156-
]
8157-
},
81588159
"_LEGACY_ERROR_TEMP_1205" : {
81598160
"message" : [
81608161
"Expected only partition pruning predicates: <nonPartitionPruningPredicates>."

sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2475,7 +2475,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase with Compilat
24752475
def cannotResolveColumnNameAmongAttributesError(
24762476
colName: String, fieldNames: String): Throwable = {
24772477
new AnalysisException(
2478-
errorClass = "_LEGACY_ERROR_TEMP_1201",
2478+
errorClass = "UNRESOLVED_COLUMN_AMONG_FIELD_NAMES",
24792479
messageParameters = Map(
24802480
"colName" -> colName,
24812481
"fieldNames" -> fieldNames))

0 commit comments

Comments
 (0)