Expand description
Bridge from Rust types to Arrow typed arrays and DataType
.
This module provides a compile-time mapping from Rust value types to
arrow-rs typed builders/arrays and their corresponding arrow_schema::DataType
,
avoiding any runtime DataType
matching.
- Core trait:
ArrowBinding
(Rust type → typed builder/array +DataType
). - Primitives:
i{8,16,32,64}
,u{8,16,32,64}
,f{32,64}
,bool
. - Utf8/Binary:
String
→Utf8
,Vec<u8>
→Binary
. - Nested containers:
List<T>
with non-null items, andList<Option<T>>
for nullable items.Dictionary<K, String>
→ dictionary-encoded Utf8 values.Timestamp<U>
with unit markers (Second
,Millisecond
,Microsecond
,Nanosecond
) andTimestampTz<U, Z>
for timezone-aware timestamps.- Any
T: Record + StructMeta
binds to an ArrowStructArray
.
See tests for end-to-end examples and usage patterns.
Structs§
- Column
Builder - A typed column builder for column
I
of recordR
. - Date32
- Days since UNIX epoch.
- Date64
- Milliseconds since UNIX epoch.
- Decimal128
- Fixed-precision decimal stored in 128 bits.
The value is represented as a scaled integer of type
i128
. - Decimal256
- Fixed-precision decimal stored in 256 bits.
The value is represented as a scaled integer of type
i256
. - Dictionary
- Wrapper denoting an Arrow Dictionary column with key type
K
and values ofV
. - Duration
- Duration in the given unit.
- Fixed
Size List - Wrapper denoting an Arrow
FixedSizeListArray
column withN
elements ofT
. - Fixed
Size List Nullable - Wrapper denoting a
FixedSizeListArray
withN
elements where items are nullable. - Interval
DayTime - Interval with unit
DayTime
(packed days and milliseconds). - Interval
Month DayNano - Interval with unit
MonthDayNano
(packed months, days, and nanoseconds). - Interval
Year Month - Interval with unit
YearMonth
(i32 months since epoch). - Large
Binary - Wrapper denoting Arrow
LargeBinary
values. Use when individual binary values can exceed 2GB or when 64-bit offsets are preferred. - Large
List - Wrapper denoting an Arrow
LargeListArray
column with elements ofT
. - Large
Utf8 - Wrapper denoting Arrow
LargeUtf8
values. Use when individual strings can be extremely large or when 64-bit offsets are preferred. - List
- Wrapper denoting an Arrow
ListArray
column with elements ofT
. - Map
- Wrapper denoting an Arrow
MapArray
column with entries(K, V)
. - Null
- Marker type for Arrow
DataType::Null
columns. - Ordered
Map - Sorted-keys
Map
: entries sourced fromBTreeMap<K, V>
, declaringkeys_sorted = true
. Keys are non-nullable; the value field is nullable perMapBuilder
semantics, but this wrapper does not write null values. - Time32
- Number of seconds/milliseconds since midnight.
- Time64
- Number of microseconds/nanoseconds since midnight.
- Timestamp
- Timestamp value (unit only, timezone = None).
- Timestamp
Tz - Timestamp with time unit
U
and timezone markerZ
.
Enums§
- Microsecond
- Microseconds since epoch.
- Millisecond
- Milliseconds since epoch.
- Nanosecond
- Nanoseconds since epoch.
- Second
- Seconds since epoch.
- Utc
- UTC timezone marker.
Traits§
- Arrow
Binding - Binding from a Rust type to Arrow typed builders/arrays and
DataType
. - DictKey
- Dictionary key mapping from Rust integer to Arrow key type.
- Time
Zone Spec - Marker describing a timestamp timezone.
Functions§
- data_
type_ of - Returns the Arrow
DataType
for columnI
of recordR
.