Enum ShreddingState

Source
pub enum ShreddingState {
    Unshredded {
        metadata: BinaryViewArray,
        value: BinaryViewArray,
    },
    Typed {
        metadata: BinaryViewArray,
        typed_value: ArrayRef,
    },
    PartiallyShredded {
        metadata: BinaryViewArray,
        value: BinaryViewArray,
        typed_value: ArrayRef,
    },
}
Expand description

Represents the shredding state of a VariantArray

VariantArrays can be shredded according to the Parquet Variant Shredding Spec. Shredding means that the actual value is stored in a typed typed_field instead of the generic value field.

Both value and typed_value are optional fields used together to encode a single value. Values in the two fields must be interpreted according to the following table (see Parquet Variant Shredding Spec for more details):

valuetyped_valueMeaning
nullnullThe value is missing; only valid for shredded object fields
non-nullnullThe value is present and may be any type, including null
nullnon-nullThe value is present and is the shredded type
non-nullnon-nullThe value is present and is a partially shredded object

Variants§

§

Unshredded

This variant has no typed_value field

Fields

§metadata: BinaryViewArray
§value: BinaryViewArray
§

Typed

This variant has a typed_value field and no value field meaning it is the shredded type

Fields

§metadata: BinaryViewArray
§typed_value: ArrayRef
§

PartiallyShredded

Partially shredded:

  • value is an object
  • typed_value is a shredded object.

Note the spec says “Writers must not produce data where both value and typed_value are non-null, unless the Variant value is an object.”

Fields

§metadata: BinaryViewArray
§value: BinaryViewArray
§typed_value: ArrayRef

Implementations§

Source§

impl ShreddingState

Source

pub fn try_new( metadata: BinaryViewArray, value: Option<BinaryViewArray>, typed_value: Option<ArrayRef>, ) -> Result<Self, ArrowError>

try to create a new ShreddingState from the given fields

Source

pub fn metadata_field(&self) -> &BinaryViewArray

Return a reference to the metadata field

Source

pub fn value_field(&self) -> Option<&BinaryViewArray>

Return a reference to the value field, if present

Source

pub fn typed_value_field(&self) -> Option<&ArrayRef>

Return a reference to the typed_value field, if present

Source

pub fn slice(&self, offset: usize, length: usize) -> Self

Slice all the underlying arrays

Trait Implementations§

Source§

impl Debug for ShreddingState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> Ungil for T
where T: Send,