use arrow_array::ArrayRef as ArrowArrayRef;
use arrow_schema::DataType;
use vortex_error::VortexResult;
mod array;
pub mod compute;
mod convert;
mod datum;
mod iter;
mod record_batch;
pub use array::*;
pub(crate) use compute::warm_up_vtable;
pub use datum::*;
pub use iter::*;
use crate::arrow::compute::ToArrowOptions;
pub trait FromArrowArray<A> {
fn from_arrow(array: A, nullable: bool) -> Self;
}
pub trait IntoArrowArray {
fn into_arrow_preferred(self) -> VortexResult<ArrowArrayRef>;
fn into_arrow(self, data_type: &DataType) -> VortexResult<ArrowArrayRef>;
}
impl IntoArrowArray for crate::ArrayRef {
fn into_arrow_preferred(self) -> VortexResult<ArrowArrayRef> {
compute::to_arrow_opts(&self, &ToArrowOptions { arrow_type: None })
}
fn into_arrow(self, data_type: &DataType) -> VortexResult<ArrowArrayRef> {
compute::to_arrow_opts(
&self,
&ToArrowOptions {
arrow_type: Some(data_type.clone()),
},
)
}
}