mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Make grouping never return low cardinality
This commit is contained in:
parent
c932d26799
commit
8cdaa1a32a
@ -47,6 +47,10 @@ public:
|
||||
|
||||
bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & /*arguments*/) const override { return false; }
|
||||
|
||||
/// Change it to never return LowCardinality, making it consistent when using groupingForRollup / groupingForforCube
|
||||
/// with __grouping_set
|
||||
bool canBeExecutedOnLowCardinalityDictionary() const override { return false; }
|
||||
|
||||
DataTypePtr getReturnTypeImpl(const DataTypes & /*arguments*/) const override
|
||||
{
|
||||
return std::make_shared<DataTypeUInt64>();
|
||||
|
@ -54,3 +54,18 @@ GROUP BY
|
||||
WITH ROLLUP
|
||||
ORDER BY multiIf(d = 0, key_a, NULL) ASC
|
||||
FORMAT Null;
|
||||
|
||||
SELECT grouping(key_a) + grouping(key_b) AS d
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
rand() % 10 AS key_a,
|
||||
rand(toLowCardinality(1)) % 5 AS key_b,
|
||||
number
|
||||
FROM numbers(100)
|
||||
)
|
||||
GROUP BY
|
||||
key_a,
|
||||
key_b
|
||||
WITH ROLLUP
|
||||
FORMAT Null;
|
||||
|
Loading…
Reference in New Issue
Block a user