Lists Classes#

group lists_classes
class lists_column_view : private cudf::column_view#
#include <lists_column_view.hpp>

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

Public Types

using offset_iterator = size_type const*#

Iterator type for offsets.

Public Functions

lists_column_view(column_view const &lists_column)#

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

Parameters:

lists_column – The column view to wrap

lists_column_view(lists_column_view&&) = default#

Move constructor.

lists_column_view(lists_column_view const&) = default#

Copy constructor.

lists_column_view &operator=(lists_column_view const&) = default#

Copy assignment operator.

Returns:

The reference to this lists column

lists_column_view &operator=(lists_column_view&&) = default#

Move assignment operator.

Returns:

The reference to this lists column

column_view parent() const#

Returns the parent column.

Returns:

The parent column

column_view offsets() const#

Returns the internal column of offsets.

Throws:

cudf::logic_error – if this is an empty column

Returns:

The internal column of offsets

column_view child() const#

Returns the internal child column.

Throws:

cudf::logic_error – if this is an empty column

Returns:

The internal child column

column_view get_sliced_child(rmm::cuda_stream_view 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 list 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 lists columns should be using get_sliced_child() instead of child().

Throws:

cudf::logic_error – if this is an empty column

Parameters:

stream – CUDA stream used for device memory operations and kernel launches

Returns:

A sliced child column view

inline offset_iterator offsets_begin() const noexcept#

Return first offset (accounting for column offset)

Returns:

Pointer to the first offset

inline offset_iterator offsets_end() const noexcept#

Return pointer to the position that is one past the last offset.

This function return the position that is one past the last offset of the lists column. Since the current lists column may be a sliced column, this offsets_end() iterator should not be computed using the size of the offsets() child column, which is also the offsets of the entire original (non-sliced) lists column.

Returns:

Pointer to one past the last offset

inline auto child_begin() const noexcept#

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

inline auto child_end() const noexcept#

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

Public Static Attributes

static constexpr size_type offsets_column_index = {0}#

The index of the offsets column.

static constexpr size_type child_column_index = {1}#

The index of the child column.