alamb commented on code in PR #2297:
URL: https://github.com/apache/arrow-rs/pull/2297#discussion_r936635330
##########
arrow/src/array/array_dictionary.rs:
##########
@@ -385,6 +404,86 @@ impl<T: ArrowPrimitiveType> fmt::Debug for
DictionaryArray<T> {
}
}
+/// A strongly-typed wrapper around a [`DictionaryArray`] that implements
[`ArrayAccessor`]
+/// allowing fast access to its elements
+///
+/// ```
+/// use arrow::array::{ArrayIter, DictionaryArray, StringArray};
+/// use arrow::datatypes::Int32Type;
+///
+/// let orig = ["a", "b", "a", "b"];
+/// let dictionary = DictionaryArray::<Int32Type>::from_iter(orig);
+/// let typed = dictionary.downcast_dict::<StringArray>().unwrap();
Review Comment:
```suggestion
/// // `TypedDictionaryArray` allows you to access its values as strings
/// let typed = dictionary.downcast_dict::<StringArray>().unwrap();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]