OmniSciDB  c0231cc57d
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 1592 of file RelAlgOptimizer.cpp.

Constructor & Destructor Documentation

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

Definition at line 1594 of file RelAlgOptimizer.cpp.

1595  : join_(join)
1596  , old_base_(old_base)
1597  , src1_base_(join->getInput(0)->size())
1598  , target_count_(join->size()) {}
const size_t target_count_
size_t size() const override
Definition: RelAlgDag.h:1408
const RelAlgNode * getInput(const size_t idx) const
Definition: RelAlgDag.h:826
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 1599 of file RelAlgOptimizer.cpp.

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

1599  {
1600  auto curr_idx = input->getIndex();
1601  CHECK_GE(curr_idx, old_base_);
1602  CHECK_LT(static_cast<size_t>(curr_idx), target_count_);
1603  curr_idx -= old_base_;
1604  if (curr_idx >= src1_base_) {
1605  return boost::make_unique<RexInput>(join_->getInput(1), curr_idx - src1_base_);
1606  } else {
1607  return boost::make_unique<RexInput>(join_->getInput(0), curr_idx);
1608  }
1609  }
const size_t target_count_
#define CHECK_GE(x, y)
Definition: Logger.h:235
unsigned getIndex() const
Definition: RelAlgDag.h:72
const RelAlgNode * getInput(const size_t idx) const
Definition: RelAlgDag.h:826
#define CHECK_LT(x, y)
Definition: Logger.h:232
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 1612 of file RelAlgOptimizer.cpp.

Referenced by visitInput().

const unsigned JoinTargetRebaser::old_base_
private

Definition at line 1613 of file RelAlgOptimizer.cpp.

Referenced by visitInput().

const size_t JoinTargetRebaser::src1_base_
private

Definition at line 1614 of file RelAlgOptimizer.cpp.

Referenced by visitInput().

const size_t JoinTargetRebaser::target_count_
private

Definition at line 1615 of file RelAlgOptimizer.cpp.

Referenced by visitInput().


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