andygrove commented on a change in pull request #7009:
URL: https://github.com/apache/arrow/pull/7009#discussion_r413857080
##########
File path: rust/parquet/src/record/api.rs
##########
@@ -50,6 +50,33 @@ impl Row {
pub fn len(&self) -> usize {
self.fields.len()
}
+
+ pub fn get_column_iter(&self) -> RowColumnIter {
+ RowColumnIter {
+ fields: &self.fields,
+ curr: 0,
+ count: self.fields.len(),
+ }
+ }
+}
+
+pub struct RowColumnIter<'a> {
+ fields: &'a Vec<(String, Field)>,
+ curr: usize,
+ count: usize,
+}
+
+impl<'a> Iterator for RowColumnIter<'a> {
+ type Item = (usize, &'a String);
Review comment:
Why do we need the index included in the iterator results? The user
could use `enumerate` to get those? Also, would it make more sense for the
iterator be over the `Field` rather than just field name?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]