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

CTE outer reference nested in CTE main body cannot be resolved

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.3.0
    • 3.3.1, 3.4.0
    • SQL
    • None

    Description

      AnalysisException "Table or view not found" is thrown when a CTE reference occurs in an inner CTE definition nested in the outer CTE's main body FROM clause. E.g.,

      WITH cte_outer AS (
        SELECT 1
      )
      SELECT * FROM (
        WITH cte_inner AS (
          SELECT * FROM cte_outer
        )
        SELECT * FROM cte_inner
      )
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            maryannxue Wei Xue
            maryannxue Wei Xue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment