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

juntaozhang commented on CALCITE-6983:
--------------------------------------

hi. [~nobigo] ,

Thanks for your guidance.

Sorry for misunderstanding of this jira,  the previous 
[PR|https://github.com/apache/calcite/pull/4338] only focus on solve the 
StackOverflow, which not conform to the usage specification of preparestatement 
and [~rrrrrr111] 's intention.

Here is a anther [GitHub Pull Request 
#4344|https://github.com/apache/calcite/pull/4344] which follow the statement. 
Can you help review?

Many thanks.

> 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
>            Priority: Blocker
>              Labels: pull-request-available
>
> 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