2017-12-08 05:09:08 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-12-24 06:50:11 +00:00
|
|
|
#include <DataTypes/DataTypeNullable.h>
|
2017-12-08 05:09:08 +00:00
|
|
|
#include <DataTypes/DataTypeNothing.h>
|
|
|
|
#include <Columns/IColumn.h>
|
|
|
|
#include <AggregateFunctions/IAggregateFunction.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
|
2018-10-13 14:33:43 +00:00
|
|
|
/** Aggregate function that takes arbitrary number of arbitrary arguments and does nothing.
|
2017-12-08 05:09:08 +00:00
|
|
|
*/
|
2017-12-20 07:36:30 +00:00
|
|
|
class AggregateFunctionNothing final : public IAggregateFunctionHelper<AggregateFunctionNothing>
|
2017-12-08 05:09:08 +00:00
|
|
|
{
|
|
|
|
public:
|
2019-02-11 19:26:32 +00:00
|
|
|
AggregateFunctionNothing(const DataTypes & arguments, const Array & params)
|
|
|
|
: IAggregateFunctionHelper<AggregateFunctionNothing>(arguments, params) {}
|
|
|
|
|
2017-12-08 05:09:08 +00:00
|
|
|
String getName() const override
|
|
|
|
{
|
|
|
|
return "nothing";
|
|
|
|
}
|
|
|
|
|
|
|
|
DataTypePtr getReturnType() const override
|
|
|
|
{
|
2020-06-14 07:44:02 +00:00
|
|
|
return argument_types.front();
|
2017-12-08 05:09:08 +00:00
|
|
|
}
|
|
|
|
|
2021-04-09 17:12:06 +00:00
|
|
|
bool allocatesMemoryInArena() const override { return false; }
|
|
|
|
|
2017-12-08 05:09:08 +00:00
|
|
|
void create(AggregateDataPtr) const override
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void destroy(AggregateDataPtr) const noexcept override
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasTrivialDestructor() const override
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t sizeOfData() const override
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t alignOfData() const override
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void add(AggregateDataPtr, const IColumn **, size_t, Arena *) const override
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void merge(AggregateDataPtr, ConstAggregateDataPtr, Arena *) const override
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void serialize(ConstAggregateDataPtr, WriteBuffer &) const override
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void deserialize(AggregateDataPtr, ReadBuffer &, Arena *) const override
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-06-17 19:36:27 +00:00
|
|
|
void insertResultInto(AggregateDataPtr, IColumn & to, Arena *) const override
|
2017-12-08 05:09:08 +00:00
|
|
|
{
|
|
|
|
to.insertDefault();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|