dict_from_values

Function dict_from_values 

Source
pub fn dict_from_values<K>(
    values_array: Arc<dyn Array>,
) -> Result<Arc<dyn Array>, DataFusionError>
Expand description

Create a DictionaryArray from the provided values array.

Each element gets a unique key (0..N-1), without deduplication. Useful for wrapping arrays in dictionary form.

§Input

[“alice”, “bob”, “alice”, null, “carol”]

§Output

DictionaryArray<Int32> { keys: [0, 1, 2, 3, 4], values: [“alice”, “bob”, “alice”, null, “carol”] }