OmniSciDB
bf83d84833
|
#include <RelAlgDagBuilder.h>
Public Member Functions | |
RelAlgDagBuilder ()=delete | |
RelAlgDagBuilder (const std::string &query_ra, const Catalog_Namespace::Catalog &cat, const RenderInfo *render_info) | |
RelAlgDagBuilder (RelAlgDagBuilder &root_dag_builder, const rapidjson::Value &query_ast, const Catalog_Namespace::Catalog &cat, const RenderInfo *render_opts) | |
void | eachNode (std::function< void(RelAlgNode const *)> const &) const |
const RelAlgNode & | getRootNode () const |
std::shared_ptr< const RelAlgNode > | getRootNodeShPtr () const |
void | registerSubquery (std::shared_ptr< RexSubQuery > subquery) |
const std::vector < std::shared_ptr< RexSubQuery > > & | getSubqueries () const |
void | registerQueryHints (QueryHint &query_hint) |
const QueryHint | getQueryHints () const |
void | resetQueryExecutionState () |
Private Member Functions | |
void | build (const rapidjson::Value &query_ast, RelAlgDagBuilder &root_dag_builder) |
Private Attributes | |
const Catalog_Namespace::Catalog & | cat_ |
std::vector< std::shared_ptr < RelAlgNode > > | nodes_ |
std::vector< std::shared_ptr < RexSubQuery > > | subqueries_ |
const RenderInfo * | render_info_ |
QueryHint | query_hint_ |
Builder class to create an in-memory, easy-to-navigate relational algebra DAG interpreted from a JSON representation from Calcite. Also, applies high level optimizations which can be expressed through relational algebra extended with RelCompound. The RelCompound node is an equivalent representation for sequences of RelFilter, RelProject and RelAggregate nodes. This coalescing minimizes the amount of intermediate buffers required to evaluate a query. Lower level optimizations are taken care by lower levels, mainly RelAlgTranslator and the IR code generation.
Definition at line 1775 of file RelAlgDagBuilder.h.
|
delete |
RelAlgDagBuilder::RelAlgDagBuilder | ( | const std::string & | query_ra, |
const Catalog_Namespace::Catalog & | cat, | ||
const RenderInfo * | render_info | ||
) |
Constructs a RelAlg DAG from a JSON representation.
query_ra | A JSON string representation of an RA tree from Calcite. |
cat | DB catalog for the current user. |
render_opts | Additional build options for render queries. |
Definition at line 2575 of file RelAlgDagBuilder.cpp.
References build(), CHECK, logger::ERROR, LOG, RelAlgNode::resetRelAlgFirstId(), and VLOG.
RelAlgDagBuilder::RelAlgDagBuilder | ( | RelAlgDagBuilder & | root_dag_builder, |
const rapidjson::Value & | query_ast, | ||
const Catalog_Namespace::Catalog & | cat, | ||
const RenderInfo * | render_opts | ||
) |
Constructs a sub-DAG for any subqueries. Should only be called during DAG building.
root_dag_builder | The root DAG builder. The root stores pointers to all subqueries. |
query_ast | The current JSON node to build a DAG for. |
cat | DB catalog for the current user. |
render_opts | Additional build options for render queries. |
Definition at line 2596 of file RelAlgDagBuilder.cpp.
References build().
|
private |
Definition at line 2604 of file RelAlgDagBuilder.cpp.
References anonymous_namespace{RelAlgDagBuilder.cpp}::add_window_function_pre_project(), alterRAForRender(), anonymous_namespace{RelAlgDagBuilder.cpp}::bind_inputs(), cat_, CHECK, anonymous_namespace{RelAlgDagBuilder.cpp}::coalesce_nodes(), anonymous_namespace{RelLeftDeepInnerJoin.cpp}::create_left_deep_join(), eliminate_dead_columns(), eliminate_dead_subqueries(), eliminate_identical_copy(), field(), fold_filters(), g_cluster, get_left_deep_join_root(), anonymous_namespace{RelAlgDagBuilder.cpp}::handleQueryHint(), hoist_filter_cond_to_cross_join(), anonymous_namespace{RelAlgDagBuilder.cpp}::mark_nops(), nodes_, render_info_, details::RelAlgDispatcher::run(), anonymous_namespace{RelAlgDagBuilder.cpp}::separate_window_function_expressions(), simplify_sort(), sink_projected_boolean_expr_to_join(), and subqueries_.
Referenced by RelAlgDagBuilder().
void RelAlgDagBuilder::eachNode | ( | std::function< void(RelAlgNode const *)> const & | callback | ) | const |
Definition at line 2655 of file RelAlgDagBuilder.cpp.
References nodes_.
|
inline |
|
inline |
Returns the root node of the DAG.
Definition at line 1808 of file RelAlgDagBuilder.h.
|
inline |
Definition at line 1815 of file RelAlgDagBuilder.h.
Referenced by anonymous_namespace{RelAlgDagBuilder.cpp}::parse_subquery().
|
inline |
Gets all registered subqueries. Only the root DAG can contain subqueries.
Definition at line 1831 of file RelAlgDagBuilder.h.
References subqueries_.
|
inline |
|
inline |
Registers a subquery with a root DAG builder. Should only be called during DAG building and registration should only occur on the root.
Definition at line 1824 of file RelAlgDagBuilder.h.
References subqueries_.
Referenced by anonymous_namespace{RelAlgDagBuilder.cpp}::parse_subquery().
void RelAlgDagBuilder::resetQueryExecutionState | ( | ) |
Gets all registered subqueries. Only the root DAG can contain subqueries.
Definition at line 2664 of file RelAlgDagBuilder.cpp.
References nodes_.
|
private |
Definition at line 1847 of file RelAlgDagBuilder.h.
Referenced by build().
|
private |
Definition at line 1848 of file RelAlgDagBuilder.h.
Referenced by build(), eachNode(), getRootNode(), getRootNodeShPtr(), and resetQueryExecutionState().
|
private |
Definition at line 1851 of file RelAlgDagBuilder.h.
Referenced by getQueryHints(), and registerQueryHints().
|
private |
Definition at line 1850 of file RelAlgDagBuilder.h.
Referenced by build().
|
private |
Definition at line 1849 of file RelAlgDagBuilder.h.
Referenced by build(), getSubqueries(), and registerSubquery().