aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Databases/NormalizeAndEvaluateConstantsVisitor.h
blob: bc51ddb0601895eba32326c00823be65d02b1046 (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
#pragma once

#include <Core/QualifiedTableName.h>
#include <Parsers/IAST_fwd.h>
#include <Interpreters/InDepthNodeVisitor.h>
#include <Databases/DDLLoadingDependencyVisitor.h>


namespace DB
{

/// Evaluates constants in DDL query.
class NormalizeAndEvaluateConstants : public DDLMatcherBase
{
public:
    struct Data
    {
        ContextPtr create_query_context;
    };

    using Visitor = ConstInDepthNodeVisitor<NormalizeAndEvaluateConstants, true>;

    static void visit(const ASTPtr & ast, Data & data);

private:
    static void visit(const ASTFunction & function, Data & data);
    static void visit(const ASTFunctionWithKeyValueArguments & dict_source, Data & data);
};

using NormalizeAndEvaluateConstantsVisitor = NormalizeAndEvaluateConstants::Visitor;

}