fix ReplaceColumnsVisitor #ci_set_analyzer

This commit is contained in:
vdimir 2024-03-23 14:29:08 +00:00
parent ee7d1cf7d9
commit 44f1f62904
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862

View File

@ -7727,12 +7727,22 @@ public:
break;
}
if (auto * function_node = node->as<FunctionNode>())
if (auto * function_node = node->as<FunctionNode>(); function_node && function_node->isResolved())
rerunFunctionResolve(function_node, context);
}
/// We want to re-run resolve for function _after_ its arguments are replaced
bool shouldTraverseTopToBottom() const { return false; }
bool needChildVisit(QueryTreeNodePtr & /* parent */, QueryTreeNodePtr & child)
{
/// Visit only expressions, but not subqueries
return child->getNodeType() == QueryTreeNodeType::IDENTIFIER
|| child->getNodeType() == QueryTreeNodeType::LIST
|| child->getNodeType() == QueryTreeNodeType::FUNCTION
|| child->getNodeType() == QueryTreeNodeType::COLUMN;
}
private:
const QueryTreeNodePtrWithHashMap<QueryTreeNodePtr> & replacement_map;
const ContextPtr & context;