Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Having parenthesis around window would produce wrong result. For example,
select empno, sum(empno) over (w), count(*) over w from emp window w as (partition by empno order by empno)
Notice that the second select item has parenthesis in the window clause. This query would generate a wrong plan:
LogicalProject(EMPNO=[$0], $1=[$9], $2=[$10]) LogicalWindow(window#0=[window(partition {} order by [0] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [SUM($0)])], window#1=[window(partition {0} order by [0] range between UNBOUNDED PRECEDING and CURRENT ROW aggs [COUNT()])]) LogicalTableScan(table=[[CATALOG, SALES, EMP]])
where we have two windows in the LogicalWindow.