OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Analyzer::CardinalityExpr Class Reference

#include <Analyzer.h>

+ Inheritance diagram for Analyzer::CardinalityExpr:
+ Collaboration diagram for Analyzer::CardinalityExpr:

Public Member Functions

 CardinalityExpr (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 1003 of file Analyzer.h.

Constructor & Destructor Documentation

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

Definition at line 1005 of file Analyzer.h.

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

Member Function Documentation

void Analyzer::CardinalityExpr::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 1016 of file Analyzer.h.

References arg.

1019  {
1020  arg->collect_column_var(colvar_set, include_agg);
1021  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:1040
void Analyzer::CardinalityExpr::collect_rte_idx ( std::set< int > &  rte_idx_set) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 1013 of file Analyzer.h.

References arg.

1013  {
1014  arg->collect_rte_idx(rte_idx_set);
1015  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:1040
std::shared_ptr< Analyzer::Expr > Analyzer::CardinalityExpr::deep_copy ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 165 of file Analyzer.cpp.

References arg.

165  {
166  return makeExpr<CardinalityExpr>(arg->deep_copy());
167 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:1040
void Analyzer::CardinalityExpr::find_expr ( std::function< bool(const Expr *)>  f,
std::list< const Expr * > &  expr_list 
) const
overridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 3349 of file Analyzer.cpp.

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

3350  {
3351  if (f(this)) {
3352  add_unique(expr_list);
3353  return;
3354  }
3355  arg->find_expr(f, expr_list);
3356 }
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)
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:1040

+ Here is the call graph for this function:

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

Definition at line 1007 of file Analyzer.h.

References arg.

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

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

+ Here is the caller graph for this function:

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

Definition at line 1008 of file Analyzer.h.

References arg.

1008 { return arg; }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:1040
void Analyzer::CardinalityExpr::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 1801 of file Analyzer.cpp.

References arg.

1803  {
1804  std::set<int> rte_idx_set;
1805  arg->collect_rte_idx(rte_idx_set);
1806  if (rte_idx_set.size() > 1) {
1807  join_predicates.push_back(this);
1808  } else if (rte_idx_set.size() == 1) {
1809  scan_predicates.push_back(this);
1810  } else {
1811  const_predicates.push_back(this);
1812  }
1813 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:1040
bool Analyzer::CardinalityExpr::operator== ( const Expr rhs) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2457 of file Analyzer.cpp.

References arg, and get_arg().

2457  {
2458  if (typeid(rhs) != typeid(CardinalityExpr)) {
2459  return false;
2460  }
2461  const CardinalityExpr& rhs_ca = dynamic_cast<const CardinalityExpr&>(rhs);
2462  if (!(*arg == *rhs_ca.get_arg())) {
2463  return false;
2464  }
2465  return true;
2466 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:1040
CardinalityExpr(std::shared_ptr< Analyzer::Expr > a)
Definition: Analyzer.h:1005

+ Here is the call graph for this function:

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

Reimplemented from Analyzer::Expr.

Definition at line 1030 of file Analyzer.h.

References arg.

1031  {
1032  return makeExpr<CardinalityExpr>(arg->rewrite_agg_to_var(tlist));
1033  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:1040
std::shared_ptr<Analyzer::Expr> Analyzer::CardinalityExpr::rewrite_with_child_targetlist ( const std::vector< std::shared_ptr< TargetEntry >> &  tlist) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 1026 of file Analyzer.h.

References arg.

1027  {
1028  return makeExpr<CardinalityExpr>(arg->rewrite_with_child_targetlist(tlist));
1029  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:1040
std::shared_ptr<Analyzer::Expr> Analyzer::CardinalityExpr::rewrite_with_targetlist ( const std::vector< std::shared_ptr< TargetEntry >> &  tlist) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 1022 of file Analyzer.h.

References arg.

1023  {
1024  return makeExpr<CardinalityExpr>(arg->rewrite_with_targetlist(tlist));
1025  }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:1040
std::string Analyzer::CardinalityExpr::toString ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2971 of file Analyzer.cpp.

References arg.

2971  {
2972  std::string str{"CARDINALITY("};
2973  str += arg->toString();
2974  str += ") ";
2975  return str;
2976 }
std::shared_ptr< Analyzer::Expr > arg
Definition: Analyzer.h:1040

Member Data Documentation


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