ClickHouse/src/Interpreters/NormalizeSelectWithUnionQueryVisitor.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
805 B
C++
Raw Normal View History

2021-02-25 07:47:08 +00:00
#pragma once
#include <unordered_set>
#include <Interpreters/InDepthNodeVisitor.h>
#include <Parsers/IAST_fwd.h>
2021-02-25 07:47:08 +00:00
#include <Core/Settings.h>
namespace DB
{
class ASTFunction;
class ASTSelectWithUnionQuery;
2021-02-25 07:47:08 +00:00
class NormalizeSelectWithUnionQueryMatcher
{
public:
struct Data
{
2022-08-30 10:09:01 +00:00
const SetOperationMode union_default_mode;
2021-02-25 07:47:08 +00:00
};
2021-08-16 12:03:55 +00:00
static void getSelectsFromUnionListNode(ASTPtr ast_select, ASTs & selects);
2021-02-25 07:47:08 +00:00
static void visit(ASTPtr & ast, Data &);
static void visit(ASTSelectWithUnionQuery &, Data &);
static bool needChildVisit(const ASTPtr &, const ASTPtr &) { return true; }
};
/// We need normalize children first, so we should visit AST tree bottom up
using NormalizeSelectWithUnionQueryVisitor
= InDepthNodeVisitor<NormalizeSelectWithUnionQueryMatcher, false>;
}