Downcast this dictionary to a [`TypedDictionaryArray`] ``` use arrow_array::{Array, ArrayAccessor, DictionaryArray, StringArray, types::Int32Type}; let orig = [Some("a"), Some("b"), None]; let dictionary = DictionaryArray:: ::from_iter(orig); let typed = dictionary.downcast_dict:: ().unwrap(); assert_eq!(typed.value(0), "a"); assert_eq!(typed.value(1), "b"); assert!(typed.i
(&self)
| 430 | /// ``` |
| 431 | /// |
| 432 | pub fn downcast_dict<V: 'static>(&self) -> Option<TypedDictionaryArray<'_, K, V>> { |
| 433 | let values = self.values.as_any().downcast_ref()?; |
| 434 | Some(TypedDictionaryArray { |
| 435 | dictionary: self, |
| 436 | values, |
| 437 | }) |
| 438 | } |
| 439 | |
| 440 | /// Returns a new dictionary with the same keys as the current instance |
| 441 | /// but with a different set of dictionary values |