OmniSciDB  72c90bc290
 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 2689 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 2691 of file Analyzer.h.

2693  : Expr(SQLTypeInfo(kVOID)), bound_type_(bound_type), bound_expr_(bound_expr) {}
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:70
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2721
Definition: sqltypes.h:92
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2722

Member Function Documentation

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

Implements Analyzer::Expr.

Definition at line 234 of file Analyzer.cpp.

References bound_expr_, and bound_type_.

Referenced by DeepCopyVisitor::visitWindowFunction().

234  {
235  return makeExpr<WindowFrame>(bound_type_,
236  bound_expr_ ? bound_expr_->deep_copy() : nullptr);
237 }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2721
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2722

+ Here is the caller graph for this function:

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

Definition at line 2697 of file Analyzer.h.

References bound_expr_, and CHECK.

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

2697  {
2698  CHECK(bound_expr_);
2699  return bound_expr_.get();
2700  }
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2722
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function:

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

Definition at line 2695 of file Analyzer.h.

References bound_type_.

Referenced by Executor::codegenFrameBound().

2695 { return bound_type_; }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2721

+ Here is the caller graph for this function:

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

Definition at line 2702 of file Analyzer.h.

References bound_expr_.

Referenced by Executor::codegenWindowFrameBounds().

2702  {
2703  if (bound_expr_) {
2704  const auto bound_ti = bound_expr_->get_type_info();
2705  return bound_ti.is_date() || bound_ti.is_timestamp();
2706  }
2707  return false;
2708  }
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2722

+ Here is the caller graph for this function:

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

Definition at line 2710 of file Analyzer.h.

References bound_type_, and CURRENT_ROW.

Referenced by Executor::prepareRangeModeFuncArgs().

2710  {
2712  }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2721

+ Here is the caller graph for this function:

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

Implements Analyzer::Expr.

Definition at line 2638 of file Analyzer.cpp.

References bound_expr_, bound_type_, and getBoundExpr().

2638  {
2639  const WindowFrame& rhs_window_frame = dynamic_cast<const WindowFrame&>(rhs);
2640  if (bound_type_ == rhs_window_frame.bound_type_) {
2641  if (bound_expr_) {
2642  return rhs_window_frame.bound_expr_ &&
2643  *bound_expr_.get() == *rhs_window_frame.getBoundExpr();
2644  } else {
2645  return !rhs_window_frame.bound_expr_;
2646  }
2647  }
2648  return false;
2649 }
WindowFrame(SqlWindowFrameBoundType bound_type, const std::shared_ptr< Analyzer::Expr > bound_expr)
Definition: Analyzer.h:2691
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2721
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2722

+ Here is the call graph for this function:

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

Implements Analyzer::Expr.

Definition at line 3109 of file Analyzer.cpp.

References bound_expr_, bound_type_, and toString().

3109  {
3110  auto bound_str = bound_expr_ ? bound_expr_->toString() : "None";
3111  return ::toString(bound_type_) + " " + bound_str;
3112 }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2721
std::string toString(const QueryDescriptionType &type)
Definition: Types.h:64
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2722

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

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


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