6#include <unordered_map>
7#include <unordered_set>
47 using clause_map = std::unordered_map<cnf::Clause, ClauseInfo>;
64 std::unordered_map<ThreadSafePooledString, std::reference_wrapper<DataSource>>
named_sources_;
72 std::unique_ptr<QueryGraph>
get() {
return std::move(
graph_); }
75 using ConstASTCommandVisitor::operator();
76 void operator()(Const<ast::Stmt> &s) { s.accept(*
this); }
#define M_unreachable(MSG)
ThreadSafeStringPool::proxy_type ThreadSafePooledString
Collects information of a cnf::Clause.
std::unordered_set< ThreadSafePooledString > data_sources
bool is_selection() const
std::vector< SubqueryInfo > nested_queries
void operator()(Const< ast::UseDatabaseStmt > &)
void operator()(Const< ast::UpdateStmt > &)
void operator()(Const< ast::EmptyStmt > &)
std::unique_ptr< QueryGraph > graph_
the query graph that is being constructed
void operator()(Const< ast::CreateTableStmt > &)
std::unordered_map< ThreadSafePooledString, std::reference_wrapper< DataSource > > named_sources_
maps DataSource names/aliases to the DataSource instance
void operator()(Const< ast::CreateDatabaseStmt > &)
void operator()(Const< ast::DeleteStmt > &)
void operator()(Const< ast::InsertStmt > &)
clause_map deferred_clauses_
to be handled by an outer query
void operator()(Const< ast::ErrorStmt > &)
std::vector< std::reference_wrapper< const ast::Expr > > existing_grouping_keys_
the grouping keys of the statement
void operator()(Const< ast::Stmt > &s)
std::unordered_set< std::reference_wrapper< const ast::Expr > > additional_grouping_keys_
additionally required grouping keys to perform decorrelation
void operator()(Const< ast::DropDatabaseStmt > &)
clause_map bound_clauses_
to be handled by the current query
bool needs_grouping_
whether this graph needs grouping; either by explicily grouping or implicitly by using aggregations
void operator()(Const< ast::DSVImportStmt > &)
std::unordered_map< cnf::Clause, ClauseInfo > clause_map
maps a cnf::Clause to its ClauseInfo
std::unique_ptr< QueryGraph > get()
returns the constructed QueryGraph
void operator()(Const< ast::DropTableStmt > &)
void operator()(Const< ast::SelectStmt > &s)
void process_selection(cnf::Clause &clause)
Computes correlation information of clause.
Collects info of a subquery, i.e.
const ast::QueryExpr & expr
ThreadSafePooledString alias
std::unique_ptr< GraphBuilder > builder
SubqueryInfo(const ast::QueryExpr &expr, std::unique_ptr< GraphBuilder > builder, ThreadSafePooledString alias)
A query expression for nested queries.
A cnf::Clause represents a disjunction of Predicates.