Skip to content

Commit 350aebd

Browse files
committed
Move the remaining aggregate functions into vortex-aggregates
vortex-array now keeps only the aggregate function framework and `all_non_distinct`, which `assert_arrays_eq!` uses to compare arrays. The other concrete aggregates (min/max, sum, counts, sortedness, constancy, uncompressed size and the rest), their Dict kernels, the grouped encoding kernels and their benches move to vortex-aggregates, whose `initialize` registers them on a session. `Stat::aggregate_fn` is replaced by `vortex_aggregates::stat_aggregate_fn`. `ExtensionStoragePushdown` stays in vortex-array. Pushing `is_sorted` and `min_max` down into extension storage becomes `vortex_aggregates::register_storage_ordered`, which `initialize` calls for the temporal types and `vortex_uuid::initialize` calls for UUIDs. Validation and encoding paths that must work with any session no longer go through the registry: integer arrays use `integer_bounds` (which now also reports strict sortedness and caches Min, Max and NullCount), and boolean arrays use the new `bool_bounds`. This covers validity, RunEnd ends, bit-packing, FoR, datetime-parts comparison and the compressor's integer statistics. Tests of aggregate behaviour move alongside the aggregates. Core tests use a test-only row-count aggregate and run the aggregate consistency checks only when aggregates are registered. Test sessions that compute statistics register the aggregates. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ps4mp7KF5c4p66aoSoXx5j Signed-off-by: Claude <noreply@anthropic.com>
1 parent 837a4ae commit 350aebd

191 files changed

Lines changed: 3188 additions & 2513 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Cargo.lock‎

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎benchmarks/string-bench/src/lib.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ use parquet::arrow::ParquetRecordBatchStreamBuilder;
3333
use parquet::arrow::ProjectionMask;
3434
use tokio::fs::File;
3535
use vortex::VortexSessionDefault;
36-
use vortex::aggregate_fn::fns::uncompressed_size_in_bytes::UncompressedSizeOpts;
37-
use vortex::aggregate_fn::fns::uncompressed_size_in_bytes::uncompressed_size_in_bytes;
36+
use vortex::aggregates::uncompressed_size_in_bytes::UncompressedSizeOpts;
37+
use vortex::aggregates::uncompressed_size_in_bytes::uncompressed_size_in_bytes;
3838
use vortex::array::ArrayRef;
3939
use vortex::array::ExecutionCtx;
4040
use vortex::array::IntoArray;

‎encodings/alp/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ alp = { workspace = true }
2020
itertools = { workspace = true }
2121
num-traits = { workspace = true }
2222
prost = { workspace = true }
23+
vortex-aggregates = { workspace = true }
2324
vortex-array = { workspace = true }
2425
vortex-buffer = { workspace = true }
2526
vortex-error = { workspace = true }

‎encodings/alp/src/alp/compute/nan_count.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4+
use vortex_aggregates::nan_count::NanCount;
5+
use vortex_aggregates::nan_count::nan_count;
46
use vortex_array::ArrayRef;
57
use vortex_array::ExecutionCtx;
68
use vortex_array::aggregate_fn::AggregateFnRef;
7-
use vortex_array::aggregate_fn::fns::nan_count::NanCount;
8-
use vortex_array::aggregate_fn::fns::nan_count::nan_count;
99
use vortex_array::aggregate_fn::kernels::DynAggregateKernel;
1010
use vortex_array::scalar::Scalar;
1111
use vortex_error::VortexResult;

‎encodings/alp/src/lib.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
//!
1717
//! [paper]: https://ir.cwi.nl/pub/33334/33334.pdf
1818
19+
use vortex_aggregates::nan_count::NanCount;
1920
use vortex_array::ArrayVTable;
2021
use vortex_array::aggregate_fn::AggregateFnVTable;
21-
use vortex_array::aggregate_fn::fns::nan_count::NanCount;
2222
use vortex_array::aggregate_fn::session::AggregateFnSessionExt;
2323
use vortex_array::arrays::patched::use_experimental_patches;
2424
use vortex_array::session::ArraySessionExt;

‎encodings/datetime-parts/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ workspace = true
1818
[dependencies]
1919
num-traits = { workspace = true }
2020
prost = { workspace = true }
21+
vortex-aggregates = { workspace = true }
2122
vortex-array = { workspace = true }
2223
vortex-buffer = { workspace = true }
2324
vortex-compute = { workspace = true }

‎encodings/datetime-parts/src/compute/compare.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,10 @@ mod test {
288288
use std::sync::LazyLock;
289289

290290
use rstest::rstest;
291+
use vortex_aggregates::sum::sum;
291292
use vortex_array::ArrayRef;
292293
use vortex_array::ExecutionCtx;
293294
use vortex_array::VortexSessionExecute;
294-
use vortex_array::aggregate_fn::fns::sum::sum;
295295
use vortex_array::arrays::BoolArray;
296296
use vortex_array::arrays::ConstantArray;
297297
use vortex_array::arrays::PrimitiveArray;

‎encodings/datetime-parts/src/compute/is_constant.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4+
use vortex_aggregates::is_constant::IsConstant;
5+
use vortex_aggregates::is_constant::is_constant;
46
use vortex_array::ArrayRef;
57
use vortex_array::ExecutionCtx;
68
use vortex_array::aggregate_fn::AggregateFnRef;
7-
use vortex_array::aggregate_fn::fns::is_constant::IsConstant;
8-
use vortex_array::aggregate_fn::fns::is_constant::is_constant;
99
use vortex_array::aggregate_fn::kernels::DynAggregateKernel;
1010
use vortex_array::scalar::Scalar;
1111
use vortex_error::VortexResult;

‎encodings/datetime-parts/src/lib.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ mod compute;
1111
mod ops;
1212
mod timestamp;
1313

14+
use vortex_aggregates::is_constant::IsConstant;
1415
use vortex_array::ArrayVTable;
1516
use vortex_array::aggregate_fn::AggregateFnVTable;
16-
use vortex_array::aggregate_fn::fns::is_constant::IsConstant;
1717
use vortex_array::aggregate_fn::session::AggregateFnSessionExt;
1818
use vortex_array::session::ArraySessionExt;
1919
use vortex_session::VortexSession;

‎encodings/decimal-byte-parts/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ workspace = true
1818
[dependencies]
1919
num-traits = { workspace = true }
2020
prost = { workspace = true }
21+
vortex-aggregates = { workspace = true }
2122
vortex-array = { workspace = true }
2223
vortex-buffer = { workspace = true }
2324
vortex-error = { workspace = true }

0 commit comments

Comments
 (0)