OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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
 
virtual PhysicalInputSet visitLogicalUnion (const RelLogicalUnion *) 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 179 of file QueryPhysicalInputsCollector.cpp.

References run_benchmark_import::result.

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

Reimplemented from RelAlgVisitor< PhysicalInputSet >.

Definition at line 106 of file QueryPhysicalInputsCollector.cpp.

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

107  {
109  for (size_t i = 0; i < compound->getScalarSourcesSize(); ++i) {
110  const auto rex = compound->getScalarSource(i);
111  CHECK(rex);
112  RexPhysicalInputsVisitor visitor;
113  const auto rex_phys_inputs = visitor.visit(rex);
114  result.insert(rex_phys_inputs.begin(), rex_phys_inputs.end());
115  }
116  const auto filter = compound->getFilterExpr();
117  if (filter) {
118  RexPhysicalInputsVisitor visitor;
119  const auto filter_phys_inputs = visitor.visit(filter);
120  result.insert(filter_phys_inputs.begin(), filter_phys_inputs.end());
121  }
122  return result;
123 }
const RexScalar * getFilterExpr() const
const size_t getScalarSourcesSize() const
#define CHECK(condition)
Definition: Logger.h:209
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 125 of file QueryPhysicalInputsCollector.cpp.

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

125  {
126  const auto condition = filter->getCondition();
127  CHECK(condition);
128  RexPhysicalInputsVisitor visitor;
129  return visitor.visit(condition);
130 }
const RexScalar * getCondition() const
#define CHECK(condition)
Definition: Logger.h:209

+ 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 132 of file QueryPhysicalInputsCollector.cpp.

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

132  {
133  const auto condition = join->getCondition();
134  if (!condition) {
135  return PhysicalInputSet{};
136  }
137  RexPhysicalInputsVisitor visitor;
138  return visitor.visit(condition);
139 }
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 141 of file QueryPhysicalInputsCollector.cpp.

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

142  {
144  const auto condition = left_deep_inner_join->getInnerCondition();
145  RexPhysicalInputsVisitor visitor;
146  if (condition) {
147  result = visitor.visit(condition);
148  }
149  CHECK_GE(left_deep_inner_join->inputCount(), size_t(2));
150  for (size_t nesting_level = 1; nesting_level <= left_deep_inner_join->inputCount() - 1;
151  ++nesting_level) {
152  const auto outer_condition = left_deep_inner_join->getOuterCondition(nesting_level);
153  if (outer_condition) {
154  const auto outer_result = visitor.visit(outer_condition);
155  result.insert(outer_result.begin(), outer_result.end());
156  }
157  }
158  return result;
159 }
const RexScalar * getOuterCondition(const size_t nesting_level) const
#define CHECK_GE(x, y)
Definition: Logger.h:222
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 161 of file QueryPhysicalInputsCollector.cpp.

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

162  {
164  for (size_t i = 0; i < project->size(); ++i) {
165  const auto rex = project->getProjectAt(i);
166  CHECK(rex);
167  RexPhysicalInputsVisitor visitor;
168  const auto rex_phys_inputs = visitor.visit(rex);
169  result.insert(rex_phys_inputs.begin(), rex_phys_inputs.end());
170  }
171  return result;
172 }
size_t size() const override
const RexScalar * getProjectAt(const size_t idx) const
#define CHECK(condition)
Definition: Logger.h:209

+ 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 174 of file QueryPhysicalInputsCollector.cpp.

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

174  {
175  CHECK_EQ(sort->inputCount(), size_t(1));
176  return visit(sort->getInput(0));
177 }
#define CHECK_EQ(x, y)
Definition: Logger.h:217
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: