Allow Array/OrNull combinators regardless nesting

This commit is contained in:
Azat Khuzhin 2021-09-10 21:03:15 +03:00
parent 1e7714d56d
commit d8bf2f81ec

View File

@ -180,9 +180,21 @@ AggregateFunctionPtr AggregateFunctionFactory::getImpl(
/// need to filter aggregation result based on another column for
/// example.
if (nested_name.ends_with(combinator_name))
throw Exception(ErrorCodes::ILLEGAL_AGGREGATION,
"Nested identical combinator '{}' is not supported",
combinator_name);
{
/// But the following combinators are allowed regardless nesting:
/// - Array
/// - OrNull (due to aggregate_functions_null_for_empty)
if (combinator_name == "Array" || combinator_name == "OrNull")
{
/// Is supported.
}
else
{
throw Exception(ErrorCodes::ILLEGAL_AGGREGATION,
"Nested identical combinator '{}' is not supported",
combinator_name);
}
}
DataTypes nested_types = combinator->transformArguments(argument_types);
Array nested_parameters = combinator->transformParameters(parameters);