OmniSciDB  29e35f4d58
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 visitWindowFunctionOperator (const RexWindowFunctionOperator *rex_window_function_operator) const
RetType visitCase (const RexCase *rex_case) const override

Detailed Description

template<bool bAllowMissing>
class RexInputRenumber< bAllowMissing >

Definition at line 208 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 210 of file RexVisitor.h.

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

Member Function Documentation

◆ visitInput()

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

Reimplemented from RexDeepCopyVisitor.

Definition at line 212 of file RexVisitor.h.

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

212  {
213  auto renum_it = old_to_new_idx_.find(input->getIndex());
214  if (bAllowMissing) {
215  if (renum_it != old_to_new_idx_.end()) {
216  return std::make_unique<RexInput>(input->getSourceNode(), renum_it->second);
217  } else {
218  return input->deepCopy();
219  }
220  } else {
221  CHECK(renum_it != old_to_new_idx_.end());
222  return std::make_unique<RexInput>(input->getSourceNode(), renum_it->second);
223  }
224  }
std::unique_ptr< RexInput > deepCopy() const
const std::unordered_map< size_t, size_t > & old_to_new_idx_
Definition: RexVisitor.h:227
const RelAlgNode * getSourceNode() const
unsigned getIndex() const
#define CHECK(condition)
Definition: Logger.h:193
+ 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 227 of file RexVisitor.h.

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