libcudf  24.02.00
Public Member Functions | List of all members
cudf::structs_column_view Class Reference

Given a column view of struct type, an instance of this class provides a wrapper on this compound column for struct operations. More...

#include <structs_column_view.hpp>

Inheritance diagram for cudf::structs_column_view:
cudf::column_view cudf::detail::column_view_base

Public Member Functions

 structs_column_view (structs_column_view const &)=default
 Copy constructor.
 
 structs_column_view (structs_column_view &&)=default
 Move constructor.
 
structs_column_viewoperator= (structs_column_view const &)=default
 Copy assignment operator. More...
 
structs_column_viewoperator= (structs_column_view &&)=default
 Move assignment operator. More...
 
 structs_column_view (column_view const &col)
 Construct a new structs column view object from a column view. More...
 
column_view parent () const
 Returns the parent column. More...
 
column_view get_sliced_child (int index, rmm::cuda_stream_view stream=cudf::get_default_stream()) const
 Returns the internal child column, applying any offset from the root. More...
 
auto child_begin () const noexcept
 Returns iterator to the beginning of the ordered sequence of child column-views. More...
 
auto child_end () const noexcept
 Returns iterator to the end of the ordered sequence of child column-views. More...
 
size_type num_children () const noexcept
 Returns the number of child columns. More...
 
- Public Member Functions inherited from cudf::column_view
 column_view (column_view const &)=default
 Copy constructor.
 
 column_view (column_view &&)=default
 Move constructor.
 
column_viewoperator= (column_view const &)=default
 Copy assignment operator. More...
 
column_viewoperator= (column_view &&)=default
 Move assignment operator. More...
 
 column_view (data_type type, size_type size, void const *data, bitmask_type const *null_mask, size_type null_count, size_type offset=0, std::vector< column_view > const &children={})
 Construct a column_view from pointers to device memory for the elements and bitmask of the column. More...
 
column_view child (size_type child_index) const noexcept
 Returns the specified child. More...
 
size_type num_children () const noexcept
 Returns the number of child columns. More...
 
auto child_begin () const noexcept
 Returns iterator to the beginning of the ordered sequence of child column-views. More...
 
auto child_end () const noexcept
 Returns iterator to the end of the ordered sequence of child column-views. More...
 
template<typename T , CUDF_ENABLE_IF(cudf::is_numeric< T >() or cudf::is_chrono< T >()) >
 column_view (device_span< T const > data)
 Construct a column view from a device_span<T>. More...
 
template<typename T , CUDF_ENABLE_IF(cudf::is_numeric< T >() or cudf::is_chrono< T >()) >
 operator device_span< T const > () const
 Converts a column view into a device span. More...
 
- Public Member Functions inherited from cudf::detail::column_view_base
template<typename T = void, CUDF_ENABLE_IF(std::is_same_v< T, void > or is_rep_layout_compatible< T >()) >
T const * head () const noexcept
 Returns pointer to the base device memory allocation casted to the specified type. More...
 
template<typename T , CUDF_ENABLE_IF(is_rep_layout_compatible< T >()) >
T const * data () const noexcept
 Returns the underlying data casted to the specified type, plus the offset. More...
 
template<typename T , CUDF_ENABLE_IF(is_rep_layout_compatible< T >()) >
T const * begin () const noexcept
 Return first element (accounting for offset) after underlying data is casted to the specified type. More...
 
template<typename T , CUDF_ENABLE_IF(is_rep_layout_compatible< T >()) >
T const * end () const noexcept
 Return one past the last element after underlying data is casted to the specified type. More...
 
size_type size () const noexcept
 Returns the number of elements in the column. More...
 
bool is_empty () const noexcept
 Returns true if size() returns zero, or false otherwise. More...
 
data_type type () const noexcept
 Returns the element data_type More...
 
bool nullable () const noexcept
 Indicates if the column can contain null elements, i.e., if it has an allocated bitmask. More...
 
