Skip to content

Commit

Permalink
fix typos and clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite committed Jul 26, 2024
1 parent 60080fd commit 03fa6d0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ impl<O: Offset> utils::Decoder for BinaryDecoder<O> {

fn target_reserve(&self, target: &mut Self::Target, n: usize) {
// @NOTE: This is an estimation for the reservation. It will probably not be
// accurate, but then it is a lot better then not allocating.
// accurate, but then it is a lot better than not allocating.
target.offsets.reserve(n);
target.values.reserve(n);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ pub struct PageNestedDictArrayDecoder<
_pd: std::marker::PhantomData<K>,
}

/// Return the defintion and repetition level iterators for this page.
/// Return the definition and repetition level iterators for this page.
fn level_iters(page: &DataPage) -> ParquetResult<(HybridRleDecoder, HybridRleDecoder)> {
let split = split_buffer(page)?;
let def = split.def;
Expand Down
24 changes: 0 additions & 24 deletions crates/polars/tests/it/io/parquet/read/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,6 @@ impl<'a> DefLevelsDecoder<'a> {
}
}

/// Iterator adapter to convert an iterator of non-null values and an iterator over validity
/// into an iterator of optional values.
#[derive(Debug, Clone)]
pub struct OptionalValues<T, V: Iterator<Item = bool>, I: Iterator<Item = T>> {
validity: V,
values: I,
}

impl<T, V: Iterator<Item = bool>, I: Iterator<Item = T>> Iterator for OptionalValues<T, V, I> {
type Item = Option<T>;

#[inline]
fn next(&mut self) -> Option<Self::Item> {
self.validity
.next()
.map(|x| if x { self.values.next() } else { None })
}

#[inline]
fn size_hint(&self) -> (usize, Option<usize>) {
self.validity.size_hint()
}
}

pub fn deserialize_optional<C: Clone, I: Iterator<Item = ParquetResult<C>>>(
validity: DefLevelsDecoder,
values: I,
Expand Down

0 comments on commit 03fa6d0

Please sign in to comment.