OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 visitGeoExpr (const Analyzer::GeoExpr *geo_expr) 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 visitSampleRatio (const Analyzer::SampleRatioExpr *expr) const override
 
RetType visitMLPredict (const Analyzer::MLPredictExpr *expr) const override
 
RetType visitPCAProject (const Analyzer::PCAProjectExpr *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 visitWidthBucket (const Analyzer::WidthBucketExpr *width_bucket_expr) 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 visitGeoUOper (const Analyzer::GeoUOper *geo_expr) const override
 
RetType visitGeoBinOper (const Analyzer::GeoBinOper *geo_expr) const override
 
RetType visitWindowFunction (const Analyzer::WindowFunction *window_func) const override
 
RetType visitStringOper (const Analyzer::StringOper *string_oper) 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::Expr
visitRangeJoinOper (const Analyzer::RangeOper *range_oper) const
 
virtual std::shared_ptr
< Analyzer::Expr
aggregateResult (const std::shared_ptr< Analyzer::Expr > &aggregate, const std::shared_ptr< Analyzer::Expr > &next_result) const
 
virtual void visitBegin () const
 
virtual std::shared_ptr
< Analyzer::Expr
defaultResult () 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

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

Definition at line 21 of file DeepCopyVisitor.h.

Member Function Documentation

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

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

Definition at line 256 of file DeepCopyVisitor.h.

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

256  {
257  RetType arg = agg->get_arg() ? visit(agg->get_arg()) : nullptr;
258  return makeExpr<Analyzer::AggExpr>(agg->get_type_info(),
259  agg->get_aggtype(),
260  arg,
261  agg->get_is_distinct(),
262  agg->get_arg1());
263  }
Expr * get_arg() const
Definition: Analyzer.h:1330
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
std::shared_ptr< Analyzer::Expr > RetType
bool get_is_distinct() const
Definition: Analyzer.h:1332
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
std::shared_ptr< Analyzer::Expr > get_arg1() const
Definition: Analyzer.h:1333
SQLAgg get_aggtype() const
Definition: Analyzer.h:1329

+ Here is the call graph for this function:

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 150 of file DeepCopyVisitor.h.

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

150  {
151  std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
152  for (size_t i = 0; i < array_expr->getElementCount(); ++i) {
153  args_copy.push_back(visit(array_expr->getElement(i)));
154  }
155  const auto& type_info = array_expr->get_type_info();
156  return makeExpr<Analyzer::ArrayExpr>(
157  type_info, args_copy, array_expr->isNull(), array_expr->isLocalAlloc());
158  }
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
bool isNull() const
Definition: Analyzer.h:2894
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
size_t getElementCount() const
Definition: Analyzer.h:2892
bool isLocalAlloc() const
Definition: Analyzer.h:2893
const Analyzer::Expr * getElement(const size_t i) const
Definition: Analyzer.h:2896

+ Here is the call graph for this function:

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  }
const Expr * get_right_operand() const
Definition: Analyzer.h:456
bool get_contains_agg() const
Definition: Analyzer.h:81
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
SQLOps get_optype() const
Definition: Analyzer.h:452
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
const Expr * get_left_operand() const
Definition: Analyzer.h:455
SQLQualifier get_qualifier() const
Definition: Analyzer.h:454

+ Here is the call graph for this function:

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

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

Definition at line 94 of file DeepCopyVisitor.h.

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

94  {
95  return makeExpr<Analyzer::CardinalityExpr>(visit(cardinality->get_arg()));
96  }
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:1007

+ Here is the call graph for this function:

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

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

Definition at line 123 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().

123  {
124  std::list<std::pair<RetType, RetType>> new_list;
125  for (auto p : case_expr->get_expr_pair_list()) {
126  new_list.emplace_back(visit(p.first.get()), visit(p.second.get()));
127  }
128  auto else_expr = case_expr->get_else_expr();
129  return makeExpr<Analyzer::CaseExpr>(
130  case_expr->get_type_info(),
131  case_expr->get_contains_agg(),
132  new_list,
133  else_expr == nullptr ? nullptr : visit(else_expr));
134  }
const Expr * get_else_expr() const
Definition: Analyzer.h:1387
bool get_contains_agg() const
Definition: Analyzer.h:81
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
const std::list< std::pair< std::shared_ptr< Analyzer::Expr >, std::shared_ptr< Analyzer::Expr > > > & get_expr_pair_list() const
Definition: Analyzer.h:1384

+ Here is the call graph for this function:

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

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

Definition at line 73 of file DeepCopyVisitor.h.

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

73  {
74  return makeExpr<Analyzer::CharLengthExpr>(visit(char_length->get_arg()),
75  char_length->get_calc_encoded_length());
76  }
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
bool get_calc_encoded_length() const
Definition: Analyzer.h:870
const Expr * get_arg() const
Definition: Analyzer.h:868

+ Here is the call graph for this function:

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:66

+ Here is the call graph for this function:

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:76

+ Here is the call graph for this function:

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:91

+ Here is the call graph for this function:

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

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

Definition at line 233 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().

233  {
234  return makeExpr<Analyzer::DateaddExpr>(dateadd->get_type_info(),
235  dateadd->get_field(),
236  visit(dateadd->get_number_expr()),
237  visit(dateadd->get_datetime_expr()));
238  }
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
const Expr * get_datetime_expr() const
Definition: Analyzer.h:1478
DateaddField get_field() const
Definition: Analyzer.h:1476
const Expr * get_number_expr() const
Definition: Analyzer.h:1477

+ Here is the call graph for this function:

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

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

Definition at line 226 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().

226  {
227  return makeExpr<Analyzer::DatediffExpr>(datediff->get_type_info(),
228  datediff->get_field(),
229  visit(datediff->get_start_expr()),
230  visit(datediff->get_end_expr()));
231  }
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const Expr * get_start_expr() const
Definition: Analyzer.h:1525
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
const Expr * get_end_expr() const
Definition: Analyzer.h:1526
DatetruncField get_field() const
Definition: Analyzer.h:1524

+ Here is the call graph for this function:

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

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

Definition at line 136 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().

136  {
137  return makeExpr<Analyzer::DatetruncExpr>(datetrunc->get_type_info(),
138  datetrunc->get_contains_agg(),
139  datetrunc->get_field(),
140  visit(datetrunc->get_from_expr()));
141  }
bool get_contains_agg() const
Definition: Analyzer.h:81
DatetruncField get_field() const
Definition: Analyzer.h:1566
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
const Expr * get_from_expr() const
Definition: Analyzer.h:1567

+ Here is the call graph for this function:

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

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

Definition at line 143 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().

143  {
144  return makeExpr<Analyzer::ExtractExpr>(extract->get_type_info(),
145  extract->get_contains_agg(),
146  extract->get_field(),
147  visit(extract->get_from_expr()));
148  }
const Expr * get_from_expr() const
Definition: Analyzer.h:1432
ExtractField get_field() const
Definition: Analyzer.h:1431
bool get_contains_agg() const
Definition: Analyzer.h:81
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79

+ Here is the call graph for this function:

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

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

Definition at line 217 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().

217  {
218  std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
219  for (size_t i = 0; i < func_oper->getArity(); ++i) {
220  args_copy.push_back(visit(func_oper->getArg(i)));
221  }
222  const auto& type_info = func_oper->get_type_info();
223  return makeExpr<Analyzer::FunctionOper>(type_info, func_oper->getName(), args_copy);
224  }
size_t getArity() const
Definition: Analyzer.h:2615
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:2617
std::string getName() const
Definition: Analyzer.h:2613

+ Here is the call graph for this function:

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

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

Definition at line 240 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().

241  {
242  std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
243  for (size_t i = 0; i < func_oper->getArity(); ++i) {
244  args_copy.push_back(visit(func_oper->getArg(i)));
245  }
246  const auto& type_info = func_oper->get_type_info();
247  return makeExpr<Analyzer::FunctionOperWithCustomTypeHandling>(
248  type_info, func_oper->getName(), args_copy);
249  }
size_t getArity() const
Definition: Analyzer.h:2615
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:2617
std::string getName() const
Definition: Analyzer.h:2613

