libcudf  23.12.00
Files | Functions
Sorting

Files

file  lists/sorting.hpp
 

Functions

std::unique_ptr< columncudf::lists::sort_lists (lists_column_view const &source_column, order column_order, null_order null_precedence, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Segmented sort of the elements within a list in each row of a list column. More...
 
std::unique_ptr< columncudf::lists::stable_sort_lists (lists_column_view const &source_column, order column_order, null_order null_precedence, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Segmented sort of the elements within a list in each row of a list column using stable sort. More...
 

Detailed Description

Function Documentation

◆ sort_lists()

std::unique_ptr<column> cudf::lists::sort_lists ( lists_column_view const &  source_column,
order  column_order,
null_order  null_precedence,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Segmented sort of the elements within a list in each row of a list column.

source_column with depth 1 is only supported.

  • source_column : [{4, 2, 3, 1}, {1, 2, NULL, 4}, {-10, 10, 0}]
    Ascending, Null After : [{1, 2, 3, 4}, {1, 2, 4, NULL}, {-10, 0, 10}]
    Ascending, Null Before : [{1, 2, 3, 4}, {NULL, 1, 2, 4}, {-10, 0, 10}]
    Descending, Null After : [{4, 3, 2, 1}, {NULL, 4, 2, 1}, {10, 0, -10}]
    Descending, Null Before : [{4, 3, 2, 1}, {4, 2, 1, NULL}, {10, 0, -10}]
Parameters
source_columnView of the list column of numeric types to sort
column_orderThe desired sort order
null_precedenceThe desired order of null compared to other elements in the list
streamCUDA stream used for device memory operations and kernel launches
mrDevice memory resource to allocate any returned objects
Returns
list column with elements in each list sorted.

◆ stable_sort_lists()

std::unique_ptr<column> cudf::lists::stable_sort_lists ( lists_column_view const &  source_column,
order  column_order,
null_order  null_precedence,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Segmented sort of the elements within a list in each row of a list column using stable sort.

Segmented sort of the elements within a list in each row of a list column. source_column with depth 1 is only supported.

  • source_column : [{4, 2, 3, 1}, {1, 2, NULL, 4}, {-10, 10, 0}]
    Ascending, Null After : [{1, 2, 3, 4}, {1, 2, 4, NULL}, {-10, 0, 10}]
    Ascending, Null Before : [{1, 2, 3, 4}, {NULL, 1, 2, 4}, {-10, 0, 10}]
    Descending, Null After : [{4, 3, 2, 1}, {NULL, 4, 2, 1}, {10, 0, -10}]
    Descending, Null Before : [{4, 3, 2, 1}, {4, 2, 1, NULL}, {10, 0, -10}]
Parameters
source_columnView of the list column of numeric types to sort
column_orderThe desired sort order
null_precedenceThe desired order of null compared to other elements in the list
streamCUDA stream used for device memory operations and kernel launches
mrDevice memory resource to allocate any returned objects
Returns
list column with elements in each list sorted.