OmniSciDB  c07336695a
DeepCopyVisitor Class Reference

#include <DeepCopyVisitor.h>

+ Inheritance diagram for DeepCopyVisitor:
+ Collaboration diagram for DeepCopyVisitor:

Protected Types

using RetType = std::shared_ptr< Analyzer::Expr >
 

Protected Member Functions

RetType visitColumnVar (const Analyzer::ColumnVar *col_var) const override
 
RetType visitColumnVarTuple (const Analyzer::ExpressionTuple *col_var_tuple) const override
 
RetType visitVar (const Analyzer::Var *var) const override
 
RetType visitConstant (const Analyzer::Constant *constant) const override
 
RetType visitUOper (const Analyzer::UOper *uoper) const override
 
RetType visitBinOper (const Analyzer::BinOper *bin_oper) const override
 
RetType visitInValues (const Analyzer::InValues *in_values) const override
 
RetType visitInIntegerSet (const Analyzer::InIntegerSet *in_integer_set) const override
 
RetType visitCharLength (const Analyzer::CharLengthExpr *char_length) const override
 
RetType visitKeyForString (const Analyzer::KeyForStringExpr *expr) const override
 
RetType visitCardinality (const Analyzer::CardinalityExpr *cardinality) const override
 
RetType visitLikeExpr (const Analyzer::LikeExpr *like) const override
 
RetType visitRegexpExpr (const Analyzer::RegexpExpr *regexp) const override
 
RetType visitCaseExpr (const Analyzer::CaseExpr *case_expr) const override
 
RetType visitDatetruncExpr (const Analyzer::DatetruncExpr *datetrunc) const override
 
RetType visitExtractExpr (const Analyzer::ExtractExpr *extract) const override
 
RetType visitArrayOper (const Analyzer::ArrayExpr *array_expr) const override
 
RetType visitWindowFunction (const Analyzer::WindowFunction *window_func) const override
 
RetType visitFunctionOper (const Analyzer::FunctionOper *func_oper) const override
 
RetType visitDatediffExpr (const Analyzer::DatediffExpr *datediff) const override
 
RetType visitDateaddExpr (const Analyzer::DateaddExpr *dateadd) const override
 
RetType visitFunctionOperWithCustomTypeHandling (const Analyzer::FunctionOperWithCustomTypeHandling *func_oper) const override
 
RetType visitLikelihood (const Analyzer::LikelihoodExpr *likelihood) const override
 
RetType visitAggExpr (const Analyzer::AggExpr *agg) const override
 
RetType visitOffsetInFragment (const Analyzer::OffsetInFragment *) const override
 
- Protected Member Functions inherited from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >
virtual std::shared_ptr< Analyzer::ExpraggregateResult (const std::shared_ptr< Analyzer::Expr > &aggregate, const std::shared_ptr< Analyzer::Expr > &next_result) const
 
virtual std::shared_ptr< Analyzer::ExprdefaultResult () const
 

Additional Inherited Members

- Public Member Functions inherited from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >
std::shared_ptr< Analyzer::Exprvisit (const Analyzer::Expr *expr) const
 

Detailed Description

Definition at line 19 of file DeepCopyVisitor.h.

Member Typedef Documentation

◆ RetType

using DeepCopyVisitor::RetType = std::shared_ptr<Analyzer::Expr>
protected

Definition at line 21 of file DeepCopyVisitor.h.

Member Function Documentation

◆ visitAggExpr()

RetType DeepCopyVisitor::visitAggExpr ( const Analyzer::AggExpr agg) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 197 of file DeepCopyVisitor.h.

