[jira] [Commented] (CALCITE-6231) JDBC adapter generates "UNNEST" when it should generate "UNNEST ... WITH ORDINALITY"

2024-01-30 Thread hongyu guo (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17812562#comment-17812562
 ] 

hongyu guo commented on CALCITE-6231:
-

Fix in 
[351ddeb4|https://github.com/apache/calcite/commit/351ddeb47b8dfb5c196c563920290a79575e9864].

[~eveywu] Thanks for your contribution!

> 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)


[jira] [Commented] (CALCITE-6231) JDBC adapter generates "UNNEST" when it should generate "UNNEST ... WITH ORDINALITY"

2024-01-30 Thread EveyWu (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17812268#comment-17812268
 ] 

 EveyWu commented on CALCITE-6231:
--

[~julianhyde] thanks for the modification,I have changed the pr commit message 
to the latest summary

> 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)


[jira] [Commented] (CALCITE-6231) JDBC adapter generates "UNNEST" when it should generate "UNNEST ... WITH ORDINALITY"

2024-01-29 Thread Julian Hyde (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-6231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17812039#comment-17812039
 ] 

Julian Hyde commented on CALCITE-6231:
--

My concern was that end-users have not heard about RelToSqlConverter, because 
it is a software component. They just know that the JDBC adapter is generating 
the wrong SQL. I have changed the summary accordingly.

> 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)