OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
visit (const RexScalar *rex_scalar) const

Private Attributes

const RelAlgNodeold_src_
const RelAlgNodenew_src_

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

Constructor & Destructor Documentation

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

Member Function Documentation

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

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

Definition at line 1423 of file RelAlgOptimizer.cpp.

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

1423  {
1424  CHECK_EQ(old_src_, input->getSourceNode());
1426  auto actual_new_src = new_src_;
1427  if (auto join = dynamic_cast<const RelJoin*>(new_src_)) {
1428  actual_new_src = join->getInput(0);
1429  CHECK_EQ(join->inputCount(), size_t(2));
1430  auto src2_input_base = actual_new_src->size();
1431  if (input->getIndex() >= src2_input_base) {
1432  actual_new_src = join->getInput(1);
1433  return boost::make_unique<RexInput>(actual_new_src,
1434  input->getIndex() - src2_input_base);
1435  }
1436  }
1438  return boost::make_unique<RexInput>(actual_new_src, input->getIndex());
1439  }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
std::string join(T const &container, std::string const &delim)
unsigned getIndex() const
Definition: RelAlgDag.h:174
#define CHECK_NE(x, y)
Definition: Logger.h:302
const RelAlgNode * getSourceNode() const
Definition: RelAlgDag.h:1056

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 1443 of file RelAlgOptimizer.cpp.

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

Definition at line 1442 of file RelAlgOptimizer.cpp.

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