diff --git a/dbms/include/DB/AggregateFunctions/AggregateFunctionArray.h b/dbms/include/DB/AggregateFunctions/AggregateFunctionArray.h index 6e230f888d3..4bc52a30751 100644 --- a/dbms/include/DB/AggregateFunctions/AggregateFunctionArray.h +++ b/dbms/include/DB/AggregateFunctions/AggregateFunctionArray.h @@ -38,6 +38,9 @@ public: { num_agruments = arguments.size(); + if (0 == num_agruments) + throw Exception("Array aggregate functions requires at least one argument", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + DataTypes nested_arguments; for (int i = 0; i < num_agruments; ++i) { @@ -46,6 +49,7 @@ public: else throw Exception("Illegal type " + arguments[i]->getName() + " of argument #" + toString(i + 1) + " for aggregate function " + getName() + ". Must be array.", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } + nested_func->setArguments(nested_arguments); } diff --git a/dbms/include/DB/AggregateFunctions/AggregateFunctionGroupArray.h b/dbms/include/DB/AggregateFunctions/AggregateFunctionGroupArray.h index 68aca9f1939..31e581c8724 100644 --- a/dbms/include/DB/AggregateFunctions/AggregateFunctionGroupArray.h +++ b/dbms/include/DB/AggregateFunctions/AggregateFunctionGroupArray.h @@ -17,6 +17,11 @@ namespace DB { +namespace ErrorCodes +{ + extern const int TOO_LARGE_ARRAY_SIZE; +} + /// Частный случай - реализация для числовых типов. template diff --git a/dbms/include/DB/AggregateFunctions/AggregateFunctionQuantileTDigest.h b/dbms/include/DB/AggregateFunctions/AggregateFunctionQuantileTDigest.h index ab1906fa247..ee30a9e39dd 100644 --- a/dbms/include/DB/AggregateFunctions/AggregateFunctionQuantileTDigest.h +++ b/dbms/include/DB/AggregateFunctions/AggregateFunctionQuantileTDigest.h @@ -17,6 +17,14 @@ #include +namespace DB +{ +namespace ErrorCodes +{ + extern const int TOO_LARGE_ARRAY_SIZE; +} +} + /** Алгоритм реализовал Алексей Борзенков https://███████████.yandex-team.ru/snaury * Ему принадлежит авторство кода и половины комментариев в данном namespace, * за исключением слияния, сериализации и сортировки, а также выбора типов и других изменений. diff --git a/dbms/include/DB/AggregateFunctions/AggregateFunctionSequenceMatch.h b/dbms/include/DB/AggregateFunctions/AggregateFunctionSequenceMatch.h index 15acd585c61..bd51ec6006b 100644 --- a/dbms/include/DB/AggregateFunctions/AggregateFunctionSequenceMatch.h +++ b/dbms/include/DB/AggregateFunctions/AggregateFunctionSequenceMatch.h @@ -15,6 +15,14 @@ namespace DB { +namespace ErrorCodes +{ + extern const int TOO_SLOW; + extern const int TOO_LESS_ARGUMENTS_FOR_FUNCTION; + extern const int TOO_MUCH_ARGUMENTS_FOR_FUNCTION; + extern const int SYNTAX_ERROR; +} + /// helper type for comparing `std::pair`s using solely the .first member template