OmniSciDB  a5dc49c757
 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 2820 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 2822 of file Analyzer.h.

2824  : 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:2852
Definition: sqltypes.h:92
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2853

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

+ Here is the caller graph for this function:

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

Definition at line 2828 of file Analyzer.h.

References bound_expr_, and CHECK.

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

2828  {
2829  CHECK(bound_expr_);
2830  return bound_expr_.get();
2831  }
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2853
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function:

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

Definition at line 2826 of file Analyzer.h.

References bound_type_.

Referenced by Executor::codegenFrameBound().

2826 { return bound_type_; }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2852

+ Here is the caller graph for this function:

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

Definition at line 2833 of file Analyzer.h.

References bound_expr_.

Referenced by Executor::codegenWindowFrameBounds().

2833  {
2834  if (bound_expr_) {
2835  const auto bound_ti = bound_expr_->get_type_info();
2836  return bound_ti.is_date() || bound_ti.is_timestamp();
2837  }
2838  return false;
2839  }
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2853

+ Here is the caller graph for this function:

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

Definition at line 2841 of file Analyzer.h.

References bound_type_, and CURRENT_ROW.

Referenced by Executor::prepareRangeModeFuncArgs().

2841  {
2843  }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2852

+ 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:2822
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2852
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2853

+ 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_, and bound_type_.

3109  {
3110  std::ostringstream oss;
3111  auto bound_str = bound_expr_ ? bound_expr_->toString() : "None";
3112  oss << bound_type_ << " " << bound_str;
3113  return oss.str();
3114 }
SqlWindowFrameBoundType bound_type_
Definition: Analyzer.h:2852
const std::shared_ptr< Analyzer::Expr > bound_expr_
Definition: Analyzer.h:2853

Member Data Documentation

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

Definition at line 2852 of file Analyzer.h.

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


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