pub struct SingleRowListArrayBuilder { /* private fields */ }Expand description
Creates single element ListArray, LargeListArray and
FixedSizeListArray from other arrays
For example this builder can convert [1, 2, 3] into [[1, 2, 3]]
§Example
// Array is [1, 2, 3]
let arr = ListArray::from_iter_primitive::<Int64Type, _, _>(vec![Some(vec![
Some(1),
Some(2),
Some(3),
])]);
// Wrap as a list array: [[1, 2, 3]]
let list_arr = SingleRowListArrayBuilder::new(Arc::new(arr)).build_list_array();
assert_eq!(list_arr.len(), 1);Implementations§
Source§impl SingleRowListArrayBuilder
impl SingleRowListArrayBuilder
Sourcepub fn new(arr: ArrayRef) -> Self
pub fn new(arr: ArrayRef) -> Self
Create a new instance of SingleRowListArrayBuilder
Sourcepub fn with_nullable(self, nullable: bool) -> Self
pub fn with_nullable(self, nullable: bool) -> Self
Set the nullable flag
Sourcepub fn with_field_name(self, field_name: Option<String>) -> Self
pub fn with_field_name(self, field_name: Option<String>) -> Self
sets the field name for the resulting array
Sourcepub fn with_field(self, field: &Field) -> Self
pub fn with_field(self, field: &Field) -> Self
Copies field name, nullability, and metadata from the specified field
Sourcepub fn build_list_array(self) -> ListArray
pub fn build_list_array(self) -> ListArray
Build a single element ListArray
Sourcepub fn build_list_scalar(self) -> ScalarValue
pub fn build_list_scalar(self) -> ScalarValue
Build a single element ListArray and wrap as ScalarValue::List
Sourcepub fn build_large_list_array(self) -> LargeListArray
pub fn build_large_list_array(self) -> LargeListArray
Build a single element LargeListArray
Sourcepub fn build_large_list_scalar(self) -> ScalarValue
pub fn build_large_list_scalar(self) -> ScalarValue
Build a single element LargeListArray and wrap as ScalarValue::LargeList
Sourcepub fn build_fixed_size_list_array(self, list_size: usize) -> FixedSizeListArray
pub fn build_fixed_size_list_array(self, list_size: usize) -> FixedSizeListArray
Build a single element FixedSizeListArray
Sourcepub fn build_fixed_size_list_scalar(self, list_size: usize) -> ScalarValue
pub fn build_fixed_size_list_scalar(self, list_size: usize) -> ScalarValue
Build a single element FixedSizeListArray and wrap as ScalarValue::FixedSizeList
Sourcepub fn build_list_view_array(self) -> ListViewArray
pub fn build_list_view_array(self) -> ListViewArray
Build a single element ListViewArray
Sourcepub fn build_list_view_scalar(self) -> ScalarValue
pub fn build_list_view_scalar(self) -> ScalarValue
Build a single element ListViewArray and wrap as ScalarValue::ListView
Sourcepub fn build_large_list_view_array(self) -> LargeListViewArray
pub fn build_large_list_view_array(self) -> LargeListViewArray
Build a single element LargeListViewArray
Sourcepub fn build_large_list_view_scalar(self) -> ScalarValue
pub fn build_large_list_view_scalar(self) -> ScalarValue
Build a single element LargeListViewArray and wrap as ScalarValue::LargeListView
Trait Implementations§
Source§impl Clone for SingleRowListArrayBuilder
impl Clone for SingleRowListArrayBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for SingleRowListArrayBuilder
impl !UnwindSafe for SingleRowListArrayBuilder
impl Forget for SingleRowListArrayBuilder
impl Freeze for SingleRowListArrayBuilder
impl Move for SingleRowListArrayBuilder
impl Send for SingleRowListArrayBuilder
impl Sync for SingleRowListArrayBuilder
impl Unpin for SingleRowListArrayBuilder
impl UnsafeUnpin for SingleRowListArrayBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more