2021-05-09 09:47:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Interpreters/IInterpreter.h>
|
2021-08-23 14:31:58 +00:00
|
|
|
|
2021-05-09 09:47:29 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2021-07-19 23:34:04 +00:00
|
|
|
class Context;
|
2021-05-09 09:47:29 +00:00
|
|
|
|
2021-08-18 09:29:52 +00:00
|
|
|
class InterpreterCreateFunctionQuery : public IInterpreter, WithContext
|
2021-05-09 09:47:29 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-10-14 13:15:39 +00:00
|
|
|
InterpreterCreateFunctionQuery(const ASTPtr & query_ptr_, ContextPtr context_, bool persist_function_)
|
2021-08-18 09:29:52 +00:00
|
|
|
: WithContext(context_)
|
|
|
|
, query_ptr(query_ptr_)
|
2021-10-14 13:15:39 +00:00
|
|
|
, persist_function(persist_function_) {}
|
2021-05-09 09:47:29 +00:00
|
|
|
|
|
|
|
BlockIO execute() override;
|
|
|
|
|
2021-07-20 20:20:23 +00:00
|
|
|
void setInternal(bool internal_);
|
|
|
|
|
2021-05-10 22:35:22 +00:00
|
|
|
private:
|
2021-07-03 20:17:02 +00:00
|
|
|
static void validateFunction(ASTPtr function, const String & name);
|
|
|
|
static void validateFunctionRecursiveness(ASTPtr node, const String & function_to_create);
|
2021-05-10 22:35:22 +00:00
|
|
|
|
2021-05-09 09:47:29 +00:00
|
|
|
ASTPtr query_ptr;
|
2021-10-14 13:15:39 +00:00
|
|
|
bool persist_function;
|
2021-05-09 09:47:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|