You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by we...@apache.org on 2026/03/25 07:30:33 UTC

(spark) branch master updated: [SPARK-55862][SQL] Rename _LEGACY_ERROR_TEMP_2027 to UNEXPECTED_OPERATOR_IN_CORRELATED_SUBQUERY

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

wenchen 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 4d4f50470670 [SPARK-55862][SQL] Rename _LEGACY_ERROR_TEMP_2027 to UNEXPECTED_OPERATOR_IN_CORRELATED_SUBQUERY
4d4f50470670 is described below

commit 4d4f50470670e851fec951d292fb9d6f0b8e53e4
Author: Mikhail Nikoliukin <mi...@databricks.com>
AuthorDate: Wed Mar 25 15:30:16 2026 +0800

    [SPARK-55862][SQL] Rename _LEGACY_ERROR_TEMP_2027 to UNEXPECTED_OPERATOR_IN_CORRELATED_SUBQUERY
    
    ### What changes were proposed in this pull request?
    
    Rename the legacy error condition `_LEGACY_ERROR_TEMP_2027` to a proper error class `UNEXPECTED_OPERATOR_IN_CORRELATED_SUBQUERY` with SQL state `0A000` (feature not supported).
    
    ### Why are the changes needed?
    
    `_LEGACY_ERROR_TEMP_2027` 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_2027` to `UNEXPECTED_OPERATOR_IN_CORRELATED_SUBQUERY` and now includes SQL state `0A000`. The error message itself remains unchanged.
    
    ### How was this patch tested?
    
    Existing tests.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Code 2.1.70
    
    Closes #54656 from mikhailnik-db/unexpected-operator-in-correlated-subquery.
    
    Authored-by: Mikhail Nikoliukin <mi...@databricks.com>
    Signed-off-by: Wenchen Fan <we...@databricks.com>
---
 common/utils/src/main/resources/error/error-conditions.json   | 11 ++++++-----
 .../org/apache/spark/sql/errors/QueryExecutionErrors.scala    |  4 ++--
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/common/utils/src/main/resources/error/error-conditions.json b/common/utils/src/main/resources/error/error-conditions.json
index e5af5a8a278f..b79184b72ee0 100644
--- a/common/utils/src/main/resources/error/error-conditions.json
+++ b/common/utils/src/main/resources/error/error-conditions.json
@@ -6981,6 +6981,12 @@
     ],
     "sqlState" : "42K09"
   },
+  "UNEXPECTED_OPERATOR_IN_CORRELATED_SUBQUERY" : {
+    "message" : [
+      "Unexpected operator <operator> in correlated subquery<positionHint>."
+    ],
+    "sqlState" : "XX000"
+  },
   "UNEXPECTED_POSITIONAL_ARGUMENT" : {
     "message" : [
       "Cannot invoke routine <routineName> because it contains positional argument(s) following the named argument assigned to <parameterName>; please rearrange them so the positional arguments come first and then retry the query again."
@@ -9368,11 +9374,6 @@
       "Failed to convert value <value> (class of <cls>) with the type of <dataType> to JSON."
     ]
   },
-  "_LEGACY_ERROR_TEMP_2027" : {
-    "message" : [
-      "Unexpected operator <op> in correlated subquery<pos>."
-    ]
-  },
   "_LEGACY_ERROR_TEMP_2028" : {
     "message" : [
       "This line should be unreachable<err>."
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 980272b65feb..9e4583801ba2 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
@@ -548,8 +548,8 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase with ExecutionE
   def unexpectedOperatorInCorrelatedSubquery(
       op: LogicalPlan, pos: String = ""): SparkRuntimeException = {
     new SparkRuntimeException(
-      errorClass = "_LEGACY_ERROR_TEMP_2027",
-      messageParameters = Map("op" -> op.toString(), "pos" -> pos))
+      errorClass = "UNEXPECTED_OPERATOR_IN_CORRELATED_SUBQUERY",
+      messageParameters = Map("operator" -> op.toString(), "positionHint" -> pos))
   }
 
   def resolveCannotHandleNestedSchema(plan: LogicalPlan): SparkRuntimeException = {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org