OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 860 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 862 of file RelAlgOptimizer.cpp.

865  : 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 866 of file RelAlgOptimizer.cpp.

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

866  {
867  auto source = input->getSourceNode();
868  auto node_it = node_to_input_renum_.find(source);
869  if (node_it != node_to_input_renum_.end()) {
870  auto old_to_new_num = node_it->second;
871  auto renum_it = old_to_new_num.find(input->getIndex());
872  CHECK(renum_it != old_to_new_num.end());
873  return boost::make_unique<RexInput>(source, renum_it->second);
874  }
875  return input->deepCopy();
876  }
const std::unordered_map< const RelAlgNode *, std::unordered_map< size_t, size_t > > & node_to_input_renum_
unsigned getIndex() const
Definition: RelAlgDag.h:174
std::unique_ptr< RexInput > deepCopy() const
Definition: RelAlgDag.h:1070
const RelAlgNode * getSourceNode() const
Definition: RelAlgDag.h:1056
#define CHECK(condition)
Definition: Logger.h:291

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


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