Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support list_view_array & large_list_view layout and basic construction #5576

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
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
1,254 changes: 1,254 additions & 0 deletions arrow-array/src/array/list_view_array.rs

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions arrow-array/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ mod union_array;
pub use union_array::*;

mod run_array;

pub use run_array::*;

mod byte_view_array;

pub use byte_view_array::*;

mod list_view_array;
pub use list_view_array::*;

/// An array in the [arrow columnar format](https://arrow.apache.org/docs/format/Columnar.html)
pub trait Array: std::fmt::Debug + Send + Sync {
/// Returns the array as [`Any`] so that it can be
Expand Down Expand Up @@ -519,6 +520,12 @@ impl<OffsetSize: OffsetSizeTrait> PartialEq for GenericListArray<OffsetSize> {
}
}

impl<OffsetSize: OffsetSizeTrait> PartialEq for GenericListViewArray<OffsetSize> {
fn eq(&self, other: &Self) -> bool {
self.to_data().eq(&other.to_data())
}
}

impl PartialEq for MapArray {
fn eq(&self, other: &Self) -> bool {
self.to_data().eq(&other.to_data())
Expand Down Expand Up @@ -606,7 +613,9 @@ pub fn make_array(data: ArrayData) -> ArrayRef {
DataType::LargeUtf8 => Arc::new(LargeStringArray::from(data)) as ArrayRef,
DataType::Utf8View => Arc::new(StringViewArray::from(data)) as ArrayRef,
DataType::List(_) => Arc::new(ListArray::from(data)) as ArrayRef,
DataType::ListView(_) => Arc::new(ListViewArray::from(data)) as ArrayRef,
DataType::LargeList(_) => Arc::new(LargeListArray::from(data)) as ArrayRef,
DataType::LargeListView(_) => Arc::new(LargeListViewArray::from(data)) as ArrayRef,
DataType::Struct(_) => Arc::new(StructArray::from(data)) as ArrayRef,
DataType::Map(_, _) => Arc::new(MapArray::from(data)) as ArrayRef,
DataType::Union(_, _) => Arc::new(UnionArray::from(data)) as ArrayRef,
Expand Down
2 changes: 1 addition & 1 deletion arrow-array/src/builder/generic_list_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ mod tests {
}

#[test]
fn test_boxed_primitive_aray_builder() {
fn test_boxed_primitive_array_builder() {
let values_builder = make_builder(&DataType::Int32, 5);
let mut builder = ListBuilder::new(values_builder);

Expand Down
Loading
Loading