[Enchancement](function) Inline some aggregate function && remove nullable combinator (#17328)

1. Inline some aggregate function
2. remove nullable combinator
This commit is contained in:
Pxl
2023-03-09 10:39:04 +08:00
committed by GitHub
parent 6923bf8d7b
commit 65b8dfc7ff
26 changed files with 206 additions and 742 deletions

View File

@ -117,14 +117,8 @@ struct AggregateFunction {
using Function = typename Derived::template TypeTraits<T>::Function;
static auto create(const DataTypePtr& data_type_ptr) -> AggregateFunctionPtr {
DataTypes data_types = {remove_nullable(data_type_ptr)};
AggregateFunctionPtr nested_function;
nested_function.reset(creator_with_type::create<Function>(false, data_types));
AggregateFunctionPtr function;
function.reset(new AggregateFunctionNullUnary<true>(nested_function,
{make_nullable(data_type_ptr)}));
return function;
return AggregateFunctionPtr(creator_with_type::create<Function>(
true, DataTypes {make_nullable(data_type_ptr)}));
}
};
@ -229,14 +223,8 @@ struct NameArrayMin {
template <>
struct AggregateFunction<AggregateFunctionImpl<AggregateOperation::MIN>> {
static auto create(const DataTypePtr& data_type_ptr) -> AggregateFunctionPtr {
DataTypes data_types = {remove_nullable(data_type_ptr)};
auto nested_function = AggregateFunctionPtr(
create_aggregate_function_min(NameArrayMin::name, data_types, false));
AggregateFunctionPtr function;
function.reset(new AggregateFunctionNullUnary<true>(nested_function,
{make_nullable(data_type_ptr)}));
return function;
return AggregateFunctionPtr(create_aggregate_function_min(
NameArrayMin::name, {make_nullable(data_type_ptr)}, true));
}
};
@ -247,14 +235,8 @@ struct NameArrayMax {
template <>
struct AggregateFunction<AggregateFunctionImpl<AggregateOperation::MAX>> {
static auto create(const DataTypePtr& data_type_ptr) -> AggregateFunctionPtr {
DataTypes data_types = {remove_nullable(data_type_ptr)};
auto nested_function = AggregateFunctionPtr(
create_aggregate_function_max(NameArrayMax::name, data_types, false));
AggregateFunctionPtr function;
function.reset(new AggregateFunctionNullUnary<true>(nested_function,
{make_nullable(data_type_ptr)}));
return function;
return AggregateFunctionPtr(create_aggregate_function_max(
NameArrayMax::name, {make_nullable(data_type_ptr)}, true));
}
};