Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

last_value different result from mv and ad hoc query #18927

Closed
st1page opened this issue Oct 16, 2024 · 0 comments · Fixed by #19332
Closed

last_value different result from mv and ad hoc query #18927

st1page opened this issue Oct 16, 2024 · 0 comments · Fixed by #19332
Assignees
Milestone

Comments

@st1page
Copy link
Contributor

st1page commented Oct 16, 2024

create table t1(
    id bigint primary key,
    uid bigint,
    value bigint,
    ts bigint
);
insert into t1 values(1, 1, null, 1),(2, 1, 2, 2),(3, 1, 3, 3);
flush;
select
    uid,
    last_value(case when ts=2 then value else null end order by ts) as lv
from t1
group by uid;
 uid | lv
-----+----
   1 |  2
(1 row)
create materialized view mv1 as
select
    uid,
    last_value(case when ts=2 then value else null end order by ts) as lv
from t1
group by uid;
select * from mv1;
 uid | lv
-----+----
   1 |
(1 row)
@github-actions github-actions bot added this to the release-2.2 milestone Oct 16, 2024
@st1page st1page changed the title different result from mv and ad hoc query, may related to last_value last_value different result from mv and ad hoc query Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment