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

Alessandro Solimando reassigned CALCITE-6983:
---------------------------------------------

    Assignee: juntaozhang

> SortJoinTransposeRule should not push SORT past a UNION when SORT's fetch is 
> DynamicParam
> -----------------------------------------------------------------------------------------
>
>                 Key: CALCITE-6983
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6983
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.39.0
>            Reporter: Roman Churganov
>            Assignee: juntaozhang
>            Priority: Blocker
>              Labels: pull-request-available
>             Fix For: 1.40.0
>
>
> An issue with `SortJoinTransposeRule`, which is the same as in 
> `SortUnionTransposeRule ` has been fixed in CALCITE-6647 .  Can be reproduced 
> with a query like:
> {code:sql}
> SELECT t5.fn1, t8.m_fn 
> FROM (
>           SELECT id AS fn1 FROM foo WHERE sd = ?
>      UNION SELECT id FROM bar  WHERE d = ?
>      UNION SELECT id  FROM baz  WHERE id  =  ?  ) AS t5
> LEFT JOIN (SELECT id AS m_fn FROM (
>             SELECT id, aoguid FROM foo2
>                WHERE EXISTS (SELECT 1 FROM (
>                   SELECT buildnum AS fn2 FROM v1_dhouse) AS t7 WHERE aoguid = 
> t7.fn2 ) ) AS t  ) AS t8 
>        ON t5.fn1 = t8.m_fn 
> FETCH NEXT ? ROWS ONLY
> {code}
> which hangs on building  a plan, with a debug log can see growing plans, 
> eventually it fails with StackOverflow..., 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to