OmniSciDB  fe05a0c208
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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
- Public Member Functions inherited from RexVisitor< std::unordered_set< RexInput > >
std::unordered_set< RexInputvisitInput (const RexInput *) const override
std::unordered_set< RexInputvisitLiteral (const RexLiteral *) const override
std::unordered_set< RexInputvisitSubQuery (const RexSubQuery *) const override
std::unordered_set< RexInputvisitRef (const RexRef *) const override
std::unordered_set< RexInputvisitOperator (const RexOperator *rex_operator) const override
std::unordered_set< RexInputvisitCase (const RexCase *rex_case) const override
- Public Member Functions inherited from RexVisitorBase< std::unordered_set< RexInput > >
virtual std::unordered_set
< RexInput
visit (const RexScalar *rex_scalar) const

Protected Types

using RetType = std::unordered_set< RexInput >

Protected Member Functions

RetType aggregateResult (const RetType &aggregate, const RetType &next_result) const override
- Protected Member Functions inherited from RexVisitor< std::unordered_set< RexInput > >
std::unordered_set< RexInputdefaultResult () const override

Private Attributes

const RelAlgNodenode_

Detailed Description

Definition at line 561 of file RelAlgOptimizer.cpp.

Member Typedef Documentation

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

Definition at line 566 of file RelAlgOptimizer.cpp.

Constructor & Destructor Documentation

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

Definition at line 575 of file RelAlgOptimizer.cpp.

Member Function Documentation

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

Reimplemented from RexVisitor< std::unordered_set< RexInput > >.

Definition at line 567 of file RelAlgOptimizer.cpp.

References run_benchmark_import::result.

568  {
569  RetType result(aggregate.begin(), aggregate.end());
570  result.insert(next_result.begin(), next_result.end());
571  return result;
572  }
RetType anonymous_namespace{RelAlgOptimizer.cpp}::RexInputCollector::visitInput ( const RexInput input) const

Implements RexVisitorBase< std::unordered_set< RexInput > >.

Definition at line 577 of file RelAlgOptimizer.cpp.

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

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

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 563 of file RelAlgOptimizer.cpp.

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