pub trait FieldType {
    type Array;

    const ARROW_DATA_TYPE: DataType;

    // Provided method
    fn convert_arrow_array(
        array: Self::Array,
        _data_type: DataType
    ) -> Self::Array { ... }
}
Expand description

Indicates that a type is can be stored in an Arrow array.

Required Associated Types§

source

type Array

The type of arrow array this field type is stored in.

Required Associated Constants§

source

const ARROW_DATA_TYPE: DataType

The logical arrow data type that an arrow array of this data should have.

Provided Methods§

source

fn convert_arrow_array(array: Self::Array, _data_type: DataType) -> Self::Array

Convert the logical type of Self::Array, if needed.

The default implementation is a no-op, but some field types may need to implement this to ensure the underlying boxed Arrow array can be downcast correctly.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FieldType for &str

§

type Array = Utf8Array<i32>

source§

const ARROW_DATA_TYPE: DataType = DataType::Utf8

source§

impl FieldType for bool

§

type Array = BooleanArray

source§

const ARROW_DATA_TYPE: DataType = DataType::Boolean

source§

fn convert_arrow_array(array: Self::Array, _data_type: DataType) -> Self::Array

source§

impl FieldType for f32

§

type Array = PrimitiveArray<f32>

source§

const ARROW_DATA_TYPE: DataType = DataType::Float32

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

source§

impl FieldType for f64

§

type Array = PrimitiveArray<f64>

source§

const ARROW_DATA_TYPE: DataType = DataType::Float64

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

source§

impl FieldType for i8

§

type Array = PrimitiveArray<i8>

source§

const ARROW_DATA_TYPE: DataType = DataType::Int8

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

source§

impl FieldType for i16

§

type Array = PrimitiveArray<i16>

source§

const ARROW_DATA_TYPE: DataType = DataType::Int16

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

source§

impl FieldType for i32

§

type Array = PrimitiveArray<i32>

source§

const ARROW_DATA_TYPE: DataType = DataType::Int32

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

source§

impl FieldType for i64

§

type Array = PrimitiveArray<i64>

source§

const ARROW_DATA_TYPE: DataType = DataType::Int64

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

source§

impl FieldType for u8

§

type Array = PrimitiveArray<u8>

source§

const ARROW_DATA_TYPE: DataType = DataType::UInt8

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

source§

impl FieldType for u16

§

type Array = PrimitiveArray<u16>

source§

const ARROW_DATA_TYPE: DataType = DataType::UInt16

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

source§

impl FieldType for u32

§

type Array = PrimitiveArray<u32>

source§

const ARROW_DATA_TYPE: DataType = DataType::UInt32

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

source§

impl FieldType for u64

§

type Array = PrimitiveArray<u64>

source§

const ARROW_DATA_TYPE: DataType = DataType::UInt64

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

source§

impl FieldType for String

§

type Array = Utf8Array<i32>

source§

const ARROW_DATA_TYPE: DataType = DataType::Utf8

source§

impl FieldType for SystemTime

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

Convert the logical type of Self::Array to DataType::Timestamp.

§

type Array = PrimitiveArray<i64>

source§

const ARROW_DATA_TYPE: DataType = _

source§

impl FieldType for NaiveDate

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

Convert the logical type of Self::Array to DataType::Timestamp.

§

type Array = PrimitiveArray<i64>

source§

const ARROW_DATA_TYPE: DataType = _

source§

impl FieldType for NaiveDateTime

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

Convert the logical type of Self::Array to DataType::Timestamp.

§

type Array = PrimitiveArray<i64>

source§

const ARROW_DATA_TYPE: DataType = _

source§

impl<T> FieldType for Date<T>
where T: Offset + TimeZone,

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

Convert the logical type of Self::Array to DataType::Timestamp.

§

type Array = PrimitiveArray<i64>

source§

const ARROW_DATA_TYPE: DataType = _

source§

impl<T> FieldType for DateTime<T>
where T: Offset + TimeZone,

source§

fn convert_arrow_array(array: Self::Array, data_type: DataType) -> Self::Array

Convert the logical type of Self::Array to DataType::Timestamp.

§

type Array = PrimitiveArray<i64>

source§

const ARROW_DATA_TYPE: DataType = _

Implementors§