Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ members = [
"vortex-cloud",
"vortex-array",
"vortex-functions",
"vortex-aggregates",
"vortex-expr",
"vortex-arrow",
"vortex-row",
Expand Down Expand Up @@ -300,6 +301,7 @@ zstd = { version = "0.13.3", default-features = false, features = [

# BEGIN crates published by this project
vortex = { version = "0.1.0", path = "./vortex" }
vortex-aggregates = { version = "0.1.0", path = "./vortex-aggregates", default-features = false }
vortex-alp = { version = "0.1.0", path = "./encodings/alp", default-features = false }
vortex-array = { version = "0.1.0", path = "./vortex-array", default-features = false }
vortex-array-macros = { version = "0.1.0", path = "./vortex-array-macros" }
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/string-bench/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ use parquet::arrow::ParquetRecordBatchStreamBuilder;
use parquet::arrow::ProjectionMask;
use tokio::fs::File;
use vortex::VortexSessionDefault;
use vortex::aggregate_fn::fns::uncompressed_size_in_bytes::UncompressedSizeOpts;
use vortex::aggregate_fn::fns::uncompressed_size_in_bytes::uncompressed_size_in_bytes;
use vortex::aggregates::uncompressed_size_in_bytes::UncompressedSizeOpts;
use vortex::aggregates::uncompressed_size_in_bytes::uncompressed_size_in_bytes;
use vortex::array::ArrayRef;
use vortex::array::ExecutionCtx;
use vortex::array::IntoArray;
Expand Down
1 change: 1 addition & 0 deletions encodings/alp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ alp = { workspace = true }
itertools = { workspace = true }
num-traits = { workspace = true }
prost = { workspace = true }
vortex-aggregates = { workspace = true }
vortex-array = { workspace = true }
vortex-buffer = { workspace = true }
vortex-error = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions encodings/alp/src/alp/compute/nan_count.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors

use vortex_aggregates::nan_count::NanCount;
use vortex_aggregates::nan_count::nan_count;
use vortex_array::ArrayRef;
use vortex_array::ExecutionCtx;
use vortex_array::aggregate_fn::AggregateFnRef;
use vortex_array::aggregate_fn::fns::nan_count::NanCount;
use vortex_array::aggregate_fn::fns::nan_count::nan_count;
use vortex_array::aggregate_fn::kernels::DynAggregateKernel;
use vortex_array::scalar::Scalar;
use vortex_error::VortexResult;
Expand Down
2 changes: 1 addition & 1 deletion encodings/alp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
//!
//! [paper]: https://ir.cwi.nl/pub/33334/33334.pdf

use vortex_aggregates::nan_count::NanCount;
use vortex_array::ArrayVTable;
use vortex_array::aggregate_fn::AggregateFnVTable;
use vortex_array::aggregate_fn::fns::nan_count::NanCount;
use vortex_array::aggregate_fn::session::AggregateFnSessionExt;
use vortex_array::arrays::patched::use_experimental_patches;
use vortex_array::session::ArraySessionExt;
Expand Down
1 change: 1 addition & 0 deletions encodings/datetime-parts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ workspace = true
[dependencies]
num-traits = { workspace = true }
prost = { workspace = true }
vortex-aggregates = { workspace = true }
vortex-array = { workspace = true }
vortex-buffer = { workspace = true }
vortex-compute = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion encodings/datetime-parts/src/compute/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@ mod test {
use std::sync::LazyLock;

use rstest::rstest;
use vortex_aggregates::sum::sum;
use vortex_array::ArrayRef;
use vortex_array::ExecutionCtx;
use vortex_array::VortexSessionExecute;
use vortex_array::aggregate_fn::fns::sum::sum;
use vortex_array::arrays::BoolArray;
use vortex_array::arrays::ConstantArray;
use vortex_array::arrays::PrimitiveArray;
Expand Down
4 changes: 2 additions & 2 deletions encodings/datetime-parts/src/compute/is_constant.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors

use vortex_aggregates::is_constant::IsConstant;
use vortex_aggregates::is_constant::is_constant;
use vortex_array::ArrayRef;
use vortex_array::ExecutionCtx;
use vortex_array::aggregate_fn::AggregateFnRef;
use vortex_array::aggregate_fn::fns::is_constant::IsConstant;
use vortex_array::aggregate_fn::fns::is_constant::is_constant;
use vortex_array::aggregate_fn::kernels::DynAggregateKernel;
use vortex_array::scalar::Scalar;
use vortex_error::VortexResult;
Expand Down
2 changes: 1 addition & 1 deletion encodings/datetime-parts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ mod compute;
mod ops;
mod timestamp;

use vortex_aggregates::is_constant::IsConstant;
use vortex_array::ArrayVTable;
use vortex_array::aggregate_fn::AggregateFnVTable;
use vortex_array::aggregate_fn::fns::is_constant::IsConstant;
use vortex_array::aggregate_fn::session::AggregateFnSessionExt;
use vortex_array::session::ArraySessionExt;
use vortex_session::VortexSession;
Expand Down
1 change: 1 addition & 0 deletions encodings/decimal-byte-parts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ workspace = true
[dependencies]
num-traits = { workspace = true }
prost = { workspace = true }
vortex-aggregates = { workspace = true }
vortex-array = { workspace = true }
vortex-buffer = { workspace = true }
vortex-error = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors

use vortex_aggregates::is_constant::IsConstant;
use vortex_aggregates::is_constant::is_constant;
use vortex_array::ArrayRef;
use vortex_array::ArrayView;
use vortex_array::ExecutionCtx;
use vortex_array::aggregate_fn::AggregateFnRef;
use vortex_array::aggregate_fn::fns::is_constant::IsConstant;
use vortex_array::aggregate_fn::fns::is_constant::is_constant;
use vortex_array::aggregate_fn::kernels::DynAggregateKernel;
use vortex_array::scalar::Scalar;
use vortex_error::VortexResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const MAX_I256_HIGH: i128 = 10i128.pow(37);
/// vectorized path is not trivially degenerate.
const MAX_LEN: usize = 48;

/// Bound on a drawn most significant part. Every part count's assembled value then stays inside
/// its declared precision: `10^18 * 2^192` is about `6.3e75`, below the 76 digits of the widest.
const MAX_MSP: i64 = 10i64.pow(18) - 1;

fn ctx() -> ExecutionCtx {
let session = VortexSession::empty();
crate::initialize(&session);
Expand Down Expand Up @@ -104,7 +108,7 @@ fn canonicalize(array: ArrayRef, ctx: &mut ExecutionCtx) -> DecimalArray {
fn draw_encoded(tc: &TestCase) -> (DecimalBytePartsArray, usize) {
let lower_part_count = tc.draw(gs::integers::<usize>().min_value(0).max_value(3));
let msp: Vec<i64> = tc.draw(
gs::vecs(gs::integers::<i64>())
gs::vecs(gs::integers::<i64>().min_value(-MAX_MSP).max_value(MAX_MSP))
.min_size(1)
.max_size(MAX_LEN),
);
Expand Down
2 changes: 1 addition & 1 deletion encodings/decimal-byte-parts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ use decimal_byte_parts::compute::is_constant::DecimalBytePartsIsConstantKernel;
/// an i128 decimal could be converted into a [i64, u64] with further narrowing applied to either
/// value.
pub use decimal_byte_parts::*;
use vortex_aggregates::is_constant::IsConstant;
use vortex_array::ArrayVTable;
use vortex_array::aggregate_fn::AggregateFnVTable;
use vortex_array::aggregate_fn::fns::is_constant::IsConstant;
use vortex_array::aggregate_fn::session::AggregateFnSessionExt;
use vortex_array::session::ArraySessionExt;
use vortex_session::VortexSession;
Expand Down
1 change: 1 addition & 0 deletions encodings/fastlanes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ lending-iterator = { workspace = true }
num-traits = { workspace = true }
prost = { workspace = true }
rand = { workspace = true, optional = true }
vortex-aggregates = { workspace = true }
vortex-array = { workspace = true }
vortex-buffer = { workspace = true }
vortex-compute = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ pub use global::gather_patches;
pub use global::test_harness;
use vortex_array::ExecutionCtx;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::match_each_integer_ptype;
use vortex_array::arrays::primitive::integer_bounds;
use vortex_error::VortexResult;
use vortex_error::vortex_bail;
use vortex_error::vortex_ensure;

/// Return an error unless `array` holds integers that are all non-negative, which bit-packing
/// requires.
#[expect(unused_comparisons, clippy::absurd_extreme_comparisons)]
fn ensure_non_negative_integers(
array: &PrimitiveArray,
ctx: &mut ExecutionCtx,
Expand All @@ -37,9 +36,8 @@ fn ensure_non_negative_integers(
array.ptype()
);
if array.ptype().is_signed_int() {
let has_negative_values = match_each_integer_ptype!(array.ptype(), |P| {
array.statistics().compute_min::<P>(ctx).unwrap_or_default() < 0
});
let has_negative_values =
integer_bounds(array.as_ref(), ctx)?.is_some_and(|bounds| bounds.min < 0);
if has_negative_values {
vortex_bail!(InvalidArgument: "cannot bitpack array containing negative integers")
}
Expand Down
8 changes: 4 additions & 4 deletions encodings/fastlanes/src/bitpacking/compute/is_constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ use std::ops::Range;

use itertools::Itertools;
use lending_iterator::LendingIterator;
use vortex_aggregates::is_constant::IsConstant;
use vortex_aggregates::is_constant::primitive::IS_CONST_LANE_WIDTH;
use vortex_aggregates::is_constant::primitive::compute_is_constant;
use vortex_array::ArrayRef;
use vortex_array::ArrayView;
use vortex_array::ExecutionCtx;
use vortex_array::aggregate_fn::AggregateFnRef;
use vortex_array::aggregate_fn::fns::is_constant::IsConstant;
use vortex_array::aggregate_fn::fns::is_constant::primitive::IS_CONST_LANE_WIDTH;
use vortex_array::aggregate_fn::fns::is_constant::primitive::compute_is_constant;
use vortex_array::aggregate_fn::kernels::DynAggregateKernel;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::dtype::IntegerPType;
Expand Down Expand Up @@ -193,9 +193,9 @@ fn apply_patches_idx_typed<T: BitPackedUnpack, I: IntegerPType>(
mod tests {
use std::sync::LazyLock;

use vortex_aggregates::is_constant::is_constant;
use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::aggregate_fn::fns::is_constant::is_constant;
use vortex_buffer::buffer;
use vortex_error::VortexResult;
use vortex_session::VortexSession;
Expand Down
Loading
Loading