ClickHouse/src/Interpreters/ExtractExpressionInfoVisitor.h

42 lines
1.1 KiB
C++
Raw Normal View History

2019-12-18 03:56:03 +00:00
#pragma once
#include <Interpreters/Context_fwd.h>
#include <Interpreters/DatabaseAndTableWithAlias.h>
#include <Interpreters/InDepthNodeVisitor.h>
2019-12-18 03:56:03 +00:00
#include <Parsers/ASTFunction.h>
#include <Parsers/ASTIdentifier.h>
#include <Parsers/IAST_fwd.h>
2019-12-18 03:56:03 +00:00
namespace DB
{
struct ExpressionInfoMatcher
{
2021-06-01 12:20:52 +00:00
struct Data : public WithContext
2019-12-18 03:56:03 +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-12-24 04:03:33 +00:00
bool is_window_function = false;
bool is_deterministic_function = true;
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>;
2021-06-01 12:20:52 +00:00
bool hasNonRewritableFunction(const ASTPtr & node, ContextPtr context);
2019-12-18 03:56:03 +00:00
}