Public Types | Public Member Functions | Static Public Member Functions | List of all members
cudf::range_window_bounds Struct Reference

Abstraction for window boundary sizes, to be used with grouped_range_rolling_window(). More...

#include <range_window_bounds.hpp>

Public Types

enum class  extent_type : int32_t { CURRENT_ROW = 0 , BOUNDED , UNBOUNDED }
 The type of range_window_bounds. More...
 

Public Member Functions

bool is_current_row () const
 Whether or not the window is bounded to the current row. More...
 
bool is_unbounded () const
 Whether or not the window is unbounded. More...
 
scalar const & range_scalar () const
 Returns the underlying scalar value for the bounds. More...
 
 range_window_bounds (range_window_bounds const &)=default
 Copy constructor.
 

Static Public Member Functions

static range_window_bounds get (scalar const &boundary, rmm::cuda_stream_view stream=cudf::get_default_stream())
 Factory method to construct a bounded window boundary. More...
 
static range_window_bounds current_row (data_type type, rmm::cuda_stream_view stream=cudf::get_default_stream())
 Factory method to construct a window boundary limited to the value of the current row. More...
 
static range_window_bounds unbounded (data_type type, rmm::cuda_stream_view stream=cudf::get_default_stream())
 Factory method to construct an unbounded window boundary. More...
 

Detailed Description

Abstraction for window boundary sizes, to be used with grouped_range_rolling_window().

Similar to window_bounds in grouped_rolling_window(), range_window_bounds represents window boundaries for use with grouped_range_rolling_window(). A window may be specified as one of the following:

  1. A fixed-width numeric scalar value. E.g. a) A DURATION_DAYS scalar, for use with a TIMESTAMP_DAYS orderby column b) An INT32 scalar, for use with an INT32 orderby column
  2. "unbounded", indicating that the bounds stretch to the first/last row in the group.
  3. "current row", indicating that the bounds end at the first/last row in the group that match the value of the current row.

Definition at line 44 of file range_window_bounds.hpp.

Member Enumeration Documentation

◆ extent_type

The type of range_window_bounds.

Enumerator
BOUNDED 

Bounds defined as the first/last row that matches the current row.

UNBOUNDED 

Bounds stretching to the first/last row in the entire group.

Bounds defined as the first/last row that falls within a specified range from the current row.

Definition at line 49 of file range_window_bounds.hpp.

Member Function Documentation

◆ current_row()

static range_window_bounds cudf::range_window_bounds::current_row ( data_type  type,
rmm::cuda_stream_view  stream = cudf::get_default_stream() 
)
static

Factory method to construct a window boundary limited to the value of the current row.

Parameters
typeThe datatype of the window boundary
streamCUDA stream used for device memory operations and kernel launches
Returns
A "current row" window boundary object

◆ get()

static range_window_bounds cudf::range_window_bounds::get ( scalar const &  boundary,
rmm::cuda_stream_view  stream = cudf::get_default_stream() 
)
static

Factory method to construct a bounded window boundary.

Parameters
boundaryFinite window boundary
streamCUDA stream used for device memory operations and kernel launches
Returns
A bounded window boundary object

◆ is_current_row()

bool cudf::range_window_bounds::is_current_row ( ) const
inline

Whether or not the window is bounded to the current row.

Returns
true If window is bounded to the current row
false If window is not bounded to the current row

Definition at line 83 of file range_window_bounds.hpp.

◆ is_unbounded()

bool cudf::range_window_bounds::is_unbounded ( ) const
inline

Whether or not the window is unbounded.

Returns
true If window is unbounded
false If window is of finite bounds

Definition at line 101 of file range_window_bounds.hpp.

◆ range_scalar()

scalar const& cudf::range_window_bounds::range_scalar ( ) const
inline

Returns the underlying scalar value for the bounds.

Returns
The underlying scalar value for the bounds

Definition at line 108 of file range_window_bounds.hpp.

◆ unbounded()

static range_window_bounds cudf::range_window_bounds::unbounded ( data_type  type,
rmm::cuda_stream_view  stream = cudf::get_default_stream() 
)
static

Factory method to construct an unbounded window boundary.

Parameters
typeThe datatype of the window boundary
streamCUDA stream used for device memory operations and kernel launches
Returns
An unbounded window boundary object

The documentation for this struct was generated from the following file: