Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport #49971 to 23.4: [RFC] Revert "groupArray returns cannot be nullable" #49981

Merged
merged 1 commit into from May 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AggregateFunctions/AggregateFunctionGroupArray.cpp
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
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
Expand Up @@ -3,7 +3,7 @@
1
1
[[1],[-1]]
[]
\N
1
42 42
[NULL,'','',NULL]
Expand Down
@@ -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.