OmniSciDB  b24e664e58
 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

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

Constructor & Destructor Documentation

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

Definition at line 1485 of file RelAlgOptimizer.cpp.

1486  : join_(join)
1487  , old_base_(old_base)
1488  , src1_base_(join->getInput(0)->size())
1489  , 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 1490 of file RelAlgOptimizer.cpp.

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

1490  {
1491  auto curr_idx = input->getIndex();
1492  CHECK_GE(curr_idx, old_base_);
1493  CHECK_LT(static_cast<size_t>(curr_idx), target_count_);
1494  curr_idx -= old_base_;
1495  if (curr_idx >= src1_base_) {
1496  return boost::make_unique<RexInput>(join_->getInput(1), curr_idx - src1_base_);
1497  } else {
1498  return boost::make_unique<RexInput>(join_->getInput(0), curr_idx);
1499  }
1500  }
const size_t target_count_
#define CHECK_GE(x, y)
Definition: Logger.h:203
unsigned getIndex() const
const RelAlgNode * getInput(const size_t idx) const
#define CHECK_LT(x, y)
Definition: Logger.h:200
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 1503 of file RelAlgOptimizer.cpp.

Referenced by visitInput().

const unsigned JoinTargetRebaser::old_base_
private

Definition at line 1504 of file RelAlgOptimizer.cpp.

Referenced by visitInput().

const size_t JoinTargetRebaser::src1_base_
private

Definition at line 1505 of file RelAlgOptimizer.cpp.

Referenced by visitInput().

const size_t JoinTargetRebaser::target_count_
private

Definition at line 1506 of file RelAlgOptimizer.cpp.

Referenced by visitInput().


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