vortex_arrow/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4//! Apache Arrow interoperability for Vortex.
5//!
6//! This crate owns every conversion between Vortex and Arrow. Exporting a Vortex array to Arrow goes
7//! through [`ExecuteArrowExt`], which uses the [`ArrowSession`] of its execution context. Every other
8//! conversion goes through the [`ArrowSession`] itself: importing Arrow schemas, fields, and data
9//! types into Vortex ([`ArrowSession::from_arrow_schema`], [`ArrowSession::from_arrow_field`],
10//! [`ArrowSession::from_arrow_datatype`]), importing Arrow arrays and record batches
11//! ([`ArrowSession::from_arrow_array`], [`ArrowSession::from_arrow_record_batch`]), and exporting
12//! Vortex dtypes to Arrow ([`ArrowSession::to_arrow_schema`], [`ArrowSession::to_arrow_field`],
13//! [`ArrowSession::to_arrow_datatype`]).
14//!
15//! The [`ArrowSession`] session variable is created on first use of [`ArrowSessionExt::arrow`], so
16//! no explicit registration is required. It can look up the extension types of its Vortex session
17//! by their Vortex IDs (see [`ArrowSession`]).
18//!
19//! [`ArrowScanExt`] adapts scan drivers to Arrow record-batch streams, performing conversion on
20//! the workers producing the scan batches.
21
22pub mod convert;
23mod datum;
24pub mod dtype;
25mod executor;
26
27mod extension;
28pub use extension::ArrowExtVTable;
29pub use extension::ArrowMetadataPolicy;
30
31pub mod ext_metadata;
32mod import_nullability;
33pub use import_nullability::level_validity;
34
35mod iter;
36mod null_buffer;
37mod options;
38mod run_end_import;
39mod scalar;
40mod scan;
41mod session;
42#[cfg(feature = "_test-harness")]
43pub mod test_harness;
44#[cfg(test)]
45mod tests;
46
47pub use convert::IntoVortexArray;
48pub use convert::nulls;
49pub use datum::*;
50pub use executor::*;
51pub use iter::*;
52pub use null_buffer::to_arrow_null_buffer;
53pub use null_buffer::to_null_buffer;
54pub use options::*;
55pub use scalar::ToArrowDatum;
56pub use scan::ArrowScanExt;
57pub use session::*;