OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RelAlgDag.cpp File Reference
#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>
+ Include dependency graph for RelAlgDag.cpp:

Go to the source code of this file.

Classes

class  anonymous_namespace{RelAlgDag.cpp}::RexRebindInputsVisitor
 
class  anonymous_namespace{RelAlgDag.cpp}::RexRebindReindexInputsVisitor
 
class  anonymous_namespace{RelAlgDag.cpp}::PushDownGenericExpressionInWindowFunction
 
struct  std::hash< std::pair< const RelAlgNode *, int > >
 
class  anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::RexInputReplacementVisitor
 
class  anonymous_namespace{RelAlgDag.cpp}::RANodeIterator
 
class  anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::CoalesceSecondaryProjectVisitor
 
class  anonymous_namespace{RelAlgDag.cpp}::WindowFunctionCollector
 
class  anonymous_namespace{RelAlgDag.cpp}::RexWindowFuncReplacementVisitor
 
class  anonymous_namespace{RelAlgDag.cpp}::RexInputCollector
 
class  details::RelAlgDispatcher
 

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< RexInputanonymous_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 &notnulls)
 
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< RexAbstractInputanonymous_namespace{RelAlgDag.cpp}::parse_abstract_input (const rapidjson::Value &expr) noexcept
 
std::unique_ptr< RexLiteralanonymous_namespace{RelAlgDag.cpp}::parse_literal (const rapidjson::Value &expr)
 
std::unique_ptr< const RexScalaranonymous_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< SortFieldanonymous_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< RexOperatoranonymous_namespace{RelAlgDag.cpp}::parse_operator (const rapidjson::Value &expr, RelAlgDag &root_dag)
 
std::unique_ptr< RexCaseanonymous_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 RexAgganonymous_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 RexScalaranonymous_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 RexCaseanonymous_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
 

Function Documentation

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().

371  {
372  const auto scan_node = dynamic_cast<const RelScan*>(ra_node);
373  if (scan_node) {
374  // Scan node has no inputs, output contains all columns in the table.
375  CHECK_EQ(size_t(0), scan_node->inputCount());
376  return n_outputs(scan_node, scan_node->size());
377  }
378  const auto project_node = dynamic_cast<const RelProject*>(ra_node);
379  if (project_node) {
380  // Project output count doesn't depend on the input
381  CHECK_EQ(size_t(1), project_node->inputCount());
382  return n_outputs(project_node, project_node->size());
383  }
384  const auto filter_node = dynamic_cast<const RelFilter*>(ra_node);
385  if (filter_node) {
386  // Filter preserves shape
387  CHECK_EQ(size_t(1), filter_node->inputCount());
388  const auto prev_out = get_node_output(filter_node->getInput(0));
389  return n_outputs(filter_node, prev_out.size());
390  }
391  const auto aggregate_node = dynamic_cast<const RelAggregate*>(ra_node);
392  if (aggregate_node) {
393  // Aggregate output count doesn't depend on the input
394  CHECK_EQ(size_t(1), aggregate_node->inputCount());
395  return n_outputs(aggregate_node, aggregate_node->size());
396  }
397  const auto compound_node = dynamic_cast<const RelCompound*>(ra_node);
398  if (compound_node) {
399  // Compound output count doesn't depend on the input
400  CHECK_EQ(size_t(1), compound_node->inputCount());
401  return n_outputs(compound_node, compound_node->size());
402  }
403  const auto join_node = dynamic_cast<const RelJoin*>(ra_node);
404  if (join_node) {
405  // Join concatenates the outputs from the inputs and the output
406  // directly references the nodes in the input.
407  CHECK_EQ(size_t(2), join_node->inputCount());
408  auto lhs_out =
409  n_outputs(join_node->getInput(0), get_node_output(join_node->getInput(0)).size());
410  const auto rhs_out =
411  n_outputs(join_node->getInput(1), get_node_output(join_node->getInput(1)).size());
412  lhs_out.insert(lhs_out.end(), rhs_out.begin(), rhs_out.end());
413  return lhs_out;
414  }
415  const auto table_func_node = dynamic_cast<const RelTableFunction*>(ra_node);
416  if (table_func_node) {
417  // Table Function output count doesn't depend on the input
418  return n_outputs(table_func_node, table_func_node->size());
419  }
420  const auto sort_node = dynamic_cast<const RelSort*>(ra_node);
421  if (sort_node) {
422  // Sort preserves shape
423  CHECK_EQ(size_t(1), sort_node->inputCount());
424  const auto prev_out = get_node_output(sort_node->getInput(0));
425  return n_outputs(sort_node, prev_out.size());
426  }
427  const auto logical_values_node = dynamic_cast<const RelLogicalValues*>(ra_node);
428  if (logical_values_node) {
429  CHECK_EQ(size_t(0), logical_values_node->inputCount());
430  return n_outputs(logical_values_node, logical_values_node->size());
431  }
432  const auto logical_union_node = dynamic_cast<const RelLogicalUnion*>(ra_node);
433  if (logical_union_node) {
434  return n_outputs(logical_union_node, logical_union_node->size());
435  }
436  LOG(FATAL) << "Unhandled ra_node type: " << ::toString(ra_node);
437  return {};
438 }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
#define LOG(tag)
Definition: Logger.h:285
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703
std::vector< RexInput > n_outputs(const RelAlgNode *node, const size_t n)
Definition: RelAlgDag.cpp:96
RANodeOutput get_node_output(const RelAlgNode *ra_node)
Definition: RelAlgDag.cpp:371

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::size_t hash_value ( RexAbstractInput const &  rex_ab_input)
std::size_t hash_value ( RexLiteral const &  rex_literal)

Definition at line 3557 of file RelAlgDag.cpp.

References heavydb.dtypes::T.

3557  {
3558  if (rex_literal.hash_) {
3559  return *rex_literal.hash_;
3560  }
3561  rex_literal.hash_ = typeid(RexLiteral).hash_code();
3562  boost::apply_visitor(
3563  [&rex_literal](auto&& current_val) {
3564  using T = std::decay_t<decltype(current_val)>;
3565  if constexpr (!std::is_same_v<boost::blank, T>) {
3566  static_assert(std::is_same_v<int64_t, T> || std::is_same_v<double, T> ||
3567  std::is_same_v<std::string, T> || std::is_same_v<bool, T>);
3568  boost::hash_combine(*rex_literal.hash_, current_val);
3569  }
3570  },
3571  rex_literal.literal_);
3572  boost::hash_combine(*rex_literal.hash_, rex_literal.type_);
3573  boost::hash_combine(*rex_literal.hash_, rex_literal.target_type_);
3574  boost::hash_combine(*rex_literal.hash_, rex_literal.scale_);
3575  boost::hash_combine(*rex_literal.hash_, rex_literal.precision_);
3576  boost::hash_combine(*rex_literal.hash_, rex_literal.target_scale_);
3577  boost::hash_combine(*rex_literal.hash_, rex_literal.target_precision_);
3578  return *rex_literal.hash_;
3579 }
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_.

3581  {
3582  if (rex_op.hash_) {
3583  return *rex_op.hash_;
3584  }
3585  rex_op.hash_ = typeid(RexOperator).hash_code();
3586  boost::hash_combine(*rex_op.hash_, rex_op.op_);
3587  boost::hash_combine(*rex_op.hash_, rex_op.operands_);
3588  boost::hash_combine(*rex_op.hash_, rex_op.getType().get_type_name());
3589  return *rex_op.hash_;
3590 }

+ Here is the call graph for this function:

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_.

3592  {
3593  if (rex_case.hash_) {
3594  return *rex_case.hash_;
3595  }
3596  rex_case.hash_ = typeid(RexCase).hash_code();
3597  boost::hash_combine(*rex_case.hash_, rex_case.expr_pair_list_);
3598  boost::hash_combine(*rex_case.hash_, rex_case.else_expr_);
3599  return *rex_case.hash_;
3600 }
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().

3602  {
3603  if (rex_op.hash_) {
3604  return *rex_op.hash_;
3605  }
3606  rex_op.hash_ = typeid(RexFunctionOperator).hash_code();
3607  boost::hash_combine(*rex_op.hash_, ::toString(rex_op.op_));
3608  boost::hash_combine(*rex_op.hash_, rex_op.getType().get_type_name());
3609  boost::hash_combine(*rex_op.hash_, rex_op.operands_);
3610  boost::hash_combine(*rex_op.hash_, rex_op.name_);
3611  return *rex_op.hash_;
3612 }
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703

+ Here is the call graph for this function:

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_.

3614  {
3615  auto hash = boost::hash_value(sort_field.field_);
3616  boost::hash_combine(hash, sort_field.sort_dir_ == SortDirection::Ascending ? "a" : "d");
3617  boost::hash_combine(hash,
3618  sort_field.nulls_pos_ == NullSortedPosition::First ? "f" : "l");
3619  return hash;
3620 }
std::size_t hash_value(RexAbstractInput const &rex_ab_input)
Definition: RelAlgDag.cpp:3548

+ Here is the call graph for this function:

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_.

3622  {
3623  if (rex_window.hash_) {
3624  return *rex_window.hash_;
3625  }
3626  rex_window.hash_ = typeid(RexWindowFunctionOperator).hash_code();
3627  boost::hash_combine(*rex_window.hash_, rex_window.getType().get_type_name());
3628  boost::hash_combine(*rex_window.hash_, rex_window.getName());
3629  boost::hash_combine(*rex_window.hash_, rex_window.is_rows_);
3630  boost::hash_combine(*rex_window.hash_, rex_window.collation_);
3631  boost::hash_combine(*rex_window.hash_, rex_window.operands_);
3632  boost::hash_combine(*rex_window.hash_, rex_window.partition_keys_);
3633  boost::hash_combine(*rex_window.hash_, rex_window.order_keys_);
3634  auto get_window_bound_hash =
3636  auto h = boost::hash_value(bound.bound_expr);
3637  boost::hash_combine(h, bound.unbounded);
3638  boost::hash_combine(h, bound.preceding);
3639  boost::hash_combine(h, bound.following);
3640  boost::hash_combine(h, bound.is_current_row);
3641  boost::hash_combine(h, bound.order_key);
3642  return h;
3643  };
3644  boost::hash_combine(*rex_window.hash_,
3645  get_window_bound_hash(rex_window.frame_start_bound_));
3646  boost::hash_combine(*rex_window.hash_,
3647  get_window_bound_hash(rex_window.frame_end_bound_));
3648  return *rex_window.hash_;
3649 }
std::size_t hash_value(RexAbstractInput const &rex_ab_input)
Definition: RelAlgDag.cpp:3548

+ Here is the call graph for this function:

std::size_t hash_value ( RexRef const &  rex_ref)

Definition at line 3651 of file RelAlgDag.cpp.

References Rex::hash_, and RexRef::index_.

3651  {
3652  if (rex_ref.hash_) {
3653  return *rex_ref.hash_;
3654  }
3655  rex_ref.hash_ = typeid(RexRef).hash_code();
3656  boost::hash_combine(*rex_ref.hash_, rex_ref.index_);
3657  return *rex_ref.hash_;
3658 }
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_.

3660  {
3661  if (rex_agg.hash_) {
3662  return *rex_agg.hash_;
3663  }
3664  rex_agg.hash_ = typeid(RexAgg).hash_code();
3665  boost::hash_combine(*rex_agg.hash_, rex_agg.operands_);
3666  boost::hash_combine(*rex_agg.hash_, rex_agg.agg_);
3667  boost::hash_combine(*rex_agg.hash_, rex_agg.distinct_);
3668  boost::hash_combine(*rex_agg.hash_, rex_agg.type_.get_type_name());
3669  return *rex_agg.hash_;
3670 }

+ Here is the call graph for this function:

std::size_t hash_value ( RexSubQuery const &  rex_subq)

Definition at line 3672 of file RelAlgDag.cpp.

3672  {
3673  if (rex_subq.hash_) {
3674  return *rex_subq.hash_;
3675  }
3676  rex_subq.hash_ = typeid(RexSubQuery).hash_code();
3677  boost::hash_combine(*rex_subq.hash_, rex_subq.ra_);
3678  return *rex_subq.hash_;
3679 }
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_.

3681  {
3682  if (rex_input.hash_) {
3683  return *rex_input.hash_;
3684  }
3685  rex_input.hash_ = typeid(RexInput).hash_code();
3686  boost::hash_combine(*rex_input.hash_, rex_input.node_);
3687  boost::hash_combine(*rex_input.hash_, rex_input.getIndex());
3688  return *rex_input.hash_;
3689 }

+ Here is the call graph for this function:

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().

3691  {
3692  if (rel_scan.hash_) {
3693  return *rel_scan.hash_;
3694  }
3695  rel_scan.hash_ = typeid(RelScan).hash_code();
3696  boost::hash_combine(*rel_scan.hash_, rel_scan.td_->tableId);
3697  boost::hash_combine(*rel_scan.hash_, rel_scan.td_->tableName);
3698  boost::hash_combine(*rel_scan.hash_, ::toString(rel_scan.field_names_));
3699  return *rel_scan.hash_;
3700 }
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703

+ Here is the call graph for this function:

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_.

3702  {
3703  if (rel_project.hash_) {
3704  return *rel_project.hash_;
3705  }
3706  rel_project.hash_ = typeid(RelProject).hash_code();
3707  boost::hash_combine(*rel_project.hash_, rel_project.scalar_exprs_);
3708  boost::hash_combine(*rel_project.hash_, rel_project.fields_);
3709  boost::hash_combine(*rel_project.hash_, rel_project.inputs_);
3710  return *rel_project.hash_;
3711 }
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_.

3713  {
3714  if (rel_agg.hash_) {
3715  return *rel_agg.hash_;
3716  }
3717  rel_agg.hash_ = typeid(RelAggregate).hash_code();
3718  boost::hash_combine(*rel_agg.hash_, rel_agg.groupby_count_);
3719  boost::hash_combine(*rel_agg.hash_, rel_agg.agg_exprs_);
3720  boost::hash_combine(*rel_agg.hash_, rel_agg.fields_);
3721  boost::hash_combine(*rel_agg.hash_, rel_agg.inputs_);
3722  return *rel_agg.hash_;
3723 }
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().

3725  {
3726  if (rel_join.hash_) {
3727  return *rel_join.hash_;
3728  }
3729  rel_join.hash_ = typeid(RelJoin).hash_code();
3730  boost::hash_combine(*rel_join.hash_, rel_join.condition_);
3731  boost::hash_combine(*rel_join.hash_, rel_join.inputs_);
3732  boost::hash_combine(*rel_join.hash_, ::toString(rel_join.getJoinType()));
3733  return *rel_join.hash_;
3734 }
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703

+ Here is the call graph for this function:

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().

3736  {
3737  if (rel_tr_join.hash_) {
3738  return *rel_tr_join.hash_;
3739  }
3740  rel_tr_join.hash_ = typeid(RelTranslatedJoin).hash_code();
3741  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.lhs_);
3742  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.rhs_);
3743  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.outer_join_cond_);
3744  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.nested_loop_);
3745  boost::hash_combine(*rel_tr_join.hash_, ::toString(rel_tr_join.join_type_));
3746  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.op_type_);
3747  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.qualifier_);
3748  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.op_typeinfo_);
3749  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.filter_ops_);
3750  return *rel_tr_join.hash_;
3751 }
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703

+ Here is the call graph for this function:

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_.

3753  {
3754  if (rel_filter.hash_) {
3755  return *rel_filter.hash_;
3756  }
3757  rel_filter.hash_ = typeid(RelFilter).hash_code();
3758  boost::hash_combine(*rel_filter.hash_, rel_filter.filter_);
3759  boost::hash_combine(*rel_filter.hash_, rel_filter.inputs_);
3760  return *rel_filter.hash_;
3761 }
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_.

3763  {
3764  if (rel_join.hash_) {
3765  return *rel_join.hash_;
3766  }
3767  rel_join.hash_ = typeid(RelLeftDeepInnerJoin).hash_code();
3768  boost::hash_combine(*rel_join.hash_, rel_join.condition_);
3769  boost::hash_combine(*rel_join.hash_, rel_join.outer_conditions_per_level_);
3770  boost::hash_combine(*rel_join.hash_, rel_join.original_filter_);
3771  boost::hash_combine(*rel_join.hash_, rel_join.inputs_);
3772  return *rel_join.hash_;
3773 }
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_.

3775  {
3776  if (rel_compound.hash_) {
3777  return *rel_compound.hash_;
3778  }
3779  rel_compound.hash_ = typeid(RelCompound).hash_code();
3780  boost::hash_combine(*rel_compound.hash_, rel_compound.filter_expr_);
3781  boost::hash_combine(*rel_compound.hash_, rel_compound.is_agg_);
3782  boost::hash_combine(*rel_compound.hash_, rel_compound.target_exprs_);
3783  boost::hash_combine(*rel_compound.hash_, rel_compound.agg_exprs_);
3784  boost::hash_combine(*rel_compound.hash_, rel_compound.scalar_sources_);
3785  boost::hash_combine(*rel_compound.hash_, rel_compound.groupby_count_);
3786  boost::hash_combine(*rel_compound.hash_, rel_compound.fields_);
3787  boost::hash_combine(*rel_compound.hash_, rel_compound.inputs_);
3788  return *rel_compound.hash_;
3789 }
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_.

3791  {
3792  if (rel_sort.hash_) {
3793  return *rel_sort.hash_;
3794  }
3795  rel_sort.hash_ = typeid(RelSort).hash_code();
3796  boost::hash_combine(*rel_sort.hash_, rel_sort.collation_);
3797  boost::hash_combine(*rel_sort.hash_, rel_sort.limit_.has_value());
3798  boost::hash_combine(*rel_sort.hash_, rel_sort.limit_.value_or(0));
3799  boost::hash_combine(*rel_sort.hash_, rel_sort.offset_);
3800  boost::hash_combine(*rel_sort.hash_, rel_sort.inputs_);
3801  return *rel_sort.hash_;
3802 }
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().

3804  {
3805  if (rel_modify.hash_) {
3806  return *rel_modify.hash_;
3807  }
3808  rel_modify.hash_ = typeid(RelModify).hash_code();
3809  boost::hash_combine(*rel_modify.hash_, rel_modify.table_descriptor_->tableName);
3810  boost::hash_combine(*rel_modify.hash_, rel_modify.table_descriptor_->tableId);
3811  boost::hash_combine(*rel_modify.hash_, rel_modify.flattened_);
3812  boost::hash_combine(*rel_modify.hash_,
3813  RelModify::yieldModifyOperationString(rel_modify.operation_));
3814  boost::hash_combine(*rel_modify.hash_, rel_modify.target_column_list_);
3815  boost::hash_combine(*rel_modify.hash_, rel_modify.inputs_);
3816  return *rel_modify.hash_;
3817 }
static std::string yieldModifyOperationString(ModifyOperation const op)
Definition: RelAlgDag.h:2293

+ Here is the call graph for this function:

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_.

3819  {
3820  if (rel_tf.hash_) {
3821  return *rel_tf.hash_;
3822  }
3823  rel_tf.hash_ = typeid(RelTableFunction).hash_code();
3824  boost::hash_combine(*rel_tf.hash_, rel_tf.function_name_);
3825  boost::hash_combine(*rel_tf.hash_, rel_tf.table_func_inputs_);
3826  boost::hash_combine(*rel_tf.hash_, rel_tf.target_exprs_);
3827  boost::hash_combine(*rel_tf.hash_, rel_tf.fields_);
3828  boost::hash_combine(*rel_tf.hash_, rel_tf.inputs_);
3829  return *rel_tf.hash_;
3830 }
std::size_t hash_value ( RelLogicalValues const &  rel_lv)

Definition at line 3832 of file RelAlgDag.cpp.

References RelAlgNode::hash_, and RelLogicalValues::tuple_type_.

3832  {
3833  if (rel_lv.hash_) {
3834  return *rel_lv.hash_;
3835  }
3836  rel_lv.hash_ = typeid(RelLogicalValues).hash_code();
3837  for (auto& target_meta_info : rel_lv.tuple_type_) {
3838  boost::hash_combine(*rel_lv.hash_, target_meta_info.get_resname());
3839  boost::hash_combine(*rel_lv.hash_, target_meta_info.get_type_info().get_type_name());
3840  }
3841  return *rel_lv.hash_;
3842 }
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_.

3844  {
3845  if (rel_lv.hash_) {
3846  return *rel_lv.hash_;
3847  }
3848  rel_lv.hash_ = typeid(RelLogicalUnion).hash_code();
3849  boost::hash_combine(*rel_lv.hash_, rel_lv.is_all_);
3850  boost::hash_combine(*rel_lv.hash_, rel_lv.inputs_);
3851  return *rel_lv.hash_;
3852 }
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().

3480  {
3481  std::string result = std::string(2 * depth, ' ') + ::toString(ra) + '\n';
3482  for (size_t i = 0; i < ra->inputCount(); ++i) {
3483  result += tree_string(ra->getInput(i), depth + 1);
3484  }
3485  return result;
3486 }
const RelAlgNode * getInput(const size_t idx) const
Definition: RelAlgDag.h:877
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703
std::string tree_string(const RelAlgNode *ra, const size_t depth)
Definition: RelAlgDag.cpp:3480
const size_t inputCount() const
Definition: RelAlgDag.h:875

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

bool g_cluster
bool g_enable_union

Definition at line 56 of file RelAlgExecutor.cpp.