[Enchancement](function) change aggregate function creator to return AggregateFunctionPtr (#18025)

change creator_type to return AggregateFunctionPtr.
remove some function and use creator directly.
This commit is contained in:
Pxl
2023-03-26 11:41:34 +08:00
committed by GitHub
parent 5df011cd43
commit 45ad297a1d
27 changed files with 286 additions and 531 deletions

View File

@ -117,8 +117,7 @@ struct AggregateFunction {
using Function = typename Derived::template TypeTraits<T>::Function;
static auto create(const DataTypePtr& data_type_ptr) -> AggregateFunctionPtr {
return AggregateFunctionPtr(creator_with_type::create<Function>(
true, DataTypes {make_nullable(data_type_ptr)}));
return creator_with_type::create<Function>(DataTypes {make_nullable(data_type_ptr)}, true);
}
};
@ -225,8 +224,8 @@ struct NameArrayMin {
template <>
struct AggregateFunction<AggregateFunctionImpl<AggregateOperation::MIN>> {
static auto create(const DataTypePtr& data_type_ptr) -> AggregateFunctionPtr {
return AggregateFunctionPtr(create_aggregate_function_min(
NameArrayMin::name, {make_nullable(data_type_ptr)}, true));
return create_aggregate_function_single_value<AggregateFunctionMinData>(
NameArrayMin::name, {make_nullable(data_type_ptr)}, true);
}
};
@ -237,8 +236,8 @@ struct NameArrayMax {
template <>
struct AggregateFunction<AggregateFunctionImpl<AggregateOperation::MAX>> {
static auto create(const DataTypePtr& data_type_ptr) -> AggregateFunctionPtr {
return AggregateFunctionPtr(create_aggregate_function_max(
NameArrayMax::name, {make_nullable(data_type_ptr)}, true));
return create_aggregate_function_single_value<AggregateFunctionMaxData>(
NameArrayMax::name, {make_nullable(data_type_ptr)}, true);
}
};