You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/04/23 17:59:48 UTC

[GitHub] [arrow] houqp commented on a change in pull request #7009: ARROW-8552: [Rust] support iterate parquet row columns

houqp commented on a change in pull request #7009:
URL: https://github.com/apache/arrow/pull/7009#discussion_r414007919



##########
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:
       Thanks for the suggestions, I have changed it to return column name and field as a tuple.




----------------------------------------------------------------
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:
users@infra.apache.org