mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-29 21:20:49 +00:00
Check number of arguments
This commit is contained in:
parent
a5a4fbdb00
commit
a3d57bd5af
@ -30,13 +30,8 @@ public:
|
|||||||
/// For argument-lambda expressions, it defines the types of arguments of these expressions.
|
/// For argument-lambda expressions, it defines the types of arguments of these expressions.
|
||||||
void getLambdaArgumentTypes(DataTypes & arguments) const override
|
void getLambdaArgumentTypes(DataTypes & arguments) const override
|
||||||
{
|
{
|
||||||
if (arguments.empty())
|
if (arguments.size() < 3)
|
||||||
throw Exception("Function " + getName() + " needs at least one argument; passed "
|
throw Exception("Function " + getName() + " needs lambda function, at least one array argument and one accumulator argument.",
|
||||||
+ toString(arguments.size()) + ".",
|
|
||||||
ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
|
|
||||||
|
|
||||||
if (arguments.size() == 1)
|
|
||||||
throw Exception("Function " + getName() + " needs at least one array argument.",
|
|
||||||
ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
|
ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
|
||||||
|
|
||||||
DataTypes nested_types(arguments.size() - 1);
|
DataTypes nested_types(arguments.size() - 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user