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
VariantArray
s 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):
value | typed_value | Meaning |
---|---|---|
null | null | The value is missing; only valid for shredded object fields |
non-null | null | The value is present and may be any type, including null |
null | non-null | The value is present and is the shredded type |
non-null | non-null | The value is present and is a partially shredded object |
Variants§
Unshredded
This variant has no typed_value field
Typed
This variant has a typed_value field and no value field meaning it is the shredded type
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.”
Implementations§
Source§impl ShreddingState
impl ShreddingState
Sourcepub fn try_new(
metadata: BinaryViewArray,
value: Option<BinaryViewArray>,
typed_value: Option<ArrayRef>,
) -> Result<Self, ArrowError>
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
Sourcepub fn metadata_field(&self) -> &BinaryViewArray
pub fn metadata_field(&self) -> &BinaryViewArray
Return a reference to the metadata field
Sourcepub fn value_field(&self) -> Option<&BinaryViewArray>
pub fn value_field(&self) -> Option<&BinaryViewArray>
Return a reference to the value field, if present
Sourcepub fn typed_value_field(&self) -> Option<&ArrayRef>
pub fn typed_value_field(&self) -> Option<&ArrayRef>
Return a reference to the typed_value field, if present