2023-02-03 20:05:18 +00:00
|
|
|
#pragma once
|
|
|
|
#include <Core/Field.h>
|
|
|
|
#include <Parsers/IAST_fwd.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
struct FieldFromASTImpl : public CustomType::CustomTypeImpl
|
|
|
|
{
|
|
|
|
static constexpr auto name = "AST";
|
|
|
|
|
|
|
|
explicit FieldFromASTImpl(ASTPtr ast_) : ast(ast_) {}
|
|
|
|
|
|
|
|
const char * getTypeName() const override { return name; }
|
2023-02-21 18:24:01 +00:00
|
|
|
String toString(bool show_secrets) const override;
|
|
|
|
bool isSecret() const override;
|
2023-02-03 20:05:18 +00:00
|
|
|
|
2023-02-06 16:20:29 +00:00
|
|
|
[[noreturn]] void throwNotImplemented(std::string_view method) const;
|
|
|
|
|
|
|
|
bool operator < (const CustomTypeImpl &) const override { throwNotImplemented("<"); }
|
|
|
|
bool operator <= (const CustomTypeImpl &) const override { throwNotImplemented("<="); }
|
|
|
|
bool operator > (const CustomTypeImpl &) const override { throwNotImplemented(">"); }
|
|
|
|
bool operator >= (const CustomTypeImpl &) const override { throwNotImplemented(">="); }
|
|
|
|
bool operator == (const CustomTypeImpl &) const override { throwNotImplemented("=="); }
|
|
|
|
|
2023-02-03 20:05:18 +00:00
|
|
|
ASTPtr ast;
|
|
|
|
};
|
|
|
|
|
2023-02-04 12:49:32 +00:00
|
|
|
Field createFieldFromAST(ASTPtr ast);
|
2023-02-03 20:05:18 +00:00
|
|
|
|
|
|
|
}
|