OmniSciDB  ca0c39ec8f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{ExpressionRewrite.cpp}::RecursiveOrToInVisitor Class Reference
+ Inheritance diagram for anonymous_namespace{ExpressionRewrite.cpp}::RecursiveOrToInVisitor:
+ Collaboration diagram for anonymous_namespace{ExpressionRewrite.cpp}::RecursiveOrToInVisitor:

Protected Member Functions

std::shared_ptr< Analyzer::ExprvisitBinOper (const Analyzer::BinOper *bin_oper) const override
 
- Protected Member Functions inherited from DeepCopyVisitor
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 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 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
 
- Protected Types inherited from DeepCopyVisitor
using RetType = std::shared_ptr< Analyzer::Expr >
 

Detailed Description

Definition at line 161 of file ExpressionRewrite.cpp.

Member Function Documentation

std::shared_ptr<Analyzer::Expr> anonymous_namespace{ExpressionRewrite.cpp}::RecursiveOrToInVisitor::visitBinOper ( const Analyzer::BinOper bin_oper) const
inlineoverrideprotectedvirtual

Reimplemented from DeepCopyVisitor.

Definition at line 163 of file ExpressionRewrite.cpp.

References Analyzer::Expr::get_contains_agg(), Analyzer::BinOper::get_optype(), Analyzer::BinOper::get_own_left_operand(), Analyzer::BinOper::get_own_right_operand(), Analyzer::BinOper::get_qualifier(), Analyzer::Expr::get_type_info(), kOR, and ScalarExprVisitor< T >::visit().

164  {
165  OrToInVisitor simple_visitor;
166  if (bin_oper->get_optype() == kOR) {
167  auto rewritten = simple_visitor.visit(bin_oper);
168  if (rewritten) {
169  return rewritten;
170  }
171  }
172  auto lhs = bin_oper->get_own_left_operand();
173  auto rhs = bin_oper->get_own_right_operand();
174  auto rewritten_lhs = visit(lhs.get());
175  auto rewritten_rhs = visit(rhs.get());
176  return makeExpr<Analyzer::BinOper>(bin_oper->get_type_info(),
177  bin_oper->get_contains_agg(),
178  bin_oper->get_optype(),
179  bin_oper->get_qualifier(),
180  rewritten_lhs ? rewritten_lhs : lhs,
181  rewritten_rhs ? rewritten_rhs : rhs);
182  }
Definition: sqldefs.h:37
bool get_contains_agg() const
Definition: Analyzer.h:84
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
SQLOps get_optype() const
Definition: Analyzer.h:447
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:82
const std::shared_ptr< Analyzer::Expr > get_own_right_operand() const
Definition: Analyzer.h:455
const std::shared_ptr< Analyzer::Expr > get_own_left_operand() const
Definition: Analyzer.h:452
SQLQualifier get_qualifier() const
Definition: Analyzer.h:449

+ Here is the call graph for this function:


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