Table of Contents

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

bool

HasTypedValue

True when the typed_value column has a value at this index.

public bool HasTypedValue { get; }

Property Value

bool

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

bool

Metadata

The column-level variant metadata.

public ReadOnlySpan<byte> Metadata { get; }

Property Value

ReadOnlySpan<byte>

Schema

The schema describing how this slot is shredded.

public ShredSchema Schema { get; }

Property Value

ShredSchema

Methods

GetArray()

Reader for a shredded array at this slot. Valid only when the schema's TypedValueType is Array.

public ShreddedArray GetArray()

Returns

ShreddedArray

GetBinaryBytes()

Reads the shredded binary value at this slot as a byte span.

public ReadOnlySpan<byte> GetBinaryBytes()

Returns

ReadOnlySpan<byte>

GetBoolean()

Reads the shredded boolean value at this slot.

public bool GetBoolean()

Returns

bool

GetDateDays()

Reads the shredded date (days since epoch) at this slot.

public int GetDateDays()

Returns

int

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

decimal

GetDouble()

Reads the shredded 64-bit double at this slot.

public double GetDouble()

Returns

double

GetFloat()

Reads the shredded 32-bit float at this slot.

public float GetFloat()

Returns

float

GetInt16()

Reads the shredded 16-bit signed integer at this slot.

public short GetInt16()

Returns

short

GetInt32()

Reads the shredded 32-bit signed integer at this slot.

public int GetInt32()

Returns

int

GetInt64()

Reads the shredded 64-bit signed integer at this slot.

public long GetInt64()

Returns

long

GetInt8()

Reads the shredded 8-bit signed integer at this slot.

public sbyte GetInt8()

Returns

sbyte

GetObject()

Reader for a shredded object at this slot. Valid only when the schema's TypedValueType is Object.

public ShreddedObject GetObject()

Returns

ShreddedObject

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

SqlDecimal

GetString()

Reads the shredded string value at this slot.

public string GetString()

Returns

string

GetTimeNtzMicros()

Reads the shredded time-without-tz (microseconds since midnight) at this slot.

public long GetTimeNtzMicros()

Returns

long

GetTimestampMicros()

Reads the shredded timestamp (microseconds since epoch, UTC) at this slot.

public long GetTimestampMicros()

Returns

long

GetTimestampNtzMicros()

Reads the shredded timestamp-without-tz (microseconds since epoch) at this slot.

public long GetTimestampNtzMicros()

Returns

long

GetTimestampNtzNanos()

Reads the shredded timestamp-without-tz (nanoseconds since epoch) at this slot.

public long GetTimestampNtzNanos()

Returns

long

GetTimestampTzNanos()

Reads the shredded timestamp-with-tz (nanoseconds since epoch) at this slot.

public long GetTimestampTzNanos()

Returns

long

GetUuid()

Reads the shredded UUID at this slot.

public Guid GetUuid()

Returns

Guid

GetUuidBytes()

Reads the shredded UUID at this slot as raw big-endian (RFC 4122) bytes.

public ReadOnlySpan<byte> GetUuidBytes()

Returns

ReadOnlySpan<byte>

ToVariantValue()

Materializes this slot into a logical VariantValue, merging typed-column values with residual bytes per the shredding spec.

public VariantValue ToVariantValue()

Returns

VariantValue

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

reader VariantReader

Returns

bool