OmniSciDB  340b00dbf6
 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 visitSampleRatio (const Analyzer::SampleRatioExpr *sample_ratio) 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 visitGeoUOper (const Analyzer::GeoUOper *geo_expr) const
 
virtual T visitGeoBinOper (const Analyzer::GeoBinOper *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 AllColumnVarsVisitor, anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, AllRangeTableIndexVisitor, ScalarExprToSql, anonymous_namespace{JoinFilterPushDown.cpp}::CollectInputColumnsVisitor, MaxRangeTableIndexVisitor, anonymous_namespace{ScalarCodeGenerator.cpp}::UsedColumnExpressions, and UsedColumnsVisitor.

Definition at line 337 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 > >::visitGeoBinOper(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitGeoUOper(), 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 > >::visitSampleRatio(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitUOper(), and ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitWindowFunction().

337  {
338  return next_result;
339  }

+ Here is the caller graph for this function:

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

Reimplemented in JoinCoveredQualVisitor, and ScalarExprToSql.

Definition at line 341 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 > >::visitGeoBinOper(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitGeoUOper(), 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 > >::visitSampleRatio(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitUOper(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitVar(), and ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitWindowFunction().

341 { 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{SerializeToSql.cpp}::agg_to_string(), anonymous_namespace{FromTableReordering.cpp}::build_join_cost_graph(), anonymous_namespace{EquiJoinCondition.cpp}::can_combine_with(), find_push_down_filters(), JoinHashTableInterface::getSyntheticInstance(), normalize_column_pair(), rewrite_overlaps_conjunction(), strip_join_covered_filter_quals(), anonymous_namespace{QueryMemoryDescriptor.cpp}::target_expr_proj_indices(), anonymous_namespace{SerializeToSql.cpp}::targets_to_string(), 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(), AllColumnVarsVisitor::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 > >::visitGeoBinOper(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitGeoUOper(), 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 > >::visitSampleRatio(), 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 sample_ratio = dynamic_cast<const Analyzer::SampleRatioExpr*>(expr);
68  if (sample_ratio) {
70  }
71  const auto lower = dynamic_cast<const Analyzer::LowerExpr*>(expr);
72  if (lower) {
73  return visitLower(lower);
74  }
75  const auto cardinality = dynamic_cast<const Analyzer::CardinalityExpr*>(expr);
76  if (cardinality) {
77  return visitCardinality(cardinality);
78  }
79  const auto like_expr = dynamic_cast<const Analyzer::LikeExpr*>(expr);
80  if (like_expr) {
81  return visitLikeExpr(like_expr);
82  }
83  const auto regexp_expr = dynamic_cast<const Analyzer::RegexpExpr*>(expr);
84  if (regexp_expr) {
85  return visitRegexpExpr(regexp_expr);
86  }
87  const auto case_ = dynamic_cast<const Analyzer::CaseExpr*>(expr);
88  if (case_) {
89  return visitCaseExpr(case_);
90  }
91  const auto datetrunc = dynamic_cast<const Analyzer::DatetruncExpr*>(expr);
92  if (datetrunc) {
93  return visitDatetruncExpr(datetrunc);
94  }
95  const auto extract = dynamic_cast<const Analyzer::ExtractExpr*>(expr);
96  if (extract) {
97  return visitExtractExpr(extract);
98  }
99  const auto window_func = dynamic_cast<const Analyzer::WindowFunction*>(expr);
100  if (window_func) {
101  return visitWindowFunction(window_func);
102  }
103  const auto func_with_custom_type_handling =
104  dynamic_cast<const Analyzer::FunctionOperWithCustomTypeHandling*>(expr);
105  if (func_with_custom_type_handling) {
106  return visitFunctionOperWithCustomTypeHandling(func_with_custom_type_handling);
107  }
108  const auto func = dynamic_cast<const Analyzer::FunctionOper*>(expr);
109  if (func) {
110  return visitFunctionOper(func);
111  }
112  const auto array = dynamic_cast<const Analyzer::ArrayExpr*>(expr);
113  if (array) {
114  return visitArrayOper(array);
115  }
116  const auto geo_uop = dynamic_cast<const Analyzer::GeoUOper*>(expr);
117  if (geo_uop) {
118  return visitGeoUOper(geo_uop);
119  }
120  const auto geo_binop = dynamic_cast<const Analyzer::GeoBinOper*>(expr);
121  if (geo_binop) {
122  return visitGeoBinOper(geo_binop);
123  }
124  const auto datediff = dynamic_cast<const Analyzer::DatediffExpr*>(expr);
125  if (datediff) {
126  return visitDatediffExpr(datediff);
127  }
128  const auto dateadd = dynamic_cast<const Analyzer::DateaddExpr*>(expr);
129  if (dateadd) {
130  return visitDateaddExpr(dateadd);
131  }
132  const auto likelihood = dynamic_cast<const Analyzer::LikelihoodExpr*>(expr);
133  if (likelihood) {
134  return visitLikelihood(likelihood);
135  }
136  const auto offset_in_fragment = dynamic_cast<const Analyzer::OffsetInFragment*>(expr);
137  if (offset_in_fragment) {
138  return visitOffsetInFragment(offset_in_fragment);
139  }
140  const auto agg = dynamic_cast<const Analyzer::AggExpr*>(expr);
141  if (agg) {
142  return visitAggExpr(agg);
143  }
144  return defaultResult();
145  }
virtual T visitAggExpr(const Analyzer::AggExpr *agg) const
virtual T visitOffsetInFragment(const Analyzer::OffsetInFragment *) const
virtual T visitGeoBinOper(const Analyzer::GeoBinOper *geo_expr) const
virtual T visitCardinality(const Analyzer::CardinalityExpr *cardinality) const
virtual T visitGeoUOper(const Analyzer::GeoUOper *geo_expr) 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 visitLikeExpr(const Analyzer::LikeExpr *like) const
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:791
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
#define CHECK(condition)
Definition: Logger.h:197
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 visitSampleRatio(const Analyzer::SampleRatioExpr *sample_ratio) const
virtual T visitUOper(const Analyzer::UOper *uoper) const
virtual T visitColumnVarTuple(const Analyzer::ExpressionTuple *) const
ALWAYS_INLINE DEVICE bool sample_ratio(const double proportion, const int64_t row_offset)
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, anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, and ScalarExprToSql.

Definition at line 331 of file ScalarExprVisitor.h.

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

331  {
332  T result = defaultResult();
333  return aggregateResult(result, visit(agg->get_arg()));
334  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
Expr * get_arg() const
Definition: Analyzer.h:1096
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 260 of file ScalarExprVisitor.h.

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

260  {
261  T result = defaultResult();
262  for (size_t i = 0; i < array_expr->getElementCount(); ++i) {
263  result = aggregateResult(result, visit(array_expr->getElement(i)));
264  }
265  return result;
266  }
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, ScalarExprToSql, and anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor.

Definition at line 164 of file ScalarExprVisitor.h.

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

164  {
165  T result = defaultResult();
166  result = aggregateResult(result, visit(bin_oper->get_left_operand()));
167  result = aggregateResult(result, visit(bin_oper->get_right_operand()));
168  return result;
169  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const Expr * get_right_operand() const
Definition: Analyzer.h:443
T visit(const Analyzer::Expr *expr) const
virtual T defaultResult() const
const Expr * get_left_operand() const
Definition: Analyzer.h:442

+ 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 206 of file ScalarExprVisitor.h.

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

206  {
207  T result = defaultResult();
208  result = aggregateResult(result, visit(cardinality->get_arg()));
209  return result;
210  }
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:851

+ 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, anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, and ScalarExprToSql.

Definition at line 232 of file ScalarExprVisitor.h.

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

232  {
233  T result = defaultResult();
234  const auto& expr_pair_list = case_->get_expr_pair_list();
235  for (const auto& expr_pair : expr_pair_list) {
236  result = aggregateResult(result, visit(expr_pair.first.get()));
237  result = aggregateResult(result, visit(expr_pair.second.get()));
238  }
239  result = aggregateResult(result, visit(case_->get_else_expr()));
240  return result;
241  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const Expr * get_else_expr() const
Definition: Analyzer.h:1152
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:1149

+ 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 184 of file ScalarExprVisitor.h.

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

184  {
185  T result = defaultResult();
186  result = aggregateResult(result, visit(char_length->get_arg()));
187  return result;
188  }
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:656
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 AllColumnVarsVisitor, AllRangeTableIndexVisitor, MaxRangeTableIndexVisitor, and DeepCopyVisitor.

Definition at line 152 of file ScalarExprVisitor.h.

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

152  {
153  return defaultResult();
154  }
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, and ScalarExprToSql.

Definition at line 156 of file ScalarExprVisitor.h.

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

156 { 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 316 of file ScalarExprVisitor.h.

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

316  {
317  T result = defaultResult();
318  result = aggregateResult(result, visit(dateadd->get_number_expr()));
319  result = aggregateResult(result, visit(dateadd->get_datetime_expr()));
320  return result;
321  }
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:1239
virtual T defaultResult() const
const Expr * get_number_expr() const
Definition: Analyzer.h:1238

+ 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 309 of file ScalarExprVisitor.h.

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

309  {
310  T result = defaultResult();
311  result = aggregateResult(result, visit(datediff->get_start_expr()));
312  result = aggregateResult(result, visit(datediff->get_end_expr()));
313  return result;
314  }
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:1280
const Expr * get_end_expr() const
Definition: Analyzer.h:1281
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 243 of file ScalarExprVisitor.h.

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

243  {
244  T result = defaultResult();
245  result = aggregateResult(result, visit(datetrunc->get_from_expr()));
246  return result;
247  }
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:1322
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 249 of file ScalarExprVisitor.h.

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

249  {
250  T result = defaultResult();
251  result = aggregateResult(result, visit(extract->get_from_expr()));
252  return result;
253  }
const Expr * get_from_expr() const
Definition: Analyzer.h:1197
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, DeepCopyVisitor, and ScalarExprToSql.

Definition at line 287 of file ScalarExprVisitor.h.

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

287  {
288  T result = defaultResult();
289  for (size_t i = 0; i < func_oper->getArity(); ++i) {
290  result = aggregateResult(result, visit(func_oper->getArg(i)));
291  }
292  return result;
293  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
size_t getArity() const
Definition: Analyzer.h:1360
T visit(const Analyzer::Expr *expr) const
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:1362
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 255 of file ScalarExprVisitor.h.

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

256  {
257  return visitFunctionOper(func_oper);
258  }
virtual T visitFunctionOper(const Analyzer::FunctionOper *func_oper) const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitGeoBinOper ( const Analyzer::GeoBinOper geo_expr) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor.

Definition at line 276 of file ScalarExprVisitor.h.

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

276  {
277  T result = defaultResult();
278  for (const auto& arg : geo_expr->getArgs0()) {
279  result = aggregateResult(result, visit(arg.get()));
280  }
281  for (const auto& arg : geo_expr->getArgs1()) {
282  result = aggregateResult(result, visit(arg.get()));
283  }
284  return result;
285  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs0() const
Definition: Analyzer.h:1552
T visit(const Analyzer::Expr *expr) const
virtual T defaultResult() const
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs1() const
Definition: Analyzer.h:1553

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitGeoUOper ( const Analyzer::GeoUOper geo_expr) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor.

Definition at line 268 of file ScalarExprVisitor.h.

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

268  {
269  T result = defaultResult();
270  for (const auto& arg : geo_expr->getArgs0()) {
271  result = aggregateResult(result, visit(arg.get()));
272  }
273  return result;
274  }
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 > > & getArgs0() const
Definition: Analyzer.h:1522
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 180 of file ScalarExprVisitor.h.

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

180  {
181  return visit(in_integer_set->get_arg());
182  }
T visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:633

+ 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, DeepCopyVisitor, and ScalarExprToSql.

Definition at line 171 of file ScalarExprVisitor.h.

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

171  {
172  T result = visit(in_values->get_arg());
173  const auto& value_list = in_values->get_value_list();
174  for (const auto& in_value : value_list) {
175  result = aggregateResult(result, visit(in_value.get()));
176  }
177  return result;
178  }
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:586
const Expr * get_arg() const
Definition: Analyzer.h:584

+ 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 190 of file ScalarExprVisitor.h.

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

190  {
191  T result = defaultResult();
192  result = aggregateResult(result, visit(key_for_string->get_arg()));
193  return result;
194  }
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:705
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, DeepCopyVisitor, and ScalarExprToSql.

Definition at line 212 of file ScalarExprVisitor.h.

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

212  {
213  T result = defaultResult();
214  result = aggregateResult(result, visit(like->get_arg()));
215  result = aggregateResult(result, visit(like->get_like_expr()));
216  if (like->get_escape_expr()) {
217  result = aggregateResult(result, visit(like->get_escape_expr()));
218  }
219  return result;
220  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const Expr * get_escape_expr() const
Definition: Analyzer.h:908
T visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:905
const Expr * get_like_expr() const
Definition: Analyzer.h:907
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 323 of file ScalarExprVisitor.h.

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

323  {
324  return visit(likelihood->get_arg());
325  }
const Expr * get_arg() const
Definition: Analyzer.h:1033
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 202 of file ScalarExprVisitor.h.

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

202  {
203  return visit(lower_expr->get_arg());
204  }
T visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:795

+ 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 327 of file ScalarExprVisitor.h.

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

327  {
328  return defaultResult();
329  }
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 anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, and DeepCopyVisitor.

Definition at line 222 of file ScalarExprVisitor.h.

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

222  {
223  T result = defaultResult();
224  result = aggregateResult(result, visit(regexp->get_arg()));
225  result = aggregateResult(result, visit(regexp->get_pattern_expr()));
226  if (regexp->get_escape_expr()) {
227  result = aggregateResult(result, visit(regexp->get_escape_expr()));
228  }
229  return result;
230  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const Expr * get_escape_expr() const
Definition: Analyzer.h:980
const Expr * get_arg() const
Definition: Analyzer.h:977
T visit(const Analyzer::Expr *expr) const
const Expr * get_pattern_expr() const
Definition: Analyzer.h:979
virtual T defaultResult() const

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitSampleRatio ( const Analyzer::SampleRatioExpr sample_ratio) const
inlineprotectedvirtual

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

Definition at line 196 of file ScalarExprVisitor.h.

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

196  {
197  T result = defaultResult();
198  result = aggregateResult(result, visit(sample_ratio->get_arg()));
199  return result;
200  }
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:750
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, DeepCopyVisitor, and ScalarExprToSql.

Definition at line 158 of file ScalarExprVisitor.h.

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

158  {
159  T result = defaultResult();
160  result = aggregateResult(result, visit(uoper->get_operand()));
161  return result;
162  }
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:371
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, and ScalarExprToSql.

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 >::visitWindowFunction ( const Analyzer::WindowFunction window_func) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor, and ScalarExprToSql.

Definition at line 295 of file ScalarExprVisitor.h.

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

295  {
296  T result = defaultResult();
297  for (const auto& arg : window_func->getArgs()) {
298  result = aggregateResult(result, visit(arg.get()));
299  }
300  for (const auto& partition_key : window_func->getPartitionKeys()) {
301  result = aggregateResult(result, visit(partition_key.get()));
302  }
303  for (const auto& order_key : window_func->getOrderKeys()) {
304  result = aggregateResult(result, visit(order_key.get()));
305  }
306  return result;
307  }
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:1455
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs() const
Definition: Analyzer.h:1449
virtual T defaultResult() const
const std::vector< std::shared_ptr< Analyzer::Expr > > & getPartitionKeys() const
Definition: Analyzer.h:1451

+ Here is the caller graph for this function:


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