OmniSciDB  085a039ca4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Analyzer::SampleRatioExpr Class Reference

#include <Analyzer.h>

+ Inheritance diagram for Analyzer::SampleRatioExpr:
+ Collaboration diagram for Analyzer::SampleRatioExpr:

Public Member Functions

 SampleRatioExpr (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 (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::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 800 of file Analyzer.h.

Constructor & Destructor Documentation

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

Definition at line 802 of file Analyzer.h.

803  : Expr(kBOOLEAN, a->get_type_info().get_notnull()), arg(a) {}
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:72
constexpr double a
Definition: Utm.h:32
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:837

Member Function Documentation

void Analyzer::SampleRatioExpr::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 813 of file Analyzer.h.

References arg.

816  {
817  arg->collect_column_var(colvar_set, include_agg);
818  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:837
void Analyzer::SampleRatioExpr::collect_rte_idx ( std::set< int > &  rte_idx_set) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 810 of file Analyzer.h.

References arg.

810  {
811  arg->collect_rte_idx(rte_idx_set);
812  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:837
std::shared_ptr< Analyzer::Expr > Analyzer::SampleRatioExpr::deep_copy ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 146 of file Analyzer.cpp.

References arg.

146  {
147  return makeExpr<SampleRatioExpr>(arg->deep_copy());
148 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:837
void Analyzer::SampleRatioExpr::find_expr ( bool(*)(const Expr *)  f,
std::list< const Expr * > &  expr_list 
) const
overridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 3045 of file Analyzer.cpp.

References Analyzer::Expr::add_unique(), arg, and anonymous_namespace{Utm.h}::f.

3046  {
3047  if (f(this)) {
3048  add_unique(expr_list);
3049  return;
3050  }
3051  arg->find_expr(f, expr_list);
3052 }
virtual void add_unique(std::list< const Expr * > &expr_list) const
Definition: Analyzer.cpp:2988
constexpr double f
Definition: Utm.h:31
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:837

+ Here is the call graph for this function:

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

Definition at line 804 of file Analyzer.h.

References arg.

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

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

+ Here is the caller graph for this function:

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

Definition at line 805 of file Analyzer.h.

References arg.

805 { return arg; }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:837
void Analyzer::SampleRatioExpr::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 1651 of file Analyzer.cpp.

References arg.

1653  {
1654  std::set<int> rte_idx_set;
1655  arg->collect_rte_idx(rte_idx_set);
1656  if (rte_idx_set.size() > 1) {
1657  join_predicates.push_back(this);
1658  } else if (rte_idx_set.size() == 1) {
1659  scan_predicates.push_back(this);
1660  } else {
1661  const_predicates.push_back(this);
1662  }
1663 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:837
bool Analyzer::SampleRatioExpr::operator== ( const Expr rhs) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2283 of file Analyzer.cpp.

References arg, and get_arg().

2283  {
2284  if (typeid(rhs) != typeid(SampleRatioExpr)) {
2285  return false;
2286  }
2287  const SampleRatioExpr& rhs_cl = dynamic_cast<const SampleRatioExpr&>(rhs);
2288  if (!(*arg == *rhs_cl.get_arg())) {
2289  return false;
2290  }
2291  return true;
2292 }
SampleRatioExpr(std::shared_ptr< Analyzer::Expr > a)
Definition: Analyzer.h:802
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:837

+ Here is the call graph for this function:

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

Reimplemented from Analyzer::Expr.

Definition at line 827 of file Analyzer.h.

References arg.

828  {
829  return makeExpr<SampleRatioExpr>(arg->rewrite_agg_to_var(tlist));
830  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:837
std::shared_ptr<Analyzer::Expr> Analyzer::SampleRatioExpr::rewrite_with_child_targetlist ( const std::vector< std::shared_ptr< TargetEntry >> &  tlist) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 823 of file Analyzer.h.

References arg.

824  {
825  return makeExpr<SampleRatioExpr>(arg->rewrite_with_child_targetlist(tlist));
826  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:837
std::shared_ptr<Analyzer::Expr> Analyzer::SampleRatioExpr::rewrite_with_targetlist ( const std::vector< std::shared_ptr< TargetEntry >> &  tlist) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 819 of file Analyzer.h.

References arg.

820  {
821  return makeExpr<SampleRatioExpr>(arg->rewrite_with_targetlist(tlist));
822  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:837
std::string Analyzer::SampleRatioExpr::toString ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2757 of file Analyzer.cpp.

References arg.

2757  {
2758  std::string str{"SAMPLE_RATIO("};
2759  str += arg->toString();
2760  str += ") ";
2761  return str;
2762 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:837

Member Data Documentation


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