OmniSciDB
085a039ca4
|
Namespaces | |
anonymous_namespace{RelAlgDagBuilder.cpp} | |
Classes | |
class | RexRebindInputsVisitor |
class | RexRebindReindexInputsVisitor |
class | PushDownGenericExpressionInWindowFunction |
class | RANodeIterator |
class | WindowFunctionCollector |
class | RexWindowFuncReplacementVisitor |
class | RexInputCollector |
Typedefs | |
using | RexInputSet = std::unordered_set< RexInput > |
Functions | |
std::vector< RexInput > | n_outputs (const RelAlgNode *node, const size_t n) |
bool | isRenamedInput (const RelAlgNode *node, const size_t index, const std::string &new_name) |
std::vector< std::unique_ptr < const RexAgg > > | copyAggExprs (std::vector< std::unique_ptr< const RexAgg >> const &agg_exprs) |
std::vector< std::unique_ptr < const RexScalar > > | copyRexScalars (std::vector< std::unique_ptr< const RexScalar >> const &scalar_sources) |
std::vector< const Rex * > | remapTargetPointers (std::vector< std::unique_ptr< const RexAgg >> const &agg_exprs_new, std::vector< std::unique_ptr< const RexScalar >> const &scalar_sources_new, std::vector< std::unique_ptr< const RexAgg >> const &agg_exprs_old, std::vector< std::unique_ptr< const RexScalar >> const &scalar_sources_old, std::vector< const Rex * > const &target_exprs_old) |
std::set< std::pair< const RelAlgNode *, int > > | get_equiv_cols (const RelAlgNode *node, const size_t which_col) |
unsigned | node_id (const rapidjson::Value &ra_node) noexcept |
std::string | json_node_to_string (const rapidjson::Value &node) noexcept |
std::unique_ptr< RexAbstractInput > | parse_abstract_input (const rapidjson::Value &expr) noexcept |
std::unique_ptr< RexLiteral > | parse_literal (const rapidjson::Value &expr) |
std::unique_ptr< const RexScalar > | parse_scalar_expr (const rapidjson::Value &expr, const Catalog_Namespace::Catalog &cat, RelAlgDagBuilder &root_dag_builder) |
SQLTypeInfo | parse_type (const rapidjson::Value &type_obj) |
std::vector< std::unique_ptr < const RexScalar > > | parse_expr_array (const rapidjson::Value &arr, const Catalog_Namespace::Catalog &cat, RelAlgDagBuilder &root_dag_builder) |
SqlWindowFunctionKind | parse_window_function_kind (const std::string &name) |
std::vector< std::unique_ptr < const RexScalar > > | parse_window_order_exprs (const rapidjson::Value &arr, const Catalog_Namespace::Catalog &cat, RelAlgDagBuilder &root_dag_builder) |
SortDirection | parse_sort_direction (const rapidjson::Value &collation) |
NullSortedPosition | parse_nulls_position (const rapidjson::Value &collation) |
std::vector< SortField > | parse_window_order_collation (const rapidjson::Value &arr, const Catalog_Namespace::Catalog &cat, RelAlgDagBuilder &root_dag_builder) |
RexWindowFunctionOperator::RexWindowBound | parse_window_bound (const rapidjson::Value &window_bound_obj, const Catalog_Namespace::Catalog &cat, RelAlgDagBuilder &root_dag_builder) |
std::unique_ptr< const RexSubQuery > | parse_subquery (const rapidjson::Value &expr, const Catalog_Namespace::Catalog &cat, RelAlgDagBuilder &root_dag_builder) |
std::unique_ptr< RexOperator > | parse_operator (const rapidjson::Value &expr, const Catalog_Namespace::Catalog &cat, RelAlgDagBuilder &root_dag_builder) |
std::unique_ptr< RexCase > | parse_case (const rapidjson::Value &expr, const Catalog_Namespace::Catalog &cat, RelAlgDagBuilder &root_dag_builder) |
std::vector< std::string > | strings_from_json_array (const rapidjson::Value &json_str_arr) noexcept |
std::vector< size_t > | indices_from_json_array (const rapidjson::Value &json_idx_arr) noexcept |
std::unique_ptr< const RexAgg > | parse_aggregate_expr (const rapidjson::Value &expr) |
JoinType | to_join_type (const std::string &join_type_name) |
std::unique_ptr< const RexScalar > | disambiguate_rex (const RexScalar *, const RANodeOutput &) |
std::unique_ptr< const RexOperator > | disambiguate_operator (const RexOperator *rex_operator, const RANodeOutput &ra_output) noexcept |
std::unique_ptr< const RexCase > | disambiguate_case (const RexCase *rex_case, const RANodeOutput &ra_output) |
void | bind_project_to_input (RelProject *project_node, const RANodeOutput &input) noexcept |
void | bind_table_func_to_input (RelTableFunction *table_func_node, const RANodeOutput &input) noexcept |
void | bind_inputs (const std::vector< std::shared_ptr< RelAlgNode >> &nodes) noexcept |
void | handle_query_hint (const std::vector< std::shared_ptr< RelAlgNode >> &nodes, RelAlgDagBuilder *dag_builder) noexcept |
void | compute_node_hash (const std::vector< std::shared_ptr< RelAlgNode >> &nodes) |
void | mark_nops (const std::vector< std::shared_ptr< RelAlgNode >> &nodes) noexcept |
void | create_compound (std::vector< std::shared_ptr< RelAlgNode >> &nodes, const std::vector< size_t > &pattern, std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint >> &query_hints) noexcept |
void | coalesce_nodes (std::vector< std::shared_ptr< RelAlgNode >> &nodes, const std::vector< const RelAlgNode * > &left_deep_joins, std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint >> &query_hints) |
void | propagate_hints_to_new_project (std::shared_ptr< RelProject > prev_node, std::shared_ptr< RelProject > new_node, std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint >> &query_hints) |
void | separate_window_function_expressions (std::vector< std::shared_ptr< RelAlgNode >> &nodes, std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint >> &query_hints) |
void | add_window_function_pre_project (std::vector< std::shared_ptr< RelAlgNode >> &nodes, const bool always_add_project_if_first_project_is_window_expr, std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint >> &query_hints) |
int64_t | get_int_literal_field (const rapidjson::Value &obj, const char field[], const int64_t default_val) noexcept |
void | check_empty_inputs_field (const rapidjson::Value &node) noexcept |
const TableDescriptor * | getTableFromScanNode (const Catalog_Namespace::Catalog &cat, const rapidjson::Value &scan_ra) |
std::vector< std::string > | getFieldNamesFromScanNode (const rapidjson::Value &scan_ra) |
Variables | |
const unsigned | FIRST_RA_NODE_ID = 1 |
using anonymous_namespace{RelAlgDagBuilder.cpp}::RexInputSet = typedef std::unordered_set<RexInput> |
Definition at line 2372 of file RelAlgDagBuilder.cpp.
void anonymous_namespace{RelAlgDagBuilder.cpp}::add_window_function_pre_project | ( | std::vector< std::shared_ptr< RelAlgNode >> & | nodes, |
const bool | always_add_project_if_first_project_is_window_expr, | ||
std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint >> & | query_hints | ||
) |
Inserts a simple project before any project containing a window function node. Forces all window function inputs into a single contiguous buffer for centralized processing (e.g. in distributed mode). This is also needed when a window function node is preceded by a filter node, both for correctness (otherwise a window operator will be coalesced with its preceding filter node and be computer over unfiltered results, and for performance, as currently filter nodes that are not coalesced into projects keep all columns from the table as inputs, and hence bring everything in memory. Once the new project has been created, the inputs in the window function project must be rewritten to read from the new project, and to index off the projected exprs in the new project.
Definition at line 2401 of file RelAlgDagBuilder.cpp.
References anonymous_namespace{Utm.h}::a, CHECK, CHECK_EQ, RelAggregate::getGroupByCount(), RelProject::getProjectAt(), propagate_hints_to_new_project(), gpu_enabled::sort(), RexVisitorBase< T >::visit(), and VLOG.
Referenced by RelAlgDagBuilder::build().
|
noexcept |
Definition at line 1417 of file RelAlgDagBuilder.cpp.
References bind_project_to_input(), bind_table_func_to_input(), CHECK_EQ, disambiguate_rex(), and get_node_output().
Referenced by RelAlgDagBuilder::build().
|
noexcept |
Definition at line 1389 of file RelAlgDagBuilder.cpp.
References CHECK_EQ, and disambiguate_rex().
Referenced by bind_inputs(), and create_compound().
|
noexcept |
Definition at line 1403 of file RelAlgDagBuilder.cpp.
References disambiguate_rex().
Referenced by bind_inputs().
|
noexcept |
Definition at line 2599 of file RelAlgDagBuilder.cpp.
References CHECK, and field().
Referenced by details::RelAlgDispatcher::dispatchTableScan().
void anonymous_namespace{RelAlgDagBuilder.cpp}::coalesce_nodes | ( | std::vector< std::shared_ptr< RelAlgNode >> & | nodes, |
const std::vector< const RelAlgNode * > & | left_deep_joins, | ||
std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint >> & | query_hints | ||
) |
Definition at line 1904 of file RelAlgDagBuilder.cpp.
References anonymous_namespace{RelAlgDagBuilder.cpp}::RANodeIterator::allVisited(), CHECK, CHECK_GE, create_compound(), anonymous_namespace{RelAlgDagBuilder.cpp}::anonymous_namespace{RelAlgDagBuilder.cpp}::input_can_be_coalesced(), and gpu_enabled::swap().
Referenced by RelAlgDagBuilder::build().
void anonymous_namespace{RelAlgDagBuilder.cpp}::compute_node_hash | ( | const std::vector< std::shared_ptr< RelAlgNode >> & | nodes | ) |
Definition at line 1491 of file RelAlgDagBuilder.cpp.
References CHECK_NE.
Referenced by RelAlgDagBuilder::build().
std::vector<std::unique_ptr<const RexAgg> > anonymous_namespace{RelAlgDagBuilder.cpp}::copyAggExprs | ( | std::vector< std::unique_ptr< const RexAgg >> const & | agg_exprs | ) |
Definition at line 616 of file RelAlgDagBuilder.cpp.
std::vector<std::unique_ptr<const RexScalar> > anonymous_namespace{RelAlgDagBuilder.cpp}::copyRexScalars | ( | std::vector< std::unique_ptr< const RexScalar >> const & | scalar_sources | ) |
Definition at line 626 of file RelAlgDagBuilder.cpp.
References RexVisitorBase< T >::visit().
|
noexcept |
Definition at line 1565 of file RelAlgDagBuilder.cpp.
References bind_project_to_input(), CHECK, CHECK_EQ, CHECK_GE, CHECK_LE, CHECK_LT, RegisteredQueryHint::defaults(), get_node_output(), RelProject::getFields(), anonymous_namespace{RelAlgExecutor.cpp}::is_agg(), node_id(), anonymous_namespace{RelAlgDagBuilder.cpp}::anonymous_namespace{RelAlgDagBuilder.cpp}::reproject_targets(), and run_benchmark_import::result.
Referenced by coalesce_nodes().
std::unique_ptr<const RexCase> anonymous_namespace{RelAlgDagBuilder.cpp}::disambiguate_case | ( | const RexCase * | rex_case, |
const RANodeOutput & | ra_output | ||
) |
Definition at line 1342 of file RelAlgDagBuilder.cpp.
References RexCase::branchCount(), disambiguate_rex(), RexCase::getElse(), RexCase::getThen(), and RexCase::getWhen().
Referenced by disambiguate_rex().
|
noexcept |
Definition at line 1307 of file RelAlgDagBuilder.cpp.
References disambiguate_rex(), and RexWindowFunctionOperator::getPartitionKeys().
Referenced by disambiguate_rex().
std::unique_ptr< const RexScalar > anonymous_namespace{RelAlgDagBuilder.cpp}::disambiguate_rex | ( | const RexScalar * | rex_scalar, |
const RANodeOutput & | ra_output | ||
) |
Definition at line 1363 of file RelAlgDagBuilder.cpp.
References CHECK_LT, disambiguate_case(), and disambiguate_operator().
Referenced by bind_inputs(), bind_project_to_input(), bind_table_func_to_input(), disambiguate_case(), and disambiguate_operator().
std::set<std::pair<const RelAlgNode*, int> > anonymous_namespace{RelAlgDagBuilder.cpp}::get_equiv_cols | ( | const RelAlgNode * | node, |
const size_t | which_col | ||
) |
Definition at line 739 of file RelAlgDagBuilder.cpp.
References CHECK, and CHECK_EQ.
Referenced by RelSort::hasEquivCollationOf().
|
noexcept |
Definition at line 2585 of file RelAlgDagBuilder.cpp.
References CHECK_EQ, field(), kDECIMAL, and parse_literal().
Referenced by details::RelAlgDispatcher::dispatchSort().
std::vector<std::string> anonymous_namespace{RelAlgDagBuilder.cpp}::getFieldNamesFromScanNode | ( | const rapidjson::Value & | scan_ra | ) |
Definition at line 2614 of file RelAlgDagBuilder.cpp.
References field(), and strings_from_json_array().
Referenced by details::RelAlgDispatcher::dispatchTableScan().
const TableDescriptor* anonymous_namespace{RelAlgDagBuilder.cpp}::getTableFromScanNode | ( | const Catalog_Namespace::Catalog & | cat, |
const rapidjson::Value & | scan_ra | ||
) |
Definition at line 2604 of file RelAlgDagBuilder.cpp.
References CHECK, CHECK_EQ, field(), and Catalog_Namespace::Catalog::getMetadataForTable().
Referenced by details::RelAlgDispatcher::dispatchModify(), and details::RelAlgDispatcher::dispatchTableScan().
|
noexcept |
Definition at line 1458 of file RelAlgDagBuilder.cpp.
References RelProject::getDeliveredHints(), RelAggregate::getDeliveredHints(), and RelCompound::getDeliveredHints().
Referenced by RelAlgDagBuilder::build().
|
noexcept |
Definition at line 1235 of file RelAlgDagBuilder.cpp.
References CHECK, and CHECK_GE.
Referenced by details::RelAlgDispatcher::dispatchAggregate(), and parse_aggregate_expr().
bool anonymous_namespace{RelAlgDagBuilder.cpp}::isRenamedInput | ( | const RelAlgNode * | node, |
const size_t | index, | ||
const std::string & | new_name | ||
) |
Definition at line 470 of file RelAlgDagBuilder.cpp.
References CHECK, CHECK_EQ, CHECK_GE, CHECK_LT, RelAlgNode::getInput(), join(), and RelAlgNode::size().
Referenced by RelProject::isRenaming().
|
noexcept |
Definition at line 900 of file RelAlgDagBuilder.cpp.
Referenced by details::RelAlgDispatcher::dispatchModify(), parse_scalar_expr(), and parse_type().
|
noexcept |
Definition at line 1505 of file RelAlgDagBuilder.cpp.
References CHECK_EQ, and RelAlgNode::markAsNop().
Referenced by RelAlgDagBuilder::build().
std::vector<RexInput> anonymous_namespace{RelAlgDagBuilder.cpp}::n_outputs | ( | const RelAlgNode * | node, |
const size_t | n | ||
) |
Definition at line 96 of file RelAlgDagBuilder.cpp.
References anonymous_namespace{Utm.h}::n.
Referenced by get_node_output().
|
noexcept |
Definition at line 895 of file RelAlgDagBuilder.cpp.
References field(), and json_str().
Referenced by create_compound(), details::RelAlgDispatcher::dispatchFilter(), RaExecutionSequence::extractQueryStepSkippingInfo(), QueryPlanDagExtractor::handleTranslatedJoin(), details::RelAlgDispatcher::prev(), and details::RelAlgDispatcher::run().
|
noexcept |
Definition at line 911 of file RelAlgDagBuilder.cpp.
References field(), and json_i64().
Referenced by parse_scalar_expr().
std::unique_ptr<const RexAgg> anonymous_namespace{RelAlgDagBuilder.cpp}::parse_aggregate_expr | ( | const rapidjson::Value & | expr | ) |
Definition at line 1248 of file RelAlgDagBuilder.cpp.
References field(), indices_from_json_array(), logger::INFO, json_bool(), json_str(), kAPPROX_COUNT_DISTINCT, kAPPROX_QUANTILE, LOG, parse_type(), and to_agg_kind().
Referenced by details::RelAlgDispatcher::dispatchAggregate().
std::unique_ptr<RexCase> anonymous_namespace{RelAlgDagBuilder.cpp}::parse_case | ( | const rapidjson::Value & | expr, |
const Catalog_Namespace::Catalog & | cat, | ||
RelAlgDagBuilder & | root_dag_builder | ||
) |
Definition at line 1201 of file RelAlgDagBuilder.cpp.
References CHECK, CHECK_GE, field(), and parse_scalar_expr().
Referenced by parse_scalar_expr().
std::vector<std::unique_ptr<const RexScalar> > anonymous_namespace{RelAlgDagBuilder.cpp}::parse_expr_array | ( | const rapidjson::Value & | arr, |
const Catalog_Namespace::Catalog & | cat, | ||
RelAlgDagBuilder & | root_dag_builder | ||
) |
Definition at line 1022 of file RelAlgDagBuilder.cpp.
References parse_scalar_expr().
Referenced by parse_operator().
std::unique_ptr<RexLiteral> anonymous_namespace{RelAlgDagBuilder.cpp}::parse_literal | ( | const rapidjson::Value & | expr | ) |
Definition at line 917 of file RelAlgDagBuilder.cpp.
References CHECK, field(), json_bool(), json_double(), json_i64(), json_str(), kBIGINT, kBOOLEAN, kDATE, kDECIMAL, kDOUBLE, kINT, kINTERVAL_DAY_TIME, kINTERVAL_YEAR_MONTH, kNULLT, kTEXT, kTIME, kTIMESTAMP, to_sql_type(), run_benchmark_import::type, and UNREACHABLE.
Referenced by details::RelAlgDispatcher::dispatchLogicalValues(), get_int_literal_field(), and parse_scalar_expr().
NullSortedPosition anonymous_namespace{RelAlgDagBuilder.cpp}::parse_nulls_position | ( | const rapidjson::Value & | collation | ) |
Definition at line 1102 of file RelAlgDagBuilder.cpp.
References field(), First, json_str(), and Last.
Referenced by details::RelAlgDispatcher::dispatchSort(), and parse_window_order_collation().
std::unique_ptr<RexOperator> anonymous_namespace{RelAlgDagBuilder.cpp}::parse_operator | ( | const rapidjson::Value & | expr, |
const Catalog_Namespace::Catalog & | cat, | ||
RelAlgDagBuilder & | root_dag_builder | ||
) |
Definition at line 1155 of file RelAlgDagBuilder.cpp.
References CHECK, field(), json_bool(), json_str(), kFUNCTION, kIN, gpu_enabled::lower_bound(), parse_expr_array(), parse_subquery(), parse_type(), parse_window_bound(), parse_window_function_kind(), parse_window_order_collation(), parse_window_order_exprs(), to_sql_op(), and gpu_enabled::upper_bound().
Referenced by parse_scalar_expr().
std::unique_ptr< const RexScalar > anonymous_namespace{RelAlgDagBuilder.cpp}::parse_scalar_expr | ( | const rapidjson::Value & | expr, |
const Catalog_Namespace::Catalog & | cat, | ||
RelAlgDagBuilder & | root_dag_builder | ||
) |
Definition at line 1264 of file RelAlgDagBuilder.cpp.
References CHECK, field(), json_node_to_string(), json_str(), parse_abstract_input(), parse_case(), parse_literal(), parse_operator(), and parse_subquery().
Referenced by details::RelAlgDispatcher::dispatchFilter(), details::RelAlgDispatcher::dispatchJoin(), details::RelAlgDispatcher::dispatchProject(), details::RelAlgDispatcher::dispatchTableFunction(), parse_case(), parse_expr_array(), parse_window_bound(), and parse_window_order_exprs().
SortDirection anonymous_namespace{RelAlgDagBuilder.cpp}::parse_sort_direction | ( | const rapidjson::Value & | collation | ) |
Definition at line 1096 of file RelAlgDagBuilder.cpp.
References Ascending, Descending, field(), and json_str().
Referenced by details::RelAlgDispatcher::dispatchSort(), and parse_window_order_collation().
std::unique_ptr<const RexSubQuery> anonymous_namespace{RelAlgDagBuilder.cpp}::parse_subquery | ( | const rapidjson::Value & | expr, |
const Catalog_Namespace::Catalog & | cat, | ||
RelAlgDagBuilder & | root_dag_builder | ||
) |
Definition at line 1141 of file RelAlgDagBuilder.cpp.
References CHECK, CHECK_GE, field(), RelAlgDagBuilder::getRootNodeShPtr(), and RelAlgDagBuilder::registerSubquery().
Referenced by parse_operator(), and parse_scalar_expr().
SQLTypeInfo anonymous_namespace{RelAlgDagBuilder.cpp}::parse_type | ( | const rapidjson::Value & | type_obj | ) |
Definition at line 1003 of file RelAlgDagBuilder.cpp.
References CHECK, field(), json_bool(), json_i64(), json_node_to_string(), json_str(), SQLTypeInfo::set_precision(), SQLTypeInfo::set_scale(), to_sql_type(), and run_benchmark_import::type.
Referenced by details::RelAlgDispatcher::dispatchLogicalValues(), parse_aggregate_expr(), and parse_operator().
RexWindowFunctionOperator::RexWindowBound anonymous_namespace{RelAlgDagBuilder.cpp}::parse_window_bound | ( | const rapidjson::Value & | window_bound_obj, |
const Catalog_Namespace::Catalog & | cat, | ||
RelAlgDagBuilder & | root_dag_builder | ||
) |
Definition at line 1121 of file RelAlgDagBuilder.cpp.
References CHECK, field(), json_bool(), json_i64(), parse_scalar_expr(), and RexWindowFunctionOperator::RexWindowBound::unbounded.
Referenced by parse_operator().
SqlWindowFunctionKind anonymous_namespace{RelAlgDagBuilder.cpp}::parse_window_function_kind | ( | const std::string & | name | ) |
Definition at line 1033 of file RelAlgDagBuilder.cpp.
References AVG, COUNT, CUME_DIST, DENSE_RANK, FIRST_VALUE, LAG, LAST_VALUE, LEAD, MAX, MIN, NTILE, PERCENT_RANK, RANK, ROW_NUMBER, SUM, and SUM_INTERNAL.
Referenced by parse_operator().
std::vector<SortField> anonymous_namespace{RelAlgDagBuilder.cpp}::parse_window_order_collation | ( | const rapidjson::Value & | arr, |
const Catalog_Namespace::Catalog & | cat, | ||
RelAlgDagBuilder & | root_dag_builder | ||
) |
Definition at line 1108 of file RelAlgDagBuilder.cpp.
References parse_nulls_position(), and parse_sort_direction().
Referenced by parse_operator().
std::vector<std::unique_ptr<const RexScalar> > anonymous_namespace{RelAlgDagBuilder.cpp}::parse_window_order_exprs | ( | const rapidjson::Value & | arr, |
const Catalog_Namespace::Catalog & | cat, | ||
RelAlgDagBuilder & | root_dag_builder | ||
) |
Definition at line 1085 of file RelAlgDagBuilder.cpp.
References field(), and parse_scalar_expr().
Referenced by parse_operator().
void anonymous_namespace{RelAlgDagBuilder.cpp}::propagate_hints_to_new_project | ( | std::shared_ptr< RelProject > | prev_node, |
std::shared_ptr< RelProject > | new_node, | ||
std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint >> & | query_hints | ||
) |
Definition at line 2215 of file RelAlgDagBuilder.cpp.
References CHECK.
Referenced by add_window_function_pre_project(), and separate_window_function_expressions().
std::vector<const Rex*> anonymous_namespace{RelAlgDagBuilder.cpp}::remapTargetPointers | ( | std::vector< std::unique_ptr< const RexAgg >> const & | agg_exprs_new, |
std::vector< std::unique_ptr< const RexScalar >> const & | scalar_sources_new, | ||
std::vector< std::unique_ptr< const RexAgg >> const & | agg_exprs_old, | ||
std::vector< std::unique_ptr< const RexScalar >> const & | scalar_sources_old, | ||
std::vector< const Rex * > const & | target_exprs_old | ||
) |
void anonymous_namespace{RelAlgDagBuilder.cpp}::separate_window_function_expressions | ( | std::vector< std::shared_ptr< RelAlgNode >> & | nodes, |
std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint >> & | query_hints | ||
) |
Detect the presence of window function operators nested inside expressions. Separate the window function operator from the expression, computing the expression as a subsequent step by pushing the expression to a new project node, and replacing the nested window function operator with a RexInput. Also move all input nodes to the newly created project node. Overall, we have the following query plan: from: Window_Project -> Child to: Window_Project -> New_Project -> Child In pseudocode: for each rex in project list: detect nested window function expression if nested window function expression: push the nested window function expression to the new project P create a new RexInput r_i which references the w_i in P and put it to M (M: a map between nested window function expression w_i and r_i) else push it down to the new project P create a new RexInput r_i which references the rex in P and put it to M for each rex in the project list: visit the rex and find a chance to replace it (or its operand) by using M
Definition at line 2259 of file RelAlgDagBuilder.cpp.
References CHECK, anonymous_namespace{RelAlgDagBuilder.cpp}::anonymous_namespace{RelAlgDagBuilder.cpp}::is_window_function_operator(), propagate_hints_to_new_project(), and RexVisitorBase< T >::visit().
Referenced by RelAlgDagBuilder::build().
|
noexcept |
Definition at line 1223 of file RelAlgDagBuilder.cpp.
References CHECK.
Referenced by details::RelAlgDispatcher::dispatchAggregate(), details::RelAlgDispatcher::dispatchProject(), getFieldNamesFromScanNode(), and details::RelAlgDispatcher::getRelAlgInputs().
JoinType anonymous_namespace{RelAlgDagBuilder.cpp}::to_join_type | ( | const std::string & | join_type_name | ) |
Definition at line 1289 of file RelAlgDagBuilder.cpp.
References ANTI, INNER, LEFT, and SEMI.
Referenced by details::RelAlgDispatcher::dispatchJoin().
const unsigned anonymous_namespace{RelAlgDagBuilder.cpp}::FIRST_RA_NODE_ID = 1 |
Definition at line 41 of file RelAlgDagBuilder.cpp.
Referenced by RelAlgNode::resetRelAlgFirstId().