alamb commented on code in PR #2636:
URL: https://github.com/apache/arrow-rs/pull/2636#discussion_r962144419
##########
arrow/src/array/cast.rs:
##########
@@ -53,6 +260,90 @@ where
.expect("Unable to downcast to primitive array")
}
+/// Downcast an [`Array`] to a [`DictionaryArray`] based on its [`DataType`],
accepts
+/// a number of subsequent patterns to match the data type
+///
+/// ```
+/// # use arrow::downcast_dict_array;
+/// # use arrow::array::Array;
+/// # use arrow::datatypes::DataType;
+/// # use arrow::array::as_string_array;
+///
+/// fn print_keys(array: &dyn Array) {
+/// downcast_dict_array!(
+/// array => {
+/// for v in array.keys() {
+/// println!("{:?}", v);
+/// }
+/// }
+/// t => println!("Unsupported datatype {}", t)
Review Comment:
🥘 👍
--
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]