Struct ShreddedVariant
- Namespace
- Apache.Arrow.Operations.Shredding
- Assembly
- Apache.Arrow.Operations.dll
Zero-copy reader for a single row of a (possibly shredded) variant column. Composes with the ShredSchema for this position to expose the typed columns and residual bytes side-by-side, or to materialize the logical value on demand.
A ShreddedVariant does not own any Arrow buffers; it is only valid while the underlying Arrow arrays are alive.
public ref struct ShreddedVariant
- Inherited Members
Properties
HasResidual
True when the residual value column has a value at this index.
public bool HasResidual { get; }
Property Value
HasTypedValue
True when the typed_value column has a value at this index.
public bool HasTypedValue { get; }
Property Value
IsMissing
True when neither the residual nor the typed column is populated at this index — valid only for sub-fields of shredded objects.
public bool IsMissing { get; }
Property Value
Metadata
The column-level variant metadata.
public ReadOnlySpan<byte> Metadata { get; }
Property Value
Schema
The schema describing how this slot is shredded.
public ShredSchema Schema { get; }
Property Value
Methods
GetArray()
Reader for a shredded array at this slot. Valid only when the schema's TypedValueType is Array.
public ShreddedArray GetArray()
Returns
GetBinaryBytes()
Reads the shredded binary value at this slot as a byte span.
public ReadOnlySpan<byte> GetBinaryBytes()
Returns
GetBoolean()
Reads the shredded boolean value at this slot.
public bool GetBoolean()
Returns
GetDateDays()
Reads the shredded date (days since epoch) at this slot.
public int GetDateDays()
Returns
GetDecimal()
Reads the shredded decimal value at this slot. Works for Decimal4, Decimal8, and Decimal16 shred types, regardless of whether the Arrow column is backed by Decimal32Array, Decimal64Array, or Decimal128Array.
public decimal GetDecimal()
Returns
GetDouble()
Reads the shredded 64-bit double at this slot.
public double GetDouble()
Returns
GetFloat()
Reads the shredded 32-bit float at this slot.
public float GetFloat()
Returns
GetInt16()
Reads the shredded 16-bit signed integer at this slot.
public short GetInt16()
Returns
GetInt32()
Reads the shredded 32-bit signed integer at this slot.
public int GetInt32()
Returns
GetInt64()
Reads the shredded 64-bit signed integer at this slot.
public long GetInt64()
Returns
GetInt8()
Reads the shredded 8-bit signed integer at this slot.
public sbyte GetInt8()
Returns
GetObject()
Reader for a shredded object at this slot. Valid only when the schema's TypedValueType is Object.
public ShreddedObject GetObject()
Returns
GetSqlDecimal()
Reads the shredded decimal value at this slot. Works for Decimal4, Decimal8, and Decimal16 shred types, regardless of whether the Arrow column is backed by Decimal32Array, Decimal64Array, or Decimal128Array.
public SqlDecimal GetSqlDecimal()
Returns
GetString()
Reads the shredded string value at this slot.
public string GetString()
Returns
GetTimeNtzMicros()
Reads the shredded time-without-tz (microseconds since midnight) at this slot.
public long GetTimeNtzMicros()
Returns
GetTimestampMicros()
Reads the shredded timestamp (microseconds since epoch, UTC) at this slot.
public long GetTimestampMicros()
Returns
GetTimestampNtzMicros()
Reads the shredded timestamp-without-tz (microseconds since epoch) at this slot.
public long GetTimestampNtzMicros()
Returns
GetTimestampNtzNanos()
Reads the shredded timestamp-without-tz (nanoseconds since epoch) at this slot.
public long GetTimestampNtzNanos()
Returns
GetTimestampTzNanos()
Reads the shredded timestamp-with-tz (nanoseconds since epoch) at this slot.
public long GetTimestampTzNanos()
Returns
GetUuid()
Reads the shredded UUID at this slot.
public Guid GetUuid()
Returns
GetUuidBytes()
Reads the shredded UUID at this slot as raw big-endian (RFC 4122) bytes.
public ReadOnlySpan<byte> GetUuidBytes()
Returns
ToVariantValue()
Materializes this slot into a logical VariantValue, merging typed-column values with residual bytes per the shredding spec.
public VariantValue ToVariantValue()
Returns
Exceptions
- InvalidOperationException
If the slot is missing.
TryGetResidualReader(out VariantReader)
If the residual column has a value at this index, returns a VariantReader over its bytes.
public bool TryGetResidualReader(out VariantReader reader)
Parameters
readerVariantReader