2017-06-10 09:04:31 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <TableFunctions/ITableFunction.h>
|
2018-06-20 08:09:09 +00:00
|
|
|
#include <Core/Types.h>
|
2017-06-10 09:04:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/* numbers(limit)
|
|
|
|
* - the same as SELECT number FROM system.numbers LIMIT limit.
|
|
|
|
* Used for testing purposes, as a simple example of table function.
|
|
|
|
*/
|
|
|
|
class TableFunctionNumbers : public ITableFunction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr auto name = "numbers";
|
|
|
|
std::string getName() const override { return name; }
|
2018-03-02 05:03:28 +00:00
|
|
|
private:
|
2019-07-18 18:29:49 +00:00
|
|
|
StoragePtr executeImpl(const ASTPtr & ast_function, const Context & context, const std::string & table_name) const override;
|
2018-06-20 08:09:09 +00:00
|
|
|
|
|
|
|
UInt64 evaluateArgument(const Context & context, ASTPtr & argument) const;
|
2017-06-10 09:04:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|