OmniSciDB  c07336695a
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< RexInputvisit (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 513 of file RelAlgOptimizer.cpp.

Member Typedef Documentation

◆ RetType

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

Definition at line 518 of file RelAlgOptimizer.cpp.

Constructor & Destructor Documentation

◆ RexInputCollector()

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

Definition at line 527 of file RelAlgOptimizer.cpp.

Member Function Documentation

◆ aggregateResult()

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

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

Definition at line 519 of file RelAlgOptimizer.cpp.

References run-benchmark-import::result.

520  {
521  RetType result(aggregate.begin(), aggregate.end());
522  result.insert(next_result.begin(), next_result.end());
523  return result;
524  }

◆ visitInput()

RetType anonymous_namespace{RelAlgOptimizer.cpp}::RexInputCollector::visitInput ( const RexInput input) const
inlineoverridevirtual

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

Definition at line 528 of file RelAlgOptimizer.cpp.

References CHECK_EQ, RexAbstractInput::getIndex(), RelAlgNode::getInput(), RexInput::getSourceNode(), RelAlgNode::inputCount(), join(), run-benchmark-import::result, and src.

528  {
529  RetType result;
530  if (node_->inputCount() == 1) {
531  auto src = node_->getInput(0);
532  if (auto join = dynamic_cast<const RelJoin*>(src)) {
533  CHECK_EQ(join->inputCount(), size_t(2));
534  const auto src2_in_offset = join->getInput(0)->size();
535  if (input->getSourceNode() == join->getInput(1)) {
536  result.emplace(src, input->getIndex() + src2_in_offset);
537  } else {
538  result.emplace(src, input->getIndex());
539  }
540  return result;
541  }
542  }
543  result.insert(*input);
544  return result;
545  }
#define CHECK_EQ(x, y)
Definition: Logger.h:195
std::string join(T const &container, std::string const &delim)
int64_t * src
const RelAlgNode * getSourceNode() const
const size_t inputCount() const
const RelAlgNode * getInput(const size_t idx) const
+ Here is the call graph for this function:

Member Data Documentation

◆ node_

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

Definition at line 515 of file RelAlgOptimizer.cpp.


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