Struct datafusion::common::arrow::datatypes::UnionFields
source · pub struct UnionFields(/* private fields */);
Expand description
A cheaply cloneable, owned collection of FieldRef
and their corresponding type ids
Implementations§
source§impl UnionFields
impl UnionFields
sourcepub fn empty() -> UnionFields
pub fn empty() -> UnionFields
Create a new UnionFields
with no fields
sourcepub fn new<F, T>(type_ids: T, fields: F) -> UnionFields
pub fn new<F, T>(type_ids: T, fields: F) -> UnionFields
Create a new UnionFields
from a Fields
and array of type_ids
See https://arrow.apache.org/docs/format/Columnar.html#union-layout
use arrow_schema::{DataType, Field, UnionFields};
// Create a new UnionFields with type id mapping
// 1 -> DataType::UInt8
// 3 -> DataType::Utf8
UnionFields::new(
vec![1, 3],
vec![
Field::new("field1", DataType::UInt8, false),
Field::new("field3", DataType::Utf8, false),
],
);
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of fields in this UnionFields
Trait Implementations§
source§impl Clone for UnionFields
impl Clone for UnionFields
source§fn clone(&self) -> UnionFields
fn clone(&self) -> UnionFields
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for UnionFields
impl Debug for UnionFields
source§impl FromIterator<(i8, Arc<Field>)> for UnionFields
impl FromIterator<(i8, Arc<Field>)> for UnionFields
source§fn from_iter<T>(iter: T) -> UnionFields
fn from_iter<T>(iter: T) -> UnionFields
Creates a value from an iterator. Read more
source§impl Hash for UnionFields
impl Hash for UnionFields
source§impl Ord for UnionFields
impl Ord for UnionFields
source§fn cmp(&self, other: &UnionFields) -> Ordering
fn cmp(&self, other: &UnionFields) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for UnionFields
impl PartialEq for UnionFields
source§impl PartialOrd for UnionFields
impl PartialOrd for UnionFields
impl Eq for UnionFields
impl StructuralPartialEq for UnionFields
Auto Trait Implementations§
impl Freeze for UnionFields
impl RefUnwindSafe for UnionFields
impl Send for UnionFields
impl Sync for UnionFields
impl Unpin for UnionFields
impl UnwindSafe for UnionFields
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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>
Converts
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>
Converts
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