2019-05-28 18:27:00 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <TableFunctions/ITableFunction.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2020-05-20 20:16:32 +00:00
|
|
|
|
|
|
|
class Context;
|
|
|
|
|
2019-05-28 18:27:00 +00:00
|
|
|
/* input(structure) - allows to make INSERT SELECT from incoming stream of data
|
|
|
|
*/
|
|
|
|
class TableFunctionInput : public ITableFunction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr auto name = "input";
|
|
|
|
std::string getName() const override { return name; }
|
2020-10-14 12:19:29 +00:00
|
|
|
bool hasStaticStructure() const override { return true; }
|
2019-05-28 18:27:00 +00:00
|
|
|
|
|
|
|
private:
|
2020-10-14 12:19:29 +00:00
|
|
|
StoragePtr executeImpl(const ASTPtr & ast_function, const Context & context, const std::string & table_name, ColumnsDescription cached_columns) const override;
|
2020-04-06 05:19:40 +00:00
|
|
|
const char * getStorageTypeName() const override { return "Input"; }
|
2020-10-14 12:19:29 +00:00
|
|
|
|
|
|
|
ColumnsDescription getActualTableStructure(const Context & context) const override;
|
|
|
|
void parseArguments(const ASTPtr & ast_function, const Context & context) override;
|
|
|
|
|
|
|
|
String structure;
|
2019-05-28 18:27:00 +00:00
|
|
|
};
|
2020-05-20 20:16:32 +00:00
|
|
|
|
2019-05-28 18:27:00 +00:00
|
|
|
}
|