OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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::Expr
get_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 (std::function< bool(const Expr *)> f, 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::Expr
add_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::Expr
normalize_simple_predicate (int &rte_idx) const
 
virtual size_t get_num_column_vars (const bool include_agg) 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 913 of file Analyzer.h.

Constructor & Destructor Documentation

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

Definition at line 915 of file Analyzer.h.

916  : Expr(kINT, a->get_type_info().get_notnull()), arg(a) {}
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:70
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:950
constexpr double a
Definition: Utm.h:32
Definition: sqltypes.h:72

Member Function Documentation

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 926 of file Analyzer.h.

References arg.

929  {
930  arg->collect_column_var(colvar_set, include_agg);
931  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:950
void Analyzer::KeyForStringExpr::collect_rte_idx ( std::set< int > &  rte_idx_set) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 923 of file Analyzer.h.

References arg.

923  {
924  arg->collect_rte_idx(rte_idx_set);
925  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:950
std::shared_ptr< Analyzer::Expr > Analyzer::KeyForStringExpr::deep_copy ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 157 of file Analyzer.cpp.

References arg.

157  {
158  return makeExpr<KeyForStringExpr>(arg->deep_copy());
159 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:950
void Analyzer::KeyForStringExpr::find_expr ( std::function< bool(const Expr *)>  f,
std::list< const Expr * > &  expr_list 
) const
overridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 3320 of file Analyzer.cpp.

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

3321  {
3322  if (f(this)) {
3323  add_unique(expr_list);
3324  return;
3325  }
3326  arg->find_expr(f, expr_list);
3327 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:950
virtual void add_unique(std::list< const Expr * > &expr_list) const
Definition: Analyzer.cpp:3248
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)

+ Here is the call graph for this function:

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

Definition at line 917 of file Analyzer.h.

References arg.

Referenced by CodeGenerator::codegen(), operator==(), DeepCopyVisitor::visitKeyForString(), and ScalarExprVisitor< std::set< shared::TableKey > >::visitKeyForString().

917 { return arg.get(); }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:950

+ Here is the caller graph for this function:

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

Definition at line 918 of file Analyzer.h.

References arg.

918 { return arg; }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:950
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 1725 of file Analyzer.cpp.

References arg.

1727  {
1728  std::set<int> rte_idx_set;
1729  arg->collect_rte_idx(rte_idx_set);
1730  if (rte_idx_set.size() > 1) {
1731  join_predicates.push_back(this);
1732  } else if (rte_idx_set.size() == 1) {
1733  scan_predicates.push_back(this);
1734  } else {
1735  const_predicates.push_back(this);
1736  }
1737 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:950
bool Analyzer::KeyForStringExpr::operator== ( const Expr rhs) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2391 of file Analyzer.cpp.

References arg, and get_arg().

2391  {
2392  if (typeid(rhs) != typeid(KeyForStringExpr)) {
2393  return false;
2394  }
2395  const KeyForStringExpr& rhs_cl = dynamic_cast<const KeyForStringExpr&>(rhs);
2396  if (!(*arg == *rhs_cl.get_arg())) {
2397  return false;
2398  }
2399  return true;
2400 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:950
KeyForStringExpr(std::shared_ptr< Analyzer::Expr > a)
Definition: Analyzer.h:915

+ Here is the call graph for this function:

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 940 of file Analyzer.h.

References arg.

941  {
942  return makeExpr<KeyForStringExpr>(arg->rewrite_agg_to_var(tlist));
943  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:950
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 936 of file Analyzer.h.

References arg.

937  {
938  return makeExpr<KeyForStringExpr>(arg->rewrite_with_child_targetlist(tlist));
939  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:950
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 932 of file Analyzer.h.

References arg.

933  {
934  return makeExpr<KeyForStringExpr>(arg->rewrite_with_targetlist(tlist));
935  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:950
std::string Analyzer::KeyForStringExpr::toString ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2957 of file Analyzer.cpp.

References arg.

2957  {
2958  std::string str{"KEY_FOR_STRING("};
2959  str += arg->toString();
2960  str += ") ";
2961  return str;
2962 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:950

Member Data Documentation


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