[Enchancement](function) remove unused params on aggregate function (#16886)

remove unused params on aggregate function
This commit is contained in:
Pxl
2023-02-20 11:08:45 +08:00
committed by GitHub
parent 46d5cca661
commit 2bc014d83a
72 changed files with 185 additions and 314 deletions

View File

@ -24,6 +24,7 @@
#include "vec/aggregate_functions/aggregate_function_simple_factory.h"
#include "vec/aggregate_functions/helpers.h"
#include "vec/common/typeid_cast.h"
#include "vec/data_types/data_type.h"
#include "vec/data_types/data_type_nullable.h"
namespace doris::vectorized {
@ -42,7 +43,7 @@ public:
AggregateFunctionPtr transform_aggregate_function(
const AggregateFunctionPtr& nested_function, const DataTypes& arguments,
const Array& params, const bool result_is_nullable) const override {
const bool result_is_nullable) const override {
DCHECK(nested_function != nullptr);
if (nested_function == nullptr) {
return nullptr;
@ -79,7 +80,7 @@ const std::string DISTINCT_FUNCTION_PREFIX = "multi_distinct_";
void register_aggregate_function_combinator_distinct(AggregateFunctionSimpleFactory& factory) {
AggregateFunctionCreator creator = [&](const std::string& name, const DataTypes& types,
const Array& params, const bool result_is_nullable) {
const bool result_is_nullable) {
// 1. we should get not nullable types;
DataTypes nested_types(types.size());
std::transform(types.begin(), types.end(), nested_types.begin(),
@ -87,8 +88,8 @@ void register_aggregate_function_combinator_distinct(AggregateFunctionSimpleFact
auto function_combinator = std::make_shared<AggregateFunctionCombinatorDistinct>();
auto transform_arguments = function_combinator->transform_arguments(nested_types);
auto nested_function_name = name.substr(DISTINCT_FUNCTION_PREFIX.size());
auto nested_function = factory.get(nested_function_name, transform_arguments, params);
return function_combinator->transform_aggregate_function(nested_function, types, params,
auto nested_function = factory.get(nested_function_name, transform_arguments);
return function_combinator->transform_aggregate_function(nested_function, types,
result_is_nullable);
};
factory.register_distinct_function_combinator(creator, DISTINCT_FUNCTION_PREFIX);