2021-09-09 13:47:48 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
#include <unordered_map>
|
|
|
|
|
2022-05-31 20:27:49 +00:00
|
|
|
#include <Core/Field.h>
|
2021-09-09 13:47:48 +00:00
|
|
|
#include <Functions/IFunction.h>
|
2022-05-31 20:27:49 +00:00
|
|
|
#include <Interpreters/Context_fwd.h>
|
2021-09-09 13:47:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2021-09-17 13:04:44 +00:00
|
|
|
class UserDefinedExecutableFunctionFactory
|
2021-09-09 13:47:48 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
using Creator = std::function<FunctionOverloadResolverPtr(ContextPtr)>;
|
|
|
|
|
|
|
|
static UserDefinedExecutableFunctionFactory & instance();
|
|
|
|
|
2022-05-31 20:27:49 +00:00
|
|
|
static FunctionOverloadResolverPtr get(const String & function_name, ContextPtr context, Array parameters = {});
|
2021-09-09 13:47:48 +00:00
|
|
|
|
2022-05-31 20:27:49 +00:00
|
|
|
static FunctionOverloadResolverPtr tryGet(const String & function_name, ContextPtr context, Array parameters = {});
|
2021-09-09 13:47:48 +00:00
|
|
|
|
2021-10-27 15:49:18 +00:00
|
|
|
static bool has(const String & function_name, ContextPtr context);
|
|
|
|
|
2021-09-17 13:04:44 +00:00
|
|
|
static std::vector<String> getRegisteredNames(ContextPtr context);
|
2021-09-09 13:47:48 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|