OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
 
virtual T visitTableFunction (const RelTableFunction *) const
 
virtual T visitLogicalUnion (const RelLogicalUnion *) 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

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

Reimplemented in RelLeftDeepTreeIdsCollector.

Definition at line 110 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::vector< unsigned > >::visit().

110  {
111  return next_result;
112  }

+ Here is the caller graph for this function:

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

Definition at line 25 of file RelAlgVisitor.h.

Referenced by RelAlgExecutor::getJoinInfo(), RelAlgVisitor< std::vector< unsigned > >::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) {
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  const auto table_func = dynamic_cast<const RelTableFunction*>(rel_alg);
71  if (table_func) {
72  return aggregateResult(result, visitTableFunction(table_func));
73  }
74  const auto logical_union = dynamic_cast<const RelLogicalUnion*>(rel_alg);
75  if (logical_union) {
76  return aggregateResult(result, visitLogicalUnion(logical_union));
77  }
78  LOG(FATAL) << "Unhandled rel_alg type: "
80  return {};
81  }
virtual T visitCompound(const RelCompound *) const
Definition: RelAlgVisitor.h:85
virtual T visitTableFunction(const RelTableFunction *) const
#define LOG(tag)
Definition: Logger.h:285
virtual T visitJoin(const RelJoin *) const
Definition: RelAlgVisitor.h:89
std::string join(T const &container, std::string const &delim)
DEVICE void sort(ARGS &&...args)
Definition: gpu_enabled.h:105
virtual T visitFilter(const RelFilter *) const
Definition: RelAlgVisitor.h:87
virtual T visitLogicalUnion(const RelLogicalUnion *) const
virtual T visitAggregate(const RelAggregate *) const
Definition: RelAlgVisitor.h:83
T visit(const RelAlgNode *rel_alg) const
Definition: RelAlgVisitor.h:25
const RelAlgNode * getInput(const size_t idx) const
Definition: RelAlgDag.h:877
virtual T visitSort(const RelSort *) const
Definition: RelAlgVisitor.h:99
virtual T visitModify(const RelModify *) const
virtual std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const =0
virtual T visitProject(const RelProject *) const
Definition: RelAlgVisitor.h:95
virtual T visitLogicalValues(const RelLogicalValues *) const
static RelRexToStringConfig defaults()
Definition: RelAlgDag.h:78
virtual T visitLeftDeepInnerJoin(const RelLeftDeepInnerJoin *) const
Definition: RelAlgVisitor.h:91
virtual T defaultResult() const
virtual T visitScan(const RelScan *) const
Definition: RelAlgVisitor.h:97
const size_t inputCount() const
Definition: RelAlgDag.h:875
virtual T aggregateResult(const T &aggregate, const T &next_result) const

+ Here is the caller graph for this function:

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

Definition at line 83 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::vector< unsigned > >::visit().

83 { return defaultResult(); }
virtual T defaultResult() const

+ Here is the caller graph for this function:

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

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

Definition at line 85 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::vector< unsigned > >::visit().

85 { return defaultResult(); }
virtual T defaultResult() const

+ Here is the caller graph for this function:

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

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

Definition at line 87 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::vector< unsigned > >::visit().

87 { return defaultResult(); }
virtual T defaultResult() const

+ Here is the caller graph for this function:

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

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

Definition at line 89 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::vector< unsigned > >::visit().

89 { return defaultResult(); }
virtual T defaultResult() const

+ Here is the caller graph for this function:

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

Reimplemented in RelLeftDeepTreeIdsCollector, and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor.

Definition at line 91 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::vector< unsigned > >::visit().

91  {
92  return defaultResult();
93  }
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T RelAlgVisitor< T >::visitLogicalUnion ( const RelLogicalUnion ) const
inlinevirtual

Definition at line 107 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::vector< unsigned > >::visit().

107 { return defaultResult(); }
virtual T defaultResult() const

+ Here is the caller graph for this function:

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

Definition at line 101 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::vector< unsigned > >::visit().

101 { return defaultResult(); }
virtual T defaultResult() const

+ Here is the caller graph for this function:

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

Definition at line 103 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::vector< unsigned > >::visit().

103 { return defaultResult(); }
virtual T defaultResult() const

+ Here is the caller graph for this function:

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

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

Definition at line 95 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::vector< unsigned > >::visit().

95 { return defaultResult(); }
virtual T defaultResult() const

+ Here is the caller graph for this function:

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

Definition at line 97 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::vector< unsigned > >::visit().

97 { return defaultResult(); }
virtual T defaultResult() const

+ Here is the caller graph for this function:

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

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

Definition at line 99 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::vector< unsigned > >::visit().

99 { return defaultResult(); }
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T RelAlgVisitor< T >::visitTableFunction ( const RelTableFunction ) const
inlinevirtual

Definition at line 105 of file RelAlgVisitor.h.

Referenced by RelAlgVisitor< std::vector< unsigned > >::visit().

105 { 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: