2019-12-18 03:56:03 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Parsers/IAST_fwd.h>
|
|
|
|
#include <Parsers/ASTFunction.h>
|
|
|
|
#include <Parsers/ASTIdentifier.h>
|
|
|
|
#include <Interpreters/InDepthNodeVisitor.h>
|
|
|
|
#include <Interpreters/DatabaseAndTableWithAlias.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class Context;
|
|
|
|
|
|
|
|
struct ExpressionInfoMatcher
|
|
|
|
{
|
|
|
|
struct Data
|
|
|
|
{
|
|
|
|
const Context & context;
|
2020-06-05 21:17:00 +00:00
|
|
|
const TablesWithColumns & tables;
|
2019-12-18 03:56:03 +00:00
|
|
|
|
|
|
|
bool is_array_join = false;
|
|
|
|
bool is_stateful_function = false;
|
|
|
|
bool is_aggregate_function = false;
|
2020-01-04 04:31:45 +00:00
|
|
|
std::unordered_set<size_t> unique_reference_tables_pos = {};
|
2019-12-18 03:56:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static void visit(const ASTPtr & ast, Data & data);
|
|
|
|
|
2020-01-06 10:33:08 +00:00
|
|
|
static bool needChildVisit(const ASTPtr & node, const ASTPtr &);
|
2019-12-18 03:56:03 +00:00
|
|
|
|
|
|
|
static void visit(const ASTFunction & ast_function, const ASTPtr &, Data & data);
|
|
|
|
|
|
|
|
static void visit(const ASTIdentifier & identifier, const ASTPtr &, Data & data);
|
|
|
|
};
|
|
|
|
|
|
|
|
using ExpressionInfoVisitor = ConstInDepthNodeVisitor<ExpressionInfoMatcher, true>;
|
|
|
|
|
2020-01-04 04:31:45 +00:00
|
|
|
bool hasStatefulFunction(const ASTPtr & node, const Context & context);
|
|
|
|
|
2019-12-18 03:56:03 +00:00
|
|
|
}
|