OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 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 visitLower (const Analyzer::LowerExpr *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 visitGeoExpr (const Analyzer::GeoExpr *geo_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::Expr
aggregateResult (const std::shared_ptr< Analyzer::Expr > &aggregate, const std::shared_ptr< Analyzer::Expr > &next_result) 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 151 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 153 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().

154  {
155  OrToInVisitor simple_visitor;
156  if (bin_oper->get_optype() == kOR) {
157  auto rewritten = simple_visitor.visit(bin_oper);
158  if (rewritten) {
159  return rewritten;
160  }
161  }
162  auto lhs = bin_oper->get_own_left_operand();
163  auto rhs = bin_oper->get_own_right_operand();
164  auto rewritten_lhs = visit(lhs.get());
165  auto rewritten_rhs = visit(rhs.get());
166  return makeExpr<Analyzer::BinOper>(bin_oper->get_type_info(),
167  bin_oper->get_contains_agg(),
168  bin_oper->get_optype(),
169  bin_oper->get_qualifier(),
170  rewritten_lhs ? rewritten_lhs : lhs,
171  rewritten_rhs ? rewritten_rhs : rhs);
172  }
Definition: sqldefs.h:38
bool get_contains_agg() const
Definition: Analyzer.h:80
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
SQLOps get_optype() const
Definition: Analyzer.h:433
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:78
const std::shared_ptr< Analyzer::Expr > get_own_right_operand() const
Definition: Analyzer.h:441
const std::shared_ptr< Analyzer::Expr > get_own_left_operand() const
Definition: Analyzer.h:438
SQLQualifier get_qualifier() const
Definition: Analyzer.h:435

+ Here is the call graph for this function:


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