mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Merge pull request #49971 from azat/revert-48593-group_array_nullable
[RFC] Revert "`groupArray` returns cannot be nullable"
This commit is contained in:
commit
5065049154
@ -121,7 +121,7 @@ AggregateFunctionPtr createAggregateFunctionGroupArraySample(
|
|||||||
|
|
||||||
void registerAggregateFunctionGroupArray(AggregateFunctionFactory & factory)
|
void registerAggregateFunctionGroupArray(AggregateFunctionFactory & factory)
|
||||||
{
|
{
|
||||||
AggregateFunctionProperties properties = { .returns_default_when_only_null = true, .is_order_dependent = true };
|
AggregateFunctionProperties properties = { .returns_default_when_only_null = false, .is_order_dependent = true };
|
||||||
|
|
||||||
factory.registerFunction("groupArray", { createAggregateFunctionGroupArray<false>, properties });
|
factory.registerFunction("groupArray", { createAggregateFunctionGroupArray<false>, properties });
|
||||||
factory.registerFunction("groupArraySample", { createAggregateFunctionGroupArraySample, properties });
|
factory.registerFunction("groupArraySample", { createAggregateFunctionGroupArraySample, properties });
|
||||||
|
@ -72,7 +72,7 @@ public:
|
|||||||
{
|
{
|
||||||
/// Currently the only functions that returns not-NULL on all NULL arguments are count and uniq, and they returns UInt64.
|
/// Currently the only functions that returns not-NULL on all NULL arguments are count and uniq, and they returns UInt64.
|
||||||
if (properties.returns_default_when_only_null)
|
if (properties.returns_default_when_only_null)
|
||||||
return std::make_shared<AggregateFunctionNothing>(arguments, params, nested_function->getResultType());
|
return std::make_shared<AggregateFunctionNothing>(arguments, params, std::make_shared<DataTypeUInt64>());
|
||||||
else
|
else
|
||||||
return std::make_shared<AggregateFunctionNothing>(arguments, params, std::make_shared<DataTypeNullable>(std::make_shared<DataTypeNothing>()));
|
return std::make_shared<AggregateFunctionNothing>(arguments, params, std::make_shared<DataTypeNullable>(std::make_shared<DataTypeNothing>()));
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
1
|
1
|
||||||
1
|
1
|
||||||
[[1],[-1]]
|
[[1],[-1]]
|
||||||
[]
|
\N
|
||||||
1
|
1
|
||||||
42 42
|
42 42
|
||||||
[NULL,'','',NULL]
|
[NULL,'','',NULL]
|
||||||
|
@ -1 +1 @@
|
|||||||
['\0','\0','\0']
|
[0,0,0]
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
[1]
|
|
||||||
[0,1,2,3,4,5,6,7,8,9]
|
|
||||||
[8,9]
|
|
@ -1,5 +0,0 @@
|
|||||||
SET aggregate_functions_null_for_empty = 1;
|
|
||||||
|
|
||||||
SELECT groupArray(1);
|
|
||||||
SELECT groupArray(number) FROM numbers(10);
|
|
||||||
SELECT groupArrayLast(2)(number) FROM numbers(10);
|
|
Loading…
Reference in New Issue
Block a user