vortex_array/arrow/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//! Utilities to work with `Arrow` data and types.

use arrow_array::ArrayRef;
use arrow_schema::DataType;
use vortex_error::VortexResult;

pub use crate::arrow::dtype::{infer_data_type, infer_schema};

mod array;
mod datum;
mod dtype;
mod record_batch;
pub use datum::*;

pub trait FromArrowArray<A> {
    fn from_arrow(array: A, nullable: bool) -> Self;
}

pub trait FromArrowType<T>: Sized {
    fn from_arrow(value: T) -> Self;
}

pub trait TryFromArrowType<T>: Sized {
    fn try_from_arrow(value: T) -> VortexResult<Self>;
}

pub trait IntoArrowArray {
    fn into_arrow_preferred(self) -> VortexResult<ArrayRef>;

    fn into_arrow(self, data_type: &DataType) -> VortexResult<ArrayRef>;
}