OmniSciDB  95562058bd
 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

- Public Types inherited from RexDeepCopyVisitor
using RowValues = std::vector< std::unique_ptr< const RexScalar >>
 
- Static Public Member Functions inherited from RexDeepCopyVisitor
static std::vector< RowValuescopy (std::vector< RowValues > const &rhs)
 
- 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 849 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 851 of file RelAlgOptimizer.cpp.

854  : 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 855 of file RelAlgOptimizer.cpp.

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

855  {
856  auto source = input->getSourceNode();
857  auto node_it = node_to_input_renum_.find(source);
858  if (node_it != node_to_input_renum_.end()) {
859  auto old_to_new_num = node_it->second;
860  auto renum_it = old_to_new_num.find(input->getIndex());
861  CHECK(renum_it != old_to_new_num.end());
862  return boost::make_unique<RexInput>(source, renum_it->second);
863  }
864  return input->deepCopy();
865  }
const std::unordered_map< const RelAlgNode *, std::unordered_map< size_t, size_t > > & node_to_input_renum_
unsigned getIndex() const
std::unique_ptr< RexInput > deepCopy() const
const RelAlgNode * getSourceNode() const
#define CHECK(condition)
Definition: Logger.h:197

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


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