You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Danny Chen (Jira)" <ji...@apache.org> on 2020/10/12 11:46:00 UTC

[jira] [Updated] (CALCITE-4333) The Sort rel should be decorrelated even though it has fetch or limit when its parent is not a Correlate

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

Danny Chen updated CALCITE-4333:
--------------------------------
    Description: 
Check this test in SqlToRelConverterTest:
{code:java}
@Test void testSortLimitWithCorrelateInput() {
    final String sql = "" +
        "SELECT deptno, ename\n" +
        "    FROM\n" +
        "        (SELECT DISTINCT deptno FROM emp) t1,\n" +
        "          LATERAL (\n" +
        "            SELECT ename, sal\n" +
        "            FROM emp\n" +
        "            WHERE deptno = t1.deptno)\n" +
        "    ORDER BY ename DESC\n" +
        "    LIMIT 3";
    sql(sql).ok();
  }
{code}


> The Sort rel should be decorrelated even though it has fetch or limit when its parent is not a Correlate
> --------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4333
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4333
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.26.0
>            Reporter: Danny Chen
>            Assignee: Danny Chen
>            Priority: Major
>             Fix For: 1.27.0
>
>
> Check this test in SqlToRelConverterTest:
> {code:java}
> @Test void testSortLimitWithCorrelateInput() {
>     final String sql = "" +
>         "SELECT deptno, ename\n" +
>         "    FROM\n" +
>         "        (SELECT DISTINCT deptno FROM emp) t1,\n" +
>         "          LATERAL (\n" +
>         "            SELECT ename, sal\n" +
>         "            FROM emp\n" +
>         "            WHERE deptno = t1.deptno)\n" +
>         "    ORDER BY ename DESC\n" +
>         "    LIMIT 3";
>     sql(sql).ok();
>   }
> {code}



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