Files | Functions
Filling

Files

file  lists/filling.hpp
 Column APIs for individual list sequence.
 

Functions

std::unique_ptr< columncudf::lists::sequences (column_view const &starts, column_view const &sizes, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
 Create a lists column in which each row contains a sequence of values specified by a tuple of (start, size) parameters. More...
 
std::unique_ptr< columncudf::lists::sequences (column_view const &starts, column_view const &steps, column_view const &sizes, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
 Create a lists column in which each row contains a sequence of values specified by a tuple of (start, step, size) parameters. More...
 

Detailed Description

Function Documentation

◆ sequences() [1/2]

std::unique_ptr<column> cudf::lists::sequences ( column_view const &  starts,
column_view const &  sizes,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::device_async_resource_ref  mr = cudf::get_current_device_resource_ref() 
)

Create a lists column in which each row contains a sequence of values specified by a tuple of (start, size) parameters.

Create a lists column in which each row is a sequence of values starting from a start value, incrementing by one, and its cardinality is specified by a size value. The start and size values used to generate each list is taken from the corresponding row of the input starts and sizes columns.

  • sizes must be a column of integer types.
  • All the input columns must not have nulls.
  • If any row of the sizes column contains negative value, the output is undefined.
starts = [0, 1, 2, 3, 4]
sizes = [0, 2, 2, 1, 3]
output = [ [], [1, 2], [2, 3], [3], [4, 5, 6] ]
Exceptions
cudf::logic_errorif sizes column is not of integer types.
cudf::logic_errorif any input column has nulls.
cudf::logic_errorif starts and sizes columns do not have the same size.
std::overflow_errorif the output column would exceed the column size limit.
Parameters
startsFirst values in the result sequences.
sizesNumbers of values in the result sequences.
streamCUDA stream used for device memory operations and kernel launches.
mrDevice memory resource used to allocate the returned column's device memory.
Returns
The result column containing generated sequences.

◆ sequences() [2/2]

std::unique_ptr<column> cudf::lists::sequences ( column_view const &  starts,
column_view const &  steps,
column_view const &  sizes,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::device_async_resource_ref  mr = cudf::get_current_device_resource_ref() 
)

Create a lists column in which each row contains a sequence of values specified by a tuple of (start, step, size) parameters.

Create a lists column in which each row is a sequence of values starting from a start value, incrementing by a step value, and its cardinality is specified by a size value. The values start, step, and size used to generate each list is taken from the corresponding row of the input starts, steps, and sizes columns.

  • sizes must be a column of integer types.
  • starts and steps columns must have the same type.
  • All the input columns must not have nulls.
  • If any row of the sizes column contains negative value, the output is undefined.
starts = [0, 1, 2, 3, 4]
steps = [2, 1, 1, 1, -3]
sizes = [0, 2, 2, 1, 3]
output = [ [], [1, 2], [2, 3], [3], [4, 1, -2] ]
Exceptions
cudf::logic_errorif sizes column is not of integer types.
cudf::logic_errorif any input column has nulls.
cudf::logic_errorif starts and steps columns have different types.
cudf::logic_errorif starts, steps, and sizes columns do not have the same size.
std::overflow_errorif the output column would exceed the column size limit.
Parameters
startsFirst values in the result sequences.
stepsIncrement values for the result sequences.
sizesNumbers of values in the result sequences.
streamCUDA stream used for device memory operations and kernel launches.
mrDevice memory resource used to allocate the returned column's device memory.
Returns
The result column containing generated sequences.