Skip to content

Commit

Permalink
Merge pull request #49971 from azat/revert-48593-group_array_nullable
Browse files Browse the repository at this point in the history
[RFC] Revert "`groupArray` returns cannot be nullable"
  • Loading branch information
alexey-milovidov committed May 18, 2023
2 parents 03b5bfe + e2e3a03 commit 5065049
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/AggregateFunctions/AggregateFunctionGroupArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ AggregateFunctionPtr createAggregateFunctionGroupArraySample(

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("groupArraySample", { createAggregateFunctionGroupArraySample, properties });
Expand Down
2 changes: 1 addition & 1 deletion src/AggregateFunctions/AggregateFunctionNull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AggregateFunctionCombinatorNull final : public IAggregateFunctionCombinato
{
/// 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)
return std::make_shared<AggregateFunctionNothing>(arguments, params, nested_function->getResultType());
return std::make_shared<AggregateFunctionNothing>(arguments, params, std::make_shared<DataTypeUInt64>());
else
return std::make_shared<AggregateFunctionNothing>(arguments, params, std::make_shared<DataTypeNullable>(std::make_shared<DataTypeNothing>()));
}
Expand Down
2 changes: 1 addition & 1 deletion tests/queries/0_stateless/00529_orantius.reference
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
1
1
[[1],[-1]]
[]
\N
1
42 42
[NULL,'','',NULL]
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
['\0','\0','\0']
[0,0,0]

This file was deleted.

5 changes: 0 additions & 5 deletions tests/queries/0_stateless/02713_group_array_nullable.sql

This file was deleted.

0 comments on commit 5065049

Please sign in to comment.