OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RexInputBackpropagationVisitor Class Reference
+ Inheritance diagram for anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RexInputBackpropagationVisitor:
+ Collaboration diagram for anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RexInputBackpropagationVisitor:

Public Member Functions

 RexInputBackpropagationVisitor (RelProject *node)
 
- Public Member Functions inherited from RexVisitorBase< std::unique_ptr< const RexScalar > >
virtual std::unique_ptr< const
RexScalar
visit (const RexScalar *rex_scalar) const
 

Protected Member Functions

RetType visitInput (const RexInput *rex_input) const final
 
- 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
 

Private Attributes

RelProjectnode_
 

Additional Inherited Members

- Protected Types inherited from RexDeepCopyVisitor
using RetType = std::unique_ptr< const RexScalar >
 

Detailed Description

Propagate an input backwards in the RA tree. With the exception of joins, all inputs must be carried through the RA tree. This visitor takes as a parameter a source projection RA Node, then checks to see if any inputs do not reference the source RA node (which implies the inputs reference a node farther back in the tree). The input is then backported to the source projection node, and a new input is generated which references the input on the source RA node, thereby carrying the input through the intermediate query step.

Definition at line 1616 of file RelAlgAbstractInterpreter.cpp.

Constructor & Destructor Documentation

anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RexInputBackpropagationVisitor::RexInputBackpropagationVisitor ( RelProject node)
inline

Definition at line 1618 of file RelAlgAbstractInterpreter.cpp.

References CHECK().

+ Here is the call graph for this function:

Member Function Documentation

RetType anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RexInputBackpropagationVisitor::visitInput ( const RexInput rex_input) const
inlinefinalprotectedvirtual

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

Definition at line 1621 of file RelAlgAbstractInterpreter.cpp.

1621  {
1622  if (rex_input->getSourceNode() != node_) {
1623  const auto cur_index = rex_input->getIndex();
1624  auto cur_source_node = rex_input->getSourceNode();
1625  std::string field_name = "";
1626  if (auto cur_project_node = dynamic_cast<const RelProject*>(cur_source_node)) {
1627  field_name = cur_project_node->getFieldName(cur_index);
1628  }
1629  node_->appendInput(field_name, rex_input->deepCopy());
1630  return std::make_unique<RexInput>(node_, node_->size() - 1);
1631  } else {
1632  return rex_input->deepCopy();
1633  }
1634  }
size_t size() const override
void appendInput(std::string new_field_name, std::unique_ptr< const RexScalar > new_input)
unsigned getIndex() const
std::unique_ptr< RexInput > deepCopy() const
const RelAlgNode * getSourceNode() const

Member Data Documentation

RelProject* anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RexInputBackpropagationVisitor::node_
mutableprivate

Definition at line 1637 of file RelAlgAbstractInterpreter.cpp.


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