aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Interpreters/SelectIntersectExceptQueryVisitor.h
blob: daf6d2ea0df12a983cf09a219f2587779748e86d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once

#include <unordered_set>

#include <Parsers/IAST.h>
#include <Interpreters/InDepthNodeVisitor.h>

#include <Parsers/ASTSelectIntersectExceptQuery.h>
#include <Core/SettingsEnums.h>


namespace DB
{

class ASTFunction;
class ASTSelectWithUnionQuery;

class SelectIntersectExceptQueryMatcher
{
public:
    struct Data
    {
        const SetOperationMode intersect_default_mode;
        const SetOperationMode except_default_mode;
    };

    static bool needChildVisit(const ASTPtr &, const ASTPtr &) { return true; }

    static void visit(ASTPtr & ast, Data &);
    static void visit(ASTSelectWithUnionQuery &, Data &);
};

/// Visit children first.
using SelectIntersectExceptQueryVisitor
    = InDepthNodeVisitor<SelectIntersectExceptQueryMatcher, false>;
}