vortex_array/arrow/
mod.rs1use arrow_array::ArrayRef as ArrowArrayRef;
7use arrow_schema::DataType;
8use vortex_error::VortexResult;
9
10mod array;
11pub mod compute;
12mod convert;
13mod datum;
14mod iter;
15mod record_batch;
16
17pub use array::*;
18pub(crate) use compute::warm_up_vtable;
19pub use datum::*;
20pub use iter::*;
21
22use crate::arrow::compute::ToArrowOptions;
23
24pub trait FromArrowArray<A> {
25 fn from_arrow(array: A, nullable: bool) -> Self;
26}
27
28pub trait IntoArrowArray {
29 fn into_arrow_preferred(self) -> VortexResult<ArrowArrayRef>;
30
31 fn into_arrow(self, data_type: &DataType) -> VortexResult<ArrowArrayRef>;
32}
33
34impl IntoArrowArray for crate::ArrayRef {
35 fn into_arrow_preferred(self) -> VortexResult<ArrowArrayRef> {
38 compute::to_arrow_opts(&self, &ToArrowOptions { arrow_type: None })
39 }
40
41 fn into_arrow(self, data_type: &DataType) -> VortexResult<ArrowArrayRef> {
42 compute::to_arrow_opts(
43 &self,
44 &ToArrowOptions {
45 arrow_type: Some(data_type.clone()),
46 },
47 )
48 }
49}