OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor Class Reference
+ Inheritance diagram for anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor:
+ Collaboration diagram for anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor:

Public Member Functions

PhysicalInputSet visitCompound (const RelCompound *compound) const override
 
PhysicalInputSet visitFilter (const RelFilter *filter) const override
 
PhysicalInputSet visitJoin (const RelJoin *join) const override
 
PhysicalInputSet visitLeftDeepInnerJoin (const RelLeftDeepInnerJoin *) const override
 
PhysicalInputSet visitProject (const RelProject *project) const override
 
PhysicalInputSet visitSort (const RelSort *sort) const override
 
- Public Member Functions inherited from RelAlgVisitor< PhysicalInputSet >
PhysicalInputSet visit (const RelAlgNode *rel_alg) const
 
virtual PhysicalInputSet visitAggregate (const RelAggregate *) const
 
virtual PhysicalInputSet visitScan (const RelScan *) const
 
virtual PhysicalInputSet visitLogicalValues (const RelLogicalValues *) const
 
virtual PhysicalInputSet visitModify (const RelModify *) const
 
virtual PhysicalInputSet visitTableFunction (const RelTableFunction *) const
 

Protected Member Functions

PhysicalInputSet aggregateResult (const PhysicalInputSet &aggregate, const PhysicalInputSet &next_result) const override
 
- Protected Member Functions inherited from RelAlgVisitor< PhysicalInputSet >
virtual PhysicalInputSet aggregateResult (const PhysicalInputSet &aggregate, const PhysicalInputSet &next_result) const
 
virtual PhysicalInputSet defaultResult () const
 

Detailed Description

Definition at line 27 of file QueryPhysicalInputsCollector.cpp.

Member Function Documentation

PhysicalInputSet anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::aggregateResult ( const PhysicalInputSet aggregate,
const PhysicalInputSet next_result 
) const
overrideprotected

Definition at line 180 of file QueryPhysicalInputsCollector.cpp.

References run_benchmark_import::result.

182  {
183  auto result = aggregate;
184  result.insert(next_result.begin(), next_result.end());
185  return result;
186 }
PhysicalInputSet anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitCompound ( const RelCompound compound) const
overridevirtual

Reimplemented from RelAlgVisitor< PhysicalInputSet >.

Definition at line 107 of file QueryPhysicalInputsCollector.cpp.

References CHECK(), RelCompound::getFilterExpr(), RelCompound::getScalarSource(), RelCompound::getScalarSourcesSize(), run_benchmark_import::result, and RexVisitorBase< T >::visit().

108  {
110  for (size_t i = 0; i < compound->getScalarSourcesSize(); ++i) {
111  const auto rex = compound->getScalarSource(i);
112  CHECK(rex);
113  RexPhysicalInputsVisitor visitor;
114  const auto rex_phys_inputs = visitor.visit(rex);
115  result.insert(rex_phys_inputs.begin(), rex_phys_inputs.end());
116  }
117  const auto filter = compound->getFilterExpr();
118  if (filter) {
119  RexPhysicalInputsVisitor visitor;
120  const auto filter_phys_inputs = visitor.visit(filter);
121  result.insert(filter_phys_inputs.begin(), filter_phys_inputs.end());
122  }
123  return result;
124 }
const RexScalar * getFilterExpr() const
const size_t getScalarSourcesSize() const
CHECK(cgen_state)
const RexScalar * getScalarSource(const size_t i) const

+ Here is the call graph for this function:

PhysicalInputSet anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitFilter ( const RelFilter filter) const
overridevirtual

Reimplemented from RelAlgVisitor< PhysicalInputSet >.

Definition at line 126 of file QueryPhysicalInputsCollector.cpp.

References CHECK(), RelFilter::getCondition(), and RexVisitorBase< T >::visit().

126  {
127  const auto condition = filter->getCondition();
128  CHECK(condition);
129  RexPhysicalInputsVisitor visitor;
130  return visitor.visit(condition);
131 }
const RexScalar * getCondition() const
CHECK(cgen_state)

