johanl-db commented on code in PR #41155:
URL: https://github.com/apache/spark/pull/41155#discussion_r1200406987


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -3233,6 +3225,14 @@ private[sql] object QueryCompilationErrors extends 
QueryErrorsBase {
       messageParameters = Map.empty)
   }
 
+  def ambiguousRelationAliasNameInNestedCTEError(name: String): Throwable = {
+    new AnalysisException(
+      errorClass = "_LEGACY_ERROR_TEMP_1348",
+      messageParameters = Map(
+        "name" -> name,

Review Comment:
   👍 



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -3233,6 +3225,14 @@ private[sql] object QueryCompilationErrors extends 
QueryErrorsBase {
       messageParameters = Map.empty)
   }
 
+  def ambiguousRelationAliasNameInNestedCTEError(name: String): Throwable = {
+    new AnalysisException(
+      errorClass = "_LEGACY_ERROR_TEMP_1348",
+      messageParameters = Map(
+        "name" -> name,
+        "config" -> LEGACY_CTE_PRECEDENCE_POLICY.key))

Review Comment:
   👍 



##########
core/src/main/resources/error/error-classes.json:
##########
@@ -3783,6 +3783,12 @@
       "Failed to execute command because subquery expressions are not allowed 
in DEFAULT values."
     ]
   },
+  "_LEGACY_ERROR_TEMP_1348" : {

Review Comment:
   Renamed to `AMBIGUOUS_ALIAS_IN_NESTED_CTE`



##########
core/src/main/resources/error/error-classes.json:
##########
@@ -3783,6 +3783,12 @@
       "Failed to execute command because subquery expressions are not allowed 
in DEFAULT values."
     ]
   },
+  "_LEGACY_ERROR_TEMP_1348" : {
+    "message" : [
+      "Name <name> is ambiguous in nested CTE.",
+      "Please set <config> to CORRECTED so that name defined in inner CTE 
takes precedence. If set it to LEGACY, outer CTE definitions will take 
precedence. See more details in SPARK-28228."

Review Comment:
   I linked to the existing documentation that covers this configuration in the 
migration guide: 
https://spark.apache.org/docs/latest/sql-migration-guide.html#query-engine



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to