OmniSciDB  471d68cefb
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 1904 of file RelAlgDagBuilder.cpp.

Constructor & Destructor Documentation

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

Definition at line 1906 of file RelAlgDagBuilder.cpp.

References CHECK.

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

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

1909  {
1910  if (rex_input->getSourceNode() != node_) {
1911  const auto cur_index = rex_input->getIndex();
1912  auto cur_source_node = rex_input->getSourceNode();
1913  std::string field_name = "";
1914  if (auto cur_project_node = dynamic_cast<const RelProject*>(cur_source_node)) {
1915  field_name = cur_project_node->getFieldName(cur_index);
1916  }
1917  node_->appendInput(field_name, rex_input->deepCopy());
1918  return std::make_unique<RexInput>(node_, node_->size() - 1);
1919  } else {
1920  return rex_input->deepCopy();
1921  }
1922  }
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 1925 of file RelAlgDagBuilder.cpp.

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