OmniSciDB  04ee39c94c
anonymous_namespace{RelAlgOptimizer.cpp}::RexInputRedirector Class Reference
+ Inheritance diagram for anonymous_namespace{RelAlgOptimizer.cpp}::RexInputRedirector:
+ Collaboration diagram for anonymous_namespace{RelAlgOptimizer.cpp}::RexInputRedirector:

Public Member Functions

 RexInputRedirector (const RelAlgNode *old_src, const RelAlgNode *new_src)
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 RelAlgNodeold_src_
const RelAlgNodenew_src_

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

Constructor & Destructor Documentation

◆ RexInputRedirector()

anonymous_namespace{RelAlgOptimizer.cpp}::RexInputRedirector::RexInputRedirector ( const RelAlgNode old_src,
const RelAlgNode new_src 

Member Function Documentation

◆ visitInput()

RetType anonymous_namespace{RelAlgOptimizer.cpp}::RexInputRedirector::visitInput ( const RexInput input) const

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

Definition at line 1338 of file RelAlgOptimizer.cpp.

References CHECK_EQ, CHECK_NE, RexAbstractInput::getIndex(), RexInput::getSourceNode(), and join().

1338  {
1339  CHECK_EQ(old_src_, input->getSourceNode());
1341  auto actual_new_src = new_src_;
1342  if (auto join = dynamic_cast<const RelJoin*>(new_src_)) {
1343  actual_new_src = join->getInput(0);
1344  CHECK_EQ(join->inputCount(), size_t(2));
1345  auto src2_input_base = actual_new_src->size();
1346  if (input->getIndex() >= src2_input_base) {
1347  actual_new_src = join->getInput(1);
1348  return boost::make_unique<RexInput>(actual_new_src,
1349  input->getIndex() - src2_input_base);
1350  }
1351  }
1353  return boost::make_unique<RexInput>(actual_new_src, input->getIndex());
1354  }
#define CHECK_EQ(x, y)
Definition: Logger.h:195
std::string join(T const &container, std::string const &delim)
const RelAlgNode * getSourceNode() const
#define CHECK_NE(x, y)
Definition: Logger.h:196
+ Here is the call graph for this function:

Member Data Documentation

◆ new_src_

const RelAlgNode* anonymous_namespace{RelAlgOptimizer.cpp}::RexInputRedirector::new_src_

Definition at line 1358 of file RelAlgOptimizer.cpp.

◆ old_src_

const RelAlgNode* anonymous_namespace{RelAlgOptimizer.cpp}::RexInputRedirector::old_src_

Definition at line 1357 of file RelAlgOptimizer.cpp.

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