This commit is contained in:
Yakov Olkhovskiy 2024-09-14 13:32:52 +00:00
parent dbb1d043fe
commit 56cfa74a14
2 changed files with 12 additions and 2 deletions

View File

@ -16,7 +16,12 @@ public:
{
public:
explicit ArgumentTreeNode(const IQueryTreeNode * argument_) : argument(argument_) {}
std::unique_ptr<AbstractFunction> getFunction() const override { return std::make_unique<FunctionTreeNode>(*argument->as<FunctionNode>()); }
std::unique_ptr<AbstractFunction> getFunction() const override
{
if (const auto * f = argument->as<FunctionNode>())
return std::make_unique<FunctionTreeNode>(*f);
return nullptr;
}
bool isIdentifier() const override { return argument->as<IdentifierNode>(); }
bool tryGetString(String * res, bool allow_identifier = true) const override
{

View File

@ -16,7 +16,12 @@ public:
{
public:
explicit ArgumentAST(const IAST * argument_) : argument(argument_) {}
std::unique_ptr<AbstractFunction> getFunction() const override { return std::make_unique<FunctionAST>(*argument->as<ASTFunction>()); }
std::unique_ptr<AbstractFunction> getFunction() const override
{
if (const auto * f = argument->as<ASTFunction>())
return std::make_unique<FunctionAST>(*f);
return nullptr;
}
bool isIdentifier() const override { return argument->as<ASTIdentifier>(); }
bool tryGetString(String * res, bool allow_identifier = true) const override
{