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: Arc<dyn Array>) -> SingleRowListArrayBuilder
pub fn new(arr: Arc<dyn Array>) -> SingleRowListArrayBuilder
Create a new instance of SingleRowListArrayBuilder
Sourcepub fn with_nullable(self, nullable: bool) -> SingleRowListArrayBuilder
pub fn with_nullable(self, nullable: bool) -> SingleRowListArrayBuilder
Set the nullable flag
Sourcepub fn with_field_name(
self,
field_name: Option<String>,
) -> SingleRowListArrayBuilder
pub fn with_field_name( self, field_name: Option<String>, ) -> SingleRowListArrayBuilder
sets the field name for the resulting array
Sourcepub fn with_field(self, field: &Field) -> SingleRowListArrayBuilder
pub fn with_field(self, field: &Field) -> SingleRowListArrayBuilder
Copies field name and nullable from the specified field
Sourcepub fn build_list_array(self) -> GenericListArray<i32>
pub fn build_list_array(self) -> GenericListArray<i32>
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) -> GenericListArray<i64>
pub fn build_large_list_array(self) -> GenericListArray<i64>
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) -> GenericListViewArray<i32>
pub fn build_list_view_array(self) -> GenericListViewArray<i32>
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) -> GenericListViewArray<i64>
pub fn build_large_list_view_array(self) -> GenericListViewArray<i64>
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
Source§fn clone(&self) -> SingleRowListArrayBuilder
fn clone(&self) -> SingleRowListArrayBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SingleRowListArrayBuilder
impl !UnwindSafe for SingleRowListArrayBuilder
impl Freeze for SingleRowListArrayBuilder
impl Send for SingleRowListArrayBuilder
impl Sync for SingleRowListArrayBuilder
impl Unpin for SingleRowListArrayBuilder
impl UnsafeUnpin for SingleRowListArrayBuilder
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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