2020-09-29 16:32:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Parsers/IAST.h>
|
2021-01-04 03:12:47 +00:00
|
|
|
#include <map>
|
2020-09-29 16:32:41 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2021-01-04 03:12:47 +00:00
|
|
|
|
|
|
|
class ASTSelectWithUnionQuery;
|
|
|
|
class ASTSelectQuery;
|
|
|
|
|
2020-09-29 16:32:41 +00:00
|
|
|
/// Pull out the WITH statement from the first child of ASTSelectWithUnion query if any.
|
|
|
|
class ApplyWithGlobalVisitor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static void visit(ASTPtr & ast);
|
2021-01-04 03:12:47 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static void visit(ASTSelectWithUnionQuery & selects, const std::map<String, ASTPtr> & exprs, const ASTPtr & with_expression_list);
|
|
|
|
static void visit(ASTSelectQuery & select, const std::map<String, ASTPtr> & exprs, const ASTPtr & with_expression_list);
|
2020-09-29 16:32:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|