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

Added support to read nested binary from parquet #978

Merged
merged 1 commit into from
May 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 19 additions & 33 deletions src/io/parquet/read/deserialize/mod.rs
Original file line number Diff line number Diff line change
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