You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Zhiqiang He (JIRA)" <ji...@apache.org> on 2017/01/18 03:54:27 UTC

[jira] [Updated] (CALCITE-1586) wrong rel-to-sql conversion when performing set operation more then two inputs.

     [ https://issues.apache.org/jira/browse/CALCITE-1586?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zhiqiang He updated CALCITE-1586:
---------------------------------
    Description: 
in union example, after UnionMergeRule, the union input is convert to three input, and rel to sql convert result is wrong.

inputsql
 {quote}
 SELECT *
FROM (SELECT \"product_id\"
FROM \"foodmart\".\"product\"
UNION ALL
SELECT \"product_id\"
FROM \"foodmart\".\"sales_fact_1997\")
UNION ALL
SELECT \"product_class_id\" AS \"PRODUCT_ID\"
FROM \"foodmart\".\"product_class\"
{quote}
output sql
{quote}
SELECT \"product_id\"
FROM \"foodmart\".\"product\"
UNION ALL
SELECT \"product_id\"
FROM \"foodmart\".\"sales_fact_199
{quote}
on union query is lost.


  was:

in union example, after UnionMergeRule, the union input is convert to three input, and rel to sql convert result is wrong.

inputsql
 
 SELECT *
FROM (SELECT \"product_id\"
FROM \"foodmart\".\"product\"
UNION ALL
SELECT \"product_id\"
FROM \"foodmart\".\"sales_fact_1997\")
UNION ALL
SELECT \"product_class_id\" AS \"PRODUCT_ID\"
FROM \"foodmart\".\"product_class\"

output sql

SELECT \"product_id\"
FROM \"foodmart\".\"product\"
UNION ALL
SELECT \"product_id\"
FROM \"foodmart\".\"sales_fact_199

on union query is lost.



> wrong rel-to-sql conversion when performing set operation more then two inputs.
> -------------------------------------------------------------------------------
>
>                 Key: CALCITE-1586
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1586
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.10.0
>         Environment: NA
>            Reporter: Zhiqiang He
>            Assignee: Julian Hyde
>            Priority: Critical
>
> in union example, after UnionMergeRule, the union input is convert to three input, and rel to sql convert result is wrong.
> inputsql
>  {quote}
>  SELECT *
> FROM (SELECT \"product_id\"
> FROM \"foodmart\".\"product\"
> UNION ALL
> SELECT \"product_id\"
> FROM \"foodmart\".\"sales_fact_1997\")
> UNION ALL
> SELECT \"product_class_id\" AS \"PRODUCT_ID\"
> FROM \"foodmart\".\"product_class\"
> {quote}
> output sql
> {quote}
> SELECT \"product_id\"
> FROM \"foodmart\".\"product\"
> UNION ALL
> SELECT \"product_id\"
> FROM \"foodmart\".\"sales_fact_199
> {quote}
> on union query is lost.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)