git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SqlValidator can't prohibit the data type of ORDER BY with RANGE prober.


win("window w as (order by ename range ^100^ preceding)")
    .fails("Data type of ORDER BY prohibits use of RANGE clause");

The query will be prohibited in calcite because the ename's type is
varchar(20). But the followed query will be allowed in calcite.

win("window w as (partition by ename order by ename)").ok();

The former window still be range window frame  because RANGE UNBOUNDED
PRECEDING AND CURRENT ROW is used as default for window frame if ROWS/RANGE
is not specified but ORDER BY is specified. So I think the former query
should also be prohibited.

-- 

Regards

John Fang