aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Interpreters/OptimizeIfWithConstantConditionVisitor.h
blob: ad98f92bafd2a22aed896f697dd674d40b4e260e (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
#pragma once

#include <Interpreters/Aliases.h>

namespace DB
{

/// It removes Function_if node from AST if condition is constant.
/// TODO: rewrite with InDepthNodeVisitor
class OptimizeIfWithConstantConditionVisitor
{
public:
    explicit OptimizeIfWithConstantConditionVisitor(Aliases & aliases_)
        : aliases(aliases_)
    {}

    void visit(ASTPtr & ast);

private:
    Aliases & aliases;
};

}