OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 226 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 228 of file RexVisitor.h.

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

Member Function Documentation

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

Reimplemented from RexDeepCopyVisitor.

Definition at line 230 of file RexVisitor.h.

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

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

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

Definition at line 245 of file RexVisitor.h.

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

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