liukun4515 commented on code in PR #2332:
URL: https://github.com/apache/arrow-rs/pull/2332#discussion_r939501676


##########
parquet/src/arrow/array_reader/complex_object_array.rs:
##########
@@ -197,19 +197,25 @@ where
     }
 
     fn skip_records(&mut self, num_records: usize) -> Result<usize> {
-        match self.column_reader.as_mut() {
-            Some(reader) => reader.skip_records(num_records),
-            None => {
-                if self.next_column_reader()? {
-                    self.column_reader
-                        .as_mut()
-                        .unwrap()
-                        .skip_records(num_records)
-                } else {
-                    Ok(0)
-                }
+        let mut num_read = 0;
+        while (self.column_reader.is_some() || self.next_column_reader()?)
+            && num_read < num_records
+        {
+            let remain_to_skip = num_records - num_read;
+            let skip = self
+                .column_reader
+                .as_mut()
+                .unwrap()
+                .skip_records(remain_to_skip)
+                .unwrap();

Review Comment:
   ```suggestion
               let skip = self
                   .column_reader
                   .as_mut()
                   .unwrap()
                   .skip_records(remain_to_skip)?;
   ```



-- 
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]

Reply via email to