OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ScalarExprVisitor< T > Class Template Reference

#include <ScalarExprVisitor.h>

Public Member Functions

visit (const Analyzer::Expr *expr) const
 

Protected Member Functions

virtual T visitVar (const Analyzer::Var *) const
 
virtual T visitColumnVar (const Analyzer::ColumnVar *) const
 
virtual T visitColumnVarTuple (const Analyzer::ExpressionTuple *) const
 
virtual T visitConstant (const Analyzer::Constant *) const
 
virtual T visitUOper (const Analyzer::UOper *uoper) const
 
virtual T visitBinOper (const Analyzer::BinOper *bin_oper) const
 
virtual T visitInValues (const Analyzer::InValues *in_values) const
 
virtual T visitInIntegerSet (const Analyzer::InIntegerSet *in_integer_set) const
 
virtual T visitCharLength (const Analyzer::CharLengthExpr *char_length) const
 
virtual T visitKeyForString (const Analyzer::KeyForStringExpr *key_for_string) const
 
virtual T visitLower (const Analyzer::LowerExpr *lower_expr) const
 
virtual T visitCardinality (const Analyzer::CardinalityExpr *cardinality) const
 
virtual T visitLikeExpr (const Analyzer::LikeExpr *like) const
 
virtual T visitRegexpExpr (const Analyzer::RegexpExpr *regexp) const
 
virtual T visitCaseExpr (const Analyzer::CaseExpr *case_) const
 
virtual T visitDatetruncExpr (const Analyzer::DatetruncExpr *datetrunc) const
 
virtual T visitExtractExpr (const Analyzer::ExtractExpr *extract) const
 
virtual T visitFunctionOperWithCustomTypeHandling (const Analyzer::FunctionOperWithCustomTypeHandling *func_oper) const
 
virtual T visitArrayOper (Analyzer::ArrayExpr const *array_expr) const
 
virtual T visitGeoExpr (const Analyzer::GeoExpr *geo_expr) const
 
virtual T visitFunctionOper (const Analyzer::FunctionOper *func_oper) const
 
virtual T visitWindowFunction (const Analyzer::WindowFunction *window_func) const
 
virtual T visitDatediffExpr (const Analyzer::DatediffExpr *datediff) const
 
virtual T visitDateaddExpr (const Analyzer::DateaddExpr *dateadd) const
 
virtual T visitLikelihood (const Analyzer::LikelihoodExpr *likelihood) const
 
virtual T visitOffsetInFragment (const Analyzer::OffsetInFragment *) const
 
virtual T visitAggExpr (const Analyzer::AggExpr *agg) const
 
virtual T aggregateResult (const T &aggregate, const T &next_result) const
 
virtual T defaultResult () const
 

Detailed Description

template<class T>
class ScalarExprVisitor< T >

Definition at line 23 of file ScalarExprVisitor.h.

Member Function Documentation

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

Reimplemented in anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, AllRangeTableIndexVisitor, anonymous_namespace{JoinFilterPushDown.cpp}::CollectInputColumnsVisitor, MaxRangeTableIndexVisitor, anonymous_namespace{ScalarCodeGenerator.cpp}::UsedColumnExpressions, and UsedColumnsVisitor.

