2018-12-03 03:17:06 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DataTypes/DataTypesNumber.h>
|
|
|
|
#include <Columns/ColumnsNumber.h>
|
2019-12-09 13:12:54 +00:00
|
|
|
#include <Functions/IFunctionImpl.h>
|
2018-12-03 03:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
template <typename Impl>
|
|
|
|
class FunctionMathConstFloat64 : public IFunction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr auto name = Impl::name;
|
|
|
|
static FunctionPtr create(const Context &) { return std::make_shared<FunctionMathConstFloat64>(); }
|
|
|
|
|
|
|
|
private:
|
|
|
|
String getName() const override { return name; }
|
|
|
|
|
|
|
|
size_t getNumberOfArguments() const override { return 0; }
|
|
|
|
|
|
|
|
DataTypePtr getReturnTypeImpl(const DataTypes & /*arguments*/) const override
|
|
|
|
{
|
|
|
|
return std::make_shared<DataTypeFloat64>();
|
|
|
|
}
|
|
|
|
|
2020-07-21 13:58:07 +00:00
|
|
|
void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) const override
|
2018-12-03 03:17:06 +00:00
|
|
|
{
|
|
|
|
block.getByPosition(result).column = block.getByPosition(result).type->createColumnConst(input_rows_count, Impl::value);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|