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

Commit

Permalink
Fix error in reading nested parquet structs (#1015)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed May 27, 2022
1 parent bbe7209 commit 7cc874f
Show file tree
Hide file tree
Showing 9 changed files with 162 additions and 136 deletions.
2 changes: 1 addition & 1 deletion src/io/parquet/read/deserialize/binary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub use dictionary::DictIter;
/// Converts [`DataPages`] to an [`Iterator`] of [`Array`]
pub fn iter_to_arrays_nested<'a, O, A, I>(
iter: I,
init: InitNested,
init: Vec<InitNested>,
data_type: DataType,
chunk_size: usize,
) -> NestedArrayIter<'a>
Expand Down
4 changes: 2 additions & 2 deletions src/io/parquet/read/deserialize/binary/nested.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ impl<'a, O: Offset> utils::Decoder<'a> for BinaryDecoder<O> {
pub struct ArrayIterator<O: Offset, A: TraitBinaryArray<O>, I: DataPages> {
iter: I,
data_type: DataType,
init: InitNested,
init: Vec<InitNested>,
items: VecDeque<(Binary<O>, MutableBitmap)>,
nested: VecDeque<NestedState>,
chunk_size: usize,
phantom_a: std::marker::PhantomData<A>,
}

impl<O: Offset, A: TraitBinaryArray<O>, I: DataPages> ArrayIterator<O, A, I> {
pub fn new(iter: I, init: InitNested, data_type: DataType, chunk_size: usize) -> Self {
pub fn new(iter: I, init: Vec<InitNested>, data_type: DataType, chunk_size: usize) -> Self {
Self {
iter,
data_type,
Expand Down
2 changes: 1 addition & 1 deletion src/io/parquet/read/deserialize/boolean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub use self::basic::Iter;
/// Converts [`DataPages`] to an [`Iterator`] of [`Array`]
pub fn iter_to_arrays_nested<'a, I: 'a>(
iter: I,
init: InitNested,
init: Vec<InitNested>,
chunk_size: usize,
) -> NestedArrayIter<'a>
where
Expand Down
4 changes: 2 additions & 2 deletions src/io/parquet/read/deserialize/boolean/nested.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ impl<'a> Decoder<'a> for BooleanDecoder {
#[derive(Debug)]
pub struct ArrayIterator<I: DataPages> {
iter: I,
init: InitNested,
init: Vec<InitNested>,
// invariant: items.len() == nested.len()
items: VecDeque<(MutableBitmap, MutableBitmap)>,
nested: VecDeque<NestedState>,
chunk_size: usize,
}

impl<I: DataPages> ArrayIterator<I> {
pub fn new(iter: I, init: InitNested, chunk_size: usize) -> Self {
pub fn new(iter: I, init: Vec<InitNested>, chunk_size: usize) -> Self {
Self {
iter,
init,
Expand Down
Loading

0 comments on commit 7cc874f

Please sign in to comment.