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 arc_swap_map;
37mod array;
38pub mod arrays;
39pub mod arrow;
40pub mod buffer;
41pub mod builders;
42pub mod builtins;
43mod canonical;
44mod columnar;
45pub mod compute;
46pub mod display;
47pub mod dtype;
48mod executor;
49pub mod expr;
50mod expression;
51pub mod extension;
52mod hash;
53pub mod iter;
54pub mod kernel;
55pub mod mask;
56mod mask_future;
57pub mod matcher;
58pub mod memory;
59mod metadata;
60pub mod normalize;
61pub mod optimizer;
62mod partial_ord;
63pub mod patches;
64pub mod scalar;
65pub mod scalar_fn;
66pub mod search_sorted;
67pub mod serde;
68pub mod session;
69pub mod stats;
70pub mod stream;
71#[cfg(any(test, feature = "_test-harness"))]
72pub mod test_harness;
73pub mod validity;
74pub mod variants;
75
76pub mod flatbuffers {
77    //! Re-exported autogenerated code from the core Vortex flatbuffer definitions.
78    pub use vortex_flatbuffers::array::*;
79}
80
81// TODO(ngates): canonicalize doesn't currently take a session, therefore we cannot invoke execute
82//  from the new array encodings to support back-compat for legacy encodings. So we hold a session
83//  here...
84pub static LEGACY_SESSION: LazyLock<VortexSession> =
85    LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
86
87pub type ArrayContext = Context<ArrayPluginRef>;