pub(crate) struct UnionVariantToArrowRowBuilder<'a> {
fields: &'a UnionFields,
mode: UnionMode,
children: Vec<UnionChildBuilder<'a>>,
type_ids: Vec<i8>,
offsets: Vec<i32>,
null_child: usize,
cast_options: &'a CastOptions<'a>,
}Expand description
Builder for converting variant values into a [UnionArray].
Each value is dispatched to the union field that most exactly represents its runtime type
(see union_child_rank), with ties broken by declaration order. Unions have no top-level
null buffer, so null rows – and, in safe mode, values no field can represent – become a
null in the [DataType::Null] child if the union declares one, otherwise in the first child.
Fields§
§fields: &'a UnionFields§mode: UnionMode§children: Vec<UnionChildBuilder<'a>>§type_ids: Vec<i8>§offsets: Vec<i32>Dense mode only
null_child: usize§cast_options: &'a CastOptions<'a>Implementations§
Source§impl<'a> UnionVariantToArrowRowBuilder<'a>
impl<'a> UnionVariantToArrowRowBuilder<'a>
fn try_new( fields: &'a UnionFields, mode: UnionMode, cast_options: &'a CastOptions<'a>, capacity: usize, ) -> Result<Self>
fn append_null(&mut self) -> Result<()>
fn append_value(&mut self, value: &Variant<'_, '_>) -> Result<bool>
fn select_child(&self, value: &Variant<'_, '_>) -> Option<usize>
fn append_to_child( &mut self, index: usize, value: Option<&Variant<'_, '_>>, ) -> Result<bool>
fn finish(self) -> Result<ArrayRef>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for UnionVariantToArrowRowBuilder<'a>
impl<'a> !UnwindSafe for UnionVariantToArrowRowBuilder<'a>
impl<'a> Freeze for UnionVariantToArrowRowBuilder<'a>
impl<'a> Send for UnionVariantToArrowRowBuilder<'a>
impl<'a> Sync for UnionVariantToArrowRowBuilder<'a>
impl<'a> Unpin for UnionVariantToArrowRowBuilder<'a>
impl<'a> UnsafeUnpin for UnionVariantToArrowRowBuilder<'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
Mutably borrows from an owned value. Read more