mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Fix tests
This commit is contained in:
parent
634829bccb
commit
e720d78f23
@ -77,11 +77,15 @@ AggregateFunctionPtr AggregateFunctionFactory::get(
|
|||||||
DataTypes nested_types = combinator->transformArguments(type_without_low_cardinality);
|
DataTypes nested_types = combinator->transformArguments(type_without_low_cardinality);
|
||||||
Array nested_parameters = combinator->transformParameters(parameters);
|
Array nested_parameters = combinator->transformParameters(parameters);
|
||||||
|
|
||||||
AggregateFunctionPtr nested_function = getImpl(name, nested_types, nested_parameters, out_properties, recursion_level);
|
bool has_null_arguments = std::any_of(type_without_low_cardinality.begin(), type_without_low_cardinality.end(),
|
||||||
|
[](const auto & type) { return type->onlyNull(); });
|
||||||
|
|
||||||
|
AggregateFunctionPtr nested_function = getImpl(
|
||||||
|
name, nested_types, nested_parameters, out_properties, has_null_arguments, recursion_level);
|
||||||
return combinator->transformAggregateFunction(nested_function, out_properties, type_without_low_cardinality, parameters);
|
return combinator->transformAggregateFunction(nested_function, out_properties, type_without_low_cardinality, parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto res = getImpl(name, type_without_low_cardinality, parameters, out_properties, recursion_level);
|
auto res = getImpl(name, type_without_low_cardinality, parameters, out_properties, false, recursion_level);
|
||||||
if (!res)
|
if (!res)
|
||||||
throw Exception("Logical error: AggregateFunctionFactory returned nullptr", ErrorCodes::LOGICAL_ERROR);
|
throw Exception("Logical error: AggregateFunctionFactory returned nullptr", ErrorCodes::LOGICAL_ERROR);
|
||||||
return res;
|
return res;
|
||||||
@ -93,6 +97,7 @@ AggregateFunctionPtr AggregateFunctionFactory::getImpl(
|
|||||||
const DataTypes & argument_types,
|
const DataTypes & argument_types,
|
||||||
const Array & parameters,
|
const Array & parameters,
|
||||||
AggregateFunctionProperties & out_properties,
|
AggregateFunctionProperties & out_properties,
|
||||||
|
bool has_null_arguments,
|
||||||
int recursion_level) const
|
int recursion_level) const
|
||||||
{
|
{
|
||||||
String name = getAliasToOrName(name_param);
|
String name = getAliasToOrName(name_param);
|
||||||
@ -116,11 +121,8 @@ AggregateFunctionPtr AggregateFunctionFactory::getImpl(
|
|||||||
out_properties = found.properties;
|
out_properties = found.properties;
|
||||||
|
|
||||||
/// The case when aggregate function should return NULL on NULL arguments. This case is handled in "get" method.
|
/// The case when aggregate function should return NULL on NULL arguments. This case is handled in "get" method.
|
||||||
if (!out_properties.returns_default_when_only_null
|
if (!out_properties.returns_default_when_only_null && has_null_arguments)
|
||||||
&& std::any_of(argument_types.begin(), argument_types.end(), [](const auto & type) { return WhichDataType(type).isNothing(); }))
|
|
||||||
{
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
|
||||||
|
|
||||||
return found.creator(name, argument_types, parameters);
|
return found.creator(name, argument_types, parameters);
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,7 @@ private:
|
|||||||
const DataTypes & argument_types,
|
const DataTypes & argument_types,
|
||||||
const Array & parameters,
|
const Array & parameters,
|
||||||
AggregateFunctionProperties & out_properties,
|
AggregateFunctionProperties & out_properties,
|
||||||
|
bool has_null_arguments,
|
||||||
int recursion_level) const;
|
int recursion_level) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user