OmniSciDB  cde582ebc3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::RexInputReplacementVisitor Class Reference
+ Inheritance diagram for anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::RexInputReplacementVisitor:
+ Collaboration diagram for anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::RexInputReplacementVisitor:

Public Member Functions

 RexInputReplacementVisitor (const RelAlgNode *node_to_keep, const std::vector< std::unique_ptr< const RexScalar >> &scalar_sources)
RetType visitInput (const RexInput *input) const final
- 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 RelAlgNodenode_to_keep_
const std::vector
< std::unique_ptr< const
RexScalar > > & 

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

The RexInputReplacement visitor visits each node in a given relational algebra expression and replaces the inputs to that expression with inputs from a different node in the RA tree. Used for coalescing nodes with complex expressions.

Definition at line 1542 of file RelAlgDag.cpp.

Constructor & Destructor Documentation

anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::RexInputReplacementVisitor::RexInputReplacementVisitor ( const RelAlgNode node_to_keep,
const std::vector< std::unique_ptr< const RexScalar >> &  scalar_sources 

Definition at line 1544 of file RelAlgDag.cpp.

Member Function Documentation

RetType anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::RexInputReplacementVisitor::visitInput ( const RexInput input) const

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

Definition at line 1550 of file RelAlgDag.cpp.

References CHECK_LT.

1550  {
1551  if (input->getSourceNode() == node_to_keep_) {
1552  const auto index = input->getIndex();
1553  CHECK_LT(index, scalar_sources_.size());
1554  return visit(scalar_sources_[index].get());
1555  } else {
1556  return input->deepCopy();
1557  }
1558  }
virtual std::unique_ptr< const RexScalar > visit(const RexScalar *rex_scalar) const
Definition: RexVisitor.h:27
unsigned getIndex() const
Definition: RelAlgDag.h:72
std::unique_ptr< RexInput > deepCopy() const
Definition: RelAlgDag.h:367
#define CHECK_LT(x, y)
Definition: Logger.h:232
const RelAlgNode * getSourceNode() const
Definition: RelAlgDag.h:351

Member Data Documentation

const RelAlgNode* anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::RexInputReplacementVisitor::node_to_keep_

Definition at line 1561 of file RelAlgDag.cpp.

const std::vector<std::unique_ptr<const RexScalar> >& anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::RexInputReplacementVisitor::scalar_sources_

Definition at line 1562 of file RelAlgDag.cpp.

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