Ted-Jiang commented on code in PR #2158:
URL: https://github.com/apache/arrow-rs/pull/2158#discussion_r930574164
##########
parquet/src/arrow/arrow_reader.rs:
##########
@@ -298,11 +307,15 @@ impl Iterator for ParquetRecordBatchReader {
continue;
}
+ // try to read record
let to_read = match
front.row_count.checked_sub(self.batch_size) {
- Some(remaining) => {
- selection.push_front(RowSelection::skip(remaining));
+ Some(remaining) if remaining != 0 => {
+ // if page row count less than batch_size we must set
batch size to page row count.
+ // add check avoid dead loop
+ selection.push_front(RowSelection::select(remaining));
self.batch_size
}
+ Some(_) => self.batch_size,
Review Comment:
yes more elegance 👍
--
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]