OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 181 of file RelLeftDeepInnerJoin.cpp.

References CHECK_EQ.

Referenced by create_left_deep_join().

184  {
185  original_joins.push_back(join);
186  CHECK_EQ(size_t(2), join->inputCount());
187  const auto left_input_join =
188  std::dynamic_pointer_cast<const RelJoin>(join->getAndOwnInput(0));
189  if (left_input_join) {
190  inputs.push_front(join->getAndOwnInput(1));
191  collect_left_deep_join_inputs(inputs, original_joins, left_input_join);
192  } else {
193  inputs.push_front(join->getAndOwnInput(1));
194  inputs.push_front(join->getAndOwnInput(0));
195  }
196 }
#define CHECK_EQ(x, y)
Definition: Logger.h:297
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 199 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 RelAlgDagBuilder::optimizeDag().

199  {
200  const auto old_root = get_left_deep_join_root(left_deep_join_root);
201  if (!old_root) {
202  return {nullptr, nullptr};
203  }
204  std::deque<std::shared_ptr<const RelAlgNode>> inputs_deque;
205  const auto left_deep_join_filter =
206  std::dynamic_pointer_cast<RelFilter>(left_deep_join_root);
207  const auto join =
208  std::dynamic_pointer_cast<const RelJoin>(left_deep_join_root->getAndOwnInput(0));
209  CHECK(join);
210  std::vector<std::shared_ptr<const RelJoin>> original_joins;
211  collect_left_deep_join_inputs(inputs_deque, original_joins, join);
212  std::vector<std::shared_ptr<const RelAlgNode>> inputs(inputs_deque.begin(),
213  inputs_deque.end());
214  return {std::make_shared<RelLeftDeepInnerJoin>(
215  left_deep_join_filter, inputs, original_joins),
216  old_root};
217 }
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)
#define CHECK(condition)
Definition: Logger.h:289
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: