Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
skip len checks on nested pages
Browse files Browse the repository at this point in the history
  • Loading branch information
danburkert committed Jan 27, 2022
1 parent 542b4e9 commit bf675a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/io/parquet/read/binary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ where
while let Some(page) = iter.next()? {
basic::extend_from_page(page, metadata.descriptor(), &mut values, &mut validity)?
}
debug_assert_eq!(values.len(), capacity);
debug_assert_eq!(validity.len(), capacity * usize::from(is_nullable));
} else {
while let Some(page) = iter.next()? {
nested::extend_from_page(
Expand All @@ -52,8 +54,6 @@ where
)?
}
}
debug_assert_eq!(values.len(), capacity);
debug_assert_eq!(validity.len(), capacity * usize::from(is_nullable));
Ok(utils::finish_array(data_type, values, validity))
}

Expand Down
4 changes: 2 additions & 2 deletions src/io/parquet/read/boolean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ where
while let Some(page) = iter.next()? {
basic::extend_from_page(page, metadata.descriptor(), &mut values, &mut validity)?
}
debug_assert_eq!(values.len(), capacity);
debug_assert_eq!(validity.len(), capacity * usize::from(is_nullable));
} else {
while let Some(page) = iter.next()? {
nested::extend_from_page(
Expand All @@ -45,8 +47,6 @@ where
)?
}
}
debug_assert_eq!(values.len(), capacity);
debug_assert_eq!(validity.len(), capacity * usize::from(is_nullable));

Ok(Box::new(BooleanArray::from_data(
data_type,
Expand Down
4 changes: 2 additions & 2 deletions src/io/parquet/read/primitive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ where
while let Some(page) = iter.next()? {
basic::extend_from_page(page, metadata.descriptor(), &mut values, &mut validity, op)?
}
debug_assert_eq!(values.len(), capacity);
debug_assert_eq!(validity.len(), capacity * usize::from(is_nullable));
} else {
while let Some(page) = iter.next()? {
nested::extend_from_page(
Expand All @@ -97,8 +99,6 @@ where
)?
}
}
debug_assert_eq!(values.len(), capacity);
debug_assert_eq!(validity.len(), capacity * usize::from(is_nullable));

let data_type = match data_type {
DataType::Dictionary(_, values, _) => values.as_ref().clone(),
Expand Down

0 comments on commit bf675a2

Please sign in to comment.