size_type null_count () const
 Returns the count of null elements. More...
 
size_type null_count (size_type begin, size_type end) const
 Returns the count of null elements in the range [begin, end) More...
 
bool has_nulls () const
 Indicates if the column contains null elements, i.e., null_count() > 0 More...
 
bool has_nulls (size_type begin, size_type end) const
 Indicates if the column contains null elements in the range [begin, end), i.e., null_count(begin, end) > 0 More...
 
bitmask_type const * null_mask () const noexcept
 Returns raw pointer to the underlying bitmask allocation. More...
 
size_type offset () const noexcept
 Returns the index of the first element relative to the base memory allocation, i.e., what is returned from head<T>(). More...
 

Additional Inherited Members

- Protected Member Functions inherited from cudf::detail::column_view_base
 column_view_base (column_view_base const &)=default
 Copy constructor.
 
 column_view_base (column_view_base &&)=default
 Move constructor.
 
column_view_baseoperator= (column_view_base const &)=default
 Copy assignment operator. More...
 
column_view_baseoperator= (column_view_base &&)=default
 Move assignment operator. More...
 
 column_view_base (data_type type, size_type size, void const *data, bitmask_type const *null_mask, size_type null_count, size_type offset=0)
 Construct a column_view_base from pointers to device memory for the elements and bitmask of the column. More...
 
- Protected Attributes inherited from cudf::detail::column_view_base
data_type _type {type_id::EMPTY}
 Element type.
 
size_type _size {}
 Number of elements.
 
void const * _data {}
 Pointer to device memory containing elements.
 
bitmask_type const * _null_mask {}
 
size_type _null_count {}
 The number of null elements.
 
size_type _offset {}
 

Detailed Description

Given a column view of struct type, an instance of this class provides a wrapper on this compound column for struct operations.

Definition at line 40 of file structs_column_view.hpp.

Constructor & Destructor Documentation

◆ structs_column_view()

cudf::structs_column_view::structs_column_view ( column_view const &  col)
explicit

Construct a new structs column view object from a column view.

Parameters
colThe column view to wrap

Member Function Documentation

◆ child_begin()

auto cudf::column_view::child_begin
inlinenoexcept

Returns iterator to the beginning of the ordered sequence of child column-views.

Returns
An iterator to a column_view referencing the first child column

Definition at line 402 of file column_view.hpp.

◆ child_end()

auto cudf::column_view::child_end
inlinenoexcept

Returns iterator to the end of the ordered sequence of child column-views.

Returns
An iterator to a column_view one past the end of the child columns

Definition at line 409 of file column_view.hpp.

◆ get_sliced_child()

column_view cudf::structs_column_view::get_sliced_child ( int  index,
rmm::cuda_stream_view  stream = cudf::get_default_stream() 
) const

Returns the internal child column, applying any offset from the root.

Slice/split offset values are only stored at the root level of a struct column. So when doing computations on them, we need to apply that offset to the child columns when recursing. Most functions operating in a recursive manner on struct columns should be using get_sliced_child() instead of child().

Exceptions
cudf::logic_errorif this is an empty column
Parameters
indexThe index of the child column to return
streamThe stream on which to perform the operation. Uses the default CUDF stream if none is specified.
Returns
The child column sliced relative to the parent's offset and size

◆ num_children()

size_type cudf::column_view::num_children
inlinenoexcept

Returns the number of child columns.

Returns
The number of child columns

Definition at line 395 of file column_view.hpp.

◆ operator=() [1/2]

structs_column_view& cudf::structs_column_view::operator= ( structs_column_view &&  )
default

Move assignment operator.

Returns
The reference to this structs column

◆ operator=() [2/2]

structs_column_view& cudf::structs_column_view::operator= ( structs_column_view const &  )
default

Copy assignment operator.

Returns
The reference to this structs column

◆ parent()

column_view cudf::structs_column_view::parent ( ) const

Returns the parent column.

Returns
The parent column

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