You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2024/01/29 19:57:00 UTC
[jira] [Updated] (CALCITE-6231) JDBC adapter generates "UNNEST" when it should generate "UNNEST ... WITH ORDINALITY"
[ https://issues.apache.org/jira/browse/CALCITE-6231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Hyde updated CALCITE-6231:
---------------------------------
Summary: JDBC adapter generates "UNNEST" when it should generate "UNNEST ... WITH ORDINALITY" (was: RelToSqlConverter incorrectly convert UNNEST() WITH ORDINALITY)
> JDBC adapter generates "UNNEST" when it should generate "UNNEST ... WITH ORDINALITY"
> ------------------------------------------------------------------------------------
>
> Key: CALCITE-6231
> URL: https://issues.apache.org/jira/browse/CALCITE-6231
> Project: Calcite
> Issue Type: Bug
> Reporter: EveyWu
> Assignee: EveyWu
> Priority: Major
> Labels: pull-request-available
>
> The syntax UNNEST() WITH ORDINALITY is missing the ORDINALITY keyword.
> For example sql:
> {code:java}
> select did + 1 from
> unnest(select collect("department_id") as deptid from "department")
> with ordinality as t(did, pos){code}
>
> current planned sql:
> {code:java}
> SELECT DEPTID + 1 FROM UNNEST (
> SELECT COLLECT("department_id") AS "DEPTID" FROM "foodmart"."department")
> AS "t0" ("DEPTID", "ORDINALITY") {code}
>
> fixed planned sql:
> {code:java}
> SELECT "DEPTID" + 1 FROM UNNEST (
> SELECT COLLECT("department_id") AS "DEPTID" FROM "foodmart"."department")
> WITH ORDINALITY AS "t0" ("DEPTID", "ORDINALITY") {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)