OmniSciDB  c0231cc57d
 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 2332 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 2334 of file Analyzer.h.

2336  : Expr(SQLTypeInfo(kVOID)), bound_type_(bound_type), bound_expr_(bound_expr) {}
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:73
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2352
Definition: sqltypes.h:79
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2353

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:2352
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2353

+ Here is the caller graph for this function:

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

Definition at line 2340 of file Analyzer.h.

References bound_expr_, and CHECK.

Referenced by Executor::codegenFrameBoundExpr(), Executor::codegenWindowFrameBound(), and operator==().

2340  {
2341  CHECK(bound_expr_);
2342  return bound_expr_.get();
2343  }
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2353
#define CHECK(condition)
Definition: Logger.h:222

+ Here is the caller graph for this function:

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

Definition at line 2338 of file Analyzer.h.

References bound_type_.

Referenced by Executor::codegenWindowFrameBound().

2338 { return bound_type_; }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2352

+ Here is the caller graph for this function:

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

Implements Analyzer::Expr.

Definition at line 2506 of file Analyzer.cpp.

References bound_expr_, bound_type_, and getBoundExpr().

2506  {
2507  const WindowFrame& rhs_window_frame = dynamic_cast<const WindowFrame&>(rhs);
2508  if (bound_type_ == rhs_window_frame.bound_type_) {
2509  if (bound_expr_) {
2510  return rhs_window_frame.bound_expr_ &&
2511  *bound_expr_.get() == *rhs_window_frame.getBoundExpr();
2512  } else {
2513  return !rhs_window_frame.bound_expr_;
2514  }
2515  }
2516  return false;
2517 }
WindowFrame(SqlWindowFrameBoundType bound_type, const std::shared_ptr< Analyzer::Expr > bound_expr)
Definition: Analyzer.h:2334
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2352
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2353

+ Here is the call graph for this function:

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

Implements Analyzer::Expr.

Definition at line 2937 of file Analyzer.cpp.

References bound_expr_, bound_type_, and toString().

2937  {
2938  auto bound_str = bound_expr_ ? bound_expr_->toString() : "None";
2939  return ::toString(bound_type_) + " " + bound_str;
2940 }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2352
std::string toString(const QueryDescriptionType &type)
Definition: Types.h:64
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2353

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

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

SqlWindowFrameBoundType Analyzer::WindowFrame::bound_type_
private

Definition at line 2352 of file Analyzer.h.

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


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