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