OmniSciDB  471d68cefb
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 visitGeoExpr (const Analyzer::GeoExpr *geo_expr) 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 visitWidthBucket (const Analyzer::WidthBucketExpr *width_bucket_expr) 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 anonymous_namespace{IRCodegen.cpp}::ExprTableIdVisitor, AllColumnVarsVisitor, anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, ColumnVarsVisitor, AllRangeTableIndexVisitor, ScalarExprToSql, anonymous_namespace{JoinFilterPushDown.cpp}::CollectInputColumnsVisitor, MaxRangeTableIndexVisitor, anonymous_namespace{ScalarCodeGenerator.cpp}::UsedColumnExpressions, and UsedColumnsVisitor.

Definition at line 367 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 > >::visitGeoExpr(), 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(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitWidthBucket(), and ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitWindowFunction().

367  {
368  return next_result;
369  }

+ Here is the caller graph for this function:

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

Reimplemented in JoinCoveredQualVisitor, TransientDictIdVisitor, ScalarExprToSql, and TransientStringLiteralsVisitor.

Definition at line 371 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 > >::visitGeoExpr(), 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(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitWidthBucket(), and ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitWindowFunction().

371 { 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 Executor::addTransientStringLiterals(), anonymous_namespace{SerializeToSql.cpp}::agg_to_string(), anonymous_namespace{FromTableReordering.cpp}::build_join_cost_graph(), anonymous_namespace{EquiJoinCondition.cpp}::can_combine_with(), QueryPlanDagCache::collectColVars(), find_push_down_filters(), HashJoin::getSyntheticInstance(), HashJoin::normalizeColumnPair(), 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(), ColumnVarsVisitor::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 > >::visitGeoExpr(), 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(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitWidthBucket(), 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 geo_expr = dynamic_cast<const Analyzer::GeoExpr*>(expr);
52  if (geo_expr) {
53  return visitGeoExpr(geo_expr);
54  }
55  const auto in_values = dynamic_cast<const Analyzer::InValues*>(expr);
56  if (in_values) {
57  return visitInValues(in_values);
58  }
59  const auto in_integer_set = dynamic_cast<const Analyzer::InIntegerSet*>(expr);
60  if (in_integer_set) {
61  return visitInIntegerSet(in_integer_set);
62  }
63  const auto char_length = dynamic_cast<const Analyzer::CharLengthExpr*>(expr);
64  if (char_length) {
66  }
67  const auto key_for_string = dynamic_cast<const Analyzer::KeyForStringExpr*>(expr);
68  if (key_for_string) {
69  return visitKeyForString(key_for_string);
70  }
71  const auto sample_ratio = dynamic_cast<const Analyzer::SampleRatioExpr*>(expr);
72  if (sample_ratio) {
74  }
75  const auto width_bucket = dynamic_cast<const Analyzer::WidthBucketExpr*>(expr);
76  if (width_bucket) {
78  }
79  const auto lower = dynamic_cast<const Analyzer::LowerExpr*>(expr);
80  if (lower) {
81  return visitLower(lower);
82  }
83  const auto cardinality = dynamic_cast<const Analyzer::CardinalityExpr*>(expr);
84  if (cardinality) {
85  return visitCardinality(cardinality);
86  }
87  const auto width_bucket_expr = dynamic_cast<const Analyzer::WidthBucketExpr*>(expr);
88  if (width_bucket_expr) {
90  }
91  const auto like_expr = dynamic_cast<const Analyzer::LikeExpr*>(expr);
92  if (like_expr) {
93  return visitLikeExpr(like_expr);
94  }
95  const auto regexp_expr = dynamic_cast<const Analyzer::RegexpExpr*>(expr);
96  if (regexp_expr) {
97  return visitRegexpExpr(regexp_expr);
98  }
99  const auto case_ = dynamic_cast<const Analyzer::CaseExpr*>(expr);
100  if (case_) {
101  return visitCaseExpr(case_);
102  }
103  const auto datetrunc = dynamic_cast<const Analyzer::DatetruncExpr*>(expr);
104  if (datetrunc) {
105  return visitDatetruncExpr(datetrunc);
106  }
107  const auto extract = dynamic_cast<const Analyzer::ExtractExpr*>(expr);
108  if (extract) {
109  return visitExtractExpr(extract);
110  }
111  const auto window_func = dynamic_cast<const Analyzer::WindowFunction*>(expr);
112  if (window_func) {
113  return visitWindowFunction(window_func);
114  }
115  const auto func_with_custom_type_handling =
116  dynamic_cast<const Analyzer::FunctionOperWithCustomTypeHandling*>(expr);
117  if (func_with_custom_type_handling) {
118  return visitFunctionOperWithCustomTypeHandling(func_with_custom_type_handling);
119  }
120  const auto func = dynamic_cast<const Analyzer::FunctionOper*>(expr);
121  if (func) {
122  return visitFunctionOper(func);
123  }
124  const auto array = dynamic_cast<const Analyzer::ArrayExpr*>(expr);
125  if (array) {
126  return visitArrayOper(array);
127  }
128  const auto geo_uop = dynamic_cast<const Analyzer::GeoUOper*>(expr);
129  if (geo_uop) {
130  return visitGeoUOper(geo_uop);
131  }
132  const auto geo_binop = dynamic_cast<const Analyzer::GeoBinOper*>(expr);
133  if (geo_binop) {
134  return visitGeoBinOper(geo_binop);
135  }
136  const auto datediff = dynamic_cast<const Analyzer::DatediffExpr*>(expr);
137  if (datediff) {
138  return visitDatediffExpr(datediff);
139  }
140  const auto dateadd = dynamic_cast<const Analyzer::DateaddExpr*>(expr);
141  if (dateadd) {
142  return visitDateaddExpr(dateadd);
143  }
144  const auto likelihood = dynamic_cast<const Analyzer::LikelihoodExpr*>(expr);
145  if (likelihood) {
146  return visitLikelihood(likelihood);
147  }
148  const auto offset_in_fragment = dynamic_cast<const Analyzer::OffsetInFragment*>(expr);
149  if (offset_in_fragment) {
150  return visitOffsetInFragment(offset_in_fragment);
151  }
152  const auto agg = dynamic_cast<const Analyzer::AggExpr*>(expr);
153  if (agg) {
154  return visitAggExpr(agg);
155  }
156  return defaultResult();
157  }
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 visitGeoExpr(const Analyzer::GeoExpr *geo_expr) 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:837
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:209
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
virtual T visitWidthBucket(const Analyzer::WidthBucketExpr *width_bucket_expr) const
ALWAYS_INLINE DEVICE double width_bucket_expr(const double target_value, const bool reversed, const double lower_bound, const double upper_bound, const int32_t partition_count)
ALWAYS_INLINE DEVICE double width_bucket(const double target_value, const double lower_bound, const double upper_bound, const double scale_factor, const int32_t partition_count)

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

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

361  {
362  T result = defaultResult();
363  return aggregateResult(result, visit(agg->get_arg()));
364  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
Expr * get_arg() const
Definition: Analyzer.h:1250
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 290 of file ScalarExprVisitor.h.

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

290  {
291  T result = defaultResult();
292  for (size_t i = 0; i < array_expr->getElementCount(); ++i) {
293  result = aggregateResult(result, visit(array_expr->getElement(i)));
294  }
295  return result;
296  }
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{IRCodegen.cpp}::ExprTableIdVisitor, anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor, anonymous_namespace{ExpressionRewrite.cpp}::RecursiveOrToInVisitor, DeepCopyVisitor, anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, and ScalarExprToSql.

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(bin_oper->get_left_operand()));
179  result = aggregateResult(result, visit(bin_oper->get_right_operand()));
180  return result;
181  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const Expr * get_right_operand() const
Definition: Analyzer.h:442
T visit(const Analyzer::Expr *expr) const
virtual T defaultResult() const
const Expr * get_left_operand() const
Definition: Analyzer.h:441

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

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

227  {
228  T result = defaultResult();
229  result = aggregateResult(result, visit(cardinality->get_arg()));
230  return result;
231  }
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:897

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

Definition at line 262 of file ScalarExprVisitor.h.

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

262  {
263  T result = defaultResult();
264  const auto& expr_pair_list = case_->get_expr_pair_list();
265  for (const auto& expr_pair : expr_pair_list) {
266  result = aggregateResult(result, visit(expr_pair.first.get()));
267  result = aggregateResult(result, visit(expr_pair.second.get()));
268  }
269  result = aggregateResult(result, visit(case_->get_else_expr()));
270  return result;
271  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const Expr * get_else_expr() const
Definition: Analyzer.h:1307
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:1304

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

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

205  {
206  T result = defaultResult();
207  result = aggregateResult(result, visit(char_length->get_arg()));
208  return result;
209  }
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:702
virtual T defaultResult() const

+ Here is the caller graph for this function:

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

Reimplemented in AllColumnVarsVisitor, ColumnVarsVisitor, AllRangeTableIndexVisitor, MaxRangeTableIndexVisitor, and DeepCopyVisitor.

Definition at line 164 of file ScalarExprVisitor.h.

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

164  {
165  return defaultResult();
166  }
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, ScalarExprToSql, and TransientStringLiteralsVisitor.

Definition at line 168 of file ScalarExprVisitor.h.

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

168 { 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 346 of file ScalarExprVisitor.h.

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

346  {
347  T result = defaultResult();
348  result = aggregateResult(result, visit(dateadd->get_number_expr()));
349  result = aggregateResult(result, visit(dateadd->get_datetime_expr()));
350  return result;
351  }
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:1394
virtual T defaultResult() const
const Expr * get_number_expr() const
Definition: Analyzer.h:1393

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

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

339  {
340  T result = defaultResult();
341  result = aggregateResult(result, visit(datediff->get_start_expr()));
342  result = aggregateResult(result, visit(datediff->get_end_expr()));
343  return result;
344  }
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:1435
const Expr * get_end_expr() const
Definition: Analyzer.h:1436
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 273 of file ScalarExprVisitor.h.

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

273  {
274  T result = defaultResult();
275  result = aggregateResult(result, visit(datetrunc->get_from_expr()));
276  return result;
277  }
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:1477
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 279 of file ScalarExprVisitor.h.

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

279  {
280  T result = defaultResult();
281  result = aggregateResult(result, visit(extract->get_from_expr()));
282  return result;
283  }
const Expr * get_from_expr() const
Definition: Analyzer.h:1352
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, anonymous_namespace{IRCodegen.cpp}::ExprTableIdVisitor, DeepCopyVisitor, and ScalarExprToSql.

Definition at line 317 of file ScalarExprVisitor.h.

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

317  {
318  T result = defaultResult();
319  for (size_t i = 0; i < func_oper->getArity(); ++i) {
320  result = aggregateResult(result, visit(func_oper->getArg(i)));
321  }
322  return result;
323  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
size_t getArity() const
Definition: Analyzer.h:1515
T visit(const Analyzer::Expr *expr) const
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:1517
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 285 of file ScalarExprVisitor.h.

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

286  {
287  return visitFunctionOper(func_oper);
288  }
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 306 of file ScalarExprVisitor.h.

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

306  {
307  T result = defaultResult();
308  for (const auto& arg : geo_expr->getArgs0()) {
309  result = aggregateResult(result, visit(arg.get()));
310  }
311  for (const auto& arg : geo_expr->getArgs1()) {
312  result = aggregateResult(result, visit(arg.get()));
313  }
314  return result;
315  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs0() const
Definition: Analyzer.h:1718
T visit(const Analyzer::Expr *expr) const
virtual T defaultResult() const
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs1() const
Definition: Analyzer.h:1719

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

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

183  {
184  T result = defaultResult();
185  const auto geo_expr_children = geo_expr->getChildExprs();
186  for (const auto expr : geo_expr_children) {
187  result = aggregateResult(result, visit(expr));
188  }
189  return result;
190  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
T visit(const Analyzer::Expr *expr) const
virtual std::vector< Analyzer::Expr * > getChildExprs() const
Definition: Analyzer.h:1840
virtual T defaultResult() const

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

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

298  {
299  T result = defaultResult();
300  for (const auto& arg : geo_expr->getArgs0()) {
301  result = aggregateResult(result, visit(arg.get()));
302  }
303  return result;
304  }
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:1688
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 201 of file ScalarExprVisitor.h.

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

201  {
202  return visit(in_integer_set->get_arg());
203  }
T visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:679

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

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

192  {
193  T result = visit(in_values->get_arg());
194  const auto& value_list = in_values->get_value_list();
195  for (const auto& in_value : value_list) {
196  result = aggregateResult(result, visit(in_value.get()));
197  }
198  return result;
199  }
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:632
const Expr * get_arg() const
Definition: Analyzer.h:630

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

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

211  {
212  T result = defaultResult();
213  result = aggregateResult(result, visit(key_for_string->get_arg()));
214  return result;
215  }
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:751
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 233 of file ScalarExprVisitor.h.

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

233  {
234  T result = defaultResult();
235  result = aggregateResult(result, visit(like->get_arg()));
236  result = aggregateResult(result, visit(like->get_like_expr()));
237  if (like->get_escape_expr()) {
238  result = aggregateResult(result, visit(like->get_escape_expr()));
239  }
240  return result;
241  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const Expr * get_escape_expr() const
Definition: Analyzer.h:954
T visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:951
const Expr * get_like_expr() const
Definition: Analyzer.h:953
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 353 of file ScalarExprVisitor.h.

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

353  {
354  return visit(likelihood->get_arg());
355  }
const Expr * get_arg() const
Definition: Analyzer.h:1187
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 223 of file ScalarExprVisitor.h.

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

223  {
224  return visit(lower_expr->get_arg());
225  }
T visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:841

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

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

357  {
358  return defaultResult();
359  }
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 243 of file ScalarExprVisitor.h.

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

243  {
244  T result = defaultResult();
245  result = aggregateResult(result, visit(regexp->get_arg()));
246  result = aggregateResult(result, visit(regexp->get_pattern_expr()));
247  if (regexp->get_escape_expr()) {
248  result = aggregateResult(result, visit(regexp->get_escape_expr()));
249  }
250  return result;
251  }
virtual T aggregateResult(const T &aggregate, const T &next_result) const
const Expr * get_escape_expr() const
Definition: Analyzer.h:1026
const Expr * get_arg() const
Definition: Analyzer.h:1023
T visit(const Analyzer::Expr *expr) const
const Expr * get_pattern_expr() const
Definition: Analyzer.h:1025
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 217 of file ScalarExprVisitor.h.

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

217  {
218  T result = defaultResult();
219  result = aggregateResult(result, visit(sample_ratio->get_arg()));
220  return result;
221  }
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:796
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{IRCodegen.cpp}::ExprTableIdVisitor, anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor, anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor, TransientDictIdVisitor, DeepCopyVisitor, and ScalarExprToSql.

Definition at line 170 of file ScalarExprVisitor.h.

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

170  {
171  T result = defaultResult();
172  result = aggregateResult(result, visit(uoper->get_operand()));
173  return result;
174  }
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:370
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 160 of file ScalarExprVisitor.h.

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

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

+ Here is the caller graph for this function:

template<class T>
virtual T ScalarExprVisitor< T >::visitWidthBucket ( const Analyzer::WidthBucketExpr width_bucket_expr) const
inlineprotectedvirtual

Reimplemented in DeepCopyVisitor.

Definition at line 253 of file ScalarExprVisitor.h.

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

253  {
254  T result = defaultResult();
255  result = aggregateResult(result, visit(width_bucket_expr->get_target_value()));
256  result = aggregateResult(result, visit(width_bucket_expr->get_lower_bound()));
257  result = aggregateResult(result, visit(width_bucket_expr->get_upper_bound()));
258  result = aggregateResult(result, visit(width_bucket_expr->get_partition_count()));
259  return result;
260  }
const Expr * get_partition_count() const
Definition: Analyzer.h:1091
virtual T aggregateResult(const T &aggregate, const T &next_result) const
T visit(const Analyzer::Expr *expr) const
const Expr * get_target_value() const
Definition: Analyzer.h:1088
virtual T defaultResult() const
const Expr * get_lower_bound() const
Definition: Analyzer.h:1089
const Expr * get_upper_bound() const
Definition: Analyzer.h:1090

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

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

325  {
326  T result = defaultResult();
327  for (const auto& arg : window_func->getArgs()) {
328  result = aggregateResult(result, visit(arg.get()));
329  }
330  for (const auto& partition_key : window_func->getPartitionKeys()) {
331  result = aggregateResult(result, visit(partition_key.get()));
332  }
333  for (const auto& order_key : window_func->getOrderKeys()) {
334  result = aggregateResult(result, visit(order_key.get()));
335  }
336  return result;
337  }
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:1615
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs() const
Definition: Analyzer.h:1609
virtual T defaultResult() const
const std::vector< std::shared_ptr< Analyzer::Expr > > & getPartitionKeys() const
Definition: Analyzer.h:1611

+ Here is the caller graph for this function:


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