Definition at line 312 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitAggExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitArrayOper(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitBinOper(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitCardinality(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitCaseExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitCharLength(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitDateaddExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitDatediffExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitDatetruncExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitExtractExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitFunctionOper(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitGeoExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitInValues(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitKeyForString(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitLikeExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitRegexpExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitUOper(), and ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitWindowFunction().

312  {
313  return next_result;
314  }

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::defaultResult ( ) const
inlineprotectedvirtual

Reimplemented in JoinCoveredQualVisitor.

Definition at line 316 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitAggExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitArrayOper(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitBinOper(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitCardinality(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitCaseExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitCharLength(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitColumnVar(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitColumnVarTuple(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitConstant(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitDateaddExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitDatediffExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitDatetruncExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitExtractExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitFunctionOper(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitGeoExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitKeyForString(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitLikeExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitOffsetInFragment(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitRegexpExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitUOper(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitVar(), and ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitWindowFunction().

316 { return T{}; }

+ Here is the caller graph for this function:

template<class T>
T ScalarExprVisitor< T >::visit ( const Analyzer::Expr expr) const
inline

Definition at line 25 of file ScalarExprVisitor.h.

Referenced by anonymous_namespace{FromTableReordering.cpp}::build_join_cost_graph(), anonymous_namespace{EquiJoinCondition.cpp}::can_combine_with(), RelAlgExecutor::createModifyCompoundWorkUnit(), RelAlgExecutor::createModifyProjectWorkUnit(), find_push_down_filters(), normalize_column_pair(), rewrite_overlaps_conjunction(), strip_join_covered_filter_quals(), anonymous_namespace{QueryMemoryDescriptor.cpp}::target_expr_proj_indices(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitAggExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitArrayOper(), anonymous_namespace{ExpressionRewrite.cpp}::RecursiveOrToInVisitor::visitBinOper(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitBinOper(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitCardinality(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitCaseExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitCharLength(), MaxRangeTableIndexVisitor::visitColumnVarTuple(), AllRangeTableIndexVisitor::visitColumnVarTuple(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitDateaddExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitDatediffExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitDatetruncExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitExtractExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitFunctionOper(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitGeoExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitInIntegerSet(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitInValues(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitKeyForString(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitLikeExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitLikelihood(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitLower(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitRegexpExpr(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitUOper(), and ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitWindowFunction().

25  {
26  CHECK(expr);
27  const auto var = dynamic_cast<const Analyzer::Var*>(expr);
28  if (var) {
29  return visitVar(var);
30  }
31  const auto column_var = dynamic_cast<const Analyzer::ColumnVar*>(expr);
32  if (column_var) {
33  return visitColumnVar(column_var);
34  }
35  const auto column_var_tuple = dynamic_cast<const Analyzer::ExpressionTuple*>(expr);
36  if (column_var_tuple) {
37  return visitColumnVarTuple(column_var_tuple);
38  }
39  const auto constant = dynamic_cast<const Analyzer::Constant*>(expr);
40  if (constant) {
41  return visitConstant(constant);
42  }
43  const auto uoper = dynamic_cast<const Analyzer::UOper*>(expr);
44  if (uoper) {
45  return visitUOper(uoper);
46  }
47  const auto bin_oper = dynamic_cast<const Analyzer::BinOper*>(expr);
48  if (bin_oper) {
49  return visitBinOper(bin_oper);
50  }
51  const auto in_values = dynamic_cast<const Analyzer::InValues*>(expr);
52  if (in_values) {
53  return visitInValues(in_values);
54  }
55  const auto in_integer_set = dynamic_cast<const Analyzer::InIntegerSet*>(expr);
56  if (in_integer_set) {
57  return visitInIntegerSet(in_integer_set);
58  }
59  const auto char_length = dynamic_cast<const Analyzer::CharLengthExpr*>(expr);
60  if (char_length) {
62  }
63  const auto key_for_string = dynamic_cast<const Analyzer::KeyForStringExpr*>(expr);
64  if (key_for_string) {
65  return visitKeyForString(key_for_string);
66  }
67  const auto lower = dynamic_cast<const Analyzer::LowerExpr*>(expr);
68  if (lower) {
69  return visitLower(lower);
70  }
71  const auto cardinality = dynamic_cast<const Analyzer::CardinalityExpr*>(expr);
72  if (cardinality) {
73  return visitCardinality(cardinality);
74  }
75  const auto like_expr = dynamic_cast<const Analyzer::LikeExpr*>(expr);
76  if (like_expr) {
77  return visitLikeExpr(like_expr);
78  }
79  const auto regexp_expr = dynamic_cast<const Analyzer::RegexpExpr*>(expr);
80  if (regexp_expr) {
81  return visitRegexpExpr(regexp_expr);
82  }
83  const auto case_ = dynamic_cast<const Analyzer::CaseExpr*>(expr);
84  if (case_) {
85  return visitCaseExpr(case_);
86  }
87  const auto datetrunc = dynamic_cast<const Analyzer::DatetruncExpr*>(expr);
88  if (datetrunc) {
89  return visitDatetruncExpr(datetrunc);
90  }
91  const auto extract = dynamic_cast<const Analyzer::ExtractExpr*>(expr);
92  if (extract) {
93  return visitExtractExpr(extract);
94  }
95  const auto window_func = dynamic_cast<const Analyzer::WindowFunction*>(expr);
96  if (window_func) {
97  return visitWindowFunction(window_func);
98  }
99  const auto func_with_custom_type_handling =
100  dynamic_cast<const Analyzer::FunctionOperWithCustomTypeHandling*>(expr);
101  if (func_with_custom_type_handling) {
102  return visitFunctionOperWithCustomTypeHandling(func_with_custom_type_handling);
103  }
104  const auto func = dynamic_cast<const Analyzer::FunctionOper*>(expr);
105  if (func) {
106  return visitFunctionOper(func);
107  }
108  const auto array = dynamic_cast<const Analyzer::ArrayExpr*>(expr);
109  if (array) {
110  return visitArrayOper(array);
111  }
112  const auto geo_expr = dynamic_cast<const Analyzer::GeoExpr*>(expr);
113  if (geo_expr) {
114  return visitGeoExpr(geo_expr);
115  }
116  const auto datediff = dynamic_cast<const Analyzer::DatediffExpr*>(expr);
117  if (datediff) {
118  return visitDatediffExpr(datediff);
119  }
120  const auto dateadd = dynamic_cast<const Analyzer::DateaddExpr*>(expr);
121  if (dateadd) {
122  return visitDateaddExpr(dateadd);
123  }
124  const auto likelihood = dynamic_cast<const Analyzer::LikelihoodExpr*>(expr);
125  if (likelihood) {
126  return visitLikelihood(likelihood);
127  }
128  const auto offset_in_fragment = dynamic_cast<const Analyzer::OffsetInFragment*>(expr);
129  if (offset_in_fragment) {
130  return visitOffsetInFragment(offset_in_fragment);
131  }
132  const auto agg = dynamic_cast<const Analyzer::AggExpr*>(expr);
133  if (agg) {
134  return visitAggExpr(agg);
135  }
136  return defaultResult();
137  }
virtual T visitAggExpr(const Analyzer::AggExpr *agg) const
virtual T visitOffsetInFragment(const Analyzer::OffsetInFragment *) const
virtual T visitCardinality(const Analyzer::CardinalityExpr *cardinality) const
virtual T visitExtractExpr(const Analyzer::ExtractExpr *extract) const
virtual T visitLikelihood(const Analyzer::LikelihoodExpr *likelihood) const
virtual T visitCharLength(const Analyzer::CharLengthExpr *char_length) const
virtual T visitVar(const Analyzer::Var *) const
virtual T visitGeoExpr(const Analyzer::GeoExpr *geo_expr) const
virtual T visitLikeExpr(const Analyzer::LikeExpr *like) const
CHECK(cgen_state)
ALWAYS_INLINE DEVICE int32_t char_length(const char *str, const int32_t str_len)
virtual T visitLower(const Analyzer::LowerExpr *lower_expr) const
virtual T visitColumnVar(const Analyzer::ColumnVar *) const
virtual T visitWindowFunction(const Analyzer::WindowFunction *window_func) const
virtual T visitDatediffExpr(const Analyzer::DatediffExpr *datediff) const
virtual T visitDateaddExpr(const Analyzer::DateaddExpr *dateadd) const
virtual T visitConstant(const Analyzer::Constant *) const
virtual T visitKeyForString(const Analyzer::KeyForStringExpr *key_for_string) const
Expression class for the LOWER (lowercase) string function. The &quot;arg&quot; constructor parameter must be a...
Definition: Analyzer.h:740
virtual T visitCaseExpr(const Analyzer::CaseExpr *case_) const
virtual T visitBinOper(const Analyzer::BinOper *bin_oper) const
virtual T visitInValues(const Analyzer::InValues *in_values) const
virtual T visitInIntegerSet(const Analyzer::InIntegerSet *in_integer_set) const
virtual T visitFunctionOperWithCustomTypeHandling(const Analyzer::FunctionOperWithCustomTypeHandling *func_oper) const
virtual T visitFunctionOper(const Analyzer::FunctionOper *func_oper) const
virtual T visitArrayOper(Analyzer::ArrayExpr const *array_expr) const
virtual T defaultResult() const
virtual T visitRegexpExpr(const Analyzer::RegexpExpr *regexp) const
virtual T visitUOper(const Analyzer::UOper *uoper) const
virtual T visitColumnVarTuple(const Analyzer::ExpressionTuple *) const
virtual T visitDatetruncExpr(const Analyzer::DatetruncExpr *datetrunc) const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitAggExpr ( const Analyzer::AggExpr agg) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor, and anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor.

Definition at line 306 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

306  {
307  T result = defaultResult();
308  return aggregateResult(result, visit(agg->get_arg()));
309  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
Expr * get_arg() const
Definition: Analyzer.h:1045
T visit(const Analyzer::Expr *expr) const
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitArrayOper ( Analyzer::ArrayExpr const *  array_expr) const
inlineprotectedvirtual

Reimplemented in anonymous_namespace{ExpressionRewrite.cpp}::ArrayElementStringLiteralEncodingVisitor, and DeepCopyVisitor.

Definition at line 246 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

246  {
247  T result = defaultResult();
248  for (size_t i = 0; i < array_expr->getElementCount(); ++i) {
249  result = aggregateResult(result, visit(array_expr->getElement(i)));
250  }
251  return result;
252  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
T visit(const Analyzer::Expr *expr) const
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitBinOper ( const Analyzer::BinOper bin_oper) const
inlineprotectedvirtual

Reimplemented in anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor, anonymous_namespace{ExpressionRewrite.cpp}::RecursiveOrToInVisitor, DeepCopyVisitor, and anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor.

Definition at line 156 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

156  {
157  T result = defaultResult();
158  result = aggregateResult(result, visit(bin_oper->get_left_operand()));
159  result = aggregateResult(result, visit(bin_oper->get_right_operand()));
160  return result;
161  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const Expr * get_right_operand() const
Definition: Analyzer.h:437
T visit(const Analyzer::Expr *expr) const
virtual T defaultResult() const
const Expr * get_left_operand() const
Definition: Analyzer.h:436

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitCardinality ( const Analyzer::CardinalityExpr cardinality) const
inlineprotectedvirtual

Reimplemented in anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, and DeepCopyVisitor.

Definition at line 192 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

192  {
193  T result = defaultResult();
194  result = aggregateResult(result, visit(cardinality->get_arg()));
195  return result;
196  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
T visit(const Analyzer::Expr *expr) const
virtual T defaultResult() const
const Expr * get_arg() const
Definition: Analyzer.h:800

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitCaseExpr ( const Analyzer::CaseExpr case_) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor, and anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor.

Definition at line 218 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

218  {
219  T result = defaultResult();
220  const auto& expr_pair_list = case_->get_expr_pair_list();
221  for (const auto& expr_pair : expr_pair_list) {
222  result = aggregateResult(result, visit(expr_pair.first.get()));
223  result = aggregateResult(result, visit(expr_pair.second.get()));
224  }
225  result = aggregateResult(result, visit(case_->get_else_expr()));
226  return result;
227  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const Expr * get_else_expr() const
Definition: Analyzer.h:1101
T visit(const Analyzer::Expr *expr) const
virtual T defaultResult() const
const std::list< std::pair< std::shared_ptr< Analyzer::Expr >, std::shared_ptr< Analyzer::Expr > > > & get_expr_pair_list() const
Definition: Analyzer.h:1098

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitCharLength ( const Analyzer::CharLengthExpr char_length) const
inlineprotectedvirtual

Reimplemented in anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, and DeepCopyVisitor.

Definition at line 176 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

176  {
177  T result = defaultResult();
178  result = aggregateResult(result, visit(char_length->get_arg()));
179  return result;
180  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
T visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:650
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitColumnVar ( const Analyzer::ColumnVar ) const
inlineprotectedvirtual
template<class T>
virtual T ScalarExprVisitor< T >::visitColumnVarTuple ( const Analyzer::ExpressionTuple ) const
inlineprotectedvirtual

Reimplemented in AllRangeTableIndexVisitor, MaxRangeTableIndexVisitor, and DeepCopyVisitor.

Definition at line 144 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

144  {
145  return defaultResult();
146  }
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitConstant ( const Analyzer::Constant ) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor.

Definition at line 148 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

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

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitDateaddExpr ( const Analyzer::DateaddExpr dateadd) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor, and anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor.

Definition at line 291 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

291  {
292  T result = defaultResult();
293  result = aggregateResult(result, visit(dateadd->get_number_expr()));
294  result = aggregateResult(result, visit(dateadd->get_datetime_expr()));
295  return result;
296  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
T visit(const Analyzer::Expr *expr) const
const Expr * get_datetime_expr() const
Definition: Analyzer.h:1188
virtual T defaultResult() const
const Expr * get_number_expr() const
Definition: Analyzer.h:1187

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitDatediffExpr ( const Analyzer::DatediffExpr datediff) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor, and anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor.

Definition at line 284 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

284  {
285  T result = defaultResult();
286  result = aggregateResult(result, visit(datediff->get_start_expr()));
287  result = aggregateResult(result, visit(datediff->get_end_expr()));
288  return result;
289  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
T visit(const Analyzer::Expr *expr) const
const Expr * get_start_expr() const
Definition: Analyzer.h:1229
const Expr * get_end_expr() const
Definition: Analyzer.h:1230
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitDatetruncExpr ( const Analyzer::DatetruncExpr datetrunc) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor, and anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor.

Definition at line 229 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

229  {
230  T result = defaultResult();
231  result = aggregateResult(result, visit(datetrunc->get_from_expr()));
232  return result;
233  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
T visit(const Analyzer::Expr *expr) const
const Expr * get_from_expr() const
Definition: Analyzer.h:1271
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitExtractExpr ( const Analyzer::ExtractExpr extract) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor, and anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor.

Definition at line 235 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

235  {
236  T result = defaultResult();
237  result = aggregateResult(result, visit(extract->get_from_expr()));
238  return result;
239  }
const Expr * get_from_expr() const
Definition: Analyzer.h:1146
virtual T aggregateResult(const T &aggregate, const T &next_result) const
T visit(const Analyzer::Expr *expr) const
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitFunctionOper ( const Analyzer::FunctionOper func_oper) const
inlineprotectedvirtual

Reimplemented in JoinCoveredQualVisitor, and DeepCopyVisitor.

Definition at line 262 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit(), and ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitFunctionOperWithCustomTypeHandling().

262  {
263  T result = defaultResult();
264  for (size_t i = 0; i < func_oper->getArity(); ++i) {
265  result = aggregateResult(result, visit(func_oper->getArg(i)));
266  }
267  return result;
268  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
size_t getArity() const
Definition: Analyzer.h:1309
T visit(const Analyzer::Expr *expr) const
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:1311
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitFunctionOperWithCustomTypeHandling ( const Analyzer::FunctionOperWithCustomTypeHandling func_oper) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor.

Definition at line 241 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

242  {
243  return visitFunctionOper(func_oper);
244  }
virtual T visitFunctionOper(const Analyzer::FunctionOper *func_oper) const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitGeoExpr ( const Analyzer::GeoExpr geo_expr) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor.

Definition at line 254 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

254  {
255  T result = defaultResult();
256  for (const auto& arg : geo_expr->getArgs()) {
257  result = aggregateResult(result, visit(arg.get()));
258  }
259  return result;
260  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs() const
Definition: Analyzer.h:1473
T visit(const Analyzer::Expr *expr) const
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitInIntegerSet ( const Analyzer::InIntegerSet in_integer_set) const
inlineprotectedvirtual

Reimplemented in anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, and DeepCopyVisitor.

Definition at line 172 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

172  {
173  return visit(in_integer_set->get_arg());
174  }
T visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:627

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitInValues ( const Analyzer::InValues in_values) const
inlineprotectedvirtual

Reimplemented in anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, and DeepCopyVisitor.

Definition at line 163 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

163  {
164  T result = visit(in_values->get_arg());
165  const auto& value_list = in_values->get_value_list();
166  for (const auto in_value : value_list) {
167  result = aggregateResult(result, visit(in_value.get()));
168  }
169  return result;
170  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
T visit(const Analyzer::Expr *expr) const
const std::list< std::shared_ptr< Analyzer::Expr > > & get_value_list() const
Definition: Analyzer.h:580
const Expr * get_arg() const
Definition: Analyzer.h:578

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitKeyForString ( const Analyzer::KeyForStringExpr key_for_string) const
inlineprotectedvirtual

Reimplemented in anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, and DeepCopyVisitor.

Definition at line 182 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

182  {
183  T result = defaultResult();
184  result = aggregateResult(result, visit(key_for_string->get_arg()));
185  return result;
186  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
T visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:699
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitLikeExpr ( const Analyzer::LikeExpr like) const
inlineprotectedvirtual

Reimplemented in anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, and DeepCopyVisitor.

Definition at line 198 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

198  {
199  T result = defaultResult();
200  result = aggregateResult(result, visit(like->get_arg()));
201  result = aggregateResult(result, visit(like->get_like_expr()));
202  if (like->get_escape_expr()) {
203  result = aggregateResult(result, visit(like->get_escape_expr()));
204  }
205  return result;
206  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const Expr * get_escape_expr() const
Definition: Analyzer.h:857
T visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:854
const Expr * get_like_expr() const
Definition: Analyzer.h:856
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitLikelihood ( const Analyzer::LikelihoodExpr likelihood) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor, and anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor.

Definition at line 298 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

298  {
299  return visit(likelihood->get_arg());
300  }
const Expr * get_arg() const
Definition: Analyzer.h:982
T visit(const Analyzer::Expr *expr) const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitLower ( const Analyzer::LowerExpr lower_expr) const
inlineprotectedvirtual

Reimplemented in anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor, and DeepCopyVisitor.

Definition at line 188 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

188  {
189  return visit(lower_expr->get_arg());
190  }
T visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:744

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitOffsetInFragment ( const Analyzer::OffsetInFragment ) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor.

Definition at line 302 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

302  {
303  return defaultResult();
304  }
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitRegexpExpr ( const Analyzer::RegexpExpr regexp) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor, and anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor.

Definition at line 208 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

208  {
209  T result = defaultResult();
210  result = aggregateResult(result, visit(regexp->get_arg()));
211  result = aggregateResult(result, visit(regexp->get_pattern_expr()));
212  if (regexp->get_escape_expr()) {
213  result = aggregateResult(result, visit(regexp->get_escape_expr()));
214  }
215  return result;
216  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const Expr * get_escape_expr() const
Definition: Analyzer.h:929
const Expr * get_arg() const
Definition: Analyzer.h:926
T visit(const Analyzer::Expr *expr) const
const Expr * get_pattern_expr() const
Definition: Analyzer.h:928
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitUOper ( const Analyzer::UOper uoper) const
inlineprotectedvirtual

Reimplemented in anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor, anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, and DeepCopyVisitor.

Definition at line 150 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

150  {
151  T result = defaultResult();
152  result = aggregateResult(result, visit(uoper->get_operand()));
153  return result;
154  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
T visit(const Analyzer::Expr *expr) const
const Expr * get_operand() const
Definition: Analyzer.h:365
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitVar ( const Analyzer::Var ) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor.

Definition at line 140 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

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

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitWindowFunction ( const Analyzer::WindowFunction window_func) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor.

Definition at line 270 of file ScalarExprVisitor.h.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

270  {
271  T result = defaultResult();
272  for (const auto& arg : window_func->getArgs()) {
273  result = aggregateResult(result, visit(arg.get()));
274  }
275  for (const auto& partition_key : window_func->getPartitionKeys()) {
276  result = aggregateResult(result, visit(partition_key.get()));
277  }
278  for (const auto& order_key : window_func->getOrderKeys()) {
279  result = aggregateResult(result, visit(order_key.get()));
280  }
281  return result;
282  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
T visit(const Analyzer::Expr *expr) const
const std::vector< std::shared_ptr< Analyzer::Expr > > & getOrderKeys() const
Definition: Analyzer.h:1404
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs() const
Definition: Analyzer.h:1398
virtual T defaultResult() const
const std::vector< std::shared_ptr< Analyzer::Expr > > & getPartitionKeys() const
Definition: Analyzer.h:1400

+ Here is the caller graph for this function:


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