OmniSciDB  c07336695a
anonymous_namespace{RelAlgOptimizer.cpp}::RexInputRenumberVisitor Class Reference
+ Inheritance diagram for anonymous_namespace{RelAlgOptimizer.cpp}::RexInputRenumberVisitor:
+ Collaboration diagram for anonymous_namespace{RelAlgOptimizer.cpp}::RexInputRenumberVisitor:

Public Member Functions

 RexInputRenumberVisitor (const std::unordered_map< const RelAlgNode *, std::unordered_map< size_t, size_t >> &new_numbering)
 
RetType visitInput (const RexInput *input) const override
 
- Public Member Functions inherited from RexVisitorBase< std::unique_ptr< const RexScalar > >
virtual std::unique_ptr< const RexScalarvisit (const RexScalar *rex_scalar) const
 

Private Attributes

const std::unordered_map< const RelAlgNode *, std::unordered_map< size_t, size_t > > & node_to_input_renum_
 

Additional Inherited Members

- Protected Types inherited from RexDeepCopyVisitor
using RetType = std::unique_ptr< const RexScalar >
 
- Protected Member Functions inherited from RexDeepCopyVisitor
RetType visitInput (const RexInput *input) const override
 
RetType visitLiteral (const RexLiteral *literal) const override
 
RetType visitSubQuery (const RexSubQuery *subquery) const override
 
RetType visitRef (const RexRef *ref) const override
 
RetType visitOperator (const RexOperator *rex_operator) const override
 
RetType visitCase (const RexCase *rex_case) const override
 

Detailed Description

Definition at line 786 of file RelAlgOptimizer.cpp.

Constructor & Destructor Documentation

◆ RexInputRenumberVisitor()

anonymous_namespace{RelAlgOptimizer.cpp}::RexInputRenumberVisitor::RexInputRenumberVisitor ( const std::unordered_map< const RelAlgNode *, std::unordered_map< size_t, size_t >> &  new_numbering)
inline

Definition at line 788 of file RelAlgOptimizer.cpp.

791  : node_to_input_renum_(new_numbering) {}
const std::unordered_map< const RelAlgNode *, std::unordered_map< size_t, size_t > > & node_to_input_renum_

Member Function Documentation

◆ visitInput()

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

Implements RexVisitorBase< std::unique_ptr< const RexScalar > >.

Definition at line 792 of file RelAlgOptimizer.cpp.

References CHECK, RexInput::deepCopy(), RexAbstractInput::getIndex(), and RexInput::getSourceNode().

792  {
793  auto source = input->getSourceNode();
794  auto node_it = node_to_input_renum_.find(source);
795  if (node_it != node_to_input_renum_.end()) {
796  auto old_to_new_num = node_it->second;
797  auto renum_it = old_to_new_num.find(input->getIndex());
798  CHECK(renum_it != old_to_new_num.end());
799  return boost::make_unique<RexInput>(source, renum_it->second);
800  }
801  return input->deepCopy();
802  }
const std::unordered_map< const RelAlgNode *, std::unordered_map< size_t, size_t > > & node_to_input_renum_
std::unique_ptr< RexInput > deepCopy() const
const RelAlgNode * getSourceNode() const
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the call graph for this function:

Member Data Documentation

◆ node_to_input_renum_

const std::unordered_map<const RelAlgNode*, std::unordered_map<size_t, size_t> >& anonymous_namespace{RelAlgOptimizer.cpp}::RexInputRenumberVisitor::node_to_input_renum_
private

Definition at line 806 of file RelAlgOptimizer.cpp.


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