Files | |
file | lists/contains.hpp |
Enumerations | |
enum class | cudf::lists::duplicate_find_option : int32_t { cudf::lists::FIND_FIRST = 0 , cudf::lists::FIND_LAST } |
Option to choose whether index_of() returns the first or last match of a search key in a list row. More... | |
|
strong |
Option to choose whether index_of()
returns the first or last match of a search key in a list row.
Enumerator | |
---|---|
FIND_FIRST | Finds first instance of a search key in a list row. |
FIND_LAST | Finds last instance of a search key in a list row. |
Definition at line 105 of file lists/contains.hpp.
std::unique_ptr<column> cudf::lists::contains | ( | cudf::lists_column_view const & | lists, |
cudf::column_view const & | search_keys, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
Create a column of bool
values indicating whether the list rows of the first column contain the corresponding values in the second column.
The output column has as many elements as the input lists
column. Output column[i]
is set to true if the lists row lists[i]
contains the value in search_keys[i]
. Otherwise, it is set to false.
Output column[i]
is set to null if one or more of the following are true:
search_keys[i]
is nulllists[i]
is nulllists | Lists column whose n rows are to be searched |
search_keys | Column of elements to be looked up in each list row. |
stream | CUDA stream used for device memory operations and kernel launches. |
mr | Device memory resource used to allocate the returned column's device memory |
n
rows with the result of the lookup std::unique_ptr<column> cudf::lists::contains | ( | cudf::lists_column_view const & | lists, |
cudf::scalar const & | search_key, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
Create a column of bool
values indicating whether the specified scalar is an element of each row of a list column.
The output column has as many elements as the input lists
column. Output column[i]
is set to true if the lists row lists[i]
contains the value specified in search_key
. Otherwise, it is set to false.
Output column[i]
is set to null if one or more of the following are true:
search_key
is nulllists[i]
is nulllists | Lists column whose n rows are to be searched |
search_key | The scalar key to be looked up in each list row |
stream | CUDA stream used for device memory operations and kernel launches. |
mr | Device memory resource used to allocate the returned column's device memory |
n
rows with the result of the lookup std::unique_ptr<column> cudf::lists::contains_nulls | ( | cudf::lists_column_view const & | lists, |
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
Create a column of bool
values indicating whether each row in the lists
column contains at least one null element.
The output column has as many elements as the input lists
column. Output column[i]
is set to null if the row lists[i]
is null. Otherwise, column[i]
is set to a non-null boolean value, depending on whether that list contains a null element.
A row with an empty list will always return false. Nulls inside non-null nested elements (such as lists or structs) are not considered.
lists | Lists column whose n rows are to be searched. |
stream | CUDA stream used for device memory operations and kernel launches. |
mr | Device memory resource used to allocate the returned column's device memory |
n
rows with the result of the lookup std::unique_ptr<column> cudf::lists::index_of | ( | cudf::lists_column_view const & | lists, |
cudf::column_view const & | search_keys, | ||
duplicate_find_option | find_option = duplicate_find_option::FIND_FIRST , |
||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
Create a column of values indicating the position of a search key row within the corresponding list row in the lists
column.
The output column has as many elements as there are rows in the input lists
column. Output column[i]
contains a 0-based index indicating the position of each search key row in its corresponding list row, counting from the beginning of the list. Note:
search_keys[i]
is null, output[i]
is also null.lists[i]
is null, output[i]
is also null.lists[i]
does not contain search_key[i]
, output[i]
is set to -1
.output[i]
is set to a non-negative size_type
index.If the find_option
is set to FIND_FIRST
, the position of the first match for search_key
is returned. If find_option == FIND_LAST
, the position of the last match in the list row is returned.
cudf::logic_error | If search_keys does not match lists in its number of rows |
cudf::data_type_error | If search_keys type does not match the element type in lists |
lists | Lists column whose n rows are to be searched |
search_keys | A column of search keys to be looked up in each corresponding row of lists |
find_option | Whether to return the position of the first match (FIND_FIRST ) or last (FIND_LAST ) |
stream | CUDA stream used for device memory operations and kernel launches |
mr | Device memory resource used to allocate the returned column's device memory |
n
rows with the location of the search_key
std::unique_ptr<column> cudf::lists::index_of | ( | cudf::lists_column_view const & | lists, |
cudf::scalar const & | search_key, | ||
duplicate_find_option | find_option = duplicate_find_option::FIND_FIRST , |
||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
Create a column of values indicating the position of a search key within each list row in the lists
column.
The output column has as many elements as there are rows in the input lists
column. Output column[i]
contains a 0-based index indicating the position of the search key in each list, counting from the beginning of the list. Note:
search_key
is null, all output rows are set to null.lists[i]
is null, output[i]
is also null.lists[i]
does not contain the search_key
, output[i]
is set to -1
.output[i]
is set to a non-negative size_type
index.If the find_option
is set to FIND_FIRST
, the position of the first match for search_key
is returned. If find_option == FIND_LAST
, the position of the last match in the list row is returned.
cudf::data_type_error | If search_keys type does not match the element type in lists |
lists | Lists column whose n rows are to be searched |
search_key | The scalar key to be looked up in each list row |
find_option | Whether to return the position of the first match (FIND_FIRST ) or last (FIND_LAST ) |
stream | CUDA stream used for device memory operations and kernel launches |
mr | Device memory resource used to allocate the returned column's device memory |
n
rows with the location of the search_key