OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{RelLeftDeepInnerJoin.cpp} Namespace Reference

Classes

class  RebindRexInputsFromLeftDeepJoin
 

Functions

void collect_left_deep_join_inputs (std::deque< std::shared_ptr< const RelAlgNode >> &inputs, std::vector< std::shared_ptr< const RelJoin >> &original_joins, const std::shared_ptr< const RelJoin > &join)
 
std::pair< std::shared_ptr
< RelLeftDeepInnerJoin >
, std::shared_ptr< const
RelAlgNode > > 
create_left_deep_join (const std::shared_ptr< RelAlgNode > &left_deep_join_root)
 

Function Documentation

void anonymous_namespace{RelLeftDeepInnerJoin.cpp}::collect_left_deep_join_inputs ( std::deque< std::shared_ptr< const RelAlgNode >> &  inputs,
std::vector< std::shared_ptr< const RelJoin >> &  original_joins,
const std::shared_ptr< const RelJoin > &  join 
)

Definition at line 141 of file RelLeftDeepInnerJoin.cpp.

References CHECK_EQ.

Referenced by create_left_deep_join().

144  {
145  original_joins.push_back(join);
146  CHECK_EQ(size_t(2), join->inputCount());
147  const auto left_input_join =
148  std::dynamic_pointer_cast<const RelJoin>(join->getAndOwnInput(0));
149  if (left_input_join) {
150  inputs.push_front(join->getAndOwnInput(1));
151  collect_left_deep_join_inputs(inputs, original_joins, left_input_join);
152  } else {
153  inputs.push_front(join->getAndOwnInput(1));
154  inputs.push_front(join->getAndOwnInput(0));
155  }
156 }
#define CHECK_EQ(x, y)
Definition: Logger.h:198
std::string join(T const &container, std::string const &delim)
void collect_left_deep_join_inputs(std::deque< std::shared_ptr< const RelAlgNode >> &inputs, std::vector< std::shared_ptr< const RelJoin >> &original_joins, const std::shared_ptr< const RelJoin > &join)

+ Here is the caller graph for this function:

std::pair<std::shared_ptr<RelLeftDeepInnerJoin>, std::shared_ptr<const RelAlgNode> > anonymous_namespace{RelLeftDeepInnerJoin.cpp}::create_left_deep_join ( const std::shared_ptr< RelAlgNode > &  left_deep_join_root)

Definition at line 159 of file RelLeftDeepInnerJoin.cpp.

References CHECK(), collect_left_deep_join_inputs(), get_left_deep_join_root(), and join().

Referenced by create_left_deep_join(), and anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RelAlgAbstractInterpreter::run().

159  {
160  const auto old_root = get_left_deep_join_root(left_deep_join_root);
161  if (!old_root) {
162  return {nullptr, nullptr};
163  }
164  std::deque<std::shared_ptr<const RelAlgNode>> inputs_deque;
165  const auto left_deep_join_filter =
166  std::dynamic_pointer_cast<RelFilter>(left_deep_join_root);
167  const auto join =
168  std::dynamic_pointer_cast<const RelJoin>(left_deep_join_root->getAndOwnInput(0));
169  CHECK(join);
170  std::vector<std::shared_ptr<const RelJoin>> original_joins;
171  collect_left_deep_join_inputs(inputs_deque, original_joins, join);
172  std::vector<std::shared_ptr<const RelAlgNode>> inputs(inputs_deque.begin(),
173  inputs_deque.end());
174  return {std::make_shared<RelLeftDeepInnerJoin>(
175  left_deep_join_filter, inputs, original_joins),
176  old_root};
177 }
std::shared_ptr< const RelAlgNode > get_left_deep_join_root(const std::shared_ptr< RelAlgNode > &node)
std::string join(T const &container, std::string const &delim)
CHECK(cgen_state)
void collect_left_deep_join_inputs(std::deque< std::shared_ptr< const RelAlgNode >> &inputs, std::vector< std::shared_ptr< const RelJoin >> &original_joins, const std::shared_ptr< const RelJoin > &join)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: