arrow::datatypes

Trait ArrowPrimitiveType

pub trait ArrowPrimitiveType: PrimitiveTypeSealed + 'static {
    type Native: ArrowNativeTypeOp;

    const DATA_TYPE: DataType;

    // Provided methods
    fn get_byte_width() -> usize { ... }
    fn default_value() -> Self::Native { ... }
}
Expand description

Trait for primitive values.

This trait bridges the dynamic-typed nature of Arrow (via DataType) with the static-typed nature of rust types (ArrowNativeType) for all types that implement ArrowNativeType.

Required Associated Constants§

const DATA_TYPE: DataType

the corresponding Arrow data type of this primitive type.

Required Associated Types§

type Native: ArrowNativeTypeOp

Corresponding Rust native type for the primitive type.

Provided Methods§

fn get_byte_width() -> usize

👎Deprecated: Use ArrowNativeType::get_byte_width

Returns the byte width of this primitive type.

fn default_value() -> Self::Native

Returns a default value of this primitive type.

This is useful for aggregate array ops like sum(), mean().

Object Safety§

This trait is not object safe.

Implementors§

§

impl ArrowPrimitiveType for Date32Type

§

const DATA_TYPE: DataType = DataType::Date32

§

type Native = i32

§

impl ArrowPrimitiveType for Date64Type

§

const DATA_TYPE: DataType = DataType::Date64

§

type Native = i64

§

impl ArrowPrimitiveType for Decimal128Type

§

const DATA_TYPE: DataType = <Self as DecimalType>::DEFAULT_TYPE

§

type Native = i128

§

impl ArrowPrimitiveType for Decimal256Type

§

const DATA_TYPE: DataType = <Self as DecimalType>::DEFAULT_TYPE

§

type Native = i256

§

impl ArrowPrimitiveType for DurationMicrosecondType

§

const DATA_TYPE: DataType = _

§

type Native = i64

§

impl ArrowPrimitiveType for DurationMillisecondType

§

const DATA_TYPE: DataType = _

§

type Native = i64

§

impl ArrowPrimitiveType for DurationNanosecondType

§

const DATA_TYPE: DataType = _

§

type Native = i64

§

impl ArrowPrimitiveType for DurationSecondType

§

const DATA_TYPE: DataType = _

§

type Native = i64

§

impl ArrowPrimitiveType for Float16Type

§

const DATA_TYPE: DataType = DataType::Float16

§

type Native = f16

§

impl ArrowPrimitiveType for Float32Type

§

const DATA_TYPE: DataType = DataType::Float32

§

type Native = f32

§

impl ArrowPrimitiveType for Float64Type

§

const DATA_TYPE: DataType = DataType::Float64

§

type Native = f64

§

impl ArrowPrimitiveType for Int8Type

§

const DATA_TYPE: DataType = DataType::Int8

§

type Native = i8

§

impl ArrowPrimitiveType for Int16Type

§

const DATA_TYPE: DataType = DataType::Int16

§

type Native = i16

§

impl ArrowPrimitiveType for Int32Type

§

const DATA_TYPE: DataType = DataType::Int32

§

type Native = i32

§

impl ArrowPrimitiveType for Int64Type

§

const DATA_TYPE: DataType = DataType::Int64

§

type Native = i64

§

impl ArrowPrimitiveType for IntervalDayTimeType

§

impl ArrowPrimitiveType for IntervalMonthDayNanoType

§

impl ArrowPrimitiveType for IntervalYearMonthType

§

const DATA_TYPE: DataType = _

§

type Native = i32

§

impl ArrowPrimitiveType for Time32MillisecondType

§

const DATA_TYPE: DataType = _

§

type Native = i32

§

impl ArrowPrimitiveType for Time32SecondType

§

const DATA_TYPE: DataType = _

§

type Native = i32

§

impl ArrowPrimitiveType for Time64MicrosecondType

§

const DATA_TYPE: DataType = _

§

type Native = i64

§

impl ArrowPrimitiveType for Time64NanosecondType

§

const DATA_TYPE: DataType = _

§

type Native = i64

§

impl ArrowPrimitiveType for TimestampMicrosecondType

§

const DATA_TYPE: DataType = _

§

type Native = i64

§

impl ArrowPrimitiveType for TimestampMillisecondType

§

const DATA_TYPE: DataType = _

§

type Native = i64

§

impl ArrowPrimitiveType for TimestampNanosecondType

§

const DATA_TYPE: DataType = _

§

type Native = i64

§

impl ArrowPrimitiveType for TimestampSecondType

§

const DATA_TYPE: DataType = _

§

type Native = i64

§

impl ArrowPrimitiveType for UInt8Type

§

const DATA_TYPE: DataType = DataType::UInt8

§

type Native = u8

§

impl ArrowPrimitiveType for UInt16Type

§

const DATA_TYPE: DataType = DataType::UInt16

§

type Native = u16

§

impl ArrowPrimitiveType for UInt32Type

§

const DATA_TYPE: DataType = DataType::UInt32

§

type Native = u32

§

impl ArrowPrimitiveType for UInt64Type

§

const DATA_TYPE: DataType = DataType::UInt64

§

type Native = u64