+ Here is the call graph for this function:

PhysicalInputSet anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitJoin ( const RelJoin join) const
overridevirtual

Reimplemented from RelAlgVisitor< PhysicalInputSet >.

Definition at line 133 of file QueryPhysicalInputsCollector.cpp.

References RelJoin::getCondition(), and RexVisitorBase< T >::visit().

133  {
134  const auto condition = join->getCondition();
135  if (!condition) {
136  return PhysicalInputSet{};
137  }
138  RexPhysicalInputsVisitor visitor;
139  return visitor.visit(condition);
140 }
const RexScalar * getCondition() const

+ Here is the call graph for this function:

PhysicalInputSet anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitLeftDeepInnerJoin ( const RelLeftDeepInnerJoin left_deep_inner_join) const
overridevirtual

Reimplemented from RelAlgVisitor< PhysicalInputSet >.

Definition at line 142 of file QueryPhysicalInputsCollector.cpp.

References CHECK_GE, RelLeftDeepInnerJoin::getInnerCondition(), RelLeftDeepInnerJoin::getOuterCondition(), RelAlgNode::inputCount(), run_benchmark_import::result, and RexVisitorBase< T >::visit().

143  {
145  const auto condition = left_deep_inner_join->getInnerCondition();
146  RexPhysicalInputsVisitor visitor;
147  if (condition) {
148  result = visitor.visit(condition);
149  }
150  CHECK_GE(left_deep_inner_join->inputCount(), size_t(2));
151  for (size_t nesting_level = 1; nesting_level <= left_deep_inner_join->inputCount() - 1;
152  ++nesting_level) {
153  const auto outer_condition = left_deep_inner_join->getOuterCondition(nesting_level);
154  if (outer_condition) {
155  const auto outer_result = visitor.visit(outer_condition);
156  result.insert(outer_result.begin(), outer_result.end());
157  }
158  }
159  return result;
160 }
const RexScalar * getOuterCondition(const size_t nesting_level) const
#define CHECK_GE(x, y)
Definition: Logger.h:203
const RexScalar * getInnerCondition() const
const size_t inputCount() const

+ Here is the call graph for this function:

PhysicalInputSet anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitProject ( const RelProject project) const
overridevirtual

Reimplemented from RelAlgVisitor< PhysicalInputSet >.

Definition at line 162 of file QueryPhysicalInputsCollector.cpp.

References CHECK(), RelProject::getProjectAt(), run_benchmark_import::result, RelProject::size(), and RexVisitorBase< T >::visit().

163  {
165  for (size_t i = 0; i < project->size(); ++i) {
166  const auto rex = project->getProjectAt(i);
167  CHECK(rex);
168  RexPhysicalInputsVisitor visitor;
169  const auto rex_phys_inputs = visitor.visit(rex);
170  result.insert(rex_phys_inputs.begin(), rex_phys_inputs.end());
171  }
172  return result;
173 }
size_t size() const override
CHECK(cgen_state)
const RexScalar * getProjectAt(const size_t idx) const

+ Here is the call graph for this function:

PhysicalInputSet anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitSort ( const RelSort sort) const
overridevirtual

Reimplemented from RelAlgVisitor< PhysicalInputSet >.

Definition at line 175 of file QueryPhysicalInputsCollector.cpp.

References CHECK_EQ, RelAlgNode::getInput(), and RelAlgNode::inputCount().

175  {
176  CHECK_EQ(sort->inputCount(), size_t(1));
177  return visit(sort->getInput(0));
178 }
#define CHECK_EQ(x, y)
Definition: Logger.h:198
PhysicalInputSet visit(const RelAlgNode *rel_alg) const
Definition: RelAlgVisitor.h:25
const RelAlgNode * getInput(const size_t idx) const
const size_t inputCount() const

+ Here is the call graph for this function:


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