#pragma once #include #include namespace DB { /* numbers(limit), numbers_mt(limit) * - the same as SELECT number FROM system.numbers LIMIT limit. * Used for testing purposes, as a simple example of table function. */ template class TableFunctionNumbers : public ITableFunction { public: static constexpr auto name = multithreaded ? "numbers_mt" : "numbers"; std::string getName() const override { return name; } bool hasStaticStructure() const override { return true; } private: StoragePtr executeImpl(const ASTPtr & ast_function, ContextPtr context, const std::string & table_name, ColumnsDescription cached_columns) const override; const char * getStorageTypeName() const override { return "SystemNumbers"; } UInt64 evaluateArgument(ContextPtr context, ASTPtr & argument) const; ColumnsDescription getActualTableStructure(ContextPtr context) const override; }; }