References Analyzer::AggExpr::get_aggtype(), Analyzer::AggExpr::get_arg(), Analyzer::AggExpr::get_error_rate(), Analyzer::AggExpr::get_is_distinct(), Analyzer::Expr::get_type_info(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

197  {
198  RetType arg = agg->get_arg() ? visit(agg->get_arg()) : nullptr;
199  return makeExpr<Analyzer::AggExpr>(agg->get_type_info(),
200  agg->get_aggtype(),
201  arg,
202  agg->get_is_distinct(),
203  agg->get_error_rate());
204  }
std::shared_ptr< Analyzer::Expr > RetType
Expr * get_arg() const
Definition: Analyzer.h:988
SQLAgg get_aggtype() const
Definition: Analyzer.h:987
bool get_is_distinct() const
Definition: Analyzer.h:990
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
std::shared_ptr< Analyzer::Constant > get_error_rate() const
Definition: Analyzer.h:991
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:77
+ Here is the call graph for this function:

◆ visitArrayOper()

RetType DeepCopyVisitor::visitArrayOper ( const Analyzer::ArrayExpr array_expr) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Reimplemented in anonymous_namespace{ExpressionRewrite.cpp}::ArrayElementStringLiteralEncodingVisitor.

Definition at line 125 of file DeepCopyVisitor.h.

References Analyzer::Expr::get_type_info(), Analyzer::ArrayExpr::getElement(), Analyzer::ArrayExpr::getElementCount(), Analyzer::ArrayExpr::getExprIndex(), Analyzer::ArrayExpr::isLocalAlloc(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

125  {
126  std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
127  for (size_t i = 0; i < array_expr->getElementCount(); ++i) {
128  args_copy.push_back(visit(array_expr->getElement(i)));
129  }
130  const auto& type_info = array_expr->get_type_info();
131  return makeExpr<Analyzer::ArrayExpr>(
132  type_info, args_copy, array_expr->getExprIndex(), array_expr->isLocalAlloc());
133  }
size_t getElementCount() const
Definition: Analyzer.h:1380
bool isLocalAlloc() const
Definition: Analyzer.h:1382
int32_t getExprIndex() const
Definition: Analyzer.h:1381
const Analyzer::Expr * getElement(const size_t i) const
Definition: Analyzer.h:1384
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:77
+ Here is the call graph for this function:

◆ visitBinOper()

RetType DeepCopyVisitor::visitBinOper ( const Analyzer::BinOper bin_oper) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

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

Definition at line 44 of file DeepCopyVisitor.h.

References Analyzer::Expr::get_contains_agg(), Analyzer::BinOper::get_left_operand(), Analyzer::BinOper::get_optype(), Analyzer::BinOper::get_qualifier(), Analyzer::BinOper::get_right_operand(), Analyzer::Expr::get_type_info(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

44  {
45  return makeExpr<Analyzer::BinOper>(bin_oper->get_type_info(),
46  bin_oper->get_contains_agg(),
47  bin_oper->get_optype(),
48  bin_oper->get_qualifier(),
49  visit(bin_oper->get_left_operand()),
50  visit(bin_oper->get_right_operand()));
51  }
SQLQualifier get_qualifier() const
Definition: Analyzer.h:434
SQLOps get_optype() const
Definition: Analyzer.h:432
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:77
bool get_contains_agg() const
Definition: Analyzer.h:79
const Expr * get_right_operand() const
Definition: Analyzer.h:436
const Expr * get_left_operand() const
Definition: Analyzer.h:435
+ Here is the call graph for this function:

◆ visitCardinality()

RetType DeepCopyVisitor::visitCardinality ( const Analyzer::CardinalityExpr cardinality) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 78 of file DeepCopyVisitor.h.

References Analyzer::CardinalityExpr::get_arg(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

78  {
79  return makeExpr<Analyzer::CardinalityExpr>(visit(cardinality->get_arg()));
80  }
const Expr * get_arg() const
Definition: Analyzer.h:743
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
+ Here is the call graph for this function:

◆ visitCaseExpr()

RetType DeepCopyVisitor::visitCaseExpr ( const Analyzer::CaseExpr case_expr) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 98 of file DeepCopyVisitor.h.

References Analyzer::Expr::get_contains_agg(), Analyzer::CaseExpr::get_else_expr(), Analyzer::CaseExpr::get_expr_pair_list(), Analyzer::Expr::get_type_info(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

98  {
99  std::list<std::pair<RetType, RetType>> new_list;
100  for (auto p : case_expr->get_expr_pair_list()) {
101  new_list.emplace_back(visit(p.first.get()), visit(p.second.get()));
102  }
103  auto else_expr = case_expr->get_else_expr();
104  return makeExpr<Analyzer::CaseExpr>(
105  case_expr->get_type_info(),
106  case_expr->get_contains_agg(),
107  new_list,
108  else_expr == nullptr ? nullptr : visit(else_expr));
109  }
const Expr * get_else_expr() const
Definition: Analyzer.h:1044
const std::list< std::pair< std::shared_ptr< Analyzer::Expr >, std::shared_ptr< Analyzer::Expr > > > & get_expr_pair_list() const
Definition: Analyzer.h:1041
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:77
bool get_contains_agg() const
Definition: Analyzer.h:79
+ Here is the call graph for this function:

◆ visitCharLength()

RetType DeepCopyVisitor::visitCharLength ( const Analyzer::CharLengthExpr char_length) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 69 of file DeepCopyVisitor.h.

References Analyzer::CharLengthExpr::get_arg(), Analyzer::CharLengthExpr::get_calc_encoded_length(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

69  {
70  return makeExpr<Analyzer::CharLengthExpr>(visit(char_length->get_arg()),
71  char_length->get_calc_encoded_length());
72  }
bool get_calc_encoded_length() const
Definition: Analyzer.h:651
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:649
+ Here is the call graph for this function:

◆ visitColumnVar()

RetType DeepCopyVisitor::visitColumnVar ( const Analyzer::ColumnVar col_var) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Reimplemented in anonymous_namespace{JoinFilterPushDown.cpp}::BindFilterToOutermostVisitor.

Definition at line 22 of file DeepCopyVisitor.h.

References Analyzer::ColumnVar::deep_copy().

22  {
23  return col_var->deep_copy();
24  }
std::shared_ptr< Analyzer::Expr > deep_copy() const override
Definition: Analyzer.cpp:59
+ Here is the call graph for this function:

◆ visitColumnVarTuple()

RetType DeepCopyVisitor::visitColumnVarTuple ( const Analyzer::ExpressionTuple col_var_tuple) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 26 of file DeepCopyVisitor.h.

References Analyzer::ExpressionTuple::deep_copy().

27  {
28  return col_var_tuple->deep_copy();
29  }
std::shared_ptr< Analyzer::Expr > deep_copy() const override
Definition: Analyzer.cpp:69
+ Here is the call graph for this function:

◆ visitConstant()

RetType DeepCopyVisitor::visitConstant ( const Analyzer::Constant constant) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 33 of file DeepCopyVisitor.h.

References Analyzer::Constant::deep_copy().

33  {
34  return constant->deep_copy();
35  }
std::shared_ptr< Analyzer::Expr > deep_copy() const override
Definition: Analyzer.cpp:84
+ Here is the call graph for this function:

◆ visitDateaddExpr()

RetType DeepCopyVisitor::visitDateaddExpr ( const Analyzer::DateaddExpr dateadd) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 174 of file DeepCopyVisitor.h.

References Analyzer::DateaddExpr::get_datetime_expr(), Analyzer::DateaddExpr::get_field(), Analyzer::DateaddExpr::get_number_expr(), Analyzer::Expr::get_type_info(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

174  {
175  return makeExpr<Analyzer::DateaddExpr>(dateadd->get_type_info(),
176  dateadd->get_field(),
177  visit(dateadd->get_number_expr()),
178  visit(dateadd->get_datetime_expr()));
179  }
const Expr * get_datetime_expr() const
Definition: Analyzer.h:1131
DateaddField get_field() const
Definition: Analyzer.h:1129
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:77
const Expr * get_number_expr() const
Definition: Analyzer.h:1130
+ Here is the call graph for this function:

◆ visitDatediffExpr()

RetType DeepCopyVisitor::visitDatediffExpr ( const Analyzer::DatediffExpr datediff) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 167 of file DeepCopyVisitor.h.

References Analyzer::DatediffExpr::get_end_expr(), Analyzer::DatediffExpr::get_field(), Analyzer::DatediffExpr::get_start_expr(), Analyzer::Expr::get_type_info(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

167  {
168  return makeExpr<Analyzer::DatediffExpr>(datediff->get_type_info(),
169  datediff->get_field(),
170  visit(datediff->get_start_expr()),
171  visit(datediff->get_end_expr()));
172  }
const Expr * get_start_expr() const
Definition: Analyzer.h:1172
DatetruncField get_field() const
Definition: Analyzer.h:1171
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:77
const Expr * get_end_expr() const
Definition: Analyzer.h:1173
+ Here is the call graph for this function:

◆ visitDatetruncExpr()

RetType DeepCopyVisitor::visitDatetruncExpr ( const Analyzer::DatetruncExpr datetrunc) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 111 of file DeepCopyVisitor.h.

References Analyzer::Expr::get_contains_agg(), Analyzer::DatetruncExpr::get_field(), Analyzer::DatetruncExpr::get_from_expr(), Analyzer::Expr::get_type_info(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

111  {
112  return makeExpr<Analyzer::DatetruncExpr>(datetrunc->get_type_info(),
113  datetrunc->get_contains_agg(),
114  datetrunc->get_field(),
115  visit(datetrunc->get_from_expr()));
116  }
DatetruncField get_field() const
Definition: Analyzer.h:1213
const Expr * get_from_expr() const
Definition: Analyzer.h:1214
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:77
bool get_contains_agg() const
Definition: Analyzer.h:79
+ Here is the call graph for this function:

◆ visitExtractExpr()

RetType DeepCopyVisitor::visitExtractExpr ( const Analyzer::ExtractExpr extract) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 118 of file DeepCopyVisitor.h.

References Analyzer::Expr::get_contains_agg(), Analyzer::ExtractExpr::get_field(), Analyzer::ExtractExpr::get_from_expr(), Analyzer::Expr::get_type_info(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

118  {
119  return makeExpr<Analyzer::ExtractExpr>(extract->get_type_info(),
120  extract->get_contains_agg(),
121  extract->get_field(),
122  visit(extract->get_from_expr()));
123  }
const Expr * get_from_expr() const
Definition: Analyzer.h:1089
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:77
bool get_contains_agg() const
Definition: Analyzer.h:79
ExtractField get_field() const
Definition: Analyzer.h:1088
+ Here is the call graph for this function:

◆ visitFunctionOper()

RetType DeepCopyVisitor::visitFunctionOper ( const Analyzer::FunctionOper func_oper) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 158 of file DeepCopyVisitor.h.

References Analyzer::Expr::get_type_info(), Analyzer::FunctionOper::getArg(), Analyzer::FunctionOper::getArity(), Analyzer::FunctionOper::getName(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

158  {
159  std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
160  for (size_t i = 0; i < func_oper->getArity(); ++i) {
161  args_copy.push_back(visit(func_oper->getArg(i)));
162  }
163  const auto& type_info = func_oper->get_type_info();
164  return makeExpr<Analyzer::FunctionOper>(type_info, func_oper->getName(), args_copy);
165  }
std::string getName() const
Definition: Analyzer.h:1250
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:1254
size_t getArity() const
Definition: Analyzer.h:1252
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:77
+ Here is the call graph for this function:

◆ visitFunctionOperWithCustomTypeHandling()

RetType DeepCopyVisitor::visitFunctionOperWithCustomTypeHandling ( const Analyzer::FunctionOperWithCustomTypeHandling func_oper) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 181 of file DeepCopyVisitor.h.

References Analyzer::Expr::get_type_info(), Analyzer::FunctionOper::getArg(), Analyzer::FunctionOper::getArity(), Analyzer::FunctionOper::getName(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

182  {
183  std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
184  for (size_t i = 0; i < func_oper->getArity(); ++i) {
185  args_copy.push_back(visit(func_oper->getArg(i)));
186  }
187  const auto& type_info = func_oper->get_type_info();
188  return makeExpr<Analyzer::FunctionOperWithCustomTypeHandling>(
189  type_info, func_oper->getName(), args_copy);
190  }
std::string getName() const
Definition: Analyzer.h:1250
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:1254
size_t getArity() const
Definition: Analyzer.h:1252
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:77
+ Here is the call graph for this function:

◆ visitInIntegerSet()

RetType DeepCopyVisitor::visitInIntegerSet ( const Analyzer::InIntegerSet in_integer_set) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 62 of file DeepCopyVisitor.h.

References Analyzer::InIntegerSet::get_arg(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_notnull(), Analyzer::Expr::get_type_info(), Analyzer::InIntegerSet::get_value_list(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

62  {
63  return makeExpr<Analyzer::InIntegerSet>(
64  visit(in_integer_set->get_arg()),
65  in_integer_set->get_value_list(),
66  in_integer_set->get_type_info().get_notnull());
67  }
const Expr * get_arg() const
Definition: Analyzer.h:626
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:326
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:77
const std::vector< int64_t > & get_value_list() const
Definition: Analyzer.h:628
+ Here is the call graph for this function:

◆ visitInValues()

RetType DeepCopyVisitor::visitInValues ( const Analyzer::InValues in_values) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 53 of file DeepCopyVisitor.h.

References Analyzer::InValues::get_arg(), Analyzer::InValues::get_value_list(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

53  {
54  const auto& value_list = in_values->get_value_list();
55  std::list<RetType> new_list;
56  for (const auto in_value : value_list) {
57  new_list.push_back(visit(in_value.get()));
58  }
59  return makeExpr<Analyzer::InValues>(visit(in_values->get_arg()), new_list);
60  }
const Expr * get_arg() const
Definition: Analyzer.h:577
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const std::list< std::shared_ptr< Analyzer::Expr > > & get_value_list() const
Definition: Analyzer.h:579
+ Here is the call graph for this function:

◆ visitKeyForString()

RetType DeepCopyVisitor::visitKeyForString ( const Analyzer::KeyForStringExpr expr) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 74 of file DeepCopyVisitor.h.

References Analyzer::KeyForStringExpr::get_arg(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

74  {
75  return makeExpr<Analyzer::KeyForStringExpr>(visit(expr->get_arg()));
76  }
const Expr * get_arg() const
Definition: Analyzer.h:698
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
+ Here is the call graph for this function:

◆ visitLikeExpr()

RetType DeepCopyVisitor::visitLikeExpr ( const Analyzer::LikeExpr like) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 82 of file DeepCopyVisitor.h.

References Analyzer::LikeExpr::get_arg(), Analyzer::LikeExpr::get_escape_expr(), Analyzer::LikeExpr::get_is_ilike(), Analyzer::LikeExpr::get_is_simple(), Analyzer::LikeExpr::get_like_expr(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

82  {
83  auto escape_expr = like->get_escape_expr();
84  return makeExpr<Analyzer::LikeExpr>(visit(like->get_arg()),
85  visit(like->get_like_expr()),
86  escape_expr ? visit(escape_expr) : nullptr,
87  like->get_is_ilike(),
88  like->get_is_simple());
89  }
const Expr * get_arg() const
Definition: Analyzer.h:797
const Expr * get_escape_expr() const
Definition: Analyzer.h:800
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const Expr * get_like_expr() const
Definition: Analyzer.h:799
+ Here is the call graph for this function:

◆ visitLikelihood()

RetType DeepCopyVisitor::visitLikelihood ( const Analyzer::LikelihoodExpr likelihood) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 192 of file DeepCopyVisitor.h.

References Analyzer::LikelihoodExpr::get_arg(), Analyzer::LikelihoodExpr::get_likelihood(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

192  {
193  return makeExpr<Analyzer::LikelihoodExpr>(visit(likelihood->get_arg()),
194  likelihood->get_likelihood());
195  }
float get_likelihood() const
Definition: Analyzer.h:927
const Expr * get_arg() const
Definition: Analyzer.h:925
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
+ Here is the call graph for this function:

◆ visitOffsetInFragment()

RetType DeepCopyVisitor::visitOffsetInFragment ( const Analyzer::OffsetInFragment ) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 206 of file DeepCopyVisitor.h.

206  {
207  return makeExpr<Analyzer::OffsetInFragment>();
208  }

◆ visitRegexpExpr()

RetType DeepCopyVisitor::visitRegexpExpr ( const Analyzer::RegexpExpr regexp) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 91 of file DeepCopyVisitor.h.

References Analyzer::RegexpExpr::get_arg(), Analyzer::RegexpExpr::get_escape_expr(), Analyzer::RegexpExpr::get_pattern_expr(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

91  {
92  auto escape_expr = regexp->get_escape_expr();
93  return makeExpr<Analyzer::RegexpExpr>(visit(regexp->get_arg()),
94  visit(regexp->get_pattern_expr()),
95  escape_expr ? visit(escape_expr) : nullptr);
96  }
const Expr * get_arg() const
Definition: Analyzer.h:869
const Expr * get_pattern_expr() const
Definition: Analyzer.h:871
const Expr * get_escape_expr() const
Definition: Analyzer.h:872
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
+ Here is the call graph for this function:

◆ visitUOper()

RetType DeepCopyVisitor::visitUOper ( const Analyzer::UOper uoper) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Reimplemented in anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor.

Definition at line 37 of file DeepCopyVisitor.h.

References Analyzer::Expr::get_contains_agg(), Analyzer::UOper::get_operand(), Analyzer::UOper::get_optype(), Analyzer::Expr::get_type_info(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

37  {
38  return makeExpr<Analyzer::UOper>(uoper->get_type_info(),
39  uoper->get_contains_agg(),
40  uoper->get_optype(),
41  visit(uoper->get_operand()));
42  }
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:77
bool get_contains_agg() const
Definition: Analyzer.h:79
SQLOps get_optype() const
Definition: Analyzer.h:363
const Expr * get_operand() const
Definition: Analyzer.h:364
+ Here is the call graph for this function:

◆ visitVar()

RetType DeepCopyVisitor::visitVar ( const Analyzer::Var var) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 31 of file DeepCopyVisitor.h.

References Analyzer::Var::deep_copy().

31 { return var->deep_copy(); }
std::shared_ptr< Analyzer::Expr > deep_copy() const override
Definition: Analyzer.cpp:80
+ Here is the call graph for this function:

◆ visitWindowFunction()

RetType DeepCopyVisitor::visitWindowFunction ( const Analyzer::WindowFunction window_func) const
inlineoverrideprotectedvirtual

Reimplemented from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >.

Definition at line 135 of file DeepCopyVisitor.h.

References Analyzer::Expr::get_type_info(), Analyzer::WindowFunction::getArgs(), Analyzer::WindowFunction::getCollation(), Analyzer::WindowFunction::getKind(), Analyzer::WindowFunction::getOrderKeys(), Analyzer::WindowFunction::getPartitionKeys(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

136  {
137  std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
138  for (const auto& arg : window_func->getArgs()) {
139  args_copy.push_back(visit(arg.get()));
140  }
141  std::vector<std::shared_ptr<Analyzer::Expr>> partition_keys_copy;
142  for (const auto& partition_key : window_func->getPartitionKeys()) {
143  partition_keys_copy.push_back(visit(partition_key.get()));
144  }
145  std::vector<std::shared_ptr<Analyzer::Expr>> order_keys_copy;
146  for (const auto& order_key : window_func->getOrderKeys()) {
147  order_keys_copy.push_back(visit(order_key.get()));
148  }
149  const auto& type_info = window_func->get_type_info();
150  return makeExpr<Analyzer::WindowFunction>(type_info,
151  window_func->getKind(),
152  args_copy,
153  partition_keys_copy,
154  order_keys_copy,
155  window_func->getCollation());
156  }
const std::vector< std::shared_ptr< Analyzer::Expr > > & getOrderKeys() const
Definition: Analyzer.h:1347
const std::vector< OrderEntry > & getCollation() const
Definition: Analyzer.h:1351
const std::vector< std::shared_ptr< Analyzer::Expr > > & getPartitionKeys() const
Definition: Analyzer.h:1343
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs() const
Definition: Analyzer.h:1341
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:77
SqlWindowFunctionKind getKind() const
Definition: Analyzer.h:1339
+ Here is the call graph for this function:

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