【详述】视图中包含窗口函数,并涉及ignore nulls关键字时,创建后的视图会去掉ignore nulls,导致视图结果与原sql结果不符
【背景】创建视图
【业务影响】
【是否存算分离】否
【StarRocks版本】3.4.2
【集群规模】1fe+3be
【联系方式】crouch123@qq.com
创建视图语句为:
create view v_test
as
select *,
last_value(score IGNORE NULLS)
over (
partition by subject
order by score desc
rows between unbounded preceding and unbounded following
) as last
from scores;
通过show create view v_test查看视图的创建语句为:
create view v_test
as
select *,
last_value(score)
over (
partition by subject
order by score desc
rows between unbounded preceding and unbounded following
) as last
from scores;
缺少了 IGNORE NULLS,导致结果不正确

