OmniSciDB  c07336695a
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 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
 
- Protected Types inherited from DeepCopyVisitor
using RetType = std::shared_ptr< Analyzer::Expr >
 

Detailed Description

Definition at line 149 of file ExpressionRewrite.cpp.

Member Function Documentation

◆ visitBinOper()

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

Reimplemented from DeepCopyVisitor.

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

152  {
153  OrToInVisitor simple_visitor;
154  if (bin_oper->get_optype() == kOR) {
155  auto rewritten = simple_visitor.visit(bin_oper);
156  if (rewritten) {
157  return rewritten;
158  }
159  }
160  auto lhs = bin_oper->get_own_left_operand();
161  auto rhs = bin_oper->get_own_right_operand();
162  auto rewritten_lhs = visit(lhs.get());
163  auto rewritten_rhs = visit(rhs.get());
164  return makeExpr<Analyzer::BinOper>(bin_oper->get_type_info(),
165  bin_oper->get_contains_agg(),
166  bin_oper->get_optype(),
167  bin_oper->get_qualifier(),
168  rewritten_lhs ? rewritten_lhs : lhs,
169  rewritten_rhs ? rewritten_rhs : rhs);
170  }
SQLQualifier get_qualifier() const
Definition: Analyzer.h:434
Definition: sqldefs.h:38
SQLOps get_optype() const
Definition: Analyzer.h:432
const std::shared_ptr< Analyzer::Expr > get_own_left_operand() const
Definition: Analyzer.h:437
const std::shared_ptr< Analyzer::Expr > get_own_right_operand() const
Definition: Analyzer.h:440
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:

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