#include #include #include namespace DB { struct Settings; namespace { AggregateFunctionPtr createAggregateFunctionMin( const std::string & name, const DataTypes & argument_types, const Array & parameters, const Settings * settings) { return AggregateFunctionPtr(createAggregateFunctionSingleValue(name, argument_types, parameters, settings)); } AggregateFunctionPtr createAggregateFunctionArgMin( const std::string & name, const DataTypes & argument_types, const Array & parameters, const Settings * settings) { return AggregateFunctionPtr(createAggregateFunctionArgMinMax(name, argument_types, parameters, settings)); } } void registerAggregateFunctionsMin(AggregateFunctionFactory & factory) { factory.registerFunction("min", createAggregateFunctionMin, AggregateFunctionFactory::CaseInsensitive); /// The functions below depend on the order of data. AggregateFunctionProperties properties = { .returns_default_when_only_null = false, .is_order_dependent = true }; factory.registerFunction("argMin", { createAggregateFunctionArgMin, properties }); } }