OmniSciDB  a5dc49c757
 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 174 of file RelLeftDeepInnerJoin.cpp.

References CHECK_EQ.

Referenced by create_left_deep_join().

177  {
178  original_joins.push_back(join);
179  CHECK_EQ(size_t(2), join->inputCount());
180  const auto left_input_join =
181  std::dynamic_pointer_cast<const RelJoin>(join->getAndOwnInput(0));
182  if (left_input_join) {
183  inputs.push_front(join->getAndOwnInput(1));
184  collect_left_deep_join_inputs(inputs, original_joins, left_input_join);
185  } else {
186  inputs.push_front(join->getAndOwnInput(1));
187  inputs.push_front(join->getAndOwnInput(0));
188  }
189 }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
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 192 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().

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