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

[jira] [Created] (CALCITE-3664) Lost sort in subquery when converting SqlNode to Relnode

Wang Yanlin created CALCITE-3664:
------------------------------------

             Summary: Lost sort in subquery 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


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)