OmniSciDB  c07336695a
RelAlgVisitor< T > Class Template Reference

#include <RelAlgVisitor.h>

Public Member Functions

visit (const RelAlgNode *rel_alg) const
 
virtual T visitAggregate (const RelAggregate *) const
 
virtual T visitCompound (const RelCompound *) const
 
virtual T visitFilter (const RelFilter *) const
 
virtual T visitJoin (const RelJoin *) const
 
virtual T visitLeftDeepInnerJoin (const RelLeftDeepInnerJoin *) const
 
virtual T visitProject (const RelProject *) const
 
virtual T visitScan (const RelScan *) const
 
virtual T visitSort (const RelSort *) const
 
virtual T visitLogicalValues (const RelLogicalValues *) const
 
virtual T visitModify (const RelModify *) const
 

Protected Member Functions

virtual T aggregateResult (const T &aggregate, const T &next_result) const
 
virtual T defaultResult () const
 

Detailed Description

template<class T>
class RelAlgVisitor< T >

Definition at line 23 of file RelAlgVisitor.h.

Member Function Documentation

◆ aggregateResult()

template<class T>
virtual T RelAlgVisitor< T >::aggregateResult ( const T &  aggregate,
const T &  next_result 
) const
inlineprotectedvirtual

Reimplemented in anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalTableInputsVisitor.

Definition at line 97 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::unordered_set< int > >::visit().

97  {
98  return next_result;
99  }
+ Here is the caller graph for this function:

◆ defaultResult()

◆ visit()

template<class T>
T RelAlgVisitor< T >::visit ( const RelAlgNode rel_alg) const
inline

Definition at line 25 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::unordered_set< int > >::visit(), and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RexPhysicalInputsVisitor::visitSubQuery().

25  {
26  auto result = defaultResult();
27  for (size_t i = 0; i < rel_alg->inputCount(); ++i) {
28  result = aggregateResult(result, visit(rel_alg->getInput(i)));
29  }
30  const auto aggregate = dynamic_cast<const RelAggregate*>(rel_alg);
31  if (aggregate) {
32  return aggregateResult(result, visitAggregate(aggregate));
33  }
34  const auto compound = dynamic_cast<const RelCompound*>(rel_alg);
35  if (compound) {
36  return aggregateResult(result, visitCompound(compound));
37  }
38  const auto filter = dynamic_cast<const RelFilter*>(rel_alg);
39  if (filter) {
40  return aggregateResult(result, visitFilter(filter));
41  }
42  const auto join = dynamic_cast<const RelJoin*>(rel_alg);
43  if (join) {
45  }
46  const auto left_deep_inner_join = dynamic_cast<const RelLeftDeepInnerJoin*>(rel_alg);
47  if (left_deep_inner_join) {
48  return aggregateResult(result, visitLeftDeepInnerJoin(left_deep_inner_join));
49  }
50  const auto project = dynamic_cast<const RelProject*>(rel_alg);
51  if (project) {
52  return aggregateResult(result, visitProject(project));
53  }
54  const auto scan = dynamic_cast<const RelScan*>(rel_alg);
55  if (scan) {
56  return aggregateResult(result, visitScan(scan));
57  }
58  const auto sort = dynamic_cast<const RelSort*>(rel_alg);
59  if (sort) {
60  return aggregateResult(result, visitSort(sort));
61  }
62  const auto logical_values = dynamic_cast<const RelLogicalValues*>(rel_alg);
63  if (logical_values) {
64  return aggregateResult(result, visitLogicalValues(logical_values));
65  }
66  const auto modify = dynamic_cast<const RelModify*>(rel_alg);
67  if (modify) {
68  return aggregateResult(result, visitModify(modify));
69  }
70  CHECK(false);
71  return defaultResult();
72  }
virtual T visitScan(const RelScan *) const
Definition: RelAlgVisitor.h:88
T visit(const RelAlgNode *rel_alg) const
Definition: RelAlgVisitor.h:25
std::string join(T const &container, std::string const &delim)
virtual T aggregateResult(const T &aggregate, const T &next_result) const
Definition: RelAlgVisitor.h:97
virtual T visitProject(const RelProject *) const
Definition: RelAlgVisitor.h:86
virtual T visitJoin(const RelJoin *) const
Definition: RelAlgVisitor.h:80
virtual T visitModify(const RelModify *) const
Definition: RelAlgVisitor.h:94
virtual T visitCompound(const RelCompound *) const
Definition: RelAlgVisitor.h:76
virtual T visitAggregate(const RelAggregate *) const
Definition: RelAlgVisitor.h:74
virtual T visitLeftDeepInnerJoin(const RelLeftDeepInnerJoin *) const
Definition: RelAlgVisitor.h:82
virtual T visitFilter(const RelFilter *) const
Definition: RelAlgVisitor.h:78
const size_t inputCount() const
virtual T defaultResult() const
virtual T visitLogicalValues(const RelLogicalValues *) const
Definition: RelAlgVisitor.h:92
#define CHECK(condition)
Definition: Logger.h:187
const RelAlgNode * getInput(const size_t idx) const
virtual T visitSort(const RelSort *) const
Definition: RelAlgVisitor.h:90
+ Here is the caller graph for this function:

◆ visitAggregate()

template<class T>
virtual T RelAlgVisitor< T >::visitAggregate ( const RelAggregate ) const
inlinevirtual

Definition at line 74 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::unordered_set< int > >::visit().

74 { return defaultResult(); }
virtual T defaultResult() const
+ Here is the caller graph for this function:

◆ visitCompound()

template<class T>
virtual T RelAlgVisitor< T >::visitCompound ( const RelCompound ) const
inlinevirtual

Reimplemented in anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor.

Definition at line 76 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::unordered_set< int > >::visit().

76 { return defaultResult(); }
virtual T defaultResult() const
+ Here is the caller graph for this function:

◆ visitFilter()

template<class T>
virtual T RelAlgVisitor< T >::visitFilter ( const RelFilter ) const
inlinevirtual

Reimplemented in anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor.

Definition at line 78 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::unordered_set< int > >::visit().

78 { return defaultResult(); }
virtual T defaultResult() const
+ Here is the caller graph for this function:

◆ visitJoin()

template<class T>
virtual T RelAlgVisitor< T >::visitJoin ( const RelJoin ) const
inlinevirtual

Reimplemented in anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor.

Definition at line 80 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::unordered_set< int > >::visit().

80 { return defaultResult(); }
virtual T defaultResult() const
+ Here is the caller graph for this function:

◆ visitLeftDeepInnerJoin()

template<class T>
virtual T RelAlgVisitor< T >::visitLeftDeepInnerJoin ( const RelLeftDeepInnerJoin ) const
inlinevirtual

Reimplemented in anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor.

Definition at line 82 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::unordered_set< int > >::visit().

82  {
83  return defaultResult();
84  }
virtual T defaultResult() const
+ Here is the caller graph for this function:

◆ visitLogicalValues()

template<class T>
virtual T RelAlgVisitor< T >::visitLogicalValues ( const RelLogicalValues ) const
inlinevirtual

Definition at line 92 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::unordered_set< int > >::visit().

92 { return defaultResult(); }
virtual T defaultResult() const
+ Here is the caller graph for this function:

◆ visitModify()

template<class T>
virtual T RelAlgVisitor< T >::visitModify ( const RelModify ) const
inlinevirtual

Definition at line 94 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::unordered_set< int > >::visit().

94 { return defaultResult(); }
virtual T defaultResult() const
+ Here is the caller graph for this function:

◆ visitProject()

template<class T>
virtual T RelAlgVisitor< T >::visitProject ( const RelProject ) const
inlinevirtual

Reimplemented in anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor.

Definition at line 86 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::unordered_set< int > >::visit().

86 { return defaultResult(); }
virtual T defaultResult() const
+ Here is the caller graph for this function:

◆ visitScan()

template<class T>
virtual T RelAlgVisitor< T >::visitScan ( const RelScan ) const
inlinevirtual

Reimplemented in anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalTableInputsVisitor.

Definition at line 88 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::unordered_set< int > >::visit().

88 { return defaultResult(); }
virtual T defaultResult() const
+ Here is the caller graph for this function:

◆ visitSort()

template<class T>
virtual T RelAlgVisitor< T >::visitSort ( const RelSort ) const
inlinevirtual

Reimplemented in anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor.

Definition at line 90 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::unordered_set< int > >::visit().

90 { return defaultResult(); }
virtual T defaultResult() const
+ Here is the caller graph for this function:

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