ClickHouse/tests/queries/0_stateless/02892_SummingMergeTree_Nested.reference
Azat Khuzhin 099665478d Fix incorrect merging of Nested for SELECT FINAL FROM SummingMergeTree
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>
2023-10-08 07:32:47 +02:00

12 lines
322 B
Plaintext

-- { echo }
select * from nested_smt order by val;
2023-10-05 1 [1,2,3] [10,20,30]
2023-10-05 2 [1,2,3] [1,1,1]
select * from nested_smt final;
2023-10-05 3 [1,2,3] [11,21,31]
system start merges nested_smt;
optimize table nested_smt final;
select * from nested_smt;
2023-10-05 3 [1,2,3] [11,21,31]
drop table nested_smt;