-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug in page skipping #2552
Fix bug in page skipping #2552
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,7 +145,11 @@ where | |
loop { | ||
// Try to find some records from buffers that has been read into memory | ||
// but not counted as seen records. | ||
let end_of_column = !self.column_reader.as_mut().unwrap().has_next()?; | ||
|
||
// Check to see if the column is exhausted. Only peek the next page since in | ||
// case we are reading to a page boundary and do not actually need to read | ||
// the next page. | ||
let end_of_column = !self.column_reader.as_mut().unwrap().peek_next()?; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should ultimately get cleaned up a bit. It is confusing since we need to |
||
|
||
let (record_count, value_count) = | ||
self.count_records(num_records - records_read, end_of_column); | ||
|
@@ -154,7 +158,9 @@ where | |
self.num_values += value_count; | ||
records_read += record_count; | ||
|
||
if records_read == num_records || end_of_column { | ||
if records_read == num_records | ||
|| !self.column_reader.as_mut().unwrap().has_next()? | ||
{ | ||
break; | ||
} | ||
|
||
|
@@ -198,7 +204,7 @@ where | |
pub fn skip_records(&mut self, num_records: usize) -> Result<usize> { | ||
// First need to clear the buffer | ||
let end_of_column = match self.column_reader.as_mut() { | ||
Some(reader) => !reader.has_next()?, | ||
Some(reader) => !reader.peek_next()?, | ||
None => return Ok(0), | ||
}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I run this test without this pr change, still passed🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this test is actually unrelated to the fix. I originally thought the bug was in the
scan_ranges
so I added this test. But it turned out to be unrelated and I figured I might as well leave another unit test in. Sorry for the confusion :)