OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{RelAlgOptimizer.cpp}::RexInputCollector Class Reference
+ Inheritance diagram for anonymous_namespace{RelAlgOptimizer.cpp}::RexInputCollector:
+ Collaboration diagram for anonymous_namespace{RelAlgOptimizer.cpp}::RexInputCollector:

Public Member Functions

 RexInputCollector (const RelAlgNode *node)
 
RetType visitInput (const RexInput *input) const override
 

Protected Types

using RetType = std::unordered_set< RexInput >
 

Protected Member Functions

RetType aggregateResult (const RetType &aggregate, const RetType &next_result) const override
 

Private Attributes

const RelAlgNodenode_
 

Detailed Description

Definition at line 566 of file RelAlgOptimizer.cpp.

Member Typedef Documentation

using anonymous_namespace{RelAlgOptimizer.cpp}::RexInputCollector::RetType = std::unordered_set<RexInput>
protected

Definition at line 571 of file RelAlgOptimizer.cpp.

Constructor & Destructor Documentation

anonymous_namespace{RelAlgOptimizer.cpp}::RexInputCollector::RexInputCollector ( const RelAlgNode node)
inline

Definition at line 580 of file RelAlgOptimizer.cpp.

Member Function Documentation

RetType anonymous_namespace{RelAlgOptimizer.cpp}::RexInputCollector::aggregateResult ( const RetType aggregate,
const RetType next_result 
) const
inlineoverrideprotected

Definition at line 572 of file RelAlgOptimizer.cpp.

References run_benchmark_import::result.

573  {
574  RetType result(aggregate.begin(), aggregate.end());
575  result.insert(next_result.begin(), next_result.end());
576  return result;
577  }
RetType anonymous_namespace{RelAlgOptimizer.cpp}::RexInputCollector::visitInput ( const RexInput input) const
inlineoverride

Definition at line 582 of file RelAlgOptimizer.cpp.

References CHECK_EQ, RexAbstractInput::getIndex(), RexInput::getSourceNode(), join(), and run_benchmark_import::result.

582  {
583  RetType result;
584  if (node_->inputCount() == 1) {
585  auto src = node_->getInput(0);
586  if (auto join = dynamic_cast<const RelJoin*>(src)) {
587  CHECK_EQ(join->inputCount(), size_t(2));
588  const auto src2_in_offset = join->getInput(0)->size();
589  if (input->getSourceNode() == join->getInput(1)) {
590  result.emplace(src, input->getIndex() + src2_in_offset);
591  } else {
592  result.emplace(src, input->getIndex());
593  }
594  return result;
595  }
596  }
597  result.insert(*input);
598  return result;
599  }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
std::string join(T const &container, std::string const &delim)
unsigned getIndex() const
Definition: RelAlgDag.h:174
const RelAlgNode * getInput(const size_t idx) const
Definition: RelAlgDag.h:877
const RelAlgNode * getSourceNode() const
Definition: RelAlgDag.h:1056
const size_t inputCount() const
Definition: RelAlgDag.h:875

+ Here is the call graph for this function:

Member Data Documentation

const RelAlgNode* anonymous_namespace{RelAlgOptimizer.cpp}::RexInputCollector::node_
private

Definition at line 568 of file RelAlgOptimizer.cpp.


The documentation for this class was generated from the following file: