OmniSciDB  471d68cefb
 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 170 of file RelLeftDeepInnerJoin.cpp.

References CHECK_EQ.

Referenced by create_left_deep_join().

173  {
174  original_joins.push_back(join);
175  CHECK_EQ(size_t(2), join->inputCount());
176  const auto left_input_join =
177  std::dynamic_pointer_cast<const RelJoin>(join->getAndOwnInput(0));
178  if (left_input_join) {
179  inputs.push_front(join->getAndOwnInput(1));
180  collect_left_deep_join_inputs(inputs, original_joins, left_input_join);
181  } else {
182  inputs.push_front(join->getAndOwnInput(1));
183  inputs.push_front(join->getAndOwnInput(0));
184  }
185 }
#define CHECK_EQ(x, y)
Definition: Logger.h:217
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 188 of file RelLeftDeepInnerJoin.cpp.

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

Referenced by RelAlgDagBuilder::build(), and create_left_deep_join().

188  {
189  const auto old_root = get_left_deep_join_root(left_deep_join_root);
190  if (!old_root) {
191  return {nullptr, nullptr};
192  }
193  std::deque<std::shared_ptr<const RelAlgNode>> inputs_deque;
194  const auto left_deep_join_filter =
195  std::dynamic_pointer_cast<RelFilter>(left_deep_join_root);
196  const auto join =
197  std::dynamic_pointer_cast<const RelJoin>(left_deep_join_root->getAndOwnInput(0));
198  CHECK(join);
199  std::vector<std::shared_ptr<const RelJoin>> original_joins;
200  collect_left_deep_join_inputs(inputs_deque, original_joins, join);
201  std::vector<std::shared_ptr<const RelAlgNode>> inputs(inputs_deque.begin(),
202  inputs_deque.end());
203  return {std::make_shared<RelLeftDeepInnerJoin>(
204  left_deep_join_filter, inputs, original_joins),
205  old_root};
206 }
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:209
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: