From bb33208f293201b3b2caed50d88fc4f4cacff360 Mon Sep 17 00:00:00 2001 From: kikkon Date: Sun, 31 Mar 2024 21:39:05 +0800 Subject: [PATCH] chore: cargo clippy --- arrow-array/src/array/list_view_array.rs | 6 +++++- arrow-array/src/builder/generic_list_view_builder.rs | 3 +++ arrow-data/src/equal/list_view.rs | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arrow-array/src/array/list_view_array.rs b/arrow-array/src/array/list_view_array.rs index b0e3a0f26898..f04f328d51aa 100644 --- a/arrow-array/src/array/list_view_array.rs +++ b/arrow-array/src/array/list_view_array.rs @@ -26,6 +26,8 @@ use std::ops::Add; use std::sync::Arc; use crate::iterator::GenericListViewArrayIter; +/// A [`GenericListViewArray`] of variable size lists, storing offsets as `i32`. +/// // See [`ListViewBuilder`](crate::builder::ListViewBuilder) for how to construct a [`ListViewArray`] pub type ListViewArray = GenericListViewArray; @@ -72,6 +74,7 @@ impl GenericListViewArray { DataType::ListView }; + /// Returns the data type of the list view array pub fn try_new( field: FieldRef, offsets: OffsetBuffer, @@ -80,7 +83,6 @@ impl GenericListViewArray { nulls: Option, ) -> Result { - //todo: check illegal offset and size values let mut len = 0usize; for i in 0..offsets.len() { let offset = offsets[i].as_usize(); @@ -276,6 +278,8 @@ impl GenericListViewArray { } } + /// Creates a [`GenericListViewArray`] from an iterator of primitive values + /// pub fn from_iter_primitive(iter: I) -> Self where T: ArrowPrimitiveType, diff --git a/arrow-array/src/builder/generic_list_view_builder.rs b/arrow-array/src/builder/generic_list_view_builder.rs index 59ec9592f5aa..5d5121c4c87f 100644 --- a/arrow-array/src/builder/generic_list_view_builder.rs +++ b/arrow-array/src/builder/generic_list_view_builder.rs @@ -23,6 +23,8 @@ use arrow_schema::{Field, FieldRef}; use crate::builder::ArrayBuilder; use crate::{ArrayRef, GenericListViewArray, OffsetSizeTrait}; +/// Builder for [`GenericListArray`] +/// #[derive(Debug)] pub struct GenericListViewBuilder { offsets_builder: BufferBuilder, @@ -142,6 +144,7 @@ impl GenericListViewBuilder(&mut self, i: I) where diff --git a/arrow-data/src/equal/list_view.rs b/arrow-data/src/equal/list_view.rs index b6a5d7e945fa..6e738bc54552 100644 --- a/arrow-data/src/equal/list_view.rs +++ b/arrow-data/src/equal/list_view.rs @@ -36,7 +36,6 @@ pub(super) fn list_view_equal( return false; } - print!("lhs_offset_start: {}, rhs_offset_start: {}, lhs_size: {}\n", lhs_offset_start, rhs_offset_start, lhs_size); // compare values if !equal_range( &lhs.child_data()[0],