+ Here is the call graph for this function:

RetType DeepCopyVisitor::visitGeoBinOper ( const Analyzer::GeoBinOper geo_expr) const
inlineoverrideprotectedvirtual

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

Definition at line 170 of file DeepCopyVisitor.h.

References Analyzer::Expr::get_type_info(), Analyzer::GeoBinOper::getArgs0(), Analyzer::GeoBinOper::getArgs1(), Analyzer::GeoBinOper::getOp(), Analyzer::GeoBinOper::getTypeInfo0(), Analyzer::GeoBinOper::getTypeInfo1(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

170  {
171  std::vector<std::shared_ptr<Analyzer::Expr>> args0_copy;
172  for (const auto& arg : geo_expr->getArgs0()) {
173  args0_copy.push_back(visit(arg.get()));
174  }
175  std::vector<std::shared_ptr<Analyzer::Expr>> args1_copy;
176  for (const auto& arg : geo_expr->getArgs1()) {
177  args1_copy.push_back(visit(arg.get()));
178  }
179  const auto& ti0 = geo_expr->getTypeInfo0();
180  const auto& ti1 = geo_expr->getTypeInfo1();
181  const auto& type_info = geo_expr->get_type_info();
182  return makeExpr<Analyzer::GeoBinOper>(
183  geo_expr->getOp(), type_info, ti0, ti1, args0_copy, args1_copy);
184  }
const SQLTypeInfo getTypeInfo0() const
Definition: Analyzer.h:2960
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs0() const
Definition: Analyzer.h:2962
const SQLTypeInfo getTypeInfo1() const
Definition: Analyzer.h:2961
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
Geospatial::GeoBase::GeoOp getOp() const
Definition: Analyzer.h:2959
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs1() const
Definition: Analyzer.h:2963

+ Here is the call graph for this function:

RetType DeepCopyVisitor::visitGeoExpr ( const Analyzer::GeoExpr geo_expr) const
inlineoverrideprotectedvirtual

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

Definition at line 53 of file DeepCopyVisitor.h.

References Analyzer::Expr::deep_copy().

53  {
54  return geo_expr->deep_copy();
55  }
virtual std::shared_ptr< Analyzer::Expr > deep_copy() const =0

+ Here is the call graph for this function:

RetType DeepCopyVisitor::visitGeoUOper ( const Analyzer::GeoUOper geo_expr) const
inlineoverrideprotectedvirtual

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

Definition at line 160 of file DeepCopyVisitor.h.

References Analyzer::Expr::get_type_info(), Analyzer::GeoUOper::getArgs0(), Analyzer::GeoUOper::getOp(), Analyzer::GeoUOper::getTypeInfo0(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

160  {
161  std::vector<std::shared_ptr<Analyzer::Expr>> args0_copy;
162  for (const auto& arg : geo_expr->getArgs0()) {
163  args0_copy.push_back(visit(arg.get()));
164  }
165  const auto& ti0 = geo_expr->getTypeInfo0();
166  const auto& type_info = geo_expr->get_type_info();
167  return makeExpr<Analyzer::GeoUOper>(geo_expr->getOp(), type_info, ti0, args0_copy);
168  }
const SQLTypeInfo getTypeInfo0() const
Definition: Analyzer.h:2931
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs0() const
Definition: Analyzer.h:2932
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
Geospatial::GeoBase::GeoOp getOp() const
Definition: Analyzer.h:2930

+ Here is the call graph for this function:

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

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

Definition at line 66 of file DeepCopyVisitor.h.

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

66  {
67  return makeExpr<Analyzer::InIntegerSet>(
68  visit(in_integer_set->get_arg()),
69  in_integer_set->get_value_list(),
70  in_integer_set->get_type_info().get_notnull());
71  }
const std::vector< int64_t > & get_value_list() const
Definition: Analyzer.h:695
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
const Expr * get_arg() const
Definition: Analyzer.h:693
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:398

+ Here is the call graph for this function:

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

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

Definition at line 57 of file DeepCopyVisitor.h.

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

57  {
58  const auto& value_list = in_values->get_value_list();
59  std::list<RetType> new_list;
60  for (const auto& in_value : value_list) {
61  new_list.push_back(visit(in_value.get()));
62  }
63  return makeExpr<Analyzer::InValues>(visit(in_values->get_arg()), new_list);
64  }
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:646
const Expr * get_arg() const
Definition: Analyzer.h:644

+ Here is the call graph for this function:

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

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

Definition at line 78 of file DeepCopyVisitor.h.

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

78  {
79  return makeExpr<Analyzer::KeyForStringExpr>(visit(expr->get_arg()));
80  }
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:917

+ Here is the call graph for this function:

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

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

Definition at line 98 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().

98  {
99  auto escape_expr = like->get_escape_expr();
100  return makeExpr<Analyzer::LikeExpr>(visit(like->get_arg()),
101  visit(like->get_like_expr()),
102  escape_expr ? visit(escape_expr) : nullptr,
103  like->get_is_ilike(),
104  like->get_is_simple());
105  }
const Expr * get_escape_expr() const
Definition: Analyzer.h:1064
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:1061
const Expr * get_like_expr() const
Definition: Analyzer.h:1063

+ Here is the call graph for this function:

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

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

Definition at line 251 of file DeepCopyVisitor.h.

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

251  {
252  return makeExpr<Analyzer::LikelihoodExpr>(visit(likelihood->get_arg()),
253  likelihood->get_likelihood());
254  }
float get_likelihood() const
Definition: Analyzer.h:1269
const Expr * get_arg() const
Definition: Analyzer.h:1267
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const

+ Here is the call graph for this function:

RetType DeepCopyVisitor::visitMLPredict ( const Analyzer::MLPredictExpr expr) const
inlineoverrideprotectedvirtual

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

Definition at line 86 of file DeepCopyVisitor.h.

References Analyzer::MLPredictExpr::deep_copy().

86  {
87  return expr->deep_copy();
88  }
std::shared_ptr< Analyzer::Expr > deep_copy() const override
Definition: Analyzer.cpp:136

+ Here is the call graph for this function:

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

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

Definition at line 265 of file DeepCopyVisitor.h.

265  {
266  return makeExpr<Analyzer::OffsetInFragment>();
267  }
RetType DeepCopyVisitor::visitPCAProject ( const Analyzer::PCAProjectExpr expr) const
inlineoverrideprotectedvirtual

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

Definition at line 90 of file DeepCopyVisitor.h.

References Analyzer::PCAProjectExpr::deep_copy().

90  {
91  return expr->deep_copy();
92  }
std::shared_ptr< Analyzer::Expr > deep_copy() const override
Definition: Analyzer.cpp:144

+ Here is the call graph for this function:

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

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

Definition at line 107 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().

107  {
108  auto escape_expr = regexp->get_escape_expr();
109  return makeExpr<Analyzer::RegexpExpr>(visit(regexp->get_arg()),
110  visit(regexp->get_pattern_expr()),
111  escape_expr ? visit(escape_expr) : nullptr);
112  }
const Expr * get_escape_expr() const
Definition: Analyzer.h:1136
const Expr * get_arg() const
Definition: Analyzer.h:1133
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const Expr * get_pattern_expr() const
Definition: Analyzer.h:1135

+ Here is the call graph for this function:

RetType DeepCopyVisitor::visitSampleRatio ( const Analyzer::SampleRatioExpr expr) const
inlineoverrideprotectedvirtual

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

Definition at line 82 of file DeepCopyVisitor.h.

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

82  {
83  return makeExpr<Analyzer::SampleRatioExpr>(visit(expr->get_arg()));
84  }
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const Expr * get_arg() const
Definition: Analyzer.h:962

+ Here is the call graph for this function:

RetType DeepCopyVisitor::visitStringOper ( const Analyzer::StringOper string_oper) const
inlineoverrideprotectedvirtual

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

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

Definition at line 213 of file DeepCopyVisitor.h.

References Analyzer::StringOper::deep_copy().

213  {
214  return string_oper->deep_copy();
215  }
std::shared_ptr< Analyzer::Expr > deep_copy() const override
Definition: Analyzer.cpp:3681

+ Here is the call graph for this function:

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  }
bool get_contains_agg() const
Definition: Analyzer.h:81
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
const Expr * get_operand() const
Definition: Analyzer.h:384
SQLOps get_optype() const
Definition: Analyzer.h:383

+ Here is the call graph for this function:

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:87

+ Here is the call graph for this function:

RetType DeepCopyVisitor::visitWidthBucket ( const Analyzer::WidthBucketExpr width_bucket_expr) const
inlineoverrideprotectedvirtual

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

Definition at line 114 of file DeepCopyVisitor.h.

References Analyzer::WidthBucketExpr::get_lower_bound(), Analyzer::WidthBucketExpr::get_partition_count(), Analyzer::WidthBucketExpr::get_target_value(), Analyzer::WidthBucketExpr::get_upper_bound(), and ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >::visit().

115  {
116  return makeExpr<Analyzer::WidthBucketExpr>(
117  visit(width_bucket_expr->get_target_value()),
118  visit(width_bucket_expr->get_lower_bound()),
119  visit(width_bucket_expr->get_upper_bound()),
120  visit(width_bucket_expr->get_partition_count()));
121  }
const Expr * get_partition_count() const
Definition: Analyzer.h:1201
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const Expr * get_target_value() const
Definition: Analyzer.h:1198
const Expr * get_lower_bound() const
Definition: Analyzer.h:1199
const Expr * get_upper_bound() const
Definition: Analyzer.h:1200

+ Here is the call graph for this function:

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

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

Definition at line 186 of file DeepCopyVisitor.h.

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

187  {
188  std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
189  for (const auto& arg : window_func->getArgs()) {
190  args_copy.push_back(visit(arg.get()));
191  }
192  std::vector<std::shared_ptr<Analyzer::Expr>> partition_keys_copy;
193  for (const auto& partition_key : window_func->getPartitionKeys()) {
194  partition_keys_copy.push_back(visit(partition_key.get()));
195  }
196  std::vector<std::shared_ptr<Analyzer::Expr>> order_keys_copy;
197  for (const auto& order_key : window_func->getOrderKeys()) {
198  order_keys_copy.push_back(visit(order_key.get()));
199  }
200  const auto& type_info = window_func->get_type_info();
201  return makeExpr<Analyzer::WindowFunction>(
202  type_info,
203  window_func->getKind(),
204  args_copy,
205  partition_keys_copy,
206  order_keys_copy,
207  window_func->getFrameBoundType(),
208  window_func->getFrameStartBound()->deep_copy(),
209  window_func->getFrameEndBound()->deep_copy(),
210  window_func->getCollation());
211  }
SqlWindowFunctionKind getKind() const
Definition: Analyzer.h:2794
const Analyzer::WindowFrame * getFrameStartBound() const
Definition: Analyzer.h:2806
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
const Analyzer::WindowFrame * getFrameEndBound() const
Definition: Analyzer.h:2813
const std::vector< std::shared_ptr< Analyzer::Expr > > & getOrderKeys() const
Definition: Analyzer.h:2802
const std::vector< OrderEntry > & getCollation() const
Definition: Analyzer.h:2820
std::shared_ptr< Analyzer::Expr > deep_copy() const override
Definition: Analyzer.cpp:234
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs() const
Definition: Analyzer.h:2796
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
Analyzer::WindowFunction::FrameBoundType getFrameBoundType() const
Definition: Analyzer.h:2822
const std::vector< std::shared_ptr< Analyzer::Expr > > & getPartitionKeys() const
Definition: Analyzer.h:2798

+ Here is the call graph for this function:


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