OmniSciDB  a987f07e93
 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
 
bool hasTimestampTypeFrameBound () const
 
bool isCurrentRowBound () 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 (std::function< bool(const Expr *)> f, 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 2478 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 2480 of file Analyzer.h.

2482  : Expr(SQLTypeInfo(kVOID)), bound_type_(bound_type), bound_expr_(bound_expr) {}
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:74
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2510
Definition: sqltypes.h:80
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2511

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

+ Here is the caller graph for this function:

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

Definition at line 2486 of file Analyzer.h.

References bound_expr_, and CHECK.

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

2486  {
2487  CHECK(bound_expr_);
2488  return bound_expr_.get();
2489  }
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2511
#define CHECK(condition)
Definition: Logger.h:289

+ Here is the caller graph for this function:

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

Definition at line 2484 of file Analyzer.h.

References bound_type_.

Referenced by Executor::codegenFrameBound().

2484 { return bound_type_; }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2510

+ Here is the caller graph for this function:

bool Analyzer::WindowFrame::hasTimestampTypeFrameBound ( ) const
inline

Definition at line 2491 of file Analyzer.h.

References bound_expr_.

Referenced by Executor::codegenWindowFrameBounds().

2491  {
2492  if (bound_expr_) {
2493  const auto bound_ti = bound_expr_->get_type_info();
2494  return bound_ti.is_date() || bound_ti.is_timestamp();
2495  }
2496  return false;
2497  }
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2511

+ Here is the caller graph for this function:

bool Analyzer::WindowFrame::isCurrentRowBound ( ) const
inline

Definition at line 2499 of file Analyzer.h.

References bound_type_, and CURRENT_ROW.

Referenced by Executor::prepareRangeModeFuncArgs().

2499  {
2501  }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2510

+ Here is the caller graph for this function:

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

Implements Analyzer::Expr.

Definition at line 2522 of file Analyzer.cpp.

References bound_expr_, bound_type_, and getBoundExpr().

2522  {
2523  const WindowFrame& rhs_window_frame = dynamic_cast<const WindowFrame&>(rhs);
2524  if (bound_type_ == rhs_window_frame.bound_type_) {
2525  if (bound_expr_) {
2526  return rhs_window_frame.bound_expr_ &&
2527  *bound_expr_.get() == *rhs_window_frame.getBoundExpr();
2528  } else {
2529  return !rhs_window_frame.bound_expr_;
2530  }
2531  }
2532  return false;
2533 }
WindowFrame(SqlWindowFrameBoundType bound_type, const std::shared_ptr< Analyzer::Expr > bound_expr)
Definition: Analyzer.h:2480
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2510
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2511

+ Here is the call graph for this function:

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

Implements Analyzer::Expr.

Definition at line 2965 of file Analyzer.cpp.

References bound_expr_, bound_type_, and toString().

2965  {
2966  auto bound_str = bound_expr_ ? bound_expr_->toString() : "None";
2967  return ::toString(bound_type_) + " " + bound_str;
2968 }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2510
std::string toString(const ExecutorDeviceType &device_type)
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2511

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 2510 of file Analyzer.h.

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


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