Skip to main content

vortex_sequence/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4mod array;
5mod compress;
6mod compute;
7mod eval;
8mod kernel;
9#[cfg(test)]
10mod model_tests;
11mod rules;
12
13/// Represents the equation A\[i\] = a * i + b.
14/// This can be used for compression, fast comparisons and also for row ids.
15pub use array::Sequence;
16/// Represents the equation A\[i\] = a * i + b.
17/// This can be used for compression, fast comparisons and also for row ids.
18pub use array::SequenceArray;
19pub use array::SequenceData;
20pub use array::SequenceDataParts;
21pub use compress::sequence_encode;
22use vortex_array::ArrayVTable;
23use vortex_array::aggregate_fn::AggregateFnVTable;
24use vortex_array::aggregate_fn::fns::is_sorted::IsSorted;
25use vortex_array::aggregate_fn::fns::min_max::MinMax;
26use vortex_array::aggregate_fn::session::AggregateFnSessionExt;
27use vortex_array::session::ArraySessionExt;
28use vortex_session::VortexSession;
29
30/// Initialize sequence encoding in the given session.
31pub fn initialize(session: &VortexSession) {
32    session.arrays().register(Sequence);
33    kernel::initialize(session);
34
35    // Register the Sequence-specific aggregate kernels.
36    session.aggregate_fns().register_aggregate_kernel(
37        Sequence.id(),
38        Some(MinMax.id()),
39        &compute::min_max::SequenceMinMaxKernel,
40    );
41    session.aggregate_fns().register_aggregate_kernel(
42        Sequence.id(),
43        Some(IsSorted.id()),
44        &compute::is_sorted::SequenceIsSortedKernel,
45    );
46}
47
48// TODO(joe): hook up to the compressor
49// TODO(joe): support comparisons with other operators
50// TODO(joe): support list in expr pushdown