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