From 2d295026d69939c9aecba4b99e290b4cc3829bf0 Mon Sep 17 00:00:00 2001 From: wangbo <506340561@qq.com> Date: Tue, 27 Apr 2021 13:00:11 +0800 Subject: [PATCH] max/min support nullable column (#17) --- be/src/vec/aggregate_functions/aggregate_function_min_max.cpp | 2 -- be/src/vec/aggregate_functions/aggregate_function_null.cpp | 2 ++ .../vec/aggregate_functions/aggregate_function_simple_factory.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/be/src/vec/aggregate_functions/aggregate_function_min_max.cpp b/be/src/vec/aggregate_functions/aggregate_function_min_max.cpp index 0d1e88279e9e8e..50131d811b65d5 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_min_max.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_min_max.cpp @@ -64,9 +64,7 @@ AggregateFunctionPtr createAggregateFunctionMin(const std::string & name, const void registerAggregateFunctionMinMax(AggregateFunctionSimpleFactory& factory) { factory.registerFunction("max", createAggregateFunctionMax); - factory.registerFunction("max", createAggregateFunctionMax, true); factory.registerFunction("min", createAggregateFunctionMin); - factory.registerFunction("min", createAggregateFunctionMin, true); } } // namespace doris::vectorized \ No newline at end of file diff --git a/be/src/vec/aggregate_functions/aggregate_function_null.cpp b/be/src/vec/aggregate_functions/aggregate_function_null.cpp index 84d6e6cb48f110..d411e90443663d 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_null.cpp +++ b/be/src/vec/aggregate_functions/aggregate_function_null.cpp @@ -102,6 +102,8 @@ void registerAggregateFunctionCombinatorNull(AggregateFunctionSimpleFactory& fac return function_combinator->transformAggregateFunction(nested_function, types, params); }; factory.registerFunction("sum", creator, true); + factory.registerFunction("max", creator, true); + factory.registerFunction("min", creator, true); } } // namespace doris::vectorized diff --git a/be/src/vec/aggregate_functions/aggregate_function_simple_factory.h b/be/src/vec/aggregate_functions/aggregate_function_simple_factory.h index 5a10758c2be83a..a2ebd155784fa5 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_simple_factory.h +++ b/be/src/vec/aggregate_functions/aggregate_function_simple_factory.h @@ -81,8 +81,8 @@ class AggregateFunctionSimpleFactory { static AggregateFunctionSimpleFactory instance; std::call_once(oc, [&]() { registerAggregateFunctionSum(instance); - registerAggregateFunctionCombinatorNull(instance); registerAggregateFunctionMinMax(instance); + registerAggregateFunctionCombinatorNull(instance); }); return instance; }