2017-05-10 05:46:23 +00:00
|
|
|
#include <AggregateFunctions/AggregateFunctionFactory.h>
|
|
|
|
#include <AggregateFunctions/AggregateFunctionGroupArrayInsertAt.h>
|
|
|
|
#include <AggregateFunctions/Helpers.h>
|
2017-12-20 07:36:30 +00:00
|
|
|
#include <AggregateFunctions/FactoryHelpers.h>
|
2019-12-15 06:34:43 +00:00
|
|
|
#include "registerAggregateFunctions.h"
|
2017-12-20 07:36:30 +00:00
|
|
|
|
2017-05-10 05:46:23 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
|
2017-12-20 07:36:30 +00:00
|
|
|
AggregateFunctionPtr createAggregateFunctionGroupArrayInsertAt(const std::string & name, const DataTypes & argument_types, const Array & parameters)
|
2017-05-10 05:46:23 +00:00
|
|
|
{
|
2017-12-20 07:36:30 +00:00
|
|
|
assertBinary(name, argument_types);
|
2019-02-11 19:26:32 +00:00
|
|
|
|
|
|
|
if (argument_types.size() != 2)
|
|
|
|
throw Exception("Aggregate function groupArrayInsertAt requires two arguments.", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
|
|
|
|
|
2017-12-20 07:36:30 +00:00
|
|
|
return std::make_shared<AggregateFunctionGroupArrayInsertAtGeneric>(argument_types, parameters);
|
2017-05-10 05:46:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void registerAggregateFunctionGroupArrayInsertAt(AggregateFunctionFactory & factory)
|
|
|
|
{
|
|
|
|
factory.registerFunction("groupArrayInsertAt", createAggregateFunctionGroupArrayInsertAt);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|