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