#pragma once #include #include #include #include #include namespace DB { class Context; struct ExpressionInfoMatcher { struct Data { const Context & context; const std::vector & tables; bool is_array_join = false; bool is_stateful_function = false; bool is_aggregate_function = false; std::unordered_set unique_reference_tables_pos = {}; }; static void visit(const ASTPtr & ast, Data & data); static bool needChildVisit(const ASTPtr & node, const ASTPtr &); static void visit(const ASTFunction & ast_function, const ASTPtr &, Data & data); static void visit(const ASTIdentifier & identifier, const ASTPtr &, Data & data); }; using ExpressionInfoVisitor = ConstInDepthNodeVisitor; bool hasStatefulFunction(const ASTPtr & node, const Context & context); }