OmniSciDB  8a228a1076
anonymous_namespace{RelAlgDagBuilder.cpp}::RexInputBackpropagationVisitor Class Reference
+ Inheritance diagram for anonymous_namespace{RelAlgDagBuilder.cpp}::RexInputBackpropagationVisitor:
+ Collaboration diagram for anonymous_namespace{RelAlgDagBuilder.cpp}::RexInputBackpropagationVisitor:

Public Member Functions

 RexInputBackpropagationVisitor (RelProject *node)
- Public Member Functions inherited from RexVisitorBase< std::unique_ptr< const RexScalar > >
virtual std::unique_ptr< const RexScalarvisit (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


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 >

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 1850 of file RelAlgDagBuilder.cpp.

Constructor & Destructor Documentation

◆ RexInputBackpropagationVisitor()

anonymous_namespace{RelAlgDagBuilder.cpp}::RexInputBackpropagationVisitor::RexInputBackpropagationVisitor ( RelProject node)

Definition at line 1852 of file RelAlgDagBuilder.cpp.

References CHECK.

Member Function Documentation

◆ visitInput()

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

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

Definition at line 1855 of file RelAlgDagBuilder.cpp.

1855  {
1856  if (rex_input->getSourceNode() != node_) {
1857  const auto cur_index = rex_input->getIndex();
1858  auto cur_source_node = rex_input->getSourceNode();
1859  std::string field_name = "";
1860  if (auto cur_project_node = dynamic_cast<const RelProject*>(cur_source_node)) {
1861  field_name = cur_project_node->getFieldName(cur_index);
1862  }
1863  node_->appendInput(field_name, rex_input->deepCopy());
1864  return std::make_unique<RexInput>(node_, node_->size() - 1);
1865  } else {
1866  return rex_input->deepCopy();
1867  }
1868  }
size_t size() const override
void appendInput(std::string new_field_name, std::unique_ptr< const RexScalar > new_input)
std::unique_ptr< RexInput > deepCopy() const
const RelAlgNode * getSourceNode() const
unsigned getIndex() const

Member Data Documentation

◆ node_

RelProject* anonymous_namespace{RelAlgDagBuilder.cpp}::RexInputBackpropagationVisitor::node_

Definition at line 1871 of file RelAlgDagBuilder.cpp.

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