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

Commit

Permalink
Added support for nested binary
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed May 5, 2022
1 parent 2d70fbf commit 93fa0c3
Showing 1 changed file with 19 additions and 33 deletions.
52 changes: 19 additions & 33 deletions src/io/parquet/read/deserialize/mod.rs
Expand Up @@ -221,31 +221,34 @@ where
chunk_size,
)
}
LargeBinary => {
LargeUtf8 => {
types.pop();
binary::iter_to_arrays_nested::<i64, BinaryArray<i64>, _>(
binary::iter_to_arrays_nested::<i64, Utf8Array<i64>, _>(
columns.pop().unwrap(),
init.pop().unwrap(),
field.data_type().clone(),
chunk_size,
)
}
List(inner) => {
let iter = columns_to_iter_recursive(
vec![columns.pop().unwrap()],
types,
inner.as_ref().clone(),
init,
Binary => {
types.pop();
binary::iter_to_arrays_nested::<i32, BinaryArray<i32>, _>(
columns.pop().unwrap(),
init.pop().unwrap(),
field.data_type().clone(),
chunk_size,
)?;
let iter = iter.map(move |x| {
let (mut nested, array) = x?;
let array = create_list(field.data_type().clone(), &mut nested, array)?;
Ok((nested, array))
});
Box::new(iter) as _
)
}
LargeBinary => {
types.pop();
binary::iter_to_arrays_nested::<i64, BinaryArray<i64>, _>(
columns.pop().unwrap(),
init.pop().unwrap(),
field.data_type().clone(),
chunk_size,
)
}
LargeList(inner) => {
List(inner) | LargeList(inner) | FixedSizeList(inner, _) => {
let iter = columns_to_iter_recursive(
vec![columns.pop().unwrap()],
types,
Expand Down Expand Up @@ -277,23 +280,6 @@ where
let columns = columns.into_iter().rev().collect();
Box::new(struct_::StructIterator::new(columns, fields.clone()))
}
FixedSizeList(inner, _) => {
let iter = columns_to_iter_recursive(
vec![columns.pop().unwrap()],
types,
inner.as_ref().clone(),
init,
chunk_size,
)?;
let iter = iter.map(move |x| {
let (mut nested, array) = x?;
println!("{nested:?}");
println!("{array:?}");
let array = create_list(field.data_type().clone(), &mut nested, array)?;
Ok((nested, array))
});
Box::new(iter) as _
}
other => todo!("{other:?}"),
})
}
Expand Down

0 comments on commit 93fa0c3

Please sign in to comment.