Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6231

JDBC adapter generates "UNNEST" when it should generate "UNNEST ... WITH ORDINALITY"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.37.0
    • None

    Description

      The syntax UNNEST() WITH ORDINALITY is missing the ORDINALITY keyword.

      For example sql:

      select did + 1 from 
      unnest(select collect("department_id") as deptid from "department") 
      with ordinality as t(did, pos)

       
      current planned sql:

      SELECT DEPTID + 1 FROM UNNEST (
      SELECT COLLECT("department_id") AS "DEPTID" FROM "foodmart"."department") 
      AS "t0" ("DEPTID", "ORDINALITY") 

       
      fixed planned sql:

      SELECT "DEPTID" + 1 FROM UNNEST (
      SELECT COLLECT("department_id") AS "DEPTID" FROM "foodmart"."department") 
      WITH ORDINALITY AS "t0" ("DEPTID", "ORDINALITY") 

       

      Attachments

        Issue Links

          Activity

            People

              eveywu EveyWu
              eveywu EveyWu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: