Lists Modify#

group lists_modify

Functions

std::unique_ptr<column> 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:
  • input – Lists column for this operation

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

  • mr – Device memory resource used to allocate the returned column’s device memory

Returns:

New lists column with reversed lists