OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
visit (const RexScalar *rex_scalar) const

Private Attributes

const std::unordered_map
< size_t, size_t > & 

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 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 225 of file RexVisitor.h.

Constructor & Destructor Documentation

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

Definition at line 227 of file RexVisitor.h.

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

Member Function Documentation

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

Reimplemented from RexDeepCopyVisitor.

Definition at line 229 of file RexVisitor.h.

References CHECK, RexInput::deepCopy(), RexAbstractInput::getIndex(), RexInput::getSourceNode(), and RexInputRenumber< bAllowMissing >::old_to_new_idx_.

229  {
230  auto renum_it = old_to_new_idx_.find(input->getIndex());
231  if (bAllowMissing) {
232  if (renum_it != old_to_new_idx_.end()) {
233  return std::make_unique<RexInput>(input->getSourceNode(), renum_it->second);
234  } else {
235  return input->deepCopy();
236  }
237  } else {
238  CHECK(renum_it != old_to_new_idx_.end());
239  return std::make_unique<RexInput>(input->getSourceNode(), renum_it->second);
240  }
241  }
const std::unordered_map< size_t, size_t > & old_to_new_idx_
Definition: RexVisitor.h:244
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

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

Definition at line 244 of file RexVisitor.h.

Referenced by RexInputRenumber< bAllowMissing >::visitInput().

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