[Enchancement](function) refact and optimize some function register (#16955)

refact and optimize some function register
This commit is contained in:
Pxl
2023-02-24 10:05:11 +08:00
committed by GitHub
parent 37b9b038c4
commit c4edea5936
18 changed files with 370 additions and 343 deletions

View File

@ -118,15 +118,8 @@ struct AggregateFunction {
static auto create(const DataTypePtr& data_type_ptr) -> AggregateFunctionPtr {
DataTypes data_types = {remove_nullable(data_type_ptr)};
auto& data_type = *data_types.front();
AggregateFunctionPtr nested_function;
if (is_decimal(data_types.front())) {
nested_function = AggregateFunctionPtr(
create_with_decimal_type<Function>(data_type, data_type, data_types));
} else {
nested_function =
AggregateFunctionPtr(create_with_numeric_type<Function>(data_type, data_types));
}
nested_function.reset(creator_with_type::create<Function>(false, data_types));
AggregateFunctionPtr function;
function.reset(new AggregateFunctionNullUnary<true>(nested_function,