mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Merge pull request #42342 from canhld94/ch_canh_fix_aggregator_lc
This commit is contained in:
commit
76b102024d
@ -811,6 +811,11 @@ AggregatedDataVariants::Type Aggregator::chooseAggregationMethod()
|
||||
return AggregatedDataVariants::Type::low_cardinality_key32;
|
||||
if (size_of_field == 8)
|
||||
return AggregatedDataVariants::Type::low_cardinality_key64;
|
||||
if (size_of_field == 16)
|
||||
return AggregatedDataVariants::Type::low_cardinality_keys128;
|
||||
if (size_of_field == 32)
|
||||
return AggregatedDataVariants::Type::low_cardinality_keys256;
|
||||
throw Exception("Logical error: low cardinality numeric column has sizeOfField not in 1, 2, 4, 8, 16, 32.", ErrorCodes::LOGICAL_ERROR);
|
||||
}
|
||||
|
||||
if (size_of_field == 1)
|
||||
|
@ -0,0 +1,20 @@
|
||||
0 4950
|
||||
1 14950
|
||||
2 24950
|
||||
3 34950
|
||||
4 44950
|
||||
5 54950
|
||||
6 64950
|
||||
7 74950
|
||||
8 84950
|
||||
9 94950
|
||||
0 4950
|
||||
1 14950
|
||||
2 24950
|
||||
3 34950
|
||||
4 44950
|
||||
5 54950
|
||||
6 64950
|
||||
7 74950
|
||||
8 84950
|
||||
9 94950
|
@ -0,0 +1,9 @@
|
||||
SET allow_suspicious_low_cardinality_types = 1;
|
||||
-- LC UInt128
|
||||
CREATE TABLE group_by_pk_lc_uint128 (`k` LowCardinality(UInt128), `v` UInt32) ENGINE = MergeTree ORDER BY k PARTITION BY v%50;
|
||||
INSERT INTO group_by_pk_lc_uint128 SELECT number / 100, number FROM numbers(1000);
|
||||
SELECT k, sum(v) AS s FROM group_by_pk_lc_uint128 GROUP BY k ORDER BY k ASC LIMIT 1024 SETTINGS optimize_aggregation_in_order = 1;
|
||||
-- LC UInt256
|
||||
CREATE TABLE group_by_pk_lc_uint256 (`k` LowCardinality(UInt256), `v` UInt32) ENGINE = MergeTree ORDER BY k PARTITION BY v%50;
|
||||
INSERT INTO group_by_pk_lc_uint256 SELECT number / 100, number FROM numbers(1000);
|
||||
SELECT k, sum(v) AS s FROM group_by_pk_lc_uint256 GROUP BY k ORDER BY k ASC LIMIT 1024 SETTINGS optimize_aggregation_in_order = 1;
|
Loading…
Reference in New Issue
Block a user