OmniSciDB  95562058bd
 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 558 of file RelAlgOptimizer.cpp.

Member Typedef Documentation

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

Definition at line 563 of file RelAlgOptimizer.cpp.

Constructor & Destructor Documentation

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

Definition at line 572 of file RelAlgOptimizer.cpp.

Member Function Documentation

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 564 of file RelAlgOptimizer.cpp.

References run_benchmark_import::result.

565  {
566  RetType result(aggregate.begin(), aggregate.end());
567  result.insert(next_result.begin(), next_result.end());
568  return result;
569  }
RetType anonymous_namespace{RelAlgOptimizer.cpp}::RexInputCollector::visitInput ( const RexInput input) const
inlineoverridevirtual

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

Definition at line 573 of file RelAlgOptimizer.cpp.

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

573  {
574  RetType result;
575  if (node_->inputCount() == 1) {
576  auto src = node_->getInput(0);
577  if (auto join = dynamic_cast<const RelJoin*>(src)) {
578  CHECK_EQ(join->inputCount(), size_t(2));
579  const auto src2_in_offset = join->getInput(0)->size();
580  if (input->getSourceNode() == join->getInput(1)) {
581  result.emplace(src, input->getIndex() + src2_in_offset);
582  } else {
583  result.emplace(src, input->getIndex());
584  }
585  return result;
586  }
587  }
588  result.insert(*input);
589  return result;
590  }
#define CHECK_EQ(x, y)
Definition: Logger.h:205
int64_t * src
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_
private

Definition at line 560 of file RelAlgOptimizer.cpp.


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