-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Projections inconsistent results for ReplacingMergeTree/CollapsingMergeTree #24778
Copy link
Copy link
Closed
Closed
Copy link
Labels
comp-projectionsProjections: precomputed layouts for accelerating queries (projection parts, maintenance).Projections: precomputed layouts for accelerating queries (projection parts, maintenance).unexpected behaviourResult is unexpected, but not entirely wrong at the same time.Result is unexpected, but not entirely wrong at the same time.
Description
drop table if exists tp;
create table tp (type Int32, eventcnt UInt64,
projection p (select sum(eventcnt), type group by type))
engine = ReplacingMergeTree order by type;
insert into tp select number%3, 1 from numbers(3);
insert into tp select number%3, 2 from numbers(3);
optimize table tp final;
set allow_experimental_projection_optimization = 0, force_optimize_projection = 0;
select sum(eventcnt) eventcnt, type
from tp
group by type
┌─eventcnt─┬─type─┐
│ 2 │ 0 │
│ 2 │ 2 │
│ 2 │ 1 │
└──────────┴──────┘
set allow_experimental_projection_optimization = 1, force_optimize_projection = 1;
select sum(eventcnt) eventcnt, type
from tp
group by type
┌─eventcnt─┬─type─┐
│ 3 │ 0 │
│ 3 │ 2 │
│ 3 │ 1 │
└──────────┴──────┘Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
comp-projectionsProjections: precomputed layouts for accelerating queries (projection parts, maintenance).Projections: precomputed layouts for accelerating queries (projection parts, maintenance).unexpected behaviourResult is unexpected, but not entirely wrong at the same time.Result is unexpected, but not entirely wrong at the same time.