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

#include <Analyzer.h>

+ Inheritance diagram for Analyzer::WindowFrame:
+ Collaboration diagram for Analyzer::WindowFrame:

Public Member Functions

 WindowFrame (SqlWindowFrameBoundType bound_type, const std::shared_ptr< Analyzer::Expr > bound_expr)
 
SqlWindowFrameBoundType getBoundType () const
 
const Analyzer::ExprgetBoundExpr () const
 
std::shared_ptr< Analyzer::Exprdeep_copy () 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 void collect_rte_idx (std::set< int > &rte_idx_set) const
 
virtual void collect_column_var (std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) 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
 
virtual void find_expr (bool(*f)(const Expr *), std::list< const Expr * > &expr_list) const
 
std::shared_ptr< Analyzer::Exprdecompress ()
 
virtual void get_domain (DomainSet &domain_set) const
 

Private Attributes

SqlWindowFrameBoundType bound_type_
 
const std::shared_ptr
< Analyzer::Expr
bound_expr_
 

Additional Inherited Members

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

Detailed Description

Definition at line 2241 of file Analyzer.h.

Constructor & Destructor Documentation

Analyzer::WindowFrame::WindowFrame ( SqlWindowFrameBoundType  bound_type,
const std::shared_ptr< Analyzer::Expr bound_expr 
)
inline

Definition at line 2243 of file Analyzer.h.

2245  : Expr(SQLTypeInfo(kVOID)), bound_type_(bound_type), bound_expr_(bound_expr) {}
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:72
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2261
Definition: sqltypes.h:65
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2262

Member Function Documentation

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

Implements Analyzer::Expr.

Definition at line 217 of file Analyzer.cpp.

References bound_expr_, and bound_type_.

Referenced by DeepCopyVisitor::visitWindowFunction().

217  {
218  return makeExpr<WindowFrame>(bound_type_,
219  bound_expr_ ? bound_expr_->deep_copy() : nullptr);
220 }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2261
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2262

+ Here is the caller graph for this function:

const Analyzer::Expr* Analyzer::WindowFrame::getBoundExpr ( ) const
inline

Definition at line 2249 of file Analyzer.h.

References bound_expr_, and CHECK.

Referenced by operator==().

2249  {
2250  CHECK(bound_expr_);
2251  return bound_expr_.get();
2252  }
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2262
#define CHECK(condition)
Definition: Logger.h:222

+ Here is the caller graph for this function:

SqlWindowFrameBoundType Analyzer::WindowFrame::getBoundType ( ) const
inline

Definition at line 2247 of file Analyzer.h.

References bound_type_.

2247 { return bound_type_; }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2261
bool Analyzer::WindowFrame::operator== ( const Expr rhs) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2485 of file Analyzer.cpp.

References bound_expr_, bound_type_, and getBoundExpr().

2485  {
2486  const WindowFrame& rhs_window_frame = dynamic_cast<const WindowFrame&>(rhs);
2487  if (bound_type_ == rhs_window_frame.bound_type_) {
2488  if (bound_expr_) {
2489  return rhs_window_frame.bound_expr_ &&
2490  *bound_expr_.get() == *rhs_window_frame.getBoundExpr();
2491  } else {
2492  return !rhs_window_frame.bound_expr_;
2493  }
2494  }
2495  return false;
2496 }
WindowFrame(SqlWindowFrameBoundType bound_type, const std::shared_ptr< Analyzer::Expr > bound_expr)
Definition: Analyzer.h:2243
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2261
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2262

+ Here is the call graph for this function:

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

Implements Analyzer::Expr.

Definition at line 2916 of file Analyzer.cpp.

References bound_expr_, bound_type_, and toString().

2916  {
2917  auto bound_str = bound_expr_ ? bound_expr_->toString() : "None";
2918  return ::toString(bound_type_) + " " + bound_str;
2919 }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2261
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1448
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2262

+ Here is the call graph for this function:

Member Data Documentation

const std::shared_ptr<Analyzer::Expr> Analyzer::WindowFrame::bound_expr_
private

Definition at line 2262 of file Analyzer.h.

Referenced by deep_copy(), getBoundExpr(), operator==(), and toString().

SqlWindowFrameBoundType Analyzer::WindowFrame::bound_type_
private

Definition at line 2261 of file Analyzer.h.

Referenced by deep_copy(), getBoundType(), operator==(), and toString().


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