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>
|
|
|
|
|
2017-05-10 05:46:23 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2021-05-26 11:32:14 +00:00
|
|
|
struct Settings;
|
|
|
|
|
2020-02-25 18:10:48 +00:00
|
|
|
namespace ErrorCodes
|
|
|
|
{
|
|
|
|
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
|
|
|
|
}
|
2017-05-10 05:46:23 +00:00
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
|
2021-06-07 00:15:11 +00:00
|
|
|
AggregateFunctionPtr createAggregateFunctionGroupArrayInsertAt(
|
|
|
|
const std::string & name, const DataTypes & argument_types, const Array & parameters, const Settings *)
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|