You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Wang Yanlin (Jira)" <ji...@apache.org> on 2020/01/02 09:51:00 UTC

[jira] [Updated] (CALCITE-3664) Sort in subquery is lost when converting SqlNode to Relnode

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

Wang Yanlin updated CALCITE-3664:
---------------------------------
    Summary: Sort in subquery is lost when converting SqlNode to Relnode  (was: Lost sort in subquery when converting SqlNode to Relnode)

> Sort in subquery is lost when converting SqlNode to Relnode
> -----------------------------------------------------------
>
>                 Key: CALCITE-3664
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3664
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Wang Yanlin
>            Assignee: Wang Yanlin
>            Priority: Major
>
> Lost sort in subquery when converting a SqlNode to Relnode, making its semantics changed.
>  The test case to reproduce
> {code:java}
> // SqlToRelConverterTest
> @Test public void testSortInSubquery() {
>     final String sql = "select ename from (select ename from emp order by ename) a";
>     sql(sql).ok();
>   }
> {code}
> This test case will success with this plan.
> {code:java}
> <TestCase name="testSortInSubquery">
>         <Resource name="sql">
>             <![CDATA[select ename from (select ename from emp order by ename) a]]>
>         </Resource>
>         <Resource name="plan">
>             <![CDATA[
> LogicalProject(ENAME=[$1])
>   LogicalTableScan(table=[[CATALOG, SALES, EMP]])
> ]]>
>         </Resource>
>     </TestCase>
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)