Skip to main content

vortex_array/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3//! Vortex crate containing core logic for encoding and memory representation of [arrays](ArrayRef).
4//!
5//! At the heart of Vortex are [arrays](ArrayRef).
6//!
7//! Arrays are typed views of memory buffers that hold [scalars](crate::scalar::Scalar). These
8//! buffers can be held in a number of physical encodings to perform lightweight compression that
9//! exploits the particular data distribution of the array's values.
10//!
11//! Every data type recognized by Vortex also has a canonical physical encoding format, which
12//! arrays can be [canonicalized](Canonical) into for ease of access in compute functions.
13
14extern crate self as vortex_array;
15
16use std::sync::LazyLock;
17
18pub use array::*;
19pub use canonical::*;
20pub use columnar::*;
21pub use executor::*;
22pub use hash::*;
23pub use mask_future::*;
24pub use metadata::*;
25pub use smallvec;
26pub use vortex_array_macros::array_slots;
27use vortex_session::VortexSession;
28use vortex_session::registry::Context;
29
30use crate::session::ArraySession;
31
32pub mod accessor;
33pub mod aggregate_fn;
34#[doc(hidden)]
35pub mod aliases;
36mod array;
37pub mod arrays;
38pub mod arrow;
39pub mod buffer;
40pub mod builders;
41pub mod builtins;
42mod canonical;
43mod columnar;
44pub mod compute;
45pub mod display;
46pub mod dtype;
47mod executor;
48pub mod expr;
49mod expression;
50pub mod extension;
51mod hash;
52pub mod iter;
53pub mod kernel;
54pub mod mask;
55mod mask_future;
56pub mod matcher;
57pub mod memory;
58mod metadata;
59pub mod normalize;
60pub mod optimizer;
61mod partial_ord;
62pub mod patches;
63pub mod scalar;
64pub mod scalar_fn;
65pub mod search_sorted;
66pub mod serde;
67pub mod session;
68pub mod stats;
69pub mod stream;
70#[cfg(any(test, feature = "_test-harness"))]
71pub mod test_harness;
72pub mod validity;
73pub mod variants;
74
75pub mod flatbuffers {
76    //! Re-exported autogenerated code from the core Vortex flatbuffer definitions.
77    pub use vortex_flatbuffers::array::*;
78}
79
80// TODO(ngates): canonicalize doesn't currently take a session, therefore we cannot invoke execute
81//  from the new array encodings to support back-compat for legacy encodings. So we hold a session
82//  here...
83pub static LEGACY_SESSION: LazyLock<VortexSession> =
84    LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
85
86pub type ArrayContext = Context<ArrayPluginRef>;