Struct datafusion_python::datafusion_common::arrow::array::MutableArrayData
source · pub struct MutableArrayData<'a> { /* private fields */ }Expand description
Implementations§
source§impl<'a> MutableArrayData<'a>
impl<'a> MutableArrayData<'a>
sourcepub fn new(
arrays: Vec<&'a ArrayData>,
use_nulls: bool,
capacity: usize,
) -> MutableArrayData<'a>
pub fn new( arrays: Vec<&'a ArrayData>, use_nulls: bool, capacity: usize, ) -> MutableArrayData<'a>
returns a new MutableArrayData with capacity to capacity slots and specialized to create an
ArrayData from multiple arrays.
use_nulls is a flag used to optimize insertions. It should be false if the only source of nulls
are the arrays themselves and true if the user plans to call MutableArrayData::extend_nulls.
In other words, if use_nulls is false, calling MutableArrayData::extend_nulls should not be used.
sourcepub fn with_capacities(
arrays: Vec<&'a ArrayData>,
use_nulls: bool,
capacities: Capacities,
) -> MutableArrayData<'a>
pub fn with_capacities( arrays: Vec<&'a ArrayData>, use_nulls: bool, capacities: Capacities, ) -> MutableArrayData<'a>
Similar to MutableArrayData::new, but lets users define the preallocated capacities of the array. See also MutableArrayData::new for more information on the arguments.
§Panic
This function panics if the given capacities don’t match the data type of arrays. Or when
a Capacities variant is not yet supported.
sourcepub fn extend(&mut self, index: usize, start: usize, end: usize)
pub fn extend(&mut self, index: usize, start: usize, end: usize)
Extends this array with a chunk of its source arrays
§Arguments
index- the index of array that you what to copy values fromstart- the start index of the chunk (inclusive)end- the end index of the chunk (exclusive)
§Panic
This function panics if there is an invalid index,
i.e. index >= the number of source arrays
or end > the length of the indexth array
sourcepub fn extend_nulls(&mut self, len: usize)
pub fn extend_nulls(&mut self, len: usize)
Extends this MutableArrayData with null elements, disregarding the bound arrays
§Panics
Panics if MutableArrayData not created with use_nulls or nullable source arrays
sourcepub fn null_count(&self) -> usize
pub fn null_count(&self) -> usize
Returns the current null count
sourcepub fn freeze(self) -> ArrayData
pub fn freeze(self) -> ArrayData
Creates a ArrayData from the pushed regions up to this point, consuming self.
sourcepub fn into_builder(self) -> ArrayDataBuilder
pub fn into_builder(self) -> ArrayDataBuilder
Creates a ArrayDataBuilder from the pushed regions up to this point, consuming self.
This is useful for extending the default behavior of MutableArrayData.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for MutableArrayData<'a>
impl<'a> !RefUnwindSafe for MutableArrayData<'a>
impl<'a> !Send for MutableArrayData<'a>
impl<'a> !Sync for MutableArrayData<'a>
impl<'a> Unpin for MutableArrayData<'a>
impl<'a> !UnwindSafe for MutableArrayData<'a>
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> 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