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

[jira] [Issue Comment Deleted] (CALCITE-3824) JoinProjectTransposeRule should skip Projects containing windowing expression

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

Jesus Camacho Rodriguez updated CALCITE-3824:
---------------------------------------------
    Comment: was deleted

(was: Fixed in https://github.com/apache/calcite/commit/e427180b6a55445fe246b00c60259a95f96bdbf2. Thanks for your contribution [~vgarg]!)

> JoinProjectTransposeRule should skip Projects containing windowing expression
> -----------------------------------------------------------------------------
>
>                 Key: CALCITE-3824
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3824
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Vineet Garg
>            Assignee: Vineet Garg
>            Priority: Major
>             Fix For: 1.23.0
>
>
> This rule could push windowing expressions within join condition which doesn't make sense.
> For example
> {code:sql}
> select * from dept a 
>      join (select rank() over (order by name) as r, 1 + 1 from dept) as b 
>              on a.name = b.r
> {code}
> Above query produces following plan after the rule
> {code}
> LogicalProject(DEPTNO=[$0], NAME=[$1], R=[$3], EXPR$1=[$4])
>   LogicalProject(DEPTNO=[$0], NAME=[$1], NAME0=[CAST($1):BIGINT NOT NULL], R=[RANK() OVER (ORDER BY $3 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)], EXPR$1=[+(1, 1)])
>     LogicalJoin(condition=[=(CAST($1):BIGINT NOT NULL, RANK() OVER (ORDER BY $3 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW))], joinType=[inner])
>       LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
>       LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
> {code}



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