OmniSciDB  06b3bd477c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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
RexScalar
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 1397 of file RelAlgOptimizer.cpp.

Constructor & Destructor Documentation

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

Member Function Documentation

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

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

Definition at line 1402 of file RelAlgOptimizer.cpp.

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

1402  {
1403  CHECK_EQ(old_src_, input->getSourceNode());
1405  auto actual_new_src = new_src_;
1406  if (auto join = dynamic_cast<const RelJoin*>(new_src_)) {
1407  actual_new_src = join->getInput(0);
1408  CHECK_EQ(join->inputCount(), size_t(2));
1409  auto src2_input_base = actual_new_src->size();
1410  if (input->getIndex() >= src2_input_base) {
1411  actual_new_src = join->getInput(1);
1412  return boost::make_unique<RexInput>(actual_new_src,
1413  input->getIndex() - src2_input_base);
1414  }
1415  }
1416 
1417  return boost::make_unique<RexInput>(actual_new_src, input->getIndex());
1418  }
#define CHECK_EQ(x, y)
Definition: Logger.h:205
std::string join(T const &container, std::string const &delim)
unsigned getIndex() const
#define CHECK_NE(x, y)
Definition: Logger.h:206
const RelAlgNode * getSourceNode() const

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 1422 of file RelAlgOptimizer.cpp.

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

Definition at line 1421 of file RelAlgOptimizer.cpp.


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