Files | Functions
Searching

Files

file  dictionary/search.hpp
 

Functions

std::unique_ptr< scalarcudf::dictionary::get_index (dictionary_column_view const &dictionary, scalar const &key, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Return the index value for a given key. More...
 

Detailed Description

Function Documentation

◆ get_index()

std::unique_ptr<scalar> cudf::dictionary::get_index ( dictionary_column_view const &  dictionary,
scalar const &  key,
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Return the index value for a given key.

If the key does not exist in the dictionary the returned scalar will have is_valid()==false

Exceptions
cudf::logic_errorif key.type() != dictionary.keys().type()
Parameters
dictionaryThe dictionary to search for the key.
keyThe value to search for in the dictionary keyset.
mrDevice memory resource used to allocate the returned scalar's device memory.
Returns
Numeric scalar index value of the key within the dictionary