| 1 | #include <AggregateFunctions/AggregateFunctionFactory.h> |
| 2 | #include <AggregateFunctions/HelpersMinMaxAny.h> |
| 3 | #include <AggregateFunctions/FactoryHelpers.h> |
| 4 | #include "registerAggregateFunctions.h" |
| 5 | |
| 6 | |
| 7 | namespace DB |
| 8 | { |
| 9 | |
| 10 | namespace |
| 11 | { |
| 12 | |
| 13 | AggregateFunctionPtr createAggregateFunctionAny(const std::string & name, const DataTypes & argument_types, const Array & parameters) |
| 14 | { |
| 15 | return AggregateFunctionPtr(createAggregateFunctionSingleValue<AggregateFunctionsSingleValue, AggregateFunctionAnyData>(name, argument_types, parameters)); |
| 16 | } |
| 17 | |
| 18 | AggregateFunctionPtr createAggregateFunctionAnyLast(const std::string & name, const DataTypes & argument_types, const Array & parameters) |
| 19 | { |
| 20 | return AggregateFunctionPtr(createAggregateFunctionSingleValue<AggregateFunctionsSingleValue, AggregateFunctionAnyLastData>(name, argument_types, parameters)); |
| 21 | } |
| 22 | |
| 23 | AggregateFunctionPtr createAggregateFunctionAnyHeavy(const std::string & name, const DataTypes & argument_types, const Array & parameters) |
| 24 | { |
| 25 | return AggregateFunctionPtr(createAggregateFunctionSingleValue<AggregateFunctionsSingleValue, AggregateFunctionAnyHeavyData>(name, argument_types, parameters)); |
| 26 | } |
| 27 | |
| 28 | AggregateFunctionPtr createAggregateFunctionMin(const std::string & name, const DataTypes & argument_types, const Array & parameters) |
| 29 | { |
| 30 | return AggregateFunctionPtr(createAggregateFunctionSingleValue<AggregateFunctionsSingleValue, AggregateFunctionMinData>(name, argument_types, parameters)); |
| 31 | } |
| 32 | |
| 33 | AggregateFunctionPtr createAggregateFunctionMax(const std::string & name, const DataTypes & argument_types, const Array & parameters) |
| 34 | { |
| 35 | return AggregateFunctionPtr(createAggregateFunctionSingleValue<AggregateFunctionsSingleValue, AggregateFunctionMaxData>(name, argument_types, parameters)); |
| 36 | } |
| 37 | |
| 38 | AggregateFunctionPtr createAggregateFunctionArgMin(const std::string & name, const DataTypes & argument_types, const Array & parameters) |
| 39 | { |
| 40 | return AggregateFunctionPtr(createAggregateFunctionArgMinMax<AggregateFunctionMinData>(name, argument_types, parameters)); |
| 41 | } |
| 42 | |
| 43 | AggregateFunctionPtr createAggregateFunctionArgMax(const std::string & name, const DataTypes & argument_types, const Array & parameters) |
| 44 | { |
| 45 | return AggregateFunctionPtr(createAggregateFunctionArgMinMax<AggregateFunctionMaxData>(name, argument_types, parameters)); |
| 46 | } |
| 47 | |
| 48 | } |
| 49 | |
| 50 | void registerAggregateFunctionsMinMaxAny(AggregateFunctionFactory & factory) |
| 51 | { |
| 52 | factory.registerFunction("any" , createAggregateFunctionAny); |
| 53 | factory.registerFunction("anyLast" , createAggregateFunctionAnyLast); |
| 54 | factory.registerFunction("anyHeavy" , createAggregateFunctionAnyHeavy); |
| 55 | factory.registerFunction("min" , createAggregateFunctionMin, AggregateFunctionFactory::CaseInsensitive); |
| 56 | factory.registerFunction("max" , createAggregateFunctionMax, AggregateFunctionFactory::CaseInsensitive); |
| 57 | factory.registerFunction("argMin" , createAggregateFunctionArgMin); |
| 58 | factory.registerFunction("argMax" , createAggregateFunctionArgMax); |
| 59 | } |
| 60 | |
| 61 | } |
| 62 | |