aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Functions/UserDefined/UserDefinedExecutableFunctionFactory.h
blob: ad10cb3c10fb9fa52729d47990789ce8513a2f85 (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
#pragma once

#include <functional>
#include <memory>
#include <string>
#include <unordered_map>

#include <Core/Field.h>
#include <Functions/IFunction.h>
#include <Interpreters/Context_fwd.h>


namespace DB
{

class UserDefinedExecutableFunctionFactory
{
public:
    using Creator = std::function<FunctionOverloadResolverPtr(ContextPtr)>;

    static UserDefinedExecutableFunctionFactory & instance();

    static FunctionOverloadResolverPtr get(const String & function_name, ContextPtr context, Array parameters = {});

    static FunctionOverloadResolverPtr tryGet(const String & function_name, ContextPtr context, Array parameters = {});

    static bool has(const String & function_name, ContextPtr context);

    static std::vector<String> getRegisteredNames(ContextPtr context);

};

}