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

WITH .. INSERT doesn't work

    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

      This works perfectly fine on e.g. H2, PostgreSQL, SQL Server:

       

      CREATE TABLE t (i int PRIMARY KEY, j int);
      
      WITH 
        a(b) AS (SELECT 1)
      INSERT INTO t (i, j)
      SELECT b, b FROM a;
      
      SELECT * FROM t;
      

      The Ignite documentation claims it should work as well:
      https://ignite.apache.org/docs/latest/sql-reference/dml#with

      Alas, the WITH statement fails with this error:

      SQL Error [1001] [42000]: Failed to parse query. Column "B" not found; SQL statement:
      SELECT
      B,
      B
      FROM (SELECT
      1
      FROM SYSTEM_RANGE(1, 1)) A [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: