Skip to main content

vortex_array/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4#![cfg_attr(vortex_nightly, feature(portable_simd))]
5//! Vortex crate containing core logic for encoding and memory representation of [arrays](ArrayRef).
6//!
7//! At the heart of Vortex are [arrays](ArrayRef).
8//!
9//! Arrays are typed views of memory buffers that hold [scalars](crate::scalar::Scalar). These
10//! buffers can be held in a number of physical encodings to perform lightweight compression that
11//! exploits the particular data distribution of the array's values.
12//!
13//! Every data type recognized by Vortex also has a canonical physical encoding format, which
14//! arrays can be [canonicalized](Canonical) into for ease of access in compute functions.
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::*;
25use vortex_session::VortexSession;
26use vortex_session::registry::Context;
27
28use crate::session::ArraySession;
29use crate::vtable::DynVTable;
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;
56mod metadata;
57pub mod normalize;
58pub mod optimizer;
59mod partial_ord;
60pub mod patches;
61pub mod scalar;
62pub mod scalar_fn;
63pub mod search_sorted;
64pub mod serde;
65pub mod session;
66pub mod stats;
67pub mod stream;
68#[cfg(any(test, feature = "_test-harness"))]
69pub mod test_harness;
70pub mod validity;
71pub mod variants;
72pub mod vtable;
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<&'static dyn DynVTable>;