Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-43487

Wrong error message used for `ambiguousRelationAliasNameInNestedCTEError`

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.4.0
    • 3.5.0
    • Spark Core
    • None

    Description

      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 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.

      Attachments

        Activity

          People

            johanl-db Johan Lasperas
            johanl-db Johan Lasperas
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: