mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 04:22:03 +00:00
uniqCombined should return non-nullable type
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
This commit is contained in:
parent
1f68f5246d
commit
fd947374b5
@ -65,16 +65,17 @@ AggregateFunctionPtr createAggregateFunctionUniqCombined(bool use_64_bit_hash,
|
||||
|
||||
void registerAggregateFunctionUniqCombined(AggregateFunctionFactory & factory)
|
||||
{
|
||||
factory.registerFunction("uniqCombined",
|
||||
[](const std::string & name, const DataTypes & argument_types, const Array & parameters, const Settings *)
|
||||
{
|
||||
return createAggregateFunctionUniqCombined(false, name, argument_types, parameters);
|
||||
});
|
||||
factory.registerFunction("uniqCombined64",
|
||||
[](const std::string & name, const DataTypes & argument_types, const Array & parameters, const Settings *)
|
||||
{
|
||||
return createAggregateFunctionUniqCombined(true, name, argument_types, parameters);
|
||||
});
|
||||
AggregateFunctionProperties properties = {.returns_default_when_only_null = true, .is_order_dependent = false};
|
||||
factory.registerFunction(
|
||||
"uniqCombined",
|
||||
{[](const std::string & name, const DataTypes & argument_types, const Array & parameters, const Settings *)
|
||||
{ return createAggregateFunctionUniqCombined(false, name, argument_types, parameters); },
|
||||
properties});
|
||||
factory.registerFunction(
|
||||
"uniqCombined64",
|
||||
{[](const std::string & name, const DataTypes & argument_types, const Array & parameters, const Settings *)
|
||||
{ return createAggregateFunctionUniqCombined(true, name, argument_types, parameters); },
|
||||
properties});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,2 +1,4 @@
|
||||
10021957
|
||||
10021969
|
||||
1
|
||||
1
|
||||
|
@ -7,3 +7,16 @@
|
||||
|
||||
SELECT uniqCombined(number) FROM numbers(1e7);
|
||||
SELECT uniqCombined64(number) FROM numbers(1e7);
|
||||
|
||||
-- Fix for https://github.com/ClickHouse/ClickHouse/issues/65052
|
||||
SELECT sum(u) FROM
|
||||
(
|
||||
SELECT uniqCombined(tuple(materialize(toNullable(42)))) AS u
|
||||
)
|
||||
SETTINGS optimize_injective_functions_inside_uniq = 1, allow_experimental_analyzer = 1;
|
||||
|
||||
SELECT sum(u) FROM
|
||||
(
|
||||
SELECT uniqCombined64(tuple(materialize(toNullable(42)))) AS u
|
||||
)
|
||||
SETTINGS optimize_injective_functions_inside_uniq = 1, allow_experimental_analyzer = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user