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

#include <Analyzer.h>

+ Inheritance diagram for Analyzer::FunctionOper:
+ Collaboration diagram for Analyzer::FunctionOper:

Public Member Functions

 FunctionOper (const SQLTypeInfo &ti, const std::string &name, const std::vector< std::shared_ptr< Analyzer::Expr >> &args)
 
std::string getName () const
 
size_t getArity () const
 
const Analyzer::ExprgetArg (const size_t i) const
 
std::shared_ptr< Analyzer::ExprgetOwnArg (const size_t i) const
 
std::shared_ptr< Analyzer::Exprdeep_copy () 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
 
void find_expr (std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const override
 
bool operator== (const Expr &rhs) const override
 
std::string toString () 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 void group_predicates (std::list< const Expr * > &scan_predicates, std::list< const Expr * > &join_predicates, std::list< const Expr * > &const_predicates) const
 
virtual size_t get_num_column_vars (const bool include_agg) const
 
virtual std::shared_ptr
< Analyzer::Expr
rewrite_with_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual std::shared_ptr
< Analyzer::Expr
rewrite_with_child_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual std::shared_ptr
< Analyzer::Expr
rewrite_agg_to_var (const std::vector< std::shared_ptr< TargetEntry >> &tlist) 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

const std::string name_
 
const std::vector
< std::shared_ptr
< Analyzer::Expr > > 
args_
 

Additional Inherited Members

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

Detailed Description

Definition at line 2737 of file Analyzer.h.

Constructor & Destructor Documentation

Analyzer::FunctionOper::FunctionOper ( const SQLTypeInfo ti,
const std::string &  name,
const std::vector< std::shared_ptr< Analyzer::Expr >> &  args 
)
inline

Definition at line 2739 of file Analyzer.h.

2742  : Expr(ti, false), name_(name), args_(args) {}
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:70
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:2772
string name
Definition: setup.in.py:72
const std::string name_
Definition: Analyzer.h:2771

Member Function Documentation

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

Reimplemented from Analyzer::Expr.

Definition at line 3583 of file Analyzer.cpp.

References getArg(), and getArity().

3585  {
3586  for (unsigned i = 0; i < getArity(); i++) {
3587  const auto expr = getArg(i);
3588  expr->collect_column_var(colvar_set, include_agg);
3589  }
3590 }
size_t getArity() const
Definition: Analyzer.h:2746
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:2748

+ Here is the call graph for this function:

void Analyzer::FunctionOper::collect_rte_idx ( std::set< int > &  rte_idx_set) const
overridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 3521 of file Analyzer.cpp.

References getArg(), and getArity().

3521  {
3522  for (unsigned i = 0; i < getArity(); i++) {
3523  const auto expr = getArg(i);
3524  expr->collect_rte_idx(rte_idx_set);
3525  }
3526 }
size_t getArity() const
Definition: Analyzer.h:2746
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:2748

+ Here is the call graph for this function:

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

Implements Analyzer::Expr.

Reimplemented in Analyzer::FunctionOperWithCustomTypeHandling.

Definition at line 3824 of file Analyzer.cpp.

References getArg(), getArity(), getName(), and Analyzer::Expr::type_info.

3824  {
3825  std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
3826  for (size_t i = 0; i < getArity(); ++i) {
3827  args_copy.push_back(getArg(i)->deep_copy());
3828  }
3829  return makeExpr<Analyzer::FunctionOper>(type_info, getName(), args_copy);
3830 }
size_t getArity() const
Definition: Analyzer.h:2746
SQLTypeInfo type_info
Definition: Analyzer.h:180
std::shared_ptr< Analyzer::Expr > deep_copy() const override
Definition: Analyzer.cpp:3824
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:2748
std::string getName() const
Definition: Analyzer.h:2744

+ Here is the call graph for this function:

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

Reimplemented from Analyzer::Expr.

Definition at line 3469 of file Analyzer.cpp.

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

3470  {
3471  if (f(this)) {
3472  add_unique(expr_list);
3473  return;
3474  }
3475  for (const auto& arg : args_) {
3476  arg->find_expr(f, expr_list);
3477  }
3478 }
virtual void add_unique(std::list< const Expr * > &expr_list) const
Definition: Analyzer.cpp:3248
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:2772
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)

+ Here is the call graph for this function:

const Analyzer::Expr* Analyzer::FunctionOper::getArg ( const size_t  i) const
inline
std::shared_ptr<Analyzer::Expr> Analyzer::FunctionOper::getOwnArg ( const size_t  i) const
inline

Definition at line 2753 of file Analyzer.h.

References args_, and CHECK_LT.

Referenced by bind_function().

2753  {
2754  CHECK_LT(i, args_.size());
2755  return args_[i];
2756  }
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:2772
#define CHECK_LT(x, y)
Definition: Logger.h:303

+ Here is the caller graph for this function:

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

Implements Analyzer::Expr.

Reimplemented in Analyzer::FunctionOperWithCustomTypeHandling.

Definition at line 3864 of file Analyzer.cpp.

References Analyzer::Expr::get_type_info(), getArg(), getArity(), getName(), and Analyzer::Expr::type_info.

3864  {
3865  if (type_info != rhs.get_type_info()) {
3866  return false;
3867  }
3868  const auto rhs_func_oper = dynamic_cast<const FunctionOper*>(&rhs);
3869  if (!rhs_func_oper) {
3870  return false;
3871  }
3872  if (getName() != rhs_func_oper->getName()) {
3873  return false;
3874  }
3875  if (getArity() != rhs_func_oper->getArity()) {
3876  return false;
3877  }
3878  for (size_t i = 0; i < getArity(); ++i) {
3879  if (!(*getArg(i) == *(rhs_func_oper->getArg(i)))) {
3880  return false;
3881  }
3882  }
3883  return true;
3884 }
size_t getArity() const
Definition: Analyzer.h:2746
SQLTypeInfo type_info
Definition: Analyzer.h:180
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:2748
std::string getName() const
Definition: Analyzer.h:2744
FunctionOper(const SQLTypeInfo &ti, const std::string &name, const std::vector< std::shared_ptr< Analyzer::Expr >> &args)
Definition: Analyzer.h:2739

+ Here is the call graph for this function:

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

Implements Analyzer::Expr.

Definition at line 3895 of file Analyzer.cpp.

References args_, and name_.

3895  {
3896  std::string str{"(" + name_ + " "};
3897  for (const auto& arg : args_) {
3898  str += arg->toString();
3899  }
3900  str += ")";
3901  return str;
3902 }
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:2772
const std::string name_
Definition: Analyzer.h:2771

Member Data Documentation

const std::vector<std::shared_ptr<Analyzer::Expr> > Analyzer::FunctionOper::args_
private

Definition at line 2772 of file Analyzer.h.

Referenced by find_expr(), getArg(), getArity(), getOwnArg(), and toString().

const std::string Analyzer::FunctionOper::name_
private

Definition at line 2771 of file Analyzer.h.

Referenced by getName(), and toString().


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