mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-05 22:12:21 +00:00
099665478d
The problem was the order of the columns, in case of SELECT FINAL it got "counters_Map.count", "counters_Map.id" But in case of OPTIMIZE FINAL it got "counters_Map.id", "counters_Map.count" correctly. Note, that this bugs exists there from the very recent versions, I've checked 19.x and it was there. P.S. there is a workaround for this problem, if you will use one of the following patterns for key columns: - *ID - *Key - *Type That way it will be explicitly matched as key and everything will work. Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
27 lines
583 B
SQL
27 lines
583 B
SQL
drop table if exists nested_smt;
|
|
create table nested_smt (
|
|
date date,
|
|
val UInt64,
|
|
counters_Map Nested (
|
|
id UInt8,
|
|
count Int32
|
|
)
|
|
)
|
|
ENGINE = SummingMergeTree()
|
|
ORDER BY (date);
|
|
|
|
system stop merges nested_smt;
|
|
|
|
insert into nested_smt values ('2023-10-05', 1, [1,2,3], [10,20,30]);
|
|
insert into nested_smt values ('2023-10-05', 2, [1,2,3], [1,1,1]);
|
|
|
|
-- { echo }
|
|
select * from nested_smt order by val;
|
|
select * from nested_smt final;
|
|
|
|
system start merges nested_smt;
|
|
optimize table nested_smt final;
|
|
select * from nested_smt;
|
|
|
|
drop table nested_smt;
|