[X] I had searched in the issues and found no similar issues.
Version
master
What's Wrong?
CREATE TABLE advertiser_view_record(
time date not null,
advertiser varchar(10),
dt date not null,
channel varchar(10),
user_id int)
DUPLICATE KEY(`time`, `advertiser`)
PARTITION BY RANGE (dt)(FROM ("2024-07-02") TO ("2024-07-04") INTERVAL 1 DAY)
-- AUTO PARTITION BY RANGE (date_trunc(`time`, 'day'))()
distributed BY hash(time)
properties("replication_num" = "1");
CREATE materialized VIEW advertiser_uv AS
SELECT advertiser,
channel,
dt,
bitmap_union(to_bitmap(user_id))
FROM advertiser_view_record
GROUP BY advertiser,
channel,
dt;
insert into advertiser_view_record values("2024-07-02",'a', "2024-07-02", 'a',1);
insert into advertiser_view_record values("2024-07-03",'b', "2024-07-03", 'b',1);
EXPLAIN
SELECT dt,advertiser,
count(DISTINCT user_id)
FROM advertiser_view_record
GROUP BY dt,advertiser
The advertiser_uv can not be selected and the result is:
Search before asking
Version
master
What's Wrong?
The
advertiser_uv
can not be selected and the result is:If we set set
enable_sync_mv_cost_based_rewrite = false;
the right materialized view can be selected. This variable is introduced by #33699.What You Expected?
In version 2.1.4,
advertiser_uv
will be selected.How to Reproduce?
No response
Anything Else?
No response
Are you willing to submit PR?
Code of Conduct