johanl-db opened a new pull request, #41155: URL: https://github.com/apache/spark/pull/41155
### What changes were proposed in this pull request? The batch of errors migrated to error classes as part of spark-40540 contains an error that got mixed up with the wrong error message: [ambiguousRelationAliasNameInNestedCTEError](https://github.com/apache/spark/commit/43a6b932759865c45ccf36f3e9cf6898c1b762da#diff-744ac13f6fe074fddeab09b407404bffa2386f54abc83c501e6e1fe618f6db56R1983) uses the same error message as the following commandUnsupportedInV2TableError: WITH t AS (SELECT 1), t2 AS ( WITH t AS (SELECT 2) SELECT * FROM t) SELECT * FROM t2; AnalysisException: t is not supported for v2 tables The error should be: AnalysisException: Name tis ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy 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. ### Does this PR introduce _any_ user-facing change? Fix user-facing error message for ambiguous name in nested CTEs. ### How was this patch tested? -- 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]
