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

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

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

1320  {
1321  CHECK_EQ(old_src_, input->getSourceNode());
1323  auto actual_new_src = new_src_;
1324  if (auto join = dynamic_cast<const RelJoin*>(new_src_)) {
1325  actual_new_src = join->getInput(0);
1326  CHECK_EQ(join->inputCount(), size_t(2));
1327  auto src2_input_base = actual_new_src->size();
1328  if (input->getIndex() >= src2_input_base) {
1329  actual_new_src = join->getInput(1);
1330  return boost::make_unique<RexInput>(actual_new_src,
1331  input->getIndex() - src2_input_base);
1332  }
1333  }
1334 
1335  return boost::make_unique<RexInput>(actual_new_src, input->getIndex());
1336  }
#define CHECK_EQ(x, y)
Definition: Logger.h:198
std::string join(T const &container, std::string const &delim)
unsigned getIndex() const
#define CHECK_NE(x, y)
Definition: Logger.h:199
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 1340 of file RelAlgOptimizer.cpp.

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

Definition at line 1339 of file RelAlgOptimizer.cpp.


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