OmniSciDB  c07336695a
RexInputRenumber< bAllowMissing > Class Template Reference

#include <RexVisitor.h>

+ Inheritance diagram for RexInputRenumber< bAllowMissing >:
+ Collaboration diagram for RexInputRenumber< bAllowMissing >:

Public Member Functions

 RexInputRenumber (const 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< size_t, size_t > & old_to_new_idx_

Additional Inherited Members

- Protected Types inherited from RexDeepCopyVisitor
using RetType = std::unique_ptr< const RexScalar >
- Protected Member Functions inherited from RexDeepCopyVisitor
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

template<bool bAllowMissing>
class RexInputRenumber< bAllowMissing >

Definition at line 195 of file RexVisitor.h.

Constructor & Destructor Documentation

◆ RexInputRenumber()

template<bool bAllowMissing>
RexInputRenumber< bAllowMissing >::RexInputRenumber ( const std::unordered_map< size_t, size_t > &  new_numbering)

Definition at line 197 of file RexVisitor.h.

198  : old_to_new_idx_(new_numbering) {}
const std::unordered_map< size_t, size_t > & old_to_new_idx_
Definition: RexVisitor.h:214

Member Function Documentation

◆ visitInput()

template<bool bAllowMissing>
RetType RexInputRenumber< bAllowMissing >::visitInput ( const RexInput input) const

Reimplemented from RexDeepCopyVisitor.

Definition at line 199 of file RexVisitor.h.

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

199  {
200  auto renum_it = old_to_new_idx_.find(input->getIndex());
201  if (bAllowMissing) {
202  if (renum_it != old_to_new_idx_.end()) {
203  return boost::make_unique<RexInput>(input->getSourceNode(), renum_it->second);
204  } else {
205  return input->deepCopy();
206  }
207  } else {
208  CHECK(renum_it != old_to_new_idx_.end());
209  return boost::make_unique<RexInput>(input->getSourceNode(), renum_it->second);
210  }
211  }
std::unique_ptr< RexInput > deepCopy() const
const std::unordered_map< size_t, size_t > & old_to_new_idx_
Definition: RexVisitor.h:214
const RelAlgNode * getSourceNode() const
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the call graph for this function:

Member Data Documentation

◆ old_to_new_idx_

template<bool bAllowMissing>
const std::unordered_map<size_t, size_t>& RexInputRenumber< bAllowMissing >::old_to_new_idx_

Definition at line 214 of file RexVisitor.h.

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