OmniSciDB  addbbd5075
 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 506 of file RelAlgOptimizer.cpp.

Member Typedef Documentation

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

Definition at line 511 of file RelAlgOptimizer.cpp.

Constructor & Destructor Documentation

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

Definition at line 520 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 512 of file RelAlgOptimizer.cpp.

References run_benchmark_import::result.

513  {
514  RetType result(aggregate.begin(), aggregate.end());
515  result.insert(next_result.begin(), next_result.end());
516  return result;
517  }
RetType anonymous_namespace{RelAlgOptimizer.cpp}::RexInputCollector::visitInput ( const RexInput input) const

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

Definition at line 521 of file RelAlgOptimizer.cpp.

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

521  {
522  RetType result;
523  if (node_->inputCount() == 1) {
524  auto src = node_->getInput(0);
525  if (auto join = dynamic_cast<const RelJoin*>(src)) {
526  CHECK_EQ(join->inputCount(), size_t(2));
527  const auto src2_in_offset = join->getInput(0)->size();
528  if (input->getSourceNode() == join->getInput(1)) {
529  result.emplace(src, input->getIndex() + src2_in_offset);
530  } else {
531  result.emplace(src, input->getIndex());
532  }
533  return result;
534  }
535  }
536  result.insert(*input);
537  return result;
538  }
#define CHECK_EQ(x, y)
Definition: Logger.h:201
std::string join(T const &container, std::string const &delim)
int64_t * src
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 508 of file RelAlgOptimizer.cpp.

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