mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
code style AggregateFunctionMLMethod.cpp
This commit is contained in:
parent
6084fdd4af
commit
b9972f8e67
@ -22,11 +22,10 @@ AggregateFunctionPtr createAggregateFunctionMLMethod(
|
||||
for (size_t i = 0; i < argument_types.size(); ++i)
|
||||
{
|
||||
if (!WhichDataType(argument_types[i]).isFloat64())
|
||||
throw Exception("Illegal type " + argument_types[i]->getName() + " of argument " +
|
||||
std::to_string(i) + "for aggregate function " + name,
|
||||
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
|
||||
throw Exception("Illegal type " + argument_types[i]->getName() + " of argument "
|
||||
+ std::to_string(i) + "for aggregate function " + name,
|
||||
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
|
||||
}
|
||||
|
||||
Float64 learning_rate;
|
||||
if (parameters.empty())
|
||||
{
|
||||
@ -35,7 +34,6 @@ AggregateFunctionPtr createAggregateFunctionMLMethod(
|
||||
{
|
||||
learning_rate = applyVisitor(FieldVisitorConvertToNumber<Float64>(), parameters[0]);
|
||||
}
|
||||
|
||||
if (argument_types.size() < 2)
|
||||
throw Exception("Aggregate function " + name + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
|
||||
|
||||
@ -44,8 +42,9 @@ AggregateFunctionPtr createAggregateFunctionMLMethod(
|
||||
|
||||
}
|
||||
|
||||
void registerAggregateFunctionMLMethod(AggregateFunctionFactory & factory) {
|
||||
void registerAggregateFunctionMLMethod(AggregateFunctionFactory & factory)
|
||||
{
|
||||
factory.registerFunction("LinearRegression", createAggregateFunctionMLMethod<FuncLinearRegression>);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user