OmniSciDB
a5dc49c757
|
#include "RelAlgDag.h"
#include "CalciteDeserializerUtils.h"
#include "Catalog/Catalog.h"
#include "Descriptors/RelAlgExecutionDescriptor.h"
#include "JsonAccessors.h"
#include "QueryEngine/Visitors/RelAlgDagViewer.h"
#include "RelAlgOptimizer.h"
#include "RelLeftDeepInnerJoin.h"
#include "RexVisitor.h"
#include "Shared/sqldefs.h"
#include <rapidjson/error/en.h>
#include <rapidjson/error/error.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h>
#include <string>
#include <unordered_set>
Go to the source code of this file.
Namespaces | |
anonymous_namespace{RelAlgDag.cpp} | |
std | |
anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp} | |
details | |
Typedefs | |
using | anonymous_namespace{RelAlgDag.cpp}::RexInputSet = std::unordered_set< RexInput > |
Functions | |
std::vector< RexInput > | anonymous_namespace{RelAlgDag.cpp}::n_outputs (const RelAlgNode *node, const size_t n) |
RANodeOutput | get_node_output (const RelAlgNode *ra_node) |
bool | anonymous_namespace{RelAlgDag.cpp}::isRenamedInput (const RelAlgNode *node, const size_t index, const std::string &new_name) |
std::vector< std::unique_ptr < const RexAgg > > | anonymous_namespace{RelAlgDag.cpp}::copyAggExprs (std::vector< std::unique_ptr< const RexAgg >> const &agg_exprs) |
std::vector< std::unique_ptr < const RexScalar > > | anonymous_namespace{RelAlgDag.cpp}::copyRexScalars (std::vector< std::unique_ptr< const RexScalar >> const &scalar_sources) |
std::vector< const Rex * > | anonymous_namespace{RelAlgDag.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{RelAlgDag.cpp}::reset_table_function_inputs (std::vector< const Rex * > &column_inputs, const std::vector< std::unique_ptr< const RexScalar >> &old_table_func_inputs, const std::vector< std::unique_ptr< const RexScalar >> &new_table_func_inputs) |
std::set< std::pair< const RelAlgNode *, int > > | anonymous_namespace{RelAlgDag.cpp}::get_equiv_cols (const RelAlgNode *node, const size_t which_col) |
std::vector< bool > | anonymous_namespace{RelAlgDag.cpp}::get_notnulls (std::vector< TargetMetaInfo > const &tmis0) |
bool | anonymous_namespace{RelAlgDag.cpp}::same_ignoring_notnull (SQLTypeInfo ti0, SQLTypeInfo ti1) |
void | anonymous_namespace{RelAlgDag.cpp}::set_notnulls (std::vector< TargetMetaInfo > *tmis0, std::vector< bool > const ¬nulls) |
unsigned | anonymous_namespace{RelAlgDag.cpp}::node_id (const rapidjson::Value &ra_node) noexcept |
std::string | anonymous_namespace{RelAlgDag.cpp}::json_node_to_string (const rapidjson::Value &node) noexcept |
std::unique_ptr< RexAbstractInput > | anonymous_namespace{RelAlgDag.cpp}::parse_abstract_input (const rapidjson::Value &expr) noexcept |
std::unique_ptr< RexLiteral > | anonymous_namespace{RelAlgDag.cpp}::parse_literal (const rapidjson::Value &expr) |
std::unique_ptr< const RexScalar > | anonymous_namespace{RelAlgDag.cpp}::parse_scalar_expr (const rapidjson::Value &expr, RelAlgDag &root_dag) |
SQLTypeInfo | anonymous_namespace{RelAlgDag.cpp}::parse_type (const rapidjson::Value &type_obj) |
std::vector< std::unique_ptr < const RexScalar > > | anonymous_namespace{RelAlgDag.cpp}::parse_expr_array (const rapidjson::Value &arr, RelAlgDag &root_dag) |
SqlWindowFunctionKind | anonymous_namespace{RelAlgDag.cpp}::parse_window_function_kind (const std::string &name) |
std::vector< std::unique_ptr < const RexScalar > > | anonymous_namespace{RelAlgDag.cpp}::parse_window_order_exprs (const rapidjson::Value &arr, RelAlgDag &root_dag) |
SortDirection | anonymous_namespace{RelAlgDag.cpp}::parse_sort_direction (const rapidjson::Value &collation) |
NullSortedPosition | anonymous_namespace{RelAlgDag.cpp}::parse_nulls_position (const rapidjson::Value &collation) |
std::vector< SortField > | anonymous_namespace{RelAlgDag.cpp}::parse_window_order_collation (const rapidjson::Value &arr, RelAlgDag &root_dag) |
RexWindowFunctionOperator::RexWindowBound | anonymous_namespace{RelAlgDag.cpp}::parse_window_bound (const rapidjson::Value &window_bound_obj, RelAlgDag &root_dag) |
std::unique_ptr< const RexSubQuery > | anonymous_namespace{RelAlgDag.cpp}::parse_subquery (const rapidjson::Value &expr, RelAlgDag &root_dag) |
std::unique_ptr< RexOperator > | anonymous_namespace{RelAlgDag.cpp}::parse_operator (const rapidjson::Value &expr, RelAlgDag &root_dag) |
std::unique_ptr< RexCase > | anonymous_namespace{RelAlgDag.cpp}::parse_case (const rapidjson::Value &expr, RelAlgDag &root_dag) |
std::vector< std::string > | anonymous_namespace{RelAlgDag.cpp}::strings_from_json_array (const rapidjson::Value &json_str_arr) noexcept |
std::vector< size_t > | anonymous_namespace{RelAlgDag.cpp}::indices_from_json_array (const rapidjson::Value &json_idx_arr) noexcept |
std::unique_ptr< const RexAgg > | anonymous_namespace{RelAlgDag.cpp}::parse_aggregate_expr (const rapidjson::Value &expr) |
JoinType | anonymous_namespace{RelAlgDag.cpp}::to_join_type (const std::string &join_type_name) |
std::unique_ptr< const RexScalar > | anonymous_namespace{RelAlgDag.cpp}::disambiguate_rex (const RexScalar *, const RANodeOutput &) |
std::unique_ptr< const RexOperator > | anonymous_namespace{RelAlgDag.cpp}::disambiguate_operator (const RexOperator *rex_operator, const RANodeOutput &ra_output) noexcept |
std::unique_ptr< const RexCase > | anonymous_namespace{RelAlgDag.cpp}::disambiguate_case (const RexCase *rex_case, const RANodeOutput &ra_output) |
void | anonymous_namespace{RelAlgDag.cpp}::bind_project_to_input (RelProject *project_node, const RANodeOutput &input) noexcept |
void | anonymous_namespace{RelAlgDag.cpp}::bind_table_func_to_input (RelTableFunction *table_func_node, const RANodeOutput &input) noexcept |
void | anonymous_namespace{RelAlgDag.cpp}::bind_inputs (const std::vector< std::shared_ptr< RelAlgNode >> &nodes) noexcept |
void | anonymous_namespace{RelAlgDag.cpp}::handle_query_hint (const std::vector< std::shared_ptr< RelAlgNode >> &nodes, RelAlgDag &rel_alg_dag) noexcept |
void | anonymous_namespace{RelAlgDag.cpp}::compute_node_hash (const std::vector< std::shared_ptr< RelAlgNode >> &nodes) |
void | anonymous_namespace{RelAlgDag.cpp}::mark_nops (const std::vector< std::shared_ptr< RelAlgNode >> &nodes) noexcept |
std::vector< const Rex * > | anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::reproject_targets (const RelProject *simple_project, const std::vector< const Rex * > &target_exprs) noexcept |
void | anonymous_namespace{RelAlgDag.cpp}::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 |
bool | anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::input_can_be_coalesced (const RelAlgNode *parent_node, const size_t index, const bool first_rex_is_input) |
bool | anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::is_window_function_sum (const RexScalar *rex) |
bool | anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::is_window_function_avg (const RexScalar *rex) |
bool | anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::is_window_function_operator (const RexScalar *rex) |
void | anonymous_namespace{RelAlgDag.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) |
void | anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::create_rex_input_for_new_project_node (RelAlgNode const *node, std::vector< std::unique_ptr< const RexScalar >> &scalar_exprs, std::vector< std::string > &fields) |
void | anonymous_namespace{RelAlgDag.cpp}::handle_agg_over_join (std::vector< std::shared_ptr< RelAlgNode >> &nodes, std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint >> &query_hints) |
void | anonymous_namespace{RelAlgDag.cpp}::eliminate_redundant_projection (std::vector< std::shared_ptr< RelAlgNode >> &nodes) |
void | anonymous_namespace{RelAlgDag.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) |
void | anonymous_namespace{RelAlgDag.cpp}::separate_window_function_expressions (std::vector< std::shared_ptr< RelAlgNode >> &nodes, std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint >> &query_hints) |
bool | anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::find_generic_expr_in_window_func (RexWindowFunctionOperator const *window_expr, bool &has_generic_expr_in_window_func) |
std::pair< bool, bool > | anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::need_pushdown_generic_expr (RelProject const *window_func_project_node) |
void | anonymous_namespace{RelAlgDag.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) |
int64_t | anonymous_namespace{RelAlgDag.cpp}::get_int_literal_field (const rapidjson::Value &obj, const char field[], const int64_t default_val) noexcept |
void | anonymous_namespace{RelAlgDag.cpp}::check_empty_inputs_field (const rapidjson::Value &node) noexcept |
const std::pair< const Catalog_Namespace::Catalog *, const TableDescriptor * > | anonymous_namespace{RelAlgDag.cpp}::getCatalogAndTableFromScanNode (const rapidjson::Value &scan_ra) |
std::vector< std::string > | anonymous_namespace{RelAlgDag.cpp}::getFieldNamesFromScanNode (const rapidjson::Value &scan_ra) |
std::string | tree_string (const RelAlgNode *ra, const size_t depth) |
std::size_t | hash_value (RexAbstractInput const &rex_ab_input) |
std::size_t | hash_value (RexLiteral const &rex_literal) |
std::size_t | hash_value (RexOperator const &rex_op) |
std::size_t | hash_value (RexCase const &rex_case) |
std::size_t | hash_value (RexFunctionOperator const &rex_op) |
std::size_t | hash_value (SortField const &sort_field) |
std::size_t | hash_value (RexWindowFunctionOperator const &rex_window) |
std::size_t | hash_value (RexRef const &rex_ref) |
std::size_t | hash_value (RexAgg const &rex_agg) |
std::size_t | hash_value (RexSubQuery const &rex_subq) |
std::size_t | hash_value (RexInput const &rex_input) |
std::size_t | hash_value (RelScan const &rel_scan) |
std::size_t | hash_value (RelProject const &rel_project) |
std::size_t | hash_value (RelAggregate const &rel_agg) |
std::size_t | hash_value (RelJoin const &rel_join) |
std::size_t | hash_value (RelTranslatedJoin const &rel_tr_join) |
std::size_t | hash_value (RelFilter const &rel_filter) |
std::size_t | hash_value (RelLeftDeepInnerJoin const &rel_join) |
std::size_t | hash_value (RelCompound const &rel_compound) |
std::size_t | hash_value (RelSort const &rel_sort) |
std::size_t | hash_value (RelModify const &rel_modify) |
std::size_t | hash_value (RelTableFunction const &rel_tf) |
std::size_t | hash_value (RelLogicalValues const &rel_lv) |
std::size_t | hash_value (RelLogicalUnion const &rel_lv) |
Variables | |
bool | g_cluster |
bool | g_enable_union |
const unsigned | anonymous_namespace{RelAlgDag.cpp}::FIRST_RA_NODE_ID = 1 |
RANodeOutput get_node_output | ( | const RelAlgNode * | ra_node | ) |
Definition at line 371 of file RelAlgDag.cpp.
References CHECK_EQ, logger::FATAL, get_node_output(), LOG, anonymous_namespace{RelAlgDag.cpp}::n_outputs(), and toString().
Referenced by anonymous_namespace{RelAlgDag.cpp}::bind_inputs(), anonymous_namespace{RelAlgDag.cpp}::create_compound(), anonymous_namespace{RelAlgExecutor.cpp}::get_left_deep_join_input_sizes(), get_node_output(), RelProject::isIdentity(), anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RexPhysicalInputsVisitor::visitInput(), and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RexPhysicalInputsVisitor::visitOperator().
std::size_t hash_value | ( | RexAbstractInput const & | rex_ab_input | ) |
Definition at line 3548 of file RelAlgDag.cpp.
References Rex::hash_, and RexAbstractInput::in_index_.
Referenced by Executor::clearExternalCaches(), CodeGenerator::codegenColVar(), WindowFunctionContext::computeAggregateTreeCacheKey(), RelAlgExecutor::createWindowFunctionContext(), BoundingBoxIntersectJoinHashTable::generateCacheKey(), BaselineJoinHashTable::getAlternativeCacheKey(), PerfectJoinHashTable::getAlternativeCacheKey(), DataRecyclerUtil::getAlternativeTableKeys(), QueryPlanDagExtractor::handleTranslatedJoin(), PhysicalInput::hash(), CardinalityCacheKey::hash(), hash_value(), QueryRewriter::is_all_groupby_exprs_are_col_var(), AlterTableAlterColumnCommandRecoveryMgr::recoverAlterTableAlterColumnFromFile(), RangeJoinHashTable::reifyWithLayout(), BoundingBoxIntersectJoinHashTable::reifyWithLayout(), QueryRewriter::rewriteAggregateOnGroupByColumn(), RelAlgNode::setQueryPlanDag(), RexLiteral::toHash(), RexSubQuery::toHash(), and ScanNodeTableKeyCollector::visit().
std::size_t hash_value | ( | RexLiteral const & | rex_literal | ) |
std::size_t hash_value | ( | RexOperator const & | rex_op | ) |
Definition at line 3581 of file RelAlgDag.cpp.
References SQLTypeInfo::get_type_name(), RexOperator::getType(), Rex::hash_, RexOperator::op_, and RexOperator::operands_.
std::size_t hash_value | ( | RexCase const & | rex_case | ) |
Definition at line 3592 of file RelAlgDag.cpp.
References RexCase::else_expr_, RexCase::expr_pair_list_, and Rex::hash_.
std::size_t hash_value | ( | RexFunctionOperator const & | rex_op | ) |
Definition at line 3602 of file RelAlgDag.cpp.
References SQLTypeInfo::get_type_name(), RexOperator::getType(), Rex::hash_, RexFunctionOperator::name_, RexOperator::op_, RexOperator::operands_, and toString().
std::size_t hash_value | ( | SortField const & | sort_field | ) |
Definition at line 3614 of file RelAlgDag.cpp.
References Ascending, SortField::field_, First, hash_value(), SortField::nulls_pos_, and SortField::sort_dir_.
std::size_t hash_value | ( | RexWindowFunctionOperator const & | rex_window | ) |
Definition at line 3622 of file RelAlgDag.cpp.
References RexWindowFunctionOperator::collation_, RexWindowFunctionOperator::frame_end_bound_, RexWindowFunctionOperator::frame_start_bound_, SQLTypeInfo::get_type_name(), RexFunctionOperator::getName(), RexOperator::getType(), Rex::hash_, hash_value(), RexWindowFunctionOperator::is_rows_, RexOperator::operands_, RexWindowFunctionOperator::order_keys_, and RexWindowFunctionOperator::partition_keys_.
std::size_t hash_value | ( | RexRef const & | rex_ref | ) |
Definition at line 3651 of file RelAlgDag.cpp.
References Rex::hash_, and RexRef::index_.
std::size_t hash_value | ( | RexAgg const & | rex_agg | ) |
Definition at line 3660 of file RelAlgDag.cpp.
References RexAgg::agg_, RexAgg::distinct_, SQLTypeInfo::get_type_name(), Rex::hash_, RexAgg::operands_, and RexAgg::type_.
std::size_t hash_value | ( | RexSubQuery const & | rex_subq | ) |
Definition at line 3672 of file RelAlgDag.cpp.
std::size_t hash_value | ( | RexInput const & | rex_input | ) |
Definition at line 3681 of file RelAlgDag.cpp.
References RexAbstractInput::getIndex(), Rex::hash_, and RexInput::node_.
std::size_t hash_value | ( | RelScan const & | rel_scan | ) |
Definition at line 3691 of file RelAlgDag.cpp.
References RelScan::field_names_, RelAlgNode::hash_, TableDescriptor::tableId, TableDescriptor::tableName, RelScan::td_, and toString().
std::size_t hash_value | ( | RelProject const & | rel_project | ) |
Definition at line 3702 of file RelAlgDag.cpp.
References RelProject::fields_, RelAlgNode::hash_, RelAlgNode::inputs_, and RelProject::scalar_exprs_.
std::size_t hash_value | ( | RelAggregate const & | rel_agg | ) |
Definition at line 3713 of file RelAlgDag.cpp.
References RelAggregate::agg_exprs_, RelAggregate::fields_, RelAggregate::groupby_count_, RelAlgNode::hash_, and RelAlgNode::inputs_.
std::size_t hash_value | ( | RelJoin const & | rel_join | ) |
Definition at line 3725 of file RelAlgDag.cpp.
References RelJoin::condition_, RelJoin::getJoinType(), RelAlgNode::hash_, RelAlgNode::inputs_, and toString().
std::size_t hash_value | ( | RelTranslatedJoin const & | rel_tr_join | ) |
Definition at line 3736 of file RelAlgDag.cpp.
References RelTranslatedJoin::filter_ops_, RelAlgNode::hash_, RelTranslatedJoin::join_type_, RelTranslatedJoin::lhs_, RelTranslatedJoin::nested_loop_, RelTranslatedJoin::op_type_, RelTranslatedJoin::op_typeinfo_, RelTranslatedJoin::outer_join_cond_, RelTranslatedJoin::qualifier_, RelTranslatedJoin::rhs_, and toString().
std::size_t hash_value | ( | RelFilter const & | rel_filter | ) |
Definition at line 3753 of file RelAlgDag.cpp.
References RelFilter::filter_, RelAlgNode::hash_, and RelAlgNode::inputs_.
std::size_t hash_value | ( | RelLeftDeepInnerJoin const & | rel_join | ) |
Definition at line 3763 of file RelAlgDag.cpp.
References RelLeftDeepInnerJoin::condition_, RelAlgNode::hash_, RelAlgNode::inputs_, RelLeftDeepInnerJoin::original_filter_, and RelLeftDeepInnerJoin::outer_conditions_per_level_.
std::size_t hash_value | ( | RelCompound const & | rel_compound | ) |
Definition at line 3775 of file RelAlgDag.cpp.
References RelCompound::agg_exprs_, RelCompound::fields_, RelCompound::filter_expr_, RelCompound::groupby_count_, RelAlgNode::hash_, RelAlgNode::inputs_, RelCompound::is_agg_, RelCompound::scalar_sources_, and RelCompound::target_exprs_.
std::size_t hash_value | ( | RelSort const & | rel_sort | ) |
Definition at line 3791 of file RelAlgDag.cpp.
References RelSort::collation_, RelAlgNode::hash_, RelAlgNode::inputs_, RelSort::limit_, and RelSort::offset_.
std::size_t hash_value | ( | RelModify const & | rel_modify | ) |
Definition at line 3804 of file RelAlgDag.cpp.
References RelModify::flattened_, RelAlgNode::hash_, RelAlgNode::inputs_, RelModify::operation_, RelModify::table_descriptor_, TableDescriptor::tableId, TableDescriptor::tableName, RelModify::target_column_list_, and RelModify::yieldModifyOperationString().
std::size_t hash_value | ( | RelTableFunction const & | rel_tf | ) |
Definition at line 3819 of file RelAlgDag.cpp.
References RelTableFunction::fields_, RelTableFunction::function_name_, RelAlgNode::hash_, RelAlgNode::inputs_, RelTableFunction::table_func_inputs_, and RelTableFunction::target_exprs_.
std::size_t hash_value | ( | RelLogicalValues const & | rel_lv | ) |
Definition at line 3832 of file RelAlgDag.cpp.
References RelAlgNode::hash_, and RelLogicalValues::tuple_type_.
std::size_t hash_value | ( | RelLogicalUnion const & | rel_lv | ) |
Definition at line 3844 of file RelAlgDag.cpp.
References RelAlgNode::hash_, RelAlgNode::inputs_, and RelLogicalUnion::is_all_.
std::string tree_string | ( | const RelAlgNode * | ra, |
const size_t | depth | ||
) |
Definition at line 3480 of file RelAlgDag.cpp.
References RelAlgNode::getInput(), RelAlgNode::inputCount(), run_benchmark_import::result, toString(), and tree_string().
Referenced by tree_string().
bool g_cluster |
bool g_enable_union |
Definition at line 56 of file RelAlgExecutor.cpp.