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::SequenceArrayParts;
17pub use compress::sequence_encode;
18use vortex_array::aggregate_fn::AggregateFnVTable;
19use vortex_array::aggregate_fn::fns::is_sorted::IsSorted;
20use vortex_array::aggregate_fn::fns::min_max::MinMax;
21use vortex_array::aggregate_fn::session::AggregateFnSessionExt;
22use vortex_array::session::ArraySessionExt;
23use vortex_session::VortexSession;
24
25/// Initialize sequence encoding in the given session.
26pub fn initialize(session: &mut VortexSession) {
27    session.arrays().register(Sequence);
28
29    // Register the Sequence-specific aggregate kernels.
30    session.aggregate_fns().register_aggregate_kernel(
31        Sequence::ID,
32        Some(MinMax.id()),
33        &compute::min_max::SequenceMinMaxKernel,
34    );
35    session.aggregate_fns().register_aggregate_kernel(
36        Sequence::ID,
37        Some(IsSorted.id()),
38        &compute::is_sorted::SequenceIsSortedKernel,
39    );
40}
41
42// TODO(joe): hook up to the compressor
43// TODO(joe): support comparisons with other operators
44// TODO(joe): support list in expr pushdown