OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
RexScalar
visit (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 visitWindowFunctionOperator (const RexWindowFunctionOperator *rex_window_function_operator) const
 
RetType visitCase (const RexCase *rex_case) const override
 

Detailed Description

Definition at line 789 of file RelAlgOptimizer.cpp.

Constructor & Destructor Documentation

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

794  : 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

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

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

Definition at line 795 of file RelAlgOptimizer.cpp.

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

795  {
796  auto source = input->getSourceNode();
797  auto node_it = node_to_input_renum_.find(source);
798  if (node_it != node_to_input_renum_.end()) {
799  auto old_to_new_num = node_it->second;
800  auto renum_it = old_to_new_num.find(input->getIndex());
801  CHECK(renum_it != old_to_new_num.end());
802  return boost::make_unique<RexInput>(source, renum_it->second);
803  }
804  return input->deepCopy();
805  }
const std::unordered_map< const RelAlgNode *, std::unordered_map< size_t, size_t > > & node_to_input_renum_
unsigned getIndex() const
CHECK(cgen_state)
std::unique_ptr< RexInput > deepCopy() const
const RelAlgNode * getSourceNode() const

+ Here is the call graph for this function:

Member Data Documentation

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


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