OmniSciDB
0264ff685a
|
Namespaces | |
anonymous_namespace{RelAlgDagBuilder.cpp} | |
Classes | |
class | RANodeIterator |
class | RexInputBackpropagationVisitor |
class | RexInputCollector |
class | RexRebindInputsVisitor |
class | RexRebindReindexInputsVisitor |
class | RexWindowFuncReplacementVisitor |
class | WindowFunctionDetectionVisitor |
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 | handleQueryHint (const std::vector< std::shared_ptr< RelAlgNode >> &nodes, RelAlgDagBuilder *dag_builder) noexcept |
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) noexcept |
void | coalesce_nodes (std::vector< std::shared_ptr< RelAlgNode >> &nodes, const std::vector< const RelAlgNode *> &left_deep_joins) |
void | separate_window_function_expressions (std::vector< std::shared_ptr< RelAlgNode >> &nodes) |
void | add_window_function_pre_project (std::vector< std::shared_ptr< RelAlgNode >> &nodes) |
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 2001 of file RelAlgDagBuilder.cpp.
void anonymous_namespace{RelAlgDagBuilder.cpp}::add_window_function_pre_project | ( | std::vector< std::shared_ptr< RelAlgNode >> & | nodes | ) |
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). 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 2025 of file RelAlgDagBuilder.cpp.
References CHECK, CHECK_EQ, gpu_enabled::sort(), and RexVisitorBase< T >::visit().
Referenced by RelAlgDagBuilder::build().
|
noexcept |
Definition at line 1159 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 1131 of file RelAlgDagBuilder.cpp.
References CHECK_EQ, and disambiguate_rex().
Referenced by bind_inputs(), and create_compound().
|
noexcept |
Definition at line 1145 of file RelAlgDagBuilder.cpp.
References disambiguate_rex().
Referenced by bind_inputs().
|
noexcept |
Definition at line 2095 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 | ||
) |
Definition at line 1606 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().
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 397 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 407 of file RelAlgDagBuilder.cpp.
References RexVisitorBase< T >::visit().
|
noexcept |
Definition at line 1305 of file RelAlgDagBuilder.cpp.
References bind_project_to_input(), CHECK, CHECK_EQ, CHECK_GE, CHECK_LE, CHECK_LT, get_node_output(), RelProject::getFields(), anonymous_namespace{RelAlgExecutor.cpp}::is_agg(), 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 1089 of file RelAlgDagBuilder.cpp.
References RexCase::branchCount(), disambiguate_rex(), RexCase::getElse(), RexCase::getThen(), and RexCase::getWhen().
Referenced by disambiguate_rex().
|
noexcept |
Definition at line 1054 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 1110 of file RelAlgDagBuilder.cpp.
References CHECK, CHECK_LT, disambiguate_case(), and disambiguate_operator().
Referenced by bind_inputs(), bind_project_to_input(), bind_table_func_to_input(), disambiguate_case(), disambiguate_operator(), and to_join_type().
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 509 of file RelAlgDagBuilder.cpp.
References CHECK, and CHECK_EQ.
Referenced by RelSort::hasEquivCollationOf().
|
noexcept |
Definition at line 2081 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 2110 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 2100 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 1200 of file RelAlgDagBuilder.cpp.
References RelScan::getDeliveredHints(), RelProject::getDeliveredHints(), RelAggregate::getDeliveredHints(), RelJoin::getDeliveredHints(), and RelCompound::getDeliveredHints().
Referenced by RelAlgDagBuilder::build().
|
noexcept |
Definition at line 993 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 251 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 667 of file RelAlgDagBuilder.cpp.
Referenced by details::RelAlgDispatcher::dispatchModify(), parse_scalar_expr(), and parse_type().
|
noexcept |
Definition at line 1245 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.
Referenced by get_node_output().
|
noexcept |
Definition at line 662 of file RelAlgDagBuilder.cpp.
References field(), and json_str().
Referenced by details::RelAlgDispatcher::dispatchFilter(), details::RelAlgDispatcher::prev(), and details::RelAlgDispatcher::run().
|
noexcept |
Definition at line 678 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 1006 of file RelAlgDagBuilder.cpp.
References field(), indices_from_json_array(), json_bool(), json_str(), kAPPROX_COUNT_DISTINCT, 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 959 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 780 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 684 of file RelAlgDagBuilder.cpp.
References cat(), 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, parse_scalar_expr(), to_sql_type(), and run_benchmark_import::type.
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 860 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 913 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 1017 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_literal(), parse_window_bound(), and parse_window_order_exprs().
SortDirection anonymous_namespace{RelAlgDagBuilder.cpp}::parse_sort_direction | ( | const rapidjson::Value & | collation | ) |
Definition at line 854 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 899 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 761 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 879 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 791 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 866 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 843 of file RelAlgDagBuilder.cpp.
References field(), and parse_scalar_expr().
Referenced by parse_operator().
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 | ) |
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 and replacing the window function operator with a RexInput. Also move all input nodes to the newly created project node. In pseudocode: for each rex in project list: detect window function expression if window function expression: copy window function expression replace window function expression in base expression w/ input add base expression to new project node after the current node replace base expression in current project node with the window function expression copy
Definition at line 1895 of file RelAlgDagBuilder.cpp.
References CHECK, CHECK_EQ, CHECK_LT, RelProject::getProjectAt(), anonymous_namespace{RelAlgDagBuilder.cpp}::anonymous_namespace{RelAlgDagBuilder.cpp}::is_window_function_operator(), and RexVisitorBase< T >::visit().
Referenced by RelAlgDagBuilder::build().
|
noexcept |
Definition at line 981 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 1042 of file RelAlgDagBuilder.cpp.
References disambiguate_rex(), INNER, and LEFT.
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().