Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
This rule could push windowing expressions within join condition which doesn't make sense.
For example
select * from dept a join (select rank() over (order by name) as r, 1 + 1 from dept) as b on a.name = b.r
Above query produces following plan after the rule
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]])
Attachments
Issue Links
- links to