libcudf  24.02.00
Files | Functions
Concatenating

Files

file  concatenate.hpp
 Concatenate columns APIs.
 

Functions

rmm::device_buffer cudf::concatenate_masks (host_span< column_view const > views, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Concatenates views[i]'s bitmask from the bits [views[i].offset(), views[i].offset() + views[i].size()) for all elements views into an rmm::device_buffer More...
 
std::unique_ptr< columncudf::concatenate (host_span< column_view const > columns_to_concat, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Concatenates multiple columns into a single column. More...
 
std::unique_ptr< tablecudf::concatenate (host_span< table_view const > tables_to_concat, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Columns of tables_to_concat are concatenated vertically to return a single table. More...
 

Detailed Description

Function Documentation

◆ concatenate() [1/2]

std::unique_ptr<column> cudf::concatenate ( host_span< column_view const >  columns_to_concat,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Concatenates multiple columns into a single column.

Exceptions
cudf::logic_errorIf types of the input columns mismatch
std::overflow_errorIf the total number of output rows exceeds cudf::size_type
Parameters
columns_to_concatColumn views to be concatenated into a single column
streamCUDA stream used for device memory operations and kernel launches
mrDevice memory resource used to allocate the returned column's device memory
Returns
A single column having all the rows from the elements of columns_to_concat respectively in the same order.

◆ concatenate() [2/2]

std::unique_ptr<table> cudf::concatenate ( host_span< table_view const >  tables_to_concat,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Columns of tables_to_concat are concatenated vertically to return a single table.

column_view c0 is {0,1,2,3}
column_view c1 is {4,5,6,7}
table_view t0{{c0, c0}};
table_view t1{{c1, c1}};
...
auto t = concatenate({t0.view(), t1.view()});
column_view tc0 = (t->view()).column(0) is {0,1,2,3,4,5,6,7}
column_view tc1 = (t->view()).column(1) is {0,1,2,3,4,5,6,7}
Exceptions
cudf::logic_errorIf number of columns mismatch
std::overflow_errorIf the total number of output rows exceeds cudf::size_type
Parameters
tables_to_concatTable views to be concatenated into a single table
streamCUDA stream used for device memory operations and kernel launches
mrDevice memory resource used to allocate the returned table's device memory
Returns
A single table having all the rows from the elements of tables_to_concat respectively in the same order.

◆ concatenate_masks()

Concatenates views[i]'s bitmask from the bits [views[i].offset(), views[i].offset() + views[i].size()) for all elements views into an rmm::device_buffer

Returns an empty buffer if the column is not nullable.

Parameters
viewsColumn views whose bitmasks will be concatenated
mrDevice memory resource used for allocating the returned memory
streamCUDA stream used for device memory operations and kernel launches
Returns
Bitmasks of all the column views in the views vector