viirya commented on a change in pull request #1296:
URL: https://github.com/apache/arrow-rs/pull/1296#discussion_r803417701
##########
File path: arrow/src/array/iterator.rs
##########
@@ -403,6 +403,109 @@ impl<'a, S: OffsetSizeTrait> std::iter::ExactSizeIterator
{
}
+/// an iterator that returns Some(T) or None, that can be used on any
DictionaryArray
+// Note: This implementation is based on std's [Vec]s' [IntoIter].
+#[derive(Debug)]
+pub struct DictionaryIter<'a, K: ArrowPrimitiveType, T: ArrowPrimitiveType> {
+ array: &'a DictionaryArray<K>,
+ values: &'a PrimitiveArray<T>,
+ current: usize,
+ current_end: usize,
+}
Review comment:
We may add iterators for others, e.g. Utf8, binary..., if this direction
is correct.
--
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]