OmniSciDB  dfae7c3b14
Analyzer::LowerExpr Class Reference

Expression class for the LOWER (lowercase) string function. The "arg" constructor parameter must be an expression that resolves to a string datatype (e.g. TEXT). More...

#include <Analyzer.h>

+ Inheritance diagram for Analyzer::LowerExpr:
+ Collaboration diagram for Analyzer::LowerExpr:

Public Member Functions

 LowerExpr (std::shared_ptr< Analyzer::Expr > arg)
 
const Exprget_arg () const
 
const std::shared_ptr< Analyzer::Exprget_own_arg () const
 
void collect_rte_idx (std::set< int > &rte_idx_set) const override
 
void collect_column_var (std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const override
 
std::shared_ptr< Analyzer::Exprrewrite_with_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
 
std::shared_ptr< Analyzer::Exprrewrite_with_child_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
 
std::shared_ptr< Analyzer::Exprrewrite_agg_to_var (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
 
std::shared_ptr< Analyzer::Exprdeep_copy () const override
 
void group_predicates (std::list< const Expr *> &scan_predicates, std::list< const Expr *> &join_predicates, std::list< const Expr *> &const_predicates) const override
 
bool operator== (const Expr &rhs) const override
 
std::string toString () const override
 
void find_expr (bool(*f)(const Expr *), std::list< const Expr *> &expr_list) const override
 
- Public Member Functions inherited from Analyzer::Expr
 Expr (SQLTypes t, bool notnull)
 
 Expr (SQLTypes t, int d, bool notnull)
 
 Expr (SQLTypes t, int d, int s, bool notnull)
 
 Expr (const SQLTypeInfo &ti, bool has_agg=false)
 
virtual ~Expr ()
 
std::shared_ptr< Analyzer::Exprget_shared_ptr ()
 
const SQLTypeInfoget_type_info () const
 
void set_type_info (const SQLTypeInfo &ti)
 
bool get_contains_agg () const
 
void set_contains_agg (bool a)
 
virtual std::shared_ptr< Analyzer::Expradd_cast (const SQLTypeInfo &new_type_info)
 
virtual void check_group_by (const std::list< std::shared_ptr< Analyzer::Expr >> &groupby) const
 
virtual std::shared_ptr< Analyzer::Exprnormalize_simple_predicate (int &rte_idx) const
 
virtual void print () const
 
virtual void add_unique (std::list< const Expr *> &expr_list) const
 
std::shared_ptr< Analyzer::Exprdecompress ()
 
virtual void get_domain (DomainSet &domain_set) const
 

Private Attributes

std::shared_ptr< Analyzer::Exprarg
 

Additional Inherited Members

- Protected Attributes inherited from Analyzer::Expr
SQLTypeInfo type_info
 
bool contains_agg
 

Detailed Description

Expression class for the LOWER (lowercase) string function. The "arg" constructor parameter must be an expression that resolves to a string datatype (e.g. TEXT).

Definition at line 791 of file Analyzer.h.

Constructor & Destructor Documentation

◆ LowerExpr()

Analyzer::LowerExpr::LowerExpr ( std::shared_ptr< Analyzer::Expr arg)
inline

Definition at line 793 of file Analyzer.h.

793 : Expr(arg->get_type_info()), arg(arg) {}
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:69
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:839

Member Function Documentation

◆ collect_column_var()

void Analyzer::LowerExpr::collect_column_var ( std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &  colvar_set,
bool  include_agg 
) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 803 of file Analyzer.h.

806  {
807  arg->collect_column_var(colvar_set, include_agg);
808  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:839

◆ collect_rte_idx()

void Analyzer::LowerExpr::collect_rte_idx ( std::set< int > &  rte_idx_set) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 799 of file Analyzer.h.

799  {
800  arg->collect_rte_idx(rte_idx_set);
801  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:839

◆ deep_copy()

std::shared_ptr< Analyzer::Expr > Analyzer::LowerExpr::deep_copy ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 134 of file Analyzer.cpp.

134  {
135  return makeExpr<LowerExpr>(arg->deep_copy());
136 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:839

◆ find_expr()

void Analyzer::LowerExpr::find_expr ( bool(*)(const Expr *)  f,
std::list< const Expr *> &  expr_list 
) const
overridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 2881 of file Analyzer.cpp.

References Analyzer::Expr::add_unique(), and Analyzer::InIntegerSet::arg.

2882  {
2883  if (f(this)) {
2884  add_unique(expr_list);
2885  } else {
2886  arg->find_expr(f, expr_list);
2887  }
2888 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:839
virtual void add_unique(std::list< const Expr *> &expr_list) const
Definition: Analyzer.cpp:2815
+ Here is the call graph for this function:

◆ get_arg()

const Expr* Analyzer::LowerExpr::get_arg ( ) const
inline

Definition at line 795 of file Analyzer.h.

Referenced by CodeGenerator::codegen(), DeepCopyVisitor::visitLower(), ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitLower(), and anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitLower().

795 { return arg.get(); }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:839
+ Here is the caller graph for this function:

◆ get_own_arg()

const std::shared_ptr<Analyzer::Expr> Analyzer::LowerExpr::get_own_arg ( ) const
inline

Definition at line 797 of file Analyzer.h.

Referenced by anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitLower().

797 { return arg; }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:839
+ Here is the caller graph for this function:

◆ group_predicates()

void Analyzer::LowerExpr::group_predicates ( std::list< const Expr *> &  scan_predicates,
std::list< const Expr *> &  join_predicates,
std::list< const Expr *> &  const_predicates 
) const
overridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 1596 of file Analyzer.cpp.

References Analyzer::InIntegerSet::arg.

1598  {
1599  std::set<int> rte_idx_set;
1600  arg->collect_rte_idx(rte_idx_set);
1601  if (rte_idx_set.size() > 1) {
1602  join_predicates.push_back(this);
1603  } else if (rte_idx_set.size() == 1) {
1604  scan_predicates.push_back(this);
1605  } else {
1606  const_predicates.push_back(this);
1607  }
1608 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:839

◆ operator==()

bool Analyzer::LowerExpr::operator== ( const Expr rhs) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2171 of file Analyzer.cpp.

References Analyzer::InIntegerSet::arg, and Analyzer::InIntegerSet::get_arg().

2171  {
2172  if (typeid(rhs) != typeid(LowerExpr)) {
2173  return false;
2174  }
2175 
2176  return *arg == *dynamic_cast<const LowerExpr&>(rhs).get_arg();
2177 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:839
const Expr * get_arg() const
Definition: Analyzer.h:795
LowerExpr(std::shared_ptr< Analyzer::Expr > arg)
Definition: Analyzer.h:793
+ Here is the call graph for this function:

◆ rewrite_agg_to_var()

std::shared_ptr<Analyzer::Expr> Analyzer::LowerExpr::rewrite_agg_to_var ( const std::vector< std::shared_ptr< TargetEntry >> &  tlist) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 820 of file Analyzer.h.

References operator==(), and toString().

821  {
822  return makeExpr<LowerExpr>(arg->rewrite_agg_to_var(tlist));
823  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:839
+ Here is the call graph for this function:

◆ rewrite_with_child_targetlist()

std::shared_ptr<Analyzer::Expr> Analyzer::LowerExpr::rewrite_with_child_targetlist ( const std::vector< std::shared_ptr< TargetEntry >> &  tlist) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 815 of file Analyzer.h.

816  {
817  return makeExpr<LowerExpr>(arg->rewrite_with_child_targetlist(tlist));
818  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:839

◆ rewrite_with_targetlist()

std::shared_ptr<Analyzer::Expr> Analyzer::LowerExpr::rewrite_with_targetlist ( const std::vector< std::shared_ptr< TargetEntry >> &  tlist) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 810 of file Analyzer.h.

811  {
812  return makeExpr<LowerExpr>(arg->rewrite_with_targetlist(tlist));
813  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:839

◆ toString()

std::string Analyzer::LowerExpr::toString ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2599 of file Analyzer.cpp.

References Analyzer::InIntegerSet::arg.

2599  {
2600  return "LOWER(" + arg->toString() + ") ";
2601 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:839

Member Data Documentation

◆ arg

std::shared_ptr<Analyzer::Expr> Analyzer::LowerExpr::arg
private

Definition at line 839 of file Analyzer.h.


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