pub fn primitive_to_dictionary<T, K>(
from: &PrimitiveArray<T>
) -> Result<DictionaryArray<K>, ArrowError> where
T: NativeType + Eq + Hash,
K: DictionaryKey,
This is supported on crate feature
compute_cast
only.Expand description
Cast PrimitiveArray
to DictionaryArray
. Also known as packing.
Errors
This function errors if the maximum key is smaller than the number of distinct elements in the array.