OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JoinTargetRebaser Class Reference
+ Inheritance diagram for JoinTargetRebaser:
+ Collaboration diagram for JoinTargetRebaser:

Public Member Functions

 JoinTargetRebaser (const RelJoin *join, const unsigned old_base)
 
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 RelJoinjoin_
 
const unsigned old_base_
 
const size_t src1_base_
 
const size_t target_count_
 

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

Constructor & Destructor Documentation

JoinTargetRebaser::JoinTargetRebaser ( const RelJoin join,
const unsigned  old_base 
)
inline

Definition at line 1575 of file RelAlgOptimizer.cpp.

1576  : join_(join)
1577  , old_base_(old_base)
1578  , src1_base_(join->getInput(0)->size())
1579  , target_count_(join->size()) {}
const size_t target_count_
size_t size() const override
const RelAlgNode * getInput(const size_t idx) const
virtual size_t size() const =0
const RelJoin * join_
const unsigned old_base_

Member Function Documentation

RetType JoinTargetRebaser::visitInput ( const RexInput input) const
inlineoverridevirtual

Implements RexVisitorBase< std::unique_ptr< const RexScalar > >.

Definition at line 1580 of file RelAlgOptimizer.cpp.

References CHECK_GE, CHECK_LT, RexAbstractInput::getIndex(), RelAlgNode::getInput(), join_, old_base_, src1_base_, and target_count_.

1580  {
1581  auto curr_idx = input->getIndex();
1582  CHECK_GE(curr_idx, old_base_);
1583  CHECK_LT(static_cast<size_t>(curr_idx), target_count_);
1584  curr_idx -= old_base_;
1585  if (curr_idx >= src1_base_) {
1586  return boost::make_unique<RexInput>(join_->getInput(1), curr_idx - src1_base_);
1587  } else {
1588  return boost::make_unique<RexInput>(join_->getInput(0), curr_idx);
1589  }
1590  }
const size_t target_count_
#define CHECK_GE(x, y)
Definition: Logger.h:210
unsigned getIndex() const
const RelAlgNode * getInput(const size_t idx) const
#define CHECK_LT(x, y)
Definition: Logger.h:207
const RelJoin * join_
const unsigned old_base_

+ Here is the call graph for this function:

Member Data Documentation

const RelJoin* JoinTargetRebaser::join_
private

Definition at line 1593 of file RelAlgOptimizer.cpp.

Referenced by visitInput().

const unsigned JoinTargetRebaser::old_base_
private

Definition at line 1594 of file RelAlgOptimizer.cpp.

Referenced by visitInput().

const size_t JoinTargetRebaser::src1_base_
private

Definition at line 1595 of file RelAlgOptimizer.cpp.

Referenced by visitInput().

const size_t JoinTargetRebaser::target_count_
private

Definition at line 1596 of file RelAlgOptimizer.cpp.

Referenced by visitInput().


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