viirya commented on code in PR #2928:
URL: https://github.com/apache/arrow-rs/pull/2928#discussion_r1005986706
##########
parquet/src/arrow/arrow_reader/selection.rs:
##########
@@ -223,17 +223,26 @@ impl RowSelection {
/// returned: NNNNNNNNNNNNYYYYYNNNNYYYYYYYYYYYYYNNNYYNNN
///
///
+ /// # Panics
+ ///
+ /// Panics if `other` does not have a length equal to the number of rows
selected
+ /// by this RowSelection
+ ///
pub fn and_then(&self, other: &Self) -> Self {
let mut selectors = vec![];
let mut first = self.selectors.iter().cloned().peekable();
let mut second = other.selectors.iter().cloned().peekable();
let mut to_skip = 0;
while let Some(b) = second.peek_mut() {
- let a = first.peek_mut().unwrap();
+ let a = first
+ .peek_mut()
+ .expect("selection exceeds the number of selected rows");
if b.row_count == 0 {
- second.next().unwrap();
+ second
+ .next()
Review Comment:
We peek into `second` to get `b`. Why `second.next()` will be None?
--
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]