alamb commented on code in PR #1912:
URL: https://github.com/apache/arrow-rs/pull/1912#discussion_r902570390
##########
arrow/src/array/array_dictionary.rs:
##########
@@ -169,6 +169,17 @@ impl<'a, K: ArrowPrimitiveType> DictionaryArray<K> {
.iter()
.map(|key| key.map(|k| k.to_usize().expect("Dictionary index not
usize")))
}
+
+ /// Return the value of `keys` (the dictionary key) at index `i`,
+ /// cast to `usize`, `None` if the value at `i` is `NULL`.
+ pub fn key(&self, i: usize) -> Option<usize> {
+ self.keys.is_valid(i).then(|| {
+ self.keys
+ .value(i)
+ .to_usize()
+ .expect("Dictionary index not usize")
Review Comment:
Filed https://github.com/apache/arrow-rs/issues/1918 to track
--
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]