Skip to content

Commit

Permalink
chore: cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikkon committed Mar 31, 2024
1 parent b9ded5b commit bb33208
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion arrow-array/src/array/list_view_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<i32>;

Expand Down Expand Up @@ -72,6 +74,7 @@ impl<OffsetSize: OffsetSizeTrait> GenericListViewArray<OffsetSize> {
DataType::ListView
};

/// Returns the data type of the list view array
pub fn try_new(
field: FieldRef,
offsets: OffsetBuffer<OffsetSize>,
Expand All @@ -80,7 +83,6 @@ impl<OffsetSize: OffsetSizeTrait> GenericListViewArray<OffsetSize> {
nulls: Option<NullBuffer>,
) -> Result<Self, ArrowError> {

//todo: check illegal offset and size values
let mut len = 0usize;
for i in 0..offsets.len() {
let offset = offsets[i].as_usize();
Expand Down Expand Up @@ -276,6 +278,8 @@ impl<OffsetSize: OffsetSizeTrait> GenericListViewArray<OffsetSize> {
}
}

/// Creates a [`GenericListViewArray`] from an iterator of primitive values
///
pub fn from_iter_primitive<T, P, I>(iter: I) -> Self
where
T: ArrowPrimitiveType,
Expand Down
3 changes: 3 additions & 0 deletions arrow-array/src/builder/generic_list_view_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<OffsetSize: OffsetSizeTrait, T: ArrayBuilder> {
offsets_builder: BufferBuilder<OffsetSize>,
Expand Down Expand Up @@ -142,6 +144,7 @@ impl<OffsetSize: OffsetSizeTrait, T: ArrayBuilder> GenericListViewBuilder<Offset
self.null_buffer_builder.append(is_valid);
}

/// Append value into this [`GenericListViewBuilder`]
#[inline]
pub fn append_value<I, V>(&mut self, i: I)
where
Expand Down
1 change: 0 additions & 1 deletion arrow-data/src/equal/list_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ pub(super) fn list_view_equal<T: ArrowNativeType + Integer>(
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],
Expand Down

0 comments on commit bb33208

Please sign in to comment.