OmniSciDB  8fa3bf436f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
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


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

Constructor & Destructor Documentation

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

Definition at line 1878 of file RelAlgDagBuilder.cpp.

References CHECK.

1878 : node_(node) { CHECK(node_); }
#define CHECK(condition)
Definition: Logger.h:203

Member Function Documentation

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

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

Definition at line 1881 of file RelAlgDagBuilder.cpp.

1881  {
1882  if (rex_input->getSourceNode() != node_) {
1883  const auto cur_index = rex_input->getIndex();
1884  auto cur_source_node = rex_input->getSourceNode();
1885  std::string field_name = "";
1886  if (auto cur_project_node = dynamic_cast<const RelProject*>(cur_source_node)) {
1887  field_name = cur_project_node->getFieldName(cur_index);
1888  }
1889  node_->appendInput(field_name, rex_input->deepCopy());
1890  return std::make_unique<RexInput>(node_, node_->size() - 1);
1891  } else {
1892  return rex_input->deepCopy();
1893  }
1894  }
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{RelAlgDagBuilder.cpp}::RexInputBackpropagationVisitor::node_

Definition at line 1897 of file RelAlgDagBuilder.cpp.

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