OmniSciDB  c07336695a
Analyzer::KeyForStringExpr Class Reference

#include <Analyzer.h>

+ Inheritance diagram for Analyzer::KeyForStringExpr:
+ Collaboration diagram for Analyzer::KeyForStringExpr:

Public Member Functions

 KeyForStringExpr (std::shared_ptr< Analyzer::Expr > a)
 
const Exprget_arg () const
 
const std::shared_ptr< Analyzer::Exprget_own_arg () const
 
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
 
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
 
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 ()
 
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

Definition at line 694 of file Analyzer.h.

Constructor & Destructor Documentation

◆ KeyForStringExpr()

Analyzer::KeyForStringExpr::KeyForStringExpr ( std::shared_ptr< Analyzer::Expr a)
inline

Definition at line 696 of file Analyzer.h.

697  : Expr(kINT, a->get_type_info().get_notnull()), arg(a) {}
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:69
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:731
Definition: sqltypes.h:47

Member Function Documentation

◆ collect_column_var()

void Analyzer::KeyForStringExpr::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 707 of file Analyzer.h.

710  {
711  arg->collect_column_var(colvar_set, include_agg);
712  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:731

◆ collect_rte_idx()

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

Reimplemented from Analyzer::Expr.

Definition at line 704 of file Analyzer.h.

704  {
705  arg->collect_rte_idx(rte_idx_set);
706  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:731

◆ deep_copy()

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

Implements Analyzer::Expr.

Definition at line 126 of file Analyzer.cpp.

126  {
127  return makeExpr<KeyForStringExpr>(arg->deep_copy());
128 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:731

◆ find_expr()

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

Reimplemented from Analyzer::Expr.

Definition at line 2633 of file Analyzer.cpp.

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

2634  {
2635  if (f(this)) {
2636  add_unique(expr_list);
2637  return;
2638  }
2639  arg->find_expr(f, expr_list);
2640 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:731
virtual void add_unique(std::list< const Expr *> &expr_list) const
Definition: Analyzer.cpp:2585
+ Here is the call graph for this function:

◆ get_arg()

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

Definition at line 698 of file Analyzer.h.

Referenced by CodeGenerator::codegen(), operator==(), DeepCopyVisitor::visitKeyForString(), and ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitKeyForString().

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

◆ get_own_arg()

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

Definition at line 699 of file Analyzer.h.

699 { return arg; }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:731

◆ group_predicates()

void Analyzer::KeyForStringExpr::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 1485 of file Analyzer.cpp.

References Analyzer::InIntegerSet::arg.

1487  {
1488  std::set<int> rte_idx_set;
1489  arg->collect_rte_idx(rte_idx_set);
1490  if (rte_idx_set.size() > 1) {
1491  join_predicates.push_back(this);
1492  } else if (rte_idx_set.size() == 1) {
1493  scan_predicates.push_back(this);
1494  } else {
1495  const_predicates.push_back(this);
1496  }
1497 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:731

◆ operator==()

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

Implements Analyzer::Expr.

Definition at line 2038 of file Analyzer.cpp.

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

2038  {
2039  if (typeid(rhs) != typeid(KeyForStringExpr)) {
2040  return false;
2041  }
2042  const KeyForStringExpr& rhs_cl = dynamic_cast<const KeyForStringExpr&>(rhs);
2043  if (!(*arg == *rhs_cl.get_arg())) {
2044  return false;
2045  }
2046  return true;
2047 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:731
KeyForStringExpr(std::shared_ptr< Analyzer::Expr > a)
Definition: Analyzer.h:696
+ Here is the call graph for this function:

◆ rewrite_agg_to_var()

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

Reimplemented from Analyzer::Expr.

Definition at line 721 of file Analyzer.h.

References operator==().

722  {
723  return makeExpr<KeyForStringExpr>(arg->rewrite_agg_to_var(tlist));
724  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:731
+ Here is the call graph for this function:

◆ rewrite_with_child_targetlist()

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

Reimplemented from Analyzer::Expr.

Definition at line 717 of file Analyzer.h.

718  {
719  return makeExpr<KeyForStringExpr>(arg->rewrite_with_child_targetlist(tlist));
720  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:731

◆ rewrite_with_targetlist()

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

Reimplemented from Analyzer::Expr.

Definition at line 713 of file Analyzer.h.

714  {
715  return makeExpr<KeyForStringExpr>(arg->rewrite_with_targetlist(tlist));
716  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:731

◆ toString()

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

Implements Analyzer::Expr.

Definition at line 2422 of file Analyzer.cpp.

References Analyzer::InIntegerSet::arg.

2422  {
2423  std::string str{"KEY_FOR_STRING("};
2424  str += arg->toString();
2425  str += ") ";
2426  return str;
2427 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:731

Member Data Documentation

◆ arg

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

Definition at line 731 of file Analyzer.h.


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