pub enum DeltaType {
Show 16 variants
String,
Long,
Integer,
Short,
Byte,
Float,
Double,
Decimal(u8, i8),
Boolean,
Binary,
Date,
Timestamp,
TimestampNtz,
Array {
element: Box<DeltaType>,
contains_null: bool,
},
Map {
key: Box<DeltaType>,
value: Box<DeltaType>,
value_contains_null: bool,
},
Struct(Vec<DeltaStructField>),
}Variants§
String
Long
Integer
Short
Byte
Float
Double
Decimal(u8, i8)
Boolean
Binary
Date
Timestamp
With timezone, microsecond precision (Delta’s plain "timestamp").
TimestampNtz
Without timezone, microsecond precision - requires the
timestampNtz reader/writer table feature.
Array
Map
Struct(Vec<DeltaStructField>)
Implementations§
Source§impl DeltaType
impl DeltaType
Sourcepub fn to_json(&self) -> Value
pub fn to_json(&self) -> Value
Serializes to Delta’s actual schema JSON representation - a bare
string for primitives, a nested object for array/map/struct.
Sourcepub fn from_arrow_type(dt: &DataType) -> Self
pub fn from_arrow_type(dt: &DataType) -> Self
Infers the Delta type for an Arrow [DataType]. Nested types
(Struct/List/Map) recurse into genuine Delta struct/array/
map shapes, not a Jsonb-style flattening - Delta’s own format
natively supports nesting, unlike a Postgres column.
Sourcepub fn to_arrow_type(&self) -> DataType
pub fn to_arrow_type(&self) -> DataType
The Arrow type this Delta type round-trips through - the inverse
of from_arrow_type for the common cases (some narrowing is
inherent: e.g. Delta’s timestamp/timestampNtz are always
microsecond precision, matching Delta’s own fixed precision).
Sourcepub fn from_pg_type(pg: &PgType) -> Self
pub fn from_pg_type(pg: &PgType) -> Self
Via the Arrow hub: PgType::to_arrow_type then from_arrow_type.
Sourcepub fn to_pg_type(&self) -> PgType
pub fn to_pg_type(&self) -> PgType
Via the Arrow hub: to_arrow_type then PgType::from_arrow_type.