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    kernel::initialize(session);
31
32    // Register the Sequence-specific aggregate kernels.
33    session.aggregate_fns().register_aggregate_kernel(
34        Sequence.id(),
35        Some(MinMax.id()),
36        &compute::min_max::SequenceMinMaxKernel,
37    );
38    session.aggregate_fns().register_aggregate_kernel(
39        Sequence.id(),
40        Some(IsSorted.id()),
41        &compute::is_sorted::SequenceIsSortedKernel,
42    );
43}
44
45// TODO(joe): hook up to the compressor
46// TODO(joe): support comparisons with other operators
47// TODO(joe): support list in expr pushdown