diff --git a/src/AggregateFunctions/AggregateFunctionGroupArray.cpp b/src/AggregateFunctions/AggregateFunctionGroupArray.cpp index 67cfa3f7356..15f500b8bb6 100644 --- a/src/AggregateFunctions/AggregateFunctionGroupArray.cpp +++ b/src/AggregateFunctions/AggregateFunctionGroupArray.cpp @@ -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, properties }); factory.registerFunction("groupArraySample", { createAggregateFunctionGroupArraySample, properties }); diff --git a/src/AggregateFunctions/AggregateFunctionNull.cpp b/src/AggregateFunctions/AggregateFunctionNull.cpp index 19c66db98cd..3d3d7af3026 100644 --- a/src/AggregateFunctions/AggregateFunctionNull.cpp +++ b/src/AggregateFunctions/AggregateFunctionNull.cpp @@ -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. if (properties.returns_default_when_only_null) - return std::make_shared(arguments, params, nested_function->getResultType()); + return std::make_shared(arguments, params, std::make_shared()); else return std::make_shared(arguments, params, std::make_shared(std::make_shared())); } diff --git a/tests/queries/0_stateless/00529_orantius.reference b/tests/queries/0_stateless/00529_orantius.reference index 1deecf44752..865659048cc 100644 --- a/tests/queries/0_stateless/00529_orantius.reference +++ b/tests/queries/0_stateless/00529_orantius.reference @@ -3,7 +3,7 @@ 1 1 [[1],[-1]] -[] +\N 1 42 42 [NULL,'','',NULL] diff --git a/tests/queries/0_stateless/01664_array_slice_ubsan.reference b/tests/queries/0_stateless/01664_array_slice_ubsan.reference index beb31c4a02b..abae410d95c 100644 --- a/tests/queries/0_stateless/01664_array_slice_ubsan.reference +++ b/tests/queries/0_stateless/01664_array_slice_ubsan.reference @@ -1 +1 @@ -['\0','\0','\0'] +[0,0,0] diff --git a/tests/queries/0_stateless/02713_group_array_nullable.reference b/tests/queries/0_stateless/02713_group_array_nullable.reference deleted file mode 100644 index a163ccade3a..00000000000 --- a/tests/queries/0_stateless/02713_group_array_nullable.reference +++ /dev/null @@ -1,3 +0,0 @@ -[1] -[0,1,2,3,4,5,6,7,8,9] -[8,9] diff --git a/tests/queries/0_stateless/02713_group_array_nullable.sql b/tests/queries/0_stateless/02713_group_array_nullable.sql deleted file mode 100644 index a0cb3075252..00000000000 --- a/tests/queries/0_stateless/02713_group_array_nullable.sql +++ /dev/null @@ -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);