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;
16pub mod decompress_bool;
17mod iter;
18mod kernel;
19mod ops;
20mod rules;
21
22#[doc(hidden)]
23pub mod _benchmarking {
24    pub use compute::take::take_indices_unchecked;
25
26    use super::*;
27}
28
29use vortex_array::session::ArraySessionExt;
30use vortex_session::VortexSession;
31
32/// Initialize run-end encoding in the given session.
33pub fn initialize(session: &mut VortexSession) {
34    session.arrays().register(RunEnd::ID, RunEnd);
35}
36
37#[cfg(test)]
38mod tests {
39    use vortex_array::ProstMetadata;
40    use vortex_array::dtype::PType;
41    use vortex_array::test_harness::check_metadata;
42
43    use crate::RunEndMetadata;
44
45    #[cfg_attr(miri, ignore)]
46    #[test]
47    fn test_runend_metadata() {
48        check_metadata(
49            "runend.metadata",
50            ProstMetadata(RunEndMetadata {
51                ends_ptype: PType::U64 as i32,
52                num_runs: u64::MAX,
53                offset: u64::MAX,
54            }),
55        );
56    }
57}