OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{RelAlgOptimizer.cpp}::RexRebindInputsVisitor Class Reference
+ Inheritance diagram for anonymous_namespace{RelAlgOptimizer.cpp}::RexRebindInputsVisitor:
+ Collaboration diagram for anonymous_namespace{RelAlgOptimizer.cpp}::RexRebindInputsVisitor:

Public Member Functions

 RexRebindInputsVisitor (const RelAlgNode *old_input, const RelAlgNode *new_input)
 
void * visitInput (const RexInput *rex_input) const override
 
void visitNode (const RelAlgNode *node) const
 

Private Attributes

const RelAlgNodeold_input_
 
const RelAlgNodenew_input_
 

Detailed Description

Definition at line 57 of file RelAlgOptimizer.cpp.

Constructor & Destructor Documentation

anonymous_namespace{RelAlgOptimizer.cpp}::RexRebindInputsVisitor::RexRebindInputsVisitor ( const RelAlgNode old_input,
const RelAlgNode new_input 
)
inline

Member Function Documentation

void* anonymous_namespace{RelAlgOptimizer.cpp}::RexRebindInputsVisitor::visitInput ( const RexInput rex_input) const
inlineoverride

Definition at line 62 of file RelAlgOptimizer.cpp.

References RexInput::getSourceNode(), and RexInput::setSourceNode().

62  {
63  const auto old_source = rex_input->getSourceNode();
64  if (old_source == old_input_) {
65  rex_input->setSourceNode(new_input_);
66  }
67  return nullptr;
68  };
void setSourceNode(const RelAlgNode *node) const
Definition: RelAlgDag.h:1061
const RelAlgNode * getSourceNode() const
Definition: RelAlgDag.h:1056

+ Here is the call graph for this function:

void anonymous_namespace{RelAlgOptimizer.cpp}::RexRebindInputsVisitor::visitNode ( const RelAlgNode node) const
inline

Definition at line 70 of file RelAlgOptimizer.cpp.

References CHECK, and join().

Referenced by anonymous_namespace{RelAlgOptimizer.cpp}::redirect_inputs_of(), and anonymous_namespace{RelAlgOptimizer.cpp}::try_insert_coalesceable_proj().

70  {
71  if (dynamic_cast<const RelAggregate*>(node) || dynamic_cast<const RelSort*>(node)) {
72  return;
73  }
74  if (auto join = dynamic_cast<const RelJoin*>(node)) {
75  if (auto condition = join->getCondition()) {
76  visit(condition);
77  }
78  return;
79  }
80  if (auto project = dynamic_cast<const RelProject*>(node)) {
81  for (size_t i = 0; i < project->size(); ++i) {
82  visit(project->getProjectAt(i));
83  }
84  return;
85  }
86  if (auto filter = dynamic_cast<const RelFilter*>(node)) {
87  visit(filter->getCondition());
88  return;
89  }
90  CHECK(false);
91  }
std::string join(T const &container, std::string const &delim)
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

const RelAlgNode* anonymous_namespace{RelAlgOptimizer.cpp}::RexRebindInputsVisitor::new_input_
private

Definition at line 95 of file RelAlgOptimizer.cpp.

const RelAlgNode* anonymous_namespace{RelAlgOptimizer.cpp}::RexRebindInputsVisitor::old_input_
private

Definition at line 94 of file RelAlgOptimizer.cpp.


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