mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
some review fixes
This commit is contained in:
parent
6c7f2cbc37
commit
79010b7c3c
@ -80,6 +80,10 @@ public:
|
||||
const ColumnNumbers &arguments,
|
||||
const std::vector<Float64> &weights, Float64 bias, const Context & context) const override
|
||||
{
|
||||
if (weights.size() + 1 != arguments.size()) {
|
||||
throw Exception("In predict function number of arguments differs from the size of weights vector", ErrorCodes::LOGICAL_ERROR);
|
||||
}
|
||||
|
||||
size_t rows_num = block.rows();
|
||||
std::vector<Float64> results(rows_num, bias);
|
||||
|
||||
|
@ -37,7 +37,7 @@ void ColumnAggregateFunction::addArena(ArenaPtr arena_)
|
||||
|
||||
/// This function is used in convertToValues() and predictValues()
|
||||
/// and is written here to avoid repetitions
|
||||
bool ColumnAggregateFunction::convertion(MutableColumnPtr *res_) const
|
||||
bool ColumnAggregateFunction::tryFinalizeAggregateFunction(MutableColumnPtr *res_) const
|
||||
{
|
||||
if (const AggregateFunctionState *function_state = typeid_cast<const AggregateFunctionState *>(func.get()))
|
||||
{
|
||||
@ -92,7 +92,7 @@ MutableColumnPtr ColumnAggregateFunction::convertToValues() const
|
||||
*/
|
||||
|
||||
MutableColumnPtr res;
|
||||
if (convertion(&res))
|
||||
if (tryFinalizeAggregateFunction(&res))
|
||||
{
|
||||
return res;
|
||||
}
|
||||
@ -106,7 +106,7 @@ MutableColumnPtr ColumnAggregateFunction::convertToValues() const
|
||||
MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const ColumnNumbers & arguments, const Context & context) const
|
||||
{
|
||||
MutableColumnPtr res;
|
||||
convertion(&res);
|
||||
tryFinalizeAggregateFunction(&res);
|
||||
|
||||
auto ML_function = func.get();
|
||||
if (ML_function)
|
||||
|
@ -118,7 +118,7 @@ public:
|
||||
std::string getName() const override { return "AggregateFunction(" + func->getName() + ")"; }
|
||||
const char * getFamilyName() const override { return "AggregateFunction"; }
|
||||
|
||||
bool convertion(MutableColumnPtr* res_) const;
|
||||
bool tryFinalizeAggregateFunction(MutableColumnPtr* res_) const;
|
||||
MutableColumnPtr predictValues(Block & block, const ColumnNumbers & arguments, const Context & context) const;
|
||||
|
||||
size_t size() const override
|
||||
|
Loading…
Reference in New Issue
Block a user