#include #include #include #include #include #include #include #include #include #include #include namespace DB { namespace { template class FunctionEmptyArray : public IFunction { public: static String getNameImpl() { return "emptyArray" + DataType().getName(); } static FunctionPtr create(ContextPtr) { return std::make_shared(); } private: String getName() const override { return getNameImpl(); } size_t getNumberOfArguments() const override { return 0; } DataTypePtr getReturnTypeImpl(const DataTypes & /*arguments*/) const override { return std::make_shared(std::make_shared()); } ColumnPtr executeImpl(const ColumnsWithTypeAndName &, const DataTypePtr &, size_t input_rows_count) const override { return ColumnArray::create( DataType().createColumn(), ColumnArray::ColumnOffsets::create(input_rows_count, 0)); } }; template void registerFunction(FunctionFactory & factory) { factory.registerFunction(F::getNameImpl()); } } void registerFunctionsEmptyArray(FunctionFactory & factory) { registerFunction>(factory); registerFunction>(factory); registerFunction>(factory); registerFunction>(factory); registerFunction>(factory); registerFunction>(factory); registerFunction>(factory); registerFunction>(factory); registerFunction>(factory); registerFunction>(factory); registerFunction>(factory); registerFunction>(factory); registerFunction>(factory); } }