OmniSciDB  c07336695a
anonymous_namespace{RelAlgAbstractInterpreter.cpp}::anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RexInputReplacementVisitor Class Reference
+ Inheritance diagram for anonymous_namespace{RelAlgAbstractInterpreter.cpp}::anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RexInputReplacementVisitor:
+ Collaboration diagram for anonymous_namespace{RelAlgAbstractInterpreter.cpp}::anonymous_namespace{RelAlgAbstractInterpreter.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 RexScalarvisit (const RexScalar *rex_scalar) const
 

Private Attributes

const RelAlgNodenode_to_keep_
 
const std::vector< std::unique_ptr< const RexScalar > > & scalar_sources_
 

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

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 955 of file RelAlgAbstractInterpreter.cpp.

Constructor & Destructor Documentation

◆ RexInputReplacementVisitor()

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

Member Function Documentation

◆ visitInput()

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

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

Definition at line 963 of file RelAlgAbstractInterpreter.cpp.

References CHECK_LT.

963  {
964  if (input->getSourceNode() == node_to_keep_) {
965  const auto index = input->getIndex();
966  CHECK_LT(index, scalar_sources_.size());
967  return visit(scalar_sources_[index].get());
968  } else {
969  return input->deepCopy();
970  }
971  }
std::unique_ptr< RexInput > deepCopy() const
const RelAlgNode * getSourceNode() const
virtual std::unique_ptr< const RexScalar > visit(const RexScalar *rex_scalar) const
Definition: RexVisitor.h:27
#define CHECK_LT(x, y)
Definition: Logger.h:197

Member Data Documentation

◆ node_to_keep_

const RelAlgNode* anonymous_namespace{RelAlgAbstractInterpreter.cpp}::anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RexInputReplacementVisitor::node_to_keep_
private

Definition at line 974 of file RelAlgAbstractInterpreter.cpp.

◆ scalar_sources_

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

Definition at line 975 of file RelAlgAbstractInterpreter.cpp.


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