Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-14189

Cannot reference CTE from within derived table

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.9.1
    • None
    • sql
    • None
    • Docs Required, Release Notes Required

    Description

      The following query doesn't work:

      WITH t(a, b) AS (SELECT 1, 'a')
      SELECT *
      FROM (SELECT * FROM t) t;

      It produces this error:

      SQL Error [1001] [42000]: Failed to parse query. Column "T.A" not found; SQL statement:
      CREATE FORCE VIEW PUBLIC._352 AS
      SELECT
       T.A,
       T.B
      FROM (
       SELECT
       1,
       'a'
       FROM SYSTEM_RANGE(1, 1)
      ) T [42122-197]

      Attachments

        Activity

          People

            Unassigned Unassigned
            lukas.eder Lukas Eder
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: