OmniSciDB  72c90bc290
 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 QueryDescriptionType &type)
Definition: Types.h:64
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 3534 of file RelAlgDag.cpp.

References heavydb.dtypes::T.

3534  {
3535  if (rex_literal.hash_) {
3536  return *rex_literal.hash_;
3537  }
3538  rex_literal.hash_ = typeid(RexLiteral).hash_code();
3539  boost::apply_visitor(
3540  [&rex_literal](auto&& current_val) {
3541  using T = std::decay_t<decltype(current_val)>;
3542  if constexpr (!std::is_same_v<boost::blank, T>) {
3543  static_assert(std::is_same_v<int64_t, T> || std::is_same_v<double, T> ||
3544  std::is_same_v<std::string, T> || std::is_same_v<bool, T>);
3545  boost::hash_combine(*rex_literal.hash_, current_val);
3546  }
3547  },
3548  rex_literal.literal_);
3549  boost::hash_combine(*rex_literal.hash_, rex_literal.type_);
3550  boost::hash_combine(*rex_literal.hash_, rex_literal.target_type_);
3551  boost::hash_combine(*rex_literal.hash_, rex_literal.scale_);
3552  boost::hash_combine(*rex_literal.hash_, rex_literal.precision_);
3553  boost::hash_combine(*rex_literal.hash_, rex_literal.target_scale_);
3554  boost::hash_combine(*rex_literal.hash_, rex_literal.target_precision_);
3555  return *rex_literal.hash_;
3556 }
std::size_t hash_value ( RexOperator const &  rex_op)

Definition at line 3558 of file RelAlgDag.cpp.

References SQLTypeInfo::get_type_name(), RexOperator::getType(), Rex::hash_, RexOperator::op_, and RexOperator::operands_.

3558  {
3559  if (rex_op.hash_) {
3560  return *rex_op.hash_;
3561  }
3562  rex_op.hash_ = typeid(RexOperator).hash_code();
3563  boost::hash_combine(*rex_op.hash_, rex_op.op_);
3564  boost::hash_combine(*rex_op.hash_, rex_op.operands_);
3565  boost::hash_combine(*rex_op.hash_, rex_op.getType().get_type_name());
3566  return *rex_op.hash_;
3567 }

+ Here is the call graph for this function:

std::size_t hash_value ( RexCase const &  rex_case)

Definition at line 3569 of file RelAlgDag.cpp.

References RexCase::else_expr_, RexCase::expr_pair_list_, and Rex::hash_.

3569  {
3570  if (rex_case.hash_) {
3571  return *rex_case.hash_;
3572  }
3573  rex_case.hash_ = typeid(RexCase).hash_code();
3574  boost::hash_combine(*rex_case.hash_, rex_case.expr_pair_list_);
3575  boost::hash_combine(*rex_case.hash_, rex_case.else_expr_);
3576  return *rex_case.hash_;
3577 }
std::size_t hash_value ( RexFunctionOperator const &  rex_op)

Definition at line 3579 of file RelAlgDag.cpp.

References SQLTypeInfo::get_type_name(), RexOperator::getType(), Rex::hash_, RexFunctionOperator::name_, RexOperator::op_, RexOperator::operands_, and toString().

3579  {
3580  if (rex_op.hash_) {
3581  return *rex_op.hash_;
3582  }
3583  rex_op.hash_ = typeid(RexFunctionOperator).hash_code();
3584  boost::hash_combine(*rex_op.hash_, ::toString(rex_op.op_));
3585  boost::hash_combine(*rex_op.hash_, rex_op.getType().get_type_name());
3586  boost::hash_combine(*rex_op.hash_, rex_op.operands_);
3587  boost::hash_combine(*rex_op.hash_, rex_op.name_);
3588  return *rex_op.hash_;
3589 }
std::string toString(const QueryDescriptionType &type)
Definition: Types.h:64

+ Here is the call graph for this function:

std::size_t hash_value ( SortField const &  sort_field)

Definition at line 3591 of file RelAlgDag.cpp.

References Ascending, SortField::field_, First, hash_value(), SortField::nulls_pos_, and SortField::sort_dir_.

3591  {
3592  auto hash = boost::hash_value(sort_field.field_);
3593  boost::hash_combine(hash, sort_field.sort_dir_ == SortDirection::Ascending ? "a" : "d");
3594  boost::hash_combine(hash,
3595  sort_field.nulls_pos_ == NullSortedPosition::First ? "f" : "l");
3596  return hash;
3597 }
std::size_t hash_value(RexAbstractInput const &rex_ab_input)
Definition: RelAlgDag.cpp:3525

+ Here is the call graph for this function:

std::size_t hash_value ( RexWindowFunctionOperator const &  rex_window)

Definition at line 3599 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_.

3599  {
3600  if (rex_window.hash_) {
3601  return *rex_window.hash_;
3602  }
3603  rex_window.hash_ = typeid(RexWindowFunctionOperator).hash_code();
3604  boost::hash_combine(*rex_window.hash_, rex_window.getType().get_type_name());
3605  boost::hash_combine(*rex_window.hash_, rex_window.getName());
3606  boost::hash_combine(*rex_window.hash_, rex_window.is_rows_);
3607  boost::hash_combine(*rex_window.hash_, rex_window.collation_);
3608  boost::hash_combine(*rex_window.hash_, rex_window.operands_);
3609  boost::hash_combine(*rex_window.hash_, rex_window.partition_keys_);
3610  boost::hash_combine(*rex_window.hash_, rex_window.order_keys_);
3611  auto get_window_bound_hash =
3613  auto h = boost::hash_value(bound.bound_expr);
3614  boost::hash_combine(h, bound.unbounded);
3615  boost::hash_combine(h, bound.preceding);
3616  boost::hash_combine(h, bound.following);
3617  boost::hash_combine(h, bound.is_current_row);
3618  boost::hash_combine(h, bound.order_key);
3619  return h;
3620  };
3621  boost::hash_combine(*rex_window.hash_,
3622  get_window_bound_hash(rex_window.frame_start_bound_));
3623  boost::hash_combine(*rex_window.hash_,
3624  get_window_bound_hash(rex_window.frame_end_bound_));
3625  return *rex_window.hash_;
3626 }
std::size_t hash_value(RexAbstractInput const &rex_ab_input)
Definition: RelAlgDag.cpp:3525

+ Here is the call graph for this function:

std::size_t hash_value ( RexRef const &  rex_ref)

Definition at line 3628 of file RelAlgDag.cpp.

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

3628  {
3629  if (rex_ref.hash_) {
3630  return *rex_ref.hash_;
3631  }
3632  rex_ref.hash_ = typeid(RexRef).hash_code();
3633  boost::hash_combine(*rex_ref.hash_, rex_ref.index_);
3634  return *rex_ref.hash_;
3635 }
std::size_t hash_value ( RexAgg const &  rex_agg)

Definition at line 3637 of file RelAlgDag.cpp.

References RexAgg::agg_, RexAgg::distinct_, SQLTypeInfo::get_type_name(), Rex::hash_, RexAgg::operands_, and RexAgg::type_.

3637  {
3638  if (rex_agg.hash_) {
3639  return *rex_agg.hash_;
3640  }
3641  rex_agg.hash_ = typeid(RexAgg).hash_code();
3642  boost::hash_combine(*rex_agg.hash_, rex_agg.operands_);
3643  boost::hash_combine(*rex_agg.hash_, rex_agg.agg_);
3644  boost::hash_combine(*rex_agg.hash_, rex_agg.distinct_);
3645  boost::hash_combine(*rex_agg.hash_, rex_agg.type_.get_type_name());
3646  return *rex_agg.hash_;
3647 }

+ Here is the call graph for this function:

std::size_t hash_value ( RexSubQuery const &  rex_subq)

Definition at line 3649 of file RelAlgDag.cpp.

3649  {
3650  if (rex_subq.hash_) {
3651  return *rex_subq.hash_;
3652  }
3653  rex_subq.hash_ = typeid(RexSubQuery).hash_code();
3654  boost::hash_combine(*rex_subq.hash_, rex_subq.ra_);
3655  return *rex_subq.hash_;
3656 }
std::size_t hash_value ( RexInput const &  rex_input)

Definition at line 3658 of file RelAlgDag.cpp.

References RexAbstractInput::getIndex(), Rex::hash_, and RexInput::node_.

3658  {
3659  if (rex_input.hash_) {
3660  return *rex_input.hash_;
3661  }
3662  rex_input.hash_ = typeid(RexInput).hash_code();
3663  boost::hash_combine(*rex_input.hash_, rex_input.node_);
3664  boost::hash_combine(*rex_input.hash_, rex_input.getIndex());
3665  return *rex_input.hash_;
3666 }

+ Here is the call graph for this function:

std::size_t hash_value ( RelScan const &  rel_scan)

Definition at line 3668 of file RelAlgDag.cpp.

References RelScan::field_names_, RelAlgNode::hash_, TableDescriptor::tableId, TableDescriptor::tableName, RelScan::td_, and toString().

3668  {
3669  if (rel_scan.hash_) {
3670  return *rel_scan.hash_;
3671  }
3672  rel_scan.hash_ = typeid(RelScan).hash_code();
3673  boost::hash_combine(*rel_scan.hash_, rel_scan.td_->tableId);
3674  boost::hash_combine(*rel_scan.hash_, rel_scan.td_->tableName);
3675  boost::hash_combine(*rel_scan.hash_, ::toString(rel_scan.field_names_));
3676  return *rel_scan.hash_;
3677 }
std::string toString(const QueryDescriptionType &type)
Definition: Types.h:64

+ Here is the call graph for this function:

std::size_t hash_value ( RelProject const &  rel_project)

Definition at line 3679 of file RelAlgDag.cpp.

References RelProject::fields_, RelAlgNode::hash_, RelAlgNode::inputs_, and RelProject::scalar_exprs_.

3679  {
3680  if (rel_project.hash_) {
3681  return *rel_project.hash_;
3682  }
3683  rel_project.hash_ = typeid(RelProject).hash_code();
3684  boost::hash_combine(*rel_project.hash_, rel_project.scalar_exprs_);
3685  boost::hash_combine(*rel_project.hash_, rel_project.fields_);
3686  boost::hash_combine(*rel_project.hash_, rel_project.inputs_);
3687  return *rel_project.hash_;
3688 }
std::size_t hash_value ( RelAggregate const &  rel_agg)

Definition at line 3690 of file RelAlgDag.cpp.

References RelAggregate::agg_exprs_, RelAggregate::fields_, RelAggregate::groupby_count_, RelAlgNode::hash_, and RelAlgNode::inputs_.

3690  {
3691  if (rel_agg.hash_) {
3692  return *rel_agg.hash_;
3693  }
3694  rel_agg.hash_ = typeid(RelAggregate).hash_code();
3695  boost::hash_combine(*rel_agg.hash_, rel_agg.groupby_count_);
3696  boost::hash_combine(*rel_agg.hash_, rel_agg.agg_exprs_);
3697  boost::hash_combine(*rel_agg.hash_, rel_agg.fields_);
3698  boost::hash_combine(*rel_agg.hash_, rel_agg.inputs_);
3699  return *rel_agg.hash_;
3700 }
std::size_t hash_value ( RelJoin const &  rel_join)

Definition at line 3702 of file RelAlgDag.cpp.

References RelJoin::condition_, RelJoin::getJoinType(), RelAlgNode::hash_, RelAlgNode::inputs_, and toString().

3702  {
3703  if (rel_join.hash_) {
3704  return *rel_join.hash_;
3705  }
3706  rel_join.hash_ = typeid(RelJoin).hash_code();
3707  boost::hash_combine(*rel_join.hash_, rel_join.condition_);
3708  boost::hash_combine(*rel_join.hash_, rel_join.inputs_);
3709  boost::hash_combine(*rel_join.hash_, ::toString(rel_join.getJoinType()));
3710  return *rel_join.hash_;
3711 }
std::string toString(const QueryDescriptionType &type)
Definition: Types.h:64

+ Here is the call graph for this function:

std::size_t hash_value ( RelTranslatedJoin const &  rel_tr_join)

Definition at line 3713 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().

3713  {
3714  if (rel_tr_join.hash_) {
3715  return *rel_tr_join.hash_;
3716  }
3717  rel_tr_join.hash_ = typeid(RelTranslatedJoin).hash_code();
3718  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.lhs_);
3719  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.rhs_);
3720  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.outer_join_cond_);
3721  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.nested_loop_);
3722  boost::hash_combine(*rel_tr_join.hash_, ::toString(rel_tr_join.join_type_));
3723  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.op_type_);
3724  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.qualifier_);
3725  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.op_typeinfo_);
3726  boost::hash_combine(*rel_tr_join.hash_, rel_tr_join.filter_ops_);
3727  return *rel_tr_join.hash_;
3728 }
std::string toString(const QueryDescriptionType &type)
Definition: Types.h:64

+ Here is the call graph for this function:

std::size_t hash_value ( RelFilter const &  rel_filter)

Definition at line 3730 of file RelAlgDag.cpp.

References RelFilter::filter_, RelAlgNode::hash_, and RelAlgNode::inputs_.

3730  {
3731  if (rel_filter.hash_) {
3732  return *rel_filter.hash_;
3733  }
3734  rel_filter.hash_ = typeid(RelFilter).hash_code();
3735  boost::hash_combine(*rel_filter.hash_, rel_filter.filter_);
3736  boost::hash_combine(*rel_filter.hash_, rel_filter.inputs_);
3737  return *rel_filter.hash_;
3738 }
std::size_t hash_value ( RelLeftDeepInnerJoin const &  rel_join)

Definition at line 3740 of file RelAlgDag.cpp.

References RelLeftDeepInnerJoin::condition_, RelAlgNode::hash_, RelAlgNode::inputs_, RelLeftDeepInnerJoin::original_filter_, and RelLeftDeepInnerJoin::outer_conditions_per_level_.

3740  {
3741  if (rel_join.hash_) {
3742  return *rel_join.hash_;
3743  }
3744  rel_join.hash_ = typeid(RelLeftDeepInnerJoin).hash_code();
3745  boost::hash_combine(*rel_join.hash_, rel_join.condition_);
3746  boost::hash_combine(*rel_join.hash_, rel_join.outer_conditions_per_level_);
3747  boost::hash_combine(*rel_join.hash_, rel_join.original_filter_);
3748  boost::hash_combine(*rel_join.hash_, rel_join.inputs_);
3749  return *rel_join.hash_;
3750 }
std::size_t hash_value ( RelCompound const &  rel_compound)

Definition at line 3752 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_.

3752  {
3753  if (rel_compound.hash_) {
3754  return *rel_compound.hash_;
3755  }
3756  rel_compound.hash_ = typeid(RelCompound).hash_code();
3757  boost::hash_combine(*rel_compound.hash_, rel_compound.filter_expr_);
3758  boost::hash_combine(*rel_compound.hash_, rel_compound.is_agg_);
3759  boost::hash_combine(*rel_compound.hash_, rel_compound.target_exprs_);
3760  boost::hash_combine(*rel_compound.hash_, rel_compound.agg_exprs_);
3761  boost::hash_combine(*rel_compound.hash_, rel_compound.scalar_sources_);
3762  boost::hash_combine(*rel_compound.hash_, rel_compound.groupby_count_);
3763  boost::hash_combine(*rel_compound.hash_, rel_compound.fields_);
3764  boost::hash_combine(*rel_compound.hash_, rel_compound.inputs_);
3765  return *rel_compound.hash_;
3766 }
std::size_t hash_value ( RelSort const &  rel_sort)

Definition at line 3768 of file RelAlgDag.cpp.

References RelSort::collation_, RelAlgNode::hash_, RelAlgNode::inputs_, RelSort::limit_, and RelSort::offset_.

3768  {
3769  if (rel_sort.hash_) {
3770  return *rel_sort.hash_;
3771  }
3772  rel_sort.hash_ = typeid(RelSort).hash_code();
3773  boost::hash_combine(*rel_sort.hash_, rel_sort.collation_);
3774  boost::hash_combine(*rel_sort.hash_, rel_sort.limit_.has_value());
3775  boost::hash_combine(*rel_sort.hash_, rel_sort.limit_.value_or(0));
3776  boost::hash_combine(*rel_sort.hash_, rel_sort.offset_);
3777  boost::hash_combine(*rel_sort.hash_, rel_sort.inputs_);
3778  return *rel_sort.hash_;
3779 }
std::size_t hash_value ( RelModify const &  rel_modify)

Definition at line 3781 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().

3781  {
3782  if (rel_modify.hash_) {
3783  return *rel_modify.hash_;
3784  }
3785  rel_modify.hash_ = typeid(RelModify).hash_code();
3786  boost::hash_combine(*rel_modify.hash_, rel_modify.table_descriptor_->tableName);
3787  boost::hash_combine(*rel_modify.hash_, rel_modify.table_descriptor_->tableId);
3788  boost::hash_combine(*rel_modify.hash_, rel_modify.flattened_);
3789  boost::hash_combine(*rel_modify.hash_,
3790  RelModify::yieldModifyOperationString(rel_modify.operation_));
3791  boost::hash_combine(*rel_modify.hash_, rel_modify.target_column_list_);
3792  boost::hash_combine(*rel_modify.hash_, rel_modify.inputs_);
3793  return *rel_modify.hash_;
3794 }
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 3796 of file RelAlgDag.cpp.

References RelTableFunction::fields_, RelTableFunction::function_name_, RelAlgNode::hash_, RelAlgNode::inputs_, RelTableFunction::table_func_inputs_, and RelTableFunction::target_exprs_.

3796  {
3797  if (rel_tf.hash_) {
3798  return *rel_tf.hash_;
3799  }
3800  rel_tf.hash_ = typeid(RelTableFunction).hash_code();
3801  boost::hash_combine(*rel_tf.hash_, rel_tf.function_name_);
3802  boost::hash_combine(*rel_tf.hash_, rel_tf.table_func_inputs_);
3803  boost::hash_combine(*rel_tf.hash_, rel_tf.target_exprs_);
3804  boost::hash_combine(*rel_tf.hash_, rel_tf.fields_);
3805  boost::hash_combine(*rel_tf.hash_, rel_tf.inputs_);
3806  return *rel_tf.hash_;
3807 }
std::size_t hash_value ( RelLogicalValues const &  rel_lv)

Definition at line 3809 of file RelAlgDag.cpp.

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

3809  {
3810  if (rel_lv.hash_) {
3811  return *rel_lv.hash_;
3812  }
3813  rel_lv.hash_ = typeid(RelLogicalValues).hash_code();
3814  for (auto& target_meta_info : rel_lv.tuple_type_) {
3815  boost::hash_combine(*rel_lv.hash_, target_meta_info.get_resname());
3816  boost::hash_combine(*rel_lv.hash_, target_meta_info.get_type_info().get_type_name());
3817  }
3818  return *rel_lv.hash_;
3819 }
std::size_t hash_value ( RelLogicalUnion const &  rel_lv)

Definition at line 3821 of file RelAlgDag.cpp.

References RelAlgNode::hash_, RelAlgNode::inputs_, and RelLogicalUnion::is_all_.

3821  {
3822  if (rel_lv.hash_) {
3823  return *rel_lv.hash_;
3824  }
3825  rel_lv.hash_ = typeid(RelLogicalUnion).hash_code();
3826  boost::hash_combine(*rel_lv.hash_, rel_lv.is_all_);
3827  boost::hash_combine(*rel_lv.hash_, rel_lv.inputs_);
3828  return *rel_lv.hash_;
3829 }
std::string tree_string ( const RelAlgNode ra,
const size_t  depth 
)

Definition at line 3457 of file RelAlgDag.cpp.

References RelAlgNode::getInput(), RelAlgNode::inputCount(), run_benchmark_import::result, toString(), and tree_string().

Referenced by tree_string().

3457  {
3458  std::string result = std::string(2 * depth, ' ') + ::toString(ra) + '\n';
3459  for (size_t i = 0; i < ra->inputCount(); ++i) {
3460  result += tree_string(ra->getInput(i), depth + 1);
3461  }
3462  return result;
3463 }
std::string toString(const QueryDescriptionType &type)
Definition: Types.h:64
const RelAlgNode * getInput(const size_t idx) const
Definition: RelAlgDag.h:877
std::string tree_string(const RelAlgNode *ra, const size_t depth)
Definition: RelAlgDag.cpp:3457
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.