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

Cannot reference CTE from within derived table

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.9.1
    • Fix Version/s: None
    • Component/s: sql
    • Labels:
      None
    • Ignite Flags:
      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

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

              Dates

              • Created:
                Updated: