From 8341f1de31e19b13d0f5448a355824159a2a029b Mon Sep 17 00:00:00 2001 From: Mikhail Nikoliukin Date: Fri, 6 Mar 2026 11:56:49 +0000 Subject: [PATCH] [SPARK-55861][SQL] Rename _LEGACY_ERROR_TEMP_2045 to UNSUPPORTED_TABLE_CHANGE ### What changes were proposed in this pull request? Rename the legacy error condition `_LEGACY_ERROR_TEMP_2045` to a proper error class `UNSUPPORTED_TABLE_CHANGE` with SQL state `0A000` (feature not supported). ### Why is the change needed? `_LEGACY_ERROR_TEMP_2045` is a legacy placeholder error name. It should be replaced with a descriptive error class name and assigned a proper SQL state to improve error reporting and comply with the ANSI SQL standard. ### Does this PR introduce _any_ user-facing change? Yes. The error condition name changes from `_LEGACY_ERROR_TEMP_2045` to `UNSUPPORTED_TABLE_CHANGE` and now includes SQL state `0A000`. The error message itself remains unchanged: "Unsupported table change: ". ### How was this patch tested? Existing tests. Closes #XXXXX from mnikol/SPARK-55861-unsupported-table-change. Co-Authored-By: Claude Opus 4.6 --- .../src/main/resources/error/error-conditions.json | 11 ++++++----- .../spark/sql/errors/QueryExecutionErrors.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 8f82244e1987c..3baf9e6185fc7 100644 --- a/common/utils/src/main/resources/error/error-conditions.json +++ b/common/utils/src/main/resources/error/error-conditions.json @@ -7664,6 +7664,12 @@ }, "sqlState" : "0A000" }, + "UNSUPPORTED_TABLE_CHANGE" : { + "message" : [ + "Unsupported table change: " + ], + "sqlState" : "0A000" + }, "UNSUPPORTED_TABLE_CHANGES_IN_AUTO_SCHEMA_EVOLUTION" : { "message" : [ "Operation could not apply the following schema changes to table because the catalog did not support or only partially applied them: ." @@ -9015,11 +9021,6 @@ " is not implemented." ] }, - "_LEGACY_ERROR_TEMP_2045" : { - "message" : [ - "Unsupported table change: " - ] - }, "_LEGACY_ERROR_TEMP_2046" : { "message" : [ "[BUG] Not a DataSourceRDDPartition: ." diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala index 8985bdb519d19..717dc70922396 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala @@ -718,7 +718,7 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase with ExecutionE def unsupportedTableChangeError(e: IllegalArgumentException): Throwable = { new SparkException( - errorClass = "_LEGACY_ERROR_TEMP_2045", + errorClass = "UNSUPPORTED_TABLE_CHANGE", messageParameters = Map("message" -> e.getMessage), cause = e) }