use arrow::datatypes::*;
pub trait ArrowType {
type Native: Sized;
}
pub struct NullType;
pub struct FixedSizeBinaryType;
impl ArrowType for NullType {
type Native = ();
}
impl ArrowType for BooleanType {
type Native = bool;
}
macro_rules! impl_arrow_primitive_type {
($($t: ty,)+) => {
$(
impl ArrowType for $t {
type Native = <Self as ArrowPrimitiveType>::Native;
}
)+
};
}
impl_arrow_primitive_type!(
Int8Type,
Int16Type,
Int32Type,
Int64Type,
UInt8Type,
UInt16Type,
UInt32Type,
UInt64Type,
Float16Type,
Float32Type,
Float64Type,
TimestampSecondType,
TimestampMillisecondType,
TimestampMicrosecondType,
TimestampNanosecondType,
Date32Type,
Date64Type,
Time32SecondType,
Time32MillisecondType,
Time64MicrosecondType,
Time64NanosecondType,
IntervalYearMonthType,
IntervalDayTimeType,
IntervalMonthDayNanoType,
DurationSecondType,
DurationMillisecondType,
DurationMicrosecondType,
DurationNanosecondType,
Decimal128Type,
Decimal256Type,
);
impl ArrowType for BinaryType {
type Native = Vec<u8>;
}
impl ArrowType for LargeBinaryType {
type Native = Vec<u8>;
}
impl ArrowType for FixedSizeBinaryType {
type Native = Vec<u8>;
}
impl ArrowType for Utf8Type {
type Native = String;
}
impl ArrowType for LargeUtf8Type {
type Native = String;
}