#pragma once #include #include #include namespace DB { /* view(query) * Turning subquery into a table. * Useful for passing subquery around. */ class TableFunctionView : public ITableFunction { public: static constexpr auto name = "view"; std::string getName() const override { return name; } const ASTSelectWithUnionQuery & getSelectQuery() const; private: StoragePtr executeImpl(const ASTPtr & ast_function, ContextPtr context, const String & table_name, ColumnsDescription cached_columns, bool is_insert_query) const override; const char * getStorageTypeName() const override { return "View"; } std::vector skipAnalysisForArguments(const QueryTreeNodePtr & query_node_table_function, ContextPtr context) const override; void parseArguments(const ASTPtr & ast_function, ContextPtr context) override; ColumnsDescription getActualTableStructure(ContextPtr context, bool is_insert_query) const override; ASTCreateQuery create; }; }