Skip to main content

vortex_runend/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4#[cfg(feature = "arbitrary")]
5mod arbitrary;
6#[cfg(feature = "arbitrary")]
7pub use arbitrary::ArbitraryRunEndArray;
8pub use array::*;
9pub use iter::trimmed_ends_iter;
10
11mod array;
12#[cfg(feature = "arrow")]
13mod arrow;
14pub mod compress;
15mod compute;
16mod iter;
17mod kernel;
18mod ops;
19mod rules;
20
21#[doc(hidden)]
22pub mod _benchmarking {
23    pub use compute::take::take_indices_unchecked;
24
25    use super::*;
26}
27
28use vortex_array::session::ArraySessionExt;
29use vortex_session::VortexSession;
30
31/// Initialize run-end encoding in the given session.
32pub fn initialize(session: &mut VortexSession) {
33    session.arrays().register(RunEndVTable::ID, RunEndVTable);
34}
35
36#[cfg(test)]
37mod tests {
38    use vortex_array::ProstMetadata;
39    use vortex_array::dtype::PType;
40    use vortex_array::test_harness::check_metadata;
41
42    use crate::RunEndMetadata;
43
44    #[cfg_attr(miri, ignore)]
45    #[test]
46    fn test_runend_metadata() {
47        check_metadata(
48            "runend.metadata",
49            ProstMetadata(RunEndMetadata {
50                ends_ptype: PType::U64 as i32,
51                num_runs: u64::MAX,
52                offset: u64::MAX,
53            }),
54        );
55    }
56}