Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zclllyybb committed Nov 13, 2024
1 parent ee0de9b commit 82918fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
14 changes: 7 additions & 7 deletions be/src/vec/aggregate_functions/aggregate_function_stddev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,32 +51,32 @@ AggregateFunctionPtr create_aggregate_function_variance_samp(const std::string&
const DataTypes& argument_types,
const bool result_is_nullable,
const AggregateFunctionAttr& attr) {
return create_function_single_value<AggregateFunctionSamp, VarianceSampName, SampData, false>(
name, argument_types, result_is_nullable);
return create_function_single_value<AggregateFunctionSampVariance, VarianceSampName, SampData,
false>(name, argument_types, result_is_nullable);
}

AggregateFunctionPtr create_aggregate_function_variance_pop(const std::string& name,
const DataTypes& argument_types,
const bool result_is_nullable,
const AggregateFunctionAttr& attr) {
return create_function_single_value<AggregateFunctionPop, VarianceName, PopData, false>(
name, argument_types, result_is_nullable);
return create_function_single_value<AggregateFunctionSampVariance, VarianceName, PopData,
false>(name, argument_types, result_is_nullable);
}

AggregateFunctionPtr create_aggregate_function_stddev_pop(const std::string& name,
const DataTypes& argument_types,
const bool result_is_nullable,
const AggregateFunctionAttr& attr) {
return create_function_single_value<AggregateFunctionPop, StddevName, PopData, true>(
return create_function_single_value<AggregateFunctionSampVariance, StddevName, PopData, true>(
name, argument_types, result_is_nullable);
}

AggregateFunctionPtr create_aggregate_function_stddev_samp(const std::string& name,
const DataTypes& argument_types,
const bool result_is_nullable,
const AggregateFunctionAttr& attr) {
return create_function_single_value<AggregateFunctionSamp, StddevSampName, SampData, true>(
name, argument_types, result_is_nullable);
return create_function_single_value<AggregateFunctionSampVariance, StddevSampName, SampData,
true>(name, argument_types, result_is_nullable);
}

void register_aggregate_function_stddev_variance_pop(AggregateFunctionSimpleFactory& factory) {
Expand Down
13 changes: 3 additions & 10 deletions be/src/vec/aggregate_functions/aggregate_function_stddev.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ struct StddevSampName {
static const char* name() { return "stddev_samp"; }
};

template <bool is_pop, typename Data>
template <typename Data>
class AggregateFunctionSampVariance
: public IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<is_pop, Data>> {
: public IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>> {
public:
AggregateFunctionSampVariance(const DataTypes& argument_types_)
: IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<is_pop, Data>>(
: IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>(
argument_types_) {}

String get_name() const override { return Data::name(); }
Expand Down Expand Up @@ -216,11 +216,4 @@ class AggregateFunctionSampVariance
}
};

template <typename Data>
using AggregateFunctionSamp = AggregateFunctionSampVariance<false, Data>;

//pop function have use AggregateFunctionNullBase function, so needn't processing null values
template <typename Data>
using AggregateFunctionPop = AggregateFunctionSampVariance<true, Data>;

} // namespace doris::vectorized

0 comments on commit 82918fe

Please sign in to comment.