vortex_array/arrow/
mod.rs

1//! Utilities to work with `Arrow` data and types.
2
3use arrow_array::ArrayRef;
4use arrow_schema::DataType;
5use vortex_error::VortexResult;
6
7pub use crate::arrow::dtype::{infer_data_type, infer_schema};
8
9mod array;
10mod datum;
11mod dtype;
12mod record_batch;
13pub use datum::*;
14
15pub trait FromArrowArray<A> {
16    fn from_arrow(array: A, nullable: bool) -> Self;
17}
18
19pub trait FromArrowType<T>: Sized {
20    fn from_arrow(value: T) -> Self;
21}
22
23pub trait TryFromArrowType<T>: Sized {
24    fn try_from_arrow(value: T) -> VortexResult<Self>;
25}
26
27pub trait IntoArrowArray {
28    fn into_arrow_preferred(self) -> VortexResult<ArrayRef>;
29
30    fn into_arrow(self, data_type: &DataType) -> VortexResult<ArrayRef>;
31}