OmniSciDB  04ee39c94c
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 RexScalarvisit (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

- 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 visitCase (const RexCase *rex_case) const override
 

Detailed Description

Definition at line 1501 of file RelAlgOptimizer.cpp.

Constructor & Destructor Documentation

◆ JoinTargetRebaser()

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

Definition at line 1503 of file RelAlgOptimizer.cpp.

1504  : join_(join)
1505  , old_base_(old_base)
1506  , src1_base_(join->getInput(0)->size())
1507  , target_count_(join->size()) {}
const size_t target_count_
size_t size() const override
virtual size_t size() const =0
const RelJoin * join_
const RelAlgNode * getInput(const size_t idx) const
const unsigned old_base_

Member Function Documentation

◆ visitInput()

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

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

Definition at line 1508 of file RelAlgOptimizer.cpp.

References CHECK_GE, CHECK_LT, and RexAbstractInput::getIndex().

1508  {
1509  auto curr_idx = input->getIndex();
1510  CHECK_GE(curr_idx, old_base_);
1511  CHECK_LT(static_cast<size_t>(curr_idx), target_count_);
1512  curr_idx -= old_base_;
1513  if (curr_idx >= src1_base_) {
1514  return boost::make_unique<RexInput>(join_->getInput(1), curr_idx - src1_base_);
1515  } else {
1516  return boost::make_unique<RexInput>(join_->getInput(0), curr_idx);
1517  }
1518  }
const size_t target_count_
#define CHECK_GE(x, y)
Definition: Logger.h:200
#define CHECK_LT(x, y)
Definition: Logger.h:197
const RelJoin * join_
const RelAlgNode * getInput(const size_t idx) const
const unsigned old_base_
+ Here is the call graph for this function:

Member Data Documentation

◆ join_

const RelJoin* JoinTargetRebaser::join_
private

Definition at line 1521 of file RelAlgOptimizer.cpp.

◆ old_base_

const unsigned JoinTargetRebaser::old_base_
private

Definition at line 1522 of file RelAlgOptimizer.cpp.

◆ src1_base_

const size_t JoinTargetRebaser::src1_base_
private

Definition at line 1523 of file RelAlgOptimizer.cpp.

◆ target_count_

const size_t JoinTargetRebaser::target_count_
private

Definition at line 1524 of file RelAlgOptimizer.cpp.


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