[
https://issues.apache.org/jira/browse/CALCITE-1636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15868360#comment-15868360
]
Julian Hyde commented on CALCITE-1636:
--------------------------------------
I agree that it doesn't seem DB2-specific. I changed the abstract.
[[email protected]], Can you review and commit this? You will need to change
the comment to include the JIRA case number, the contributor's name in
parentheses, and a 'Close apache/calcite#xxx' comment to cause the pull request
to be closed. See
https://github.com/apache/calcite/commit/2d7e1f1a6649c085c88f8d81410363800a5b91ae
as an example. If you want to add tests, or change the fix, that's your call.
Just make sure that the contributor retains credit for the work they did.
> JDBC adapter generates wrong SQL for self join with sub-query
> -------------------------------------------------------------
>
> Key: CALCITE-1636
> URL: https://issues.apache.org/jira/browse/CALCITE-1636
> Project: Calcite
> Issue Type: Bug
> Components: jdbc-adapter
> Affects Versions: 1.11.0
> Reporter: Zhiqiang He
> Assignee: Julian Hyde
>
> JDBC adapter generates wrong SQL when selft join with subquery when DB2
> dialect used .
> input sql
> {code:sql}
> select t1."customer_id", t2."customer_id"
> from (select "customer_id" from "sales_fact_1997") as t1
> inner join (select "customer_id" from "sales_fact_1997") t2
> on t1."customer_id" = t2."customer_id"
> {code}
> output sql
> {code:sql}
> SELECT *
> FROM (SELECT sales_fact_1997.customer_id
> FROM foodmart.sales_fact_1997 AS sales_fact_1997) AS t
> INNER JOIN (SELECT sales_fact_19970.customer_id
> FROM foodmart.sales_fact_1997 AS sales_fact_19970) AS t0 ON
> sales_fact_1997.product_id = sales_fact_19970.product_id
> {code}
> sales_fact_1997.product_id = sales_fact_19970.product_id is wrong, can not
> found tables sales_fact_1997 and sales_fact_19970 in ON condition.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)