tustvold commented on code in PR #2158:
URL: https://github.com/apache/arrow-rs/pull/2158#discussion_r928969472
##########
parquet/src/arrow/record_reader/mod.rs:
##########
@@ -184,11 +185,24 @@ where
/// # Returns
///
/// Number of records skipped
- pub fn skip_records(&mut self, num_records: usize) -> Result<usize> {
+ pub fn skip_records(
+ &mut self,
+ num_records: usize,
+ pages: &mut dyn PageIterator,
+ ) -> Result<usize> {
// First need to clear the buffer
let end_of_column = match self.column_reader.as_mut() {
Some(reader) => !reader.has_next()?,
- None => return Ok(0),
+ None => {
+ // If we skip records before all read operation
+ // we need set `column_reader` by `set_page_reader`
+ if let Some(page_reader) = pages.next() {
+ self.set_page_reader(page_reader?)?;
+ false
Review Comment:
This is wrong, as it will now only mark end_of_column when it reaches the
end of the file, instead of the end of a column chunk within a row group. This
will break record delimiting for repeated fields.
##########
parquet/src/column/reader.rs:
##########
@@ -312,13 +312,20 @@ where
// If page has less rows than the remaining records to
// be skipped, skip entire page
- if metadata.num_rows < remaining {
+ while metadata.num_rows < remaining {
Review Comment:
Why is this necessary, there is already an outer while loop?
--
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]