Files | Functions
Modifying

Files

file  lists/reverse.hpp
 

Functions

std::unique_ptr< columncudf::lists::reverse (lists_column_view const &input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=rmm::mr::get_current_device_resource())
 Reverse the element order within each list of the input column. More...
 

Detailed Description

Function Documentation

◆ reverse()

std::unique_ptr<column> cudf::lists::reverse ( lists_column_view const &  input,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::device_async_resource_ref  mr = rmm::mr::get_current_device_resource() 
)

Reverse the element order within each list of the input column.

Any null input row will result in a corresponding null row in the output column.

Example:
s = [ [1, 2, 3], [], null, [4, 5, null] ]
r = reverse(s)
r is now [ [3, 2, 1], [], null, [null, 5, 4] ]
Parameters
inputLists column for this operation
streamCUDA stream used for device memory operations and kernel launches
mrDevice memory resource used to allocate the returned column's device memory
Returns
New lists column with reversed lists