-
Notifications
You must be signed in to change notification settings - Fork 735
Open
Labels
type/bugType: Bug. Only for issues.Type: Bug. Only for issues.
Milestone
Description
Describe the bug
A downstream materialized view using FULL OUTER JOIN can return an empty result when both join inputs are materialized views built from global aggregation (no GROUP BY).
This is unexpected because both sides produce one row and the join keys match.
Error message/log
To Reproduce
drop table if exists t;
create table t (
id int primary key,
key string,
amount int
);
insert into t values
(1, 'k', 100),
(2, 'k', 200);
-- two global-agg MVs (no GROUP BY)
create materialized view t1_v as
select sum(amount) as amount, max(key) as key
from t
where id = 1;
create materialized view t2_v as
select sum(amount) as amount, max(key) as key
from t
where id = 2;
-- downstream FULL OUTER JOIN MV
create materialized view t_stat as
select
coalesce(a.key, b.key) as key,
coalesce(a.amount, 0) as amount_1,
coalesce(b.amount, 0) as amount_2
from t1_v a
full outer join t2_v b
on a.key = b.key;
select * from t_stat;Expected behavior
Expected behavior
key | amount_1 | amount_2
-----+----------+----------
k | 100 | 200
Actual behavior
key | amount_1 | amount_2
-----+----------+----------
(0 rows)
How did you deploy RisingWave?
No response
The version of RisingWave
<=2.7.2
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type/bugType: Bug. Only for issues.Type: Bug. Only for issues.