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 and nullable 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
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 more