diff --git a/bench-vortex/benches/compressor_throughput.rs b/bench-vortex/benches/compressor_throughput.rs index 50c882c82a..2a33386e68 100644 --- a/bench-vortex/benches/compressor_throughput.rs +++ b/bench-vortex/benches/compressor_throughput.rs @@ -6,8 +6,7 @@ use rand::seq::SliceRandom as _; use rand::{thread_rng, Rng, SeedableRng as _}; use vortex::aliases::hash_set::HashSet; use vortex::array::{ConstantArray, PrimitiveArray, VarBinViewArray}; -use vortex::compute::unary::try_cast; -use vortex::compute::{compare, Operator}; +use vortex::compute::{compare, try_cast, Operator}; use vortex::dict::{dict_encode_varbinview, DictArray}; use vortex::dtype::PType; use vortex::fsst::{fsst_compress, fsst_train_compressor}; diff --git a/encodings/alp/src/alp/compress.rs b/encodings/alp/src/alp/compress.rs index 1767ddbbb4..ccc87789e4 100644 --- a/encodings/alp/src/alp/compress.rs +++ b/encodings/alp/src/alp/compress.rs @@ -107,7 +107,7 @@ fn decompress_primitive( mod tests { use core::f64; - use vortex_array::compute::unary::scalar_at; + use vortex_array::compute::scalar_at; use super::*; diff --git a/encodings/alp/src/alp/compute/mod.rs b/encodings/alp/src/alp/compute/mod.rs index 359d5451c1..944b003716 100644 --- a/encodings/alp/src/alp/compute/mod.rs +++ b/encodings/alp/src/alp/compute/mod.rs @@ -1,9 +1,8 @@ mod compare; -use vortex_array::compute::unary::{scalar_at, ScalarAtFn}; use vortex_array::compute::{ - filter, slice, take, CompareFn, ComputeVTable, FilterFn, FilterMask, SliceFn, TakeFn, - TakeOptions, + filter, scalar_at, slice, take, CompareFn, ComputeVTable, FilterFn, FilterMask, ScalarAtFn, + SliceFn, TakeFn, TakeOptions, }; use vortex_array::variants::PrimitiveArrayTrait; use vortex_array::{ArrayDType, ArrayData, IntoArrayData}; diff --git a/encodings/alp/src/alp_rd/compute/mod.rs b/encodings/alp/src/alp_rd/compute/mod.rs index 1b896d81ea..c696d1c51a 100644 --- a/encodings/alp/src/alp_rd/compute/mod.rs +++ b/encodings/alp/src/alp_rd/compute/mod.rs @@ -1,5 +1,4 @@ -use vortex_array::compute::unary::ScalarAtFn; -use vortex_array::compute::{ComputeVTable, FilterFn, SliceFn, TakeFn}; +use vortex_array::compute::{ComputeVTable, FilterFn, ScalarAtFn, SliceFn, TakeFn}; use vortex_array::ArrayData; use crate::ALPRDEncoding; diff --git a/encodings/alp/src/alp_rd/compute/scalar_at.rs b/encodings/alp/src/alp_rd/compute/scalar_at.rs index ccc1e9f47a..72f6c5511c 100644 --- a/encodings/alp/src/alp_rd/compute/scalar_at.rs +++ b/encodings/alp/src/alp_rd/compute/scalar_at.rs @@ -1,4 +1,4 @@ -use vortex_array::compute::unary::{scalar_at, ScalarAtFn}; +use vortex_array::compute::{scalar_at, ScalarAtFn}; use vortex_error::VortexResult; use vortex_scalar::Scalar; @@ -36,7 +36,7 @@ impl ScalarAtFn for ALPRDEncoding { mod test { use rstest::rstest; use vortex_array::array::PrimitiveArray; - use vortex_array::compute::unary::scalar_at; + use vortex_array::compute::scalar_at; use vortex_scalar::Scalar; use crate::{ALPRDFloat, RDEncoder}; diff --git a/encodings/bytebool/src/compute.rs b/encodings/bytebool/src/compute.rs index dafb158fde..5f8d63b59d 100644 --- a/encodings/bytebool/src/compute.rs +++ b/encodings/bytebool/src/compute.rs @@ -1,6 +1,7 @@ use num_traits::AsPrimitive; -use vortex_array::compute::unary::{FillForwardFn, ScalarAtFn}; -use vortex_array::compute::{ComputeVTable, SliceFn, TakeFn, TakeOptions}; +use vortex_array::compute::{ + ComputeVTable, FillForwardFn, ScalarAtFn, SliceFn, TakeFn, TakeOptions, +}; use vortex_array::validity::{ArrayValidity, Validity}; use vortex_array::variants::PrimitiveArrayTrait; use vortex_array::{ArrayDType, ArrayData, ArrayLen, IntoArrayData, IntoArrayVariant, ToArrayData}; @@ -142,8 +143,7 @@ impl FillForwardFn for ByteBoolEncoding { #[cfg(test)] mod tests { - use vortex_array::compute::unary::scalar_at; - use vortex_array::compute::{compare, slice, Operator}; + use vortex_array::compute::{compare, scalar_at, slice, Operator}; use super::*; diff --git a/encodings/datetime-parts/src/array.rs b/encodings/datetime-parts/src/array.rs index 7190c8bec1..c0c628a57f 100644 --- a/encodings/datetime-parts/src/array.rs +++ b/encodings/datetime-parts/src/array.rs @@ -2,7 +2,7 @@ use std::fmt::{Debug, Display}; use serde::{Deserialize, Serialize}; use vortex_array::array::StructArray; -use vortex_array::compute::unary::try_cast; +use vortex_array::compute::try_cast; use vortex_array::encoding::ids; use vortex_array::stats::{Stat, StatisticsVTable, StatsSet}; use vortex_array::validity::{LogicalValidity, Validity, ValidityVTable}; diff --git a/encodings/datetime-parts/src/compress.rs b/encodings/datetime-parts/src/compress.rs index 248c4684ee..b088f616a7 100644 --- a/encodings/datetime-parts/src/compress.rs +++ b/encodings/datetime-parts/src/compress.rs @@ -1,5 +1,5 @@ use vortex_array::array::{PrimitiveArray, TemporalArray}; -use vortex_array::compute::unary::try_cast; +use vortex_array::compute::try_cast; use vortex_array::{ArrayDType as _, ArrayData, ArrayLen, IntoArrayData, IntoArrayVariant}; use vortex_datetime_dtype::TimeUnit; use vortex_dtype::{DType, PType}; diff --git a/encodings/datetime-parts/src/compute.rs b/encodings/datetime-parts/src/compute.rs index 98bbfbfc30..aab4b28169 100644 --- a/encodings/datetime-parts/src/compute.rs +++ b/encodings/datetime-parts/src/compute.rs @@ -1,7 +1,8 @@ use itertools::Itertools as _; use vortex_array::array::{PrimitiveArray, TemporalArray}; -use vortex_array::compute::unary::{scalar_at, ScalarAtFn}; -use vortex_array::compute::{slice, take, ComputeVTable, SliceFn, TakeFn, TakeOptions}; +use vortex_array::compute::{ + scalar_at, slice, take, ComputeVTable, ScalarAtFn, SliceFn, TakeFn, TakeOptions, +}; use vortex_array::validity::ArrayValidity; use vortex_array::{ArrayDType, ArrayData, IntoArrayData, IntoArrayVariant}; use vortex_datetime_dtype::{TemporalMetadata, TimeUnit}; diff --git a/encodings/dict/src/array.rs b/encodings/dict/src/array.rs index 12ee5317bd..0b5064d4d6 100644 --- a/encodings/dict/src/array.rs +++ b/encodings/dict/src/array.rs @@ -3,8 +3,7 @@ use std::fmt::{Debug, Display}; use arrow_buffer::BooleanBuffer; use serde::{Deserialize, Serialize}; use vortex_array::array::BoolArray; -use vortex_array::compute::unary::scalar_at; -use vortex_array::compute::{take, TakeOptions}; +use vortex_array::compute::{scalar_at, take, TakeOptions}; use vortex_array::encoding::ids; use vortex_array::stats::StatsSet; use vortex_array::validity::{LogicalValidity, ValidityVTable}; diff --git a/encodings/dict/src/compress.rs b/encodings/dict/src/compress.rs index d8763e5794..2e061af25c 100644 --- a/encodings/dict/src/compress.rs +++ b/encodings/dict/src/compress.rs @@ -195,7 +195,7 @@ mod test { use vortex_array::accessor::ArrayAccessor; use vortex_array::array::{PrimitiveArray, VarBinArray}; - use vortex_array::compute::unary::scalar_at; + use vortex_array::compute::scalar_at; use vortex_dtype::Nullability::Nullable; use vortex_dtype::{DType, PType}; use vortex_scalar::Scalar; diff --git a/encodings/dict/src/compute/mod.rs b/encodings/dict/src/compute/mod.rs index 9b6422630e..9f64bee469 100644 --- a/encodings/dict/src/compute/mod.rs +++ b/encodings/dict/src/compute/mod.rs @@ -1,9 +1,8 @@ mod compare; -use vortex_array::compute::unary::{scalar_at, ScalarAtFn}; use vortex_array::compute::{ - filter, slice, take, CompareFn, ComputeVTable, FilterFn, FilterMask, SliceFn, TakeFn, - TakeOptions, + filter, scalar_at, slice, take, CompareFn, ComputeVTable, FilterFn, FilterMask, ScalarAtFn, + SliceFn, TakeFn, TakeOptions, }; use vortex_array::{ArrayData, IntoArrayData}; use vortex_error::VortexResult; @@ -74,8 +73,7 @@ impl SliceFn for DictEncoding { mod test { use vortex_array::accessor::ArrayAccessor; use vortex_array::array::{ConstantArray, PrimitiveArray, VarBinViewArray}; - use vortex_array::compute::unary::scalar_at; - use vortex_array::compute::{compare, slice, Operator}; + use vortex_array::compute::{compare, scalar_at, slice, Operator}; use vortex_array::{ArrayLen, IntoArrayData, IntoArrayVariant, ToArrayData}; use vortex_dtype::{DType, Nullability}; use vortex_scalar::Scalar; diff --git a/encodings/fastlanes/src/bitpacking/compute/mod.rs b/encodings/fastlanes/src/bitpacking/compute/mod.rs index 0ed63f83cd..57ba369586 100644 --- a/encodings/fastlanes/src/bitpacking/compute/mod.rs +++ b/encodings/fastlanes/src/bitpacking/compute/mod.rs @@ -1,5 +1,4 @@ -use vortex_array::compute::unary::ScalarAtFn; -use vortex_array::compute::{ComputeVTable, FilterFn, SearchSortedFn, SliceFn, TakeFn}; +use vortex_array::compute::{ComputeVTable, FilterFn, ScalarAtFn, SearchSortedFn, SliceFn, TakeFn}; use vortex_array::ArrayData; use crate::BitPackedEncoding; diff --git a/encodings/fastlanes/src/bitpacking/compute/scalar_at.rs b/encodings/fastlanes/src/bitpacking/compute/scalar_at.rs index f8ecc24c66..4ddd200ff3 100644 --- a/encodings/fastlanes/src/bitpacking/compute/scalar_at.rs +++ b/encodings/fastlanes/src/bitpacking/compute/scalar_at.rs @@ -1,4 +1,4 @@ -use vortex_array::compute::unary::{scalar_at, ScalarAtFn}; +use vortex_array::compute::{scalar_at, ScalarAtFn}; use vortex_array::ArrayDType; use vortex_error::VortexResult; use vortex_scalar::Scalar; @@ -21,7 +21,7 @@ impl ScalarAtFn for BitPackedEncoding { #[cfg(test)] mod test { use vortex_array::array::{PrimitiveArray, SparseArray}; - use vortex_array::compute::unary::scalar_at; + use vortex_array::compute::scalar_at; use vortex_array::validity::Validity; use vortex_array::IntoArrayData; use vortex_buffer::Buffer; diff --git a/encodings/fastlanes/src/bitpacking/compute/slice.rs b/encodings/fastlanes/src/bitpacking/compute/slice.rs index 5da63e0823..a2be5e461c 100644 --- a/encodings/fastlanes/src/bitpacking/compute/slice.rs +++ b/encodings/fastlanes/src/bitpacking/compute/slice.rs @@ -47,8 +47,7 @@ impl SliceFn for BitPackedEncoding { mod test { use itertools::Itertools; use vortex_array::array::{PrimitiveArray, SparseArray}; - use vortex_array::compute::unary::scalar_at; - use vortex_array::compute::{slice, take, TakeOptions}; + use vortex_array::compute::{scalar_at, slice, take, TakeOptions}; use vortex_array::{ArrayLen, IntoArrayData}; use crate::BitPackedArray; diff --git a/encodings/fastlanes/src/bitpacking/compute/take.rs b/encodings/fastlanes/src/bitpacking/compute/take.rs index 254d2ffa72..ffde66c6e2 100644 --- a/encodings/fastlanes/src/bitpacking/compute/take.rs +++ b/encodings/fastlanes/src/bitpacking/compute/take.rs @@ -241,8 +241,7 @@ mod test { use rand::distributions::Uniform; use rand::{thread_rng, Rng}; use vortex_array::array::{PrimitiveArray, SparseArray}; - use vortex_array::compute::unary::scalar_at; - use vortex_array::compute::{slice, take, TakeOptions}; + use vortex_array::compute::{scalar_at, slice, take, TakeOptions}; use vortex_array::{IntoArrayData, IntoArrayVariant}; use crate::BitPackedArray; diff --git a/encodings/fastlanes/src/delta/compress.rs b/encodings/fastlanes/src/delta/compress.rs index 6453c4e314..3941d2edca 100644 --- a/encodings/fastlanes/src/delta/compress.rs +++ b/encodings/fastlanes/src/delta/compress.rs @@ -2,8 +2,7 @@ use arrayref::{array_mut_ref, array_ref}; use fastlanes::{Delta, Transpose}; use num_traits::{WrappingAdd, WrappingSub}; use vortex_array::array::PrimitiveArray; -use vortex_array::compute::slice; -use vortex_array::compute::unary::fill_forward; +use vortex_array::compute::{fill_forward, slice}; use vortex_array::validity::Validity; use vortex_array::variants::PrimitiveArrayTrait; use vortex_array::{ArrayLen, IntoArrayVariant}; diff --git a/encodings/fastlanes/src/delta/compute.rs b/encodings/fastlanes/src/delta/compute.rs index 959600b4f4..01a0bab899 100644 --- a/encodings/fastlanes/src/delta/compute.rs +++ b/encodings/fastlanes/src/delta/compute.rs @@ -1,7 +1,6 @@ use std::cmp::min; -use vortex_array::compute::unary::{scalar_at, ScalarAtFn}; -use vortex_array::compute::{slice, ComputeVTable, SliceFn}; +use vortex_array::compute::{scalar_at, slice, ComputeVTable, ScalarAtFn, SliceFn}; use vortex_array::{ArrayData, IntoArrayData, IntoArrayVariant}; use vortex_error::VortexResult; use vortex_scalar::Scalar; @@ -68,8 +67,7 @@ impl SliceFn for DeltaEncoding { #[cfg(test)] mod test { - use vortex_array::compute::slice; - use vortex_array::compute::unary::scalar_at; + use vortex_array::compute::{scalar_at, slice}; use vortex_array::IntoArrayVariant; use vortex_error::VortexError; diff --git a/encodings/fastlanes/src/for/compress.rs b/encodings/fastlanes/src/for/compress.rs index 7af8d5611c..41c7c67c5b 100644 --- a/encodings/fastlanes/src/for/compress.rs +++ b/encodings/fastlanes/src/for/compress.rs @@ -144,7 +144,7 @@ fn decompress_primitive( #[cfg(test)] mod test { - use vortex_array::compute::unary::scalar_at; + use vortex_array::compute::scalar_at; use vortex_array::IntoArrayVariant; use vortex_dtype::Nullability; diff --git a/encodings/fastlanes/src/for/compute.rs b/encodings/fastlanes/src/for/compute.rs index 5f2355c93a..5324c58224 100644 --- a/encodings/fastlanes/src/for/compute.rs +++ b/encodings/fastlanes/src/for/compute.rs @@ -1,10 +1,9 @@ use std::ops::AddAssign; use num_traits::{CheckedShl, CheckedShr, WrappingAdd, WrappingSub}; -use vortex_array::compute::unary::{scalar_at, ScalarAtFn}; use vortex_array::compute::{ - filter, search_sorted, slice, take, ComputeVTable, FilterFn, FilterMask, SearchResult, - SearchSortedFn, SearchSortedSide, SliceFn, TakeFn, TakeOptions, + filter, scalar_at, search_sorted, slice, take, ComputeVTable, FilterFn, FilterMask, ScalarAtFn, + SearchResult, SearchSortedFn, SearchSortedSide, SliceFn, TakeFn, TakeOptions, }; use vortex_array::variants::PrimitiveArrayTrait; use vortex_array::{ArrayDType, ArrayData, IntoArrayData}; @@ -178,8 +177,7 @@ where #[cfg(test)] mod test { use vortex_array::array::PrimitiveArray; - use vortex_array::compute::unary::scalar_at; - use vortex_array::compute::{search_sorted, SearchResult, SearchSortedSide}; + use vortex_array::compute::{scalar_at, search_sorted, SearchResult, SearchSortedSide}; use vortex_array::IntoArrayData; use crate::{for_compress, FoRArray}; diff --git a/encodings/fsst/src/compute/compare.rs b/encodings/fsst/src/compute/compare.rs index 0c3bf89e19..2375edfcf9 100644 --- a/encodings/fsst/src/compute/compare.rs +++ b/encodings/fsst/src/compute/compare.rs @@ -82,8 +82,7 @@ fn compare_fsst_constant( #[cfg(test)] mod tests { use vortex_array::array::{ConstantArray, VarBinArray}; - use vortex_array::compute::unary::scalar_at; - use vortex_array::compute::{compare, Operator}; + use vortex_array::compute::{compare, scalar_at, Operator}; use vortex_array::{ArrayLen, IntoArrayData, IntoArrayVariant}; use vortex_dtype::{DType, Nullability}; use vortex_scalar::Scalar; diff --git a/encodings/fsst/src/compute/mod.rs b/encodings/fsst/src/compute/mod.rs index 38356b32aa..065d42b8a1 100644 --- a/encodings/fsst/src/compute/mod.rs +++ b/encodings/fsst/src/compute/mod.rs @@ -1,10 +1,9 @@ mod compare; use vortex_array::array::varbin_scalar; -use vortex_array::compute::unary::{scalar_at, ScalarAtFn}; use vortex_array::compute::{ - filter, slice, take, CompareFn, ComputeVTable, FilterFn, FilterMask, SliceFn, TakeFn, - TakeOptions, + filter, scalar_at, slice, take, CompareFn, ComputeVTable, FilterFn, FilterMask, ScalarAtFn, + SliceFn, TakeFn, TakeOptions, }; use vortex_array::{ArrayDType, ArrayData, IntoArrayData}; use vortex_buffer::Buffer; diff --git a/encodings/fsst/tests/fsst_tests.rs b/encodings/fsst/tests/fsst_tests.rs index 6f63c81d96..37fdb48cd7 100644 --- a/encodings/fsst/tests/fsst_tests.rs +++ b/encodings/fsst/tests/fsst_tests.rs @@ -2,8 +2,7 @@ use vortex_array::array::builder::VarBinBuilder; use vortex_array::array::PrimitiveArray; -use vortex_array::compute::unary::scalar_at; -use vortex_array::compute::{filter, slice, take, FilterMask, TakeOptions}; +use vortex_array::compute::{filter, scalar_at, slice, take, FilterMask, TakeOptions}; use vortex_array::validity::Validity; use vortex_array::{ArrayData, ArrayDef, IntoArrayData, IntoCanonical}; use vortex_dtype::{DType, Nullability}; diff --git a/encodings/roaring/src/boolean/compute.rs b/encodings/roaring/src/boolean/compute.rs index b35b1ac7d1..dc57986c89 100644 --- a/encodings/roaring/src/boolean/compute.rs +++ b/encodings/roaring/src/boolean/compute.rs @@ -1,6 +1,5 @@ use croaring::Bitmap; -use vortex_array::compute::unary::ScalarAtFn; -use vortex_array::compute::{ComputeVTable, SliceFn}; +use vortex_array::compute::{ComputeVTable, ScalarAtFn, SliceFn}; use vortex_array::{ArrayData, IntoArrayData}; use vortex_error::VortexResult; use vortex_scalar::Scalar; @@ -43,8 +42,7 @@ impl SliceFn for RoaringBoolEncoding { #[cfg(test)] mod tests { use vortex_array::array::BoolArray; - use vortex_array::compute::slice; - use vortex_array::compute::unary::scalar_at; + use vortex_array::compute::{scalar_at, slice}; use vortex_array::{IntoArrayData, IntoArrayVariant}; use vortex_scalar::Scalar; diff --git a/encodings/roaring/src/integer/compute.rs b/encodings/roaring/src/integer/compute.rs index 3957605c07..54a6496622 100644 --- a/encodings/roaring/src/integer/compute.rs +++ b/encodings/roaring/src/integer/compute.rs @@ -1,6 +1,5 @@ use croaring::Bitmap; -use vortex_array::compute::unary::ScalarAtFn; -use vortex_array::compute::{ComputeVTable, SliceFn}; +use vortex_array::compute::{ComputeVTable, ScalarAtFn, SliceFn}; use vortex_array::{ArrayData, ArrayLen, IntoArrayData}; use vortex_dtype::PType; use vortex_error::{vortex_err, VortexResult}; @@ -57,8 +56,7 @@ impl SliceFn for RoaringIntEncoding { #[cfg(test)] mod tests { use vortex_array::array::PrimitiveArray; - use vortex_array::compute::slice; - use vortex_array::compute::unary::scalar_at; + use vortex_array::compute::{scalar_at, slice}; use super::*; diff --git a/encodings/roaring/src/integer/mod.rs b/encodings/roaring/src/integer/mod.rs index 0f9b5c6a5e..b749c7a7ff 100644 --- a/encodings/roaring/src/integer/mod.rs +++ b/encodings/roaring/src/integer/mod.rs @@ -5,7 +5,7 @@ pub use compress::*; use croaring::{Bitmap, Portable}; use serde::{Deserialize, Serialize}; use vortex_array::array::PrimitiveArray; -use vortex_array::compute::unary::try_cast; +use vortex_array::compute::try_cast; use vortex_array::encoding::ids; use vortex_array::stats::{ArrayStatistics, Stat, StatisticsVTable, StatsSet}; use vortex_array::validity::{LogicalValidity, Validity, ValidityVTable}; diff --git a/encodings/runend-bool/src/array.rs b/encodings/runend-bool/src/array.rs index 0bd8fcf919..96f752d4b6 100644 --- a/encodings/runend-bool/src/array.rs +++ b/encodings/runend-bool/src/array.rs @@ -2,8 +2,7 @@ use std::fmt::{Debug, Display}; use serde::{Deserialize, Serialize}; use vortex_array::array::{BoolArray, PrimitiveArray}; -use vortex_array::compute::unary::scalar_at; -use vortex_array::compute::{search_sorted, SearchSortedSide}; +use vortex_array::compute::{scalar_at, search_sorted, SearchSortedSide}; use vortex_array::encoding::ids; use vortex_array::stats::{ArrayStatistics, Stat, StatisticsVTable, StatsSet}; use vortex_array::validity::{LogicalValidity, Validity, ValidityMetadata, ValidityVTable}; @@ -266,8 +265,7 @@ mod test { use itertools::Itertools as _; use rstest::rstest; use vortex_array::array::{BoolArray, PrimitiveArray}; - use vortex_array::compute::unary::scalar_at; - use vortex_array::compute::{slice, take, TakeOptions}; + use vortex_array::compute::{scalar_at, slice, take, TakeOptions}; use vortex_array::stats::ArrayStatistics; use vortex_array::validity::Validity; use vortex_array::{ diff --git a/encodings/runend-bool/src/compute.rs b/encodings/runend-bool/src/compute.rs index ee9425c428..5ff787ade0 100644 --- a/encodings/runend-bool/src/compute.rs +++ b/encodings/runend-bool/src/compute.rs @@ -1,6 +1,5 @@ use vortex_array::array::BoolArray; -use vortex_array::compute::unary::ScalarAtFn; -use vortex_array::compute::{slice, ComputeVTable, SliceFn, TakeFn, TakeOptions}; +use vortex_array::compute::{slice, ComputeVTable, ScalarAtFn, SliceFn, TakeFn, TakeOptions}; use vortex_array::variants::PrimitiveArrayTrait; use vortex_array::{ArrayData, ArrayLen, IntoArrayData, IntoArrayVariant, ToArrayData}; use vortex_dtype::match_each_integer_ptype; diff --git a/encodings/runend/src/array.rs b/encodings/runend/src/array.rs index fd8398bd7e..ff81721c35 100644 --- a/encodings/runend/src/array.rs +++ b/encodings/runend/src/array.rs @@ -2,8 +2,7 @@ use std::fmt::{Debug, Display}; use serde::{Deserialize, Serialize}; use vortex_array::array::PrimitiveArray; -use vortex_array::compute::unary::scalar_at; -use vortex_array::compute::{search_sorted, search_sorted_usize_many, SearchSortedSide}; +use vortex_array::compute::{scalar_at, search_sorted, search_sorted_usize_many, SearchSortedSide}; use vortex_array::encoding::ids; use vortex_array::stats::{ArrayStatistics, Stat, StatisticsVTable, StatsSet}; use vortex_array::validity::{ @@ -276,7 +275,7 @@ impl StatisticsVTable for RunEndEncoding { #[cfg(test)] mod tests { - use vortex_array::compute::unary::scalar_at; + use vortex_array::compute::scalar_at; use vortex_array::validity::Validity; use vortex_array::{ArrayDType, ArrayLen, IntoArrayData}; use vortex_dtype::{DType, Nullability, PType}; diff --git a/encodings/runend/src/compute/mod.rs b/encodings/runend/src/compute/mod.rs index 6cfe1a12d3..1a31a2859a 100644 --- a/encodings/runend/src/compute/mod.rs +++ b/encodings/runend/src/compute/mod.rs @@ -5,10 +5,9 @@ use std::ops::AddAssign; use num_traits::AsPrimitive; use vortex_array::array::{BooleanBuffer, ConstantArray, PrimitiveArray, SparseArray}; -use vortex_array::compute::unary::{scalar_at, ScalarAtFn}; use vortex_array::compute::{ - filter, slice, take, CompareFn, ComputeVTable, FilterFn, FilterMask, SliceFn, TakeFn, - TakeOptions, + filter, scalar_at, slice, take, CompareFn, ComputeVTable, FilterFn, FilterMask, ScalarAtFn, + SliceFn, TakeFn, TakeOptions, }; use vortex_array::validity::Validity; use vortex_array::variants::PrimitiveArrayTrait; @@ -178,8 +177,9 @@ fn filter_run_ends + AsPrimitive>( #[cfg(test)] mod test { use vortex_array::array::{BoolArray, PrimitiveArray}; - use vortex_array::compute::unary::{scalar_at, try_cast}; - use vortex_array::compute::{filter, slice, take, FilterMask, TakeOptions}; + use vortex_array::compute::{ + filter, scalar_at, slice, take, try_cast, FilterMask, TakeOptions, + }; use vortex_array::validity::{ArrayValidity, Validity}; use vortex_array::{ArrayDType, ArrayLen, IntoArrayData, IntoArrayVariant, ToArrayData}; use vortex_dtype::{DType, Nullability, PType}; diff --git a/encodings/zigzag/src/array.rs b/encodings/zigzag/src/array.rs index 2f3c907511..63a8b022a4 100644 --- a/encodings/zigzag/src/array.rs +++ b/encodings/zigzag/src/array.rs @@ -129,8 +129,7 @@ impl IntoCanonical for ZigZagArray { #[cfg(test)] mod test { - use vortex_array::compute::slice; - use vortex_array::compute::unary::scalar_at; + use vortex_array::compute::{scalar_at, slice}; use vortex_array::IntoArrayData; use super::*; diff --git a/encodings/zigzag/src/compute.rs b/encodings/zigzag/src/compute.rs index 3347e29c70..b68b542521 100644 --- a/encodings/zigzag/src/compute.rs +++ b/encodings/zigzag/src/compute.rs @@ -1,5 +1,4 @@ -use vortex_array::compute::unary::{scalar_at, ScalarAtFn}; -use vortex_array::compute::{slice, ComputeVTable, SliceFn}; +use vortex_array::compute::{scalar_at, slice, ComputeVTable, ScalarAtFn, SliceFn}; use vortex_array::variants::PrimitiveArrayTrait; use vortex_array::{ArrayDType, ArrayData, IntoArrayData}; use vortex_dtype::match_each_unsigned_integer_ptype; @@ -71,8 +70,7 @@ impl SliceFn for ZigZagEncoding { #[cfg(test)] mod tests { use vortex_array::array::PrimitiveArray; - use vortex_array::compute::unary::scalar_at; - use vortex_array::compute::{search_sorted, SearchResult, SearchSortedSide}; + use vortex_array::compute::{scalar_at, search_sorted, SearchResult, SearchSortedSide}; use vortex_array::validity::Validity; use vortex_array::IntoArrayData; use vortex_dtype::Nullability; diff --git a/fuzz/fuzz_targets/array_ops.rs b/fuzz/fuzz_targets/array_ops.rs index 355877b1f6..a998f2e222 100644 --- a/fuzz/fuzz_targets/array_ops.rs +++ b/fuzz/fuzz_targets/array_ops.rs @@ -5,9 +5,8 @@ use vortex_array::aliases::hash_set::HashSet; use vortex_array::array::{ BoolEncoding, PrimitiveEncoding, StructEncoding, VarBinEncoding, VarBinViewEncoding, }; -use vortex_array::compute::unary::scalar_at; use vortex_array::compute::{ - filter, search_sorted, slice, take, SearchResult, SearchSortedSide, TakeOptions, + filter, scalar_at, search_sorted, slice, take, SearchResult, SearchSortedSide, TakeOptions, }; use vortex_array::encoding::EncodingRef; use vortex_array::{ArrayData, IntoCanonical}; diff --git a/fuzz/src/lib.rs b/fuzz/src/lib.rs index 1f569a74be..ef649833ca 100644 --- a/fuzz/src/lib.rs +++ b/fuzz/src/lib.rs @@ -12,8 +12,7 @@ use libfuzzer_sys::arbitrary::Error::EmptyChoose; use libfuzzer_sys::arbitrary::{Arbitrary, Result, Unstructured}; pub use sort::sort_canonical_array; use vortex_array::array::PrimitiveArray; -use vortex_array::compute::unary::scalar_at; -use vortex_array::compute::{FilterMask, SearchResult, SearchSortedSide}; +use vortex_array::compute::{scalar_at, FilterMask, SearchResult, SearchSortedSide}; use vortex_array::{ArrayDType, ArrayData, IntoArrayData}; use vortex_sampling_compressor::SamplingCompressor; use vortex_scalar::arbitrary::random_scalar; diff --git a/fuzz/src/search_sorted.rs b/fuzz/src/search_sorted.rs index 033ec1d90b..9c956bcd1f 100644 --- a/fuzz/src/search_sorted.rs +++ b/fuzz/src/search_sorted.rs @@ -1,8 +1,9 @@ use std::cmp::Ordering; use vortex_array::accessor::ArrayAccessor; -use vortex_array::compute::unary::scalar_at; -use vortex_array::compute::{IndexOrd, Len, SearchResult, SearchSorted, SearchSortedSide}; +use vortex_array::compute::{ + scalar_at, IndexOrd, Len, SearchResult, SearchSorted, SearchSortedSide, +}; use vortex_array::validity::ArrayValidity; use vortex_array::{ArrayDType, ArrayData, IntoArrayData, IntoArrayVariant}; use vortex_buffer::{Buffer, BufferString}; diff --git a/fuzz/src/sort.rs b/fuzz/src/sort.rs index 98a2e349e8..4609786666 100644 --- a/fuzz/src/sort.rs +++ b/fuzz/src/sort.rs @@ -2,7 +2,7 @@ use std::cmp::Ordering; use vortex_array::accessor::ArrayAccessor; use vortex_array::array::{BoolArray, PrimitiveArray, VarBinViewArray}; -use vortex_array::compute::unary::scalar_at; +use vortex_array::compute::scalar_at; use vortex_array::validity::ArrayValidity; use vortex_array::{ArrayDType, ArrayData, IntoArrayData, IntoArrayVariant}; use vortex_dtype::{match_each_native_ptype, DType, NativePType}; diff --git a/pyvortex/src/array.rs b/pyvortex/src/array.rs index ec6073f74f..7c9fd8c6ff 100644 --- a/pyvortex/src/array.rs +++ b/pyvortex/src/array.rs @@ -4,8 +4,9 @@ use pyo3::exceptions::PyValueError; use pyo3::prelude::*; use pyo3::types::{IntoPyDict, PyInt, PyList}; use vortex::array::ChunkedArray; -use vortex::compute::unary::{fill_forward, scalar_at}; -use vortex::compute::{compare, slice, take, FilterMask, Operator, TakeOptions}; +use vortex::compute::{ + compare, fill_forward, scalar_at, slice, take, FilterMask, Operator, TakeOptions, +}; use vortex::{ArrayDType, ArrayData, IntoCanonical}; use crate::dtype::PyDType; diff --git a/vortex-array/benches/scalar_subtract.rs b/vortex-array/benches/scalar_subtract.rs index d109e994c6..1efed008c8 100644 --- a/vortex-array/benches/scalar_subtract.rs +++ b/vortex-array/benches/scalar_subtract.rs @@ -29,8 +29,7 @@ fn scalar_subtract(c: &mut Criterion) { group.bench_function("vortex", |b| { b.iter(|| { let array = - vortex_array::compute::unary::subtract_scalar(&chunked, &to_subtract.into()) - .unwrap(); + vortex_array::compute::subtract_scalar(&chunked, &to_subtract.into()).unwrap(); let chunked = ChunkedArray::try_from(array).unwrap(); black_box(chunked); diff --git a/vortex-array/src/array/bool/compute/fill.rs b/vortex-array/src/array/bool/compute/fill.rs index de7cf0725a..21a67290f5 100644 --- a/vortex-array/src/array/bool/compute/fill.rs +++ b/vortex-array/src/array/bool/compute/fill.rs @@ -3,7 +3,7 @@ use vortex_dtype::Nullability; use vortex_error::{vortex_err, VortexResult}; use crate::array::{BoolArray, BoolEncoding}; -use crate::compute::unary::FillForwardFn; +use crate::compute::FillForwardFn; use crate::validity::{ArrayValidity, Validity}; use crate::{ArrayDType, ArrayData, ArrayLen, IntoArrayData, ToArrayData}; @@ -56,8 +56,7 @@ mod test { fn fill_forward() { let barr = BoolArray::from_iter(vec![None, Some(false), None, Some(true), None]).into_array(); - let filled_bool = - BoolArray::try_from(compute::unary::fill_forward(&barr).unwrap()).unwrap(); + let filled_bool = BoolArray::try_from(compute::fill_forward(&barr).unwrap()).unwrap(); assert_eq!( filled_bool.boolean_buffer().iter().collect::>(), vec![false, false, false, true, true] diff --git a/vortex-array/src/array/bool/compute/mod.rs b/vortex-array/src/array/bool/compute/mod.rs index df35713dc1..7f6541814c 100644 --- a/vortex-array/src/array/bool/compute/mod.rs +++ b/vortex-array/src/array/bool/compute/mod.rs @@ -1,6 +1,7 @@ use crate::array::BoolEncoding; -use crate::compute::unary::{FillForwardFn, ScalarAtFn}; -use crate::compute::{BinaryBooleanFn, ComputeVTable, FilterFn, SliceFn, TakeFn}; +use crate::compute::{ + BinaryBooleanFn, ComputeVTable, FillForwardFn, FilterFn, ScalarAtFn, SliceFn, TakeFn, +}; use crate::ArrayData; mod fill; diff --git a/vortex-array/src/array/bool/compute/scalar_at.rs b/vortex-array/src/array/bool/compute/scalar_at.rs index fbef321b03..e880c703cb 100644 --- a/vortex-array/src/array/bool/compute/scalar_at.rs +++ b/vortex-array/src/array/bool/compute/scalar_at.rs @@ -2,7 +2,7 @@ use vortex_error::VortexResult; use vortex_scalar::Scalar; use crate::array::{BoolArray, BoolEncoding}; -use crate::compute::unary::ScalarAtFn; +use crate::compute::ScalarAtFn; use crate::ArrayDType; impl ScalarAtFn for BoolEncoding { diff --git a/vortex-array/src/array/bool/compute/slice.rs b/vortex-array/src/array/bool/compute/slice.rs index cfbed959da..0a0a05534d 100644 --- a/vortex-array/src/array/bool/compute/slice.rs +++ b/vortex-array/src/array/bool/compute/slice.rs @@ -17,8 +17,7 @@ impl SliceFn for BoolEncoding { #[cfg(test)] mod tests { use super::*; - use crate::compute::slice; - use crate::compute::unary::scalar_at; + use crate::compute::{scalar_at, slice}; use crate::validity::ArrayValidity; use crate::ArrayLen; diff --git a/vortex-array/src/array/bool/mod.rs b/vortex-array/src/array/bool/mod.rs index a74b2a8ea2..b1fc057d9a 100644 --- a/vortex-array/src/array/bool/mod.rs +++ b/vortex-array/src/array/bool/mod.rs @@ -241,8 +241,7 @@ mod tests { use arrow_buffer::BooleanBuffer; use crate::array::BoolArray; - use crate::compute::slice; - use crate::compute::unary::scalar_at; + use crate::compute::{scalar_at, slice}; use crate::validity::Validity; use crate::{IntoArrayData, IntoArrayVariant}; diff --git a/vortex-array/src/array/chunked/compute/mod.rs b/vortex-array/src/array/chunked/compute/mod.rs index bf61e5d323..c66833a924 100644 --- a/vortex-array/src/array/chunked/compute/mod.rs +++ b/vortex-array/src/array/chunked/compute/mod.rs @@ -3,9 +3,9 @@ use vortex_error::VortexResult; use crate::array::chunked::ChunkedArray; use crate::array::ChunkedEncoding; -use crate::compute::unary::{try_cast, CastFn, ScalarAtFn, SubtractScalarFn}; use crate::compute::{ - compare, slice, CompareFn, ComputeVTable, FilterFn, Operator, SliceFn, TakeFn, + compare, slice, try_cast, CastFn, CompareFn, ComputeVTable, FilterFn, Operator, ScalarAtFn, + SliceFn, SubtractScalarFn, TakeFn, }; use crate::{ArrayData, IntoArrayData}; @@ -84,7 +84,7 @@ mod test { use crate::array::chunked::ChunkedArray; use crate::array::primitive::PrimitiveArray; - use crate::compute::unary::try_cast; + use crate::compute::try_cast; use crate::validity::Validity; use crate::{IntoArrayData, IntoArrayVariant}; diff --git a/vortex-array/src/array/chunked/compute/scalar_at.rs b/vortex-array/src/array/chunked/compute/scalar_at.rs index c0bb3c133d..a693cdc144 100644 --- a/vortex-array/src/array/chunked/compute/scalar_at.rs +++ b/vortex-array/src/array/chunked/compute/scalar_at.rs @@ -2,7 +2,7 @@ use vortex_error::VortexResult; use vortex_scalar::Scalar; use crate::array::{ChunkedArray, ChunkedEncoding}; -use crate::compute::unary::{scalar_at, ScalarAtFn}; +use crate::compute::{scalar_at, ScalarAtFn}; impl ScalarAtFn for ChunkedEncoding { fn scalar_at(&self, array: &ChunkedArray, index: usize) -> VortexResult { @@ -16,7 +16,7 @@ mod tests { use vortex_dtype::{DType, Nullability, PType}; use crate::array::{ChunkedArray, PrimitiveArray}; - use crate::compute::unary::scalar_at; + use crate::compute::scalar_at; use crate::IntoArrayData; #[test] diff --git a/vortex-array/src/array/chunked/compute/take.rs b/vortex-array/src/array/chunked/compute/take.rs index f8b880b98e..842233e23f 100644 --- a/vortex-array/src/array/chunked/compute/take.rs +++ b/vortex-array/src/array/chunked/compute/take.rs @@ -5,8 +5,10 @@ use vortex_scalar::Scalar; use crate::array::chunked::ChunkedArray; use crate::array::ChunkedEncoding; -use crate::compute::unary::{scalar_at, subtract_scalar, try_cast}; -use crate::compute::{search_sorted, slice, take, SearchSortedSide, TakeFn, TakeOptions}; +use crate::compute::{ + scalar_at, search_sorted, slice, subtract_scalar, take, try_cast, SearchSortedSide, TakeFn, + TakeOptions, +}; use crate::stats::ArrayStatistics; use crate::{ArrayDType, ArrayData, ArrayLen, IntoArrayData, IntoArrayVariant, ToArrayData}; diff --git a/vortex-array/src/array/chunked/mod.rs b/vortex-array/src/array/chunked/mod.rs index fcedac9139..142ea8fc46 100644 --- a/vortex-array/src/array/chunked/mod.rs +++ b/vortex-array/src/array/chunked/mod.rs @@ -12,8 +12,9 @@ use vortex_error::{vortex_bail, vortex_panic, VortexExpect as _, VortexResult}; use vortex_scalar::Scalar; use crate::array::primitive::PrimitiveArray; -use crate::compute::unary::{scalar_at, subtract_scalar, SubtractScalarFn}; -use crate::compute::{search_sorted, SearchSortedSide}; +use crate::compute::{ + scalar_at, search_sorted, subtract_scalar, SearchSortedSide, SubtractScalarFn, +}; use crate::encoding::ids; use crate::iter::{ArrayIterator, ArrayIteratorAdapter}; use crate::stats::ArrayStatistics; @@ -261,7 +262,7 @@ mod test { use vortex_error::VortexResult; use crate::array::chunked::ChunkedArray; - use crate::compute::unary::{scalar_at, subtract_scalar}; + use crate::compute::{scalar_at, subtract_scalar}; use crate::{assert_arrays_eq, ArrayDType, IntoArrayData, IntoArrayVariant}; fn chunked_array() -> ChunkedArray { diff --git a/vortex-array/src/array/constant/canonical.rs b/vortex-array/src/array/constant/canonical.rs index d56d565e03..b36b0e9c01 100644 --- a/vortex-array/src/array/constant/canonical.rs +++ b/vortex-array/src/array/constant/canonical.rs @@ -124,7 +124,7 @@ mod tests { use vortex_scalar::Scalar; use crate::array::ConstantArray; - use crate::compute::unary::scalar_at; + use crate::compute::scalar_at; use crate::stats::{ArrayStatistics as _, StatsSet}; use crate::{ArrayLen, IntoArrayData as _, IntoCanonical}; diff --git a/vortex-array/src/array/constant/compute/boolean.rs b/vortex-array/src/array/constant/compute/boolean.rs index d392a7f596..f301ba42ea 100644 --- a/vortex-array/src/array/constant/compute/boolean.rs +++ b/vortex-array/src/array/constant/compute/boolean.rs @@ -73,8 +73,7 @@ mod test { use crate::array::constant::ConstantArray; use crate::array::BoolArray; - use crate::compute::unary::scalar_at; - use crate::compute::{and, or}; + use crate::compute::{and, or, scalar_at}; use crate::{ArrayData, IntoArrayData, IntoArrayVariant}; #[rstest] diff --git a/vortex-array/src/array/constant/compute/mod.rs b/vortex-array/src/array/constant/compute/mod.rs index ab0758343b..fe5c5a66ea 100644 --- a/vortex-array/src/array/constant/compute/mod.rs +++ b/vortex-array/src/array/constant/compute/mod.rs @@ -7,10 +7,9 @@ use vortex_scalar::Scalar; use crate::array::constant::ConstantArray; use crate::array::ConstantEncoding; -use crate::compute::unary::ScalarAtFn; use crate::compute::{ - BinaryBooleanFn, CompareFn, ComputeVTable, FilterFn, FilterMask, SearchSortedFn, SliceFn, - TakeFn, TakeOptions, + BinaryBooleanFn, CompareFn, ComputeVTable, FilterFn, FilterMask, ScalarAtFn, SearchSortedFn, + SliceFn, TakeFn, TakeOptions, }; use crate::{ArrayData, IntoArrayData}; diff --git a/vortex-array/src/array/extension/compute/mod.rs b/vortex-array/src/array/extension/compute/mod.rs index e73d8d087b..8f3eb8ed5b 100644 --- a/vortex-array/src/array/extension/compute/mod.rs +++ b/vortex-array/src/array/extension/compute/mod.rs @@ -5,8 +5,10 @@ use vortex_scalar::Scalar; use crate::array::extension::ExtensionArray; use crate::array::ExtensionEncoding; -use crate::compute::unary::{scalar_at, CastFn, ScalarAtFn}; -use crate::compute::{slice, take, CompareFn, ComputeVTable, SliceFn, TakeFn, TakeOptions}; +use crate::compute::{ + scalar_at, slice, take, CastFn, CompareFn, ComputeVTable, ScalarAtFn, SliceFn, TakeFn, + TakeOptions, +}; use crate::variants::ExtensionArrayTrait; use crate::{ArrayData, IntoArrayData}; diff --git a/vortex-array/src/array/null/compute.rs b/vortex-array/src/array/null/compute.rs index cb7b0a4cf0..3bd98d5db7 100644 --- a/vortex-array/src/array/null/compute.rs +++ b/vortex-array/src/array/null/compute.rs @@ -4,8 +4,7 @@ use vortex_scalar::Scalar; use crate::array::null::NullArray; use crate::array::NullEncoding; -use crate::compute::unary::ScalarAtFn; -use crate::compute::{ComputeVTable, SliceFn, TakeFn, TakeOptions}; +use crate::compute::{ComputeVTable, ScalarAtFn, SliceFn, TakeFn, TakeOptions}; use crate::variants::PrimitiveArrayTrait; use crate::{ArrayData, ArrayLen, IntoArrayData, IntoArrayVariant}; @@ -65,8 +64,7 @@ mod test { use crate::array::null::NullArray; use crate::array::ConstantArray; - use crate::compute::unary::scalar_at; - use crate::compute::{slice, take, TakeOptions}; + use crate::compute::{scalar_at, slice, take, TakeOptions}; use crate::validity::{ArrayValidity, LogicalValidity}; use crate::{ArrayLen, IntoArrayData}; diff --git a/vortex-array/src/array/primitive/compute/cast.rs b/vortex-array/src/array/primitive/compute/cast.rs index 142a4a1766..e716f1a5ce 100644 --- a/vortex-array/src/array/primitive/compute/cast.rs +++ b/vortex-array/src/array/primitive/compute/cast.rs @@ -3,7 +3,7 @@ use vortex_error::{vortex_bail, vortex_err, VortexResult}; use crate::array::primitive::PrimitiveArray; use crate::array::PrimitiveEncoding; -use crate::compute::unary::CastFn; +use crate::compute::CastFn; use crate::validity::Validity; use crate::variants::PrimitiveArrayTrait; use crate::{ArrayDType, ArrayData, ArrayLen, IntoArrayData}; @@ -69,7 +69,7 @@ mod test { use vortex_error::VortexError; use crate::array::PrimitiveArray; - use crate::compute::unary::try_cast; + use crate::compute::try_cast; use crate::validity::Validity; use crate::{IntoArrayData, IntoArrayVariant}; diff --git a/vortex-array/src/array/primitive/compute/fill.rs b/vortex-array/src/array/primitive/compute/fill.rs index d883a9d599..b80cd3d02f 100644 --- a/vortex-array/src/array/primitive/compute/fill.rs +++ b/vortex-array/src/array/primitive/compute/fill.rs @@ -3,7 +3,7 @@ use vortex_error::{vortex_err, VortexResult}; use crate::array::primitive::PrimitiveArray; use crate::array::PrimitiveEncoding; -use crate::compute::unary::FillForwardFn; +use crate::compute::FillForwardFn; use crate::validity::{ArrayValidity, Validity}; use crate::variants::PrimitiveArrayTrait; use crate::{ArrayDType, ArrayData, ArrayLen, IntoArrayData, ToArrayData}; @@ -51,7 +51,7 @@ impl FillForwardFn for PrimitiveEncoding { mod test { use crate::array::primitive::PrimitiveArray; use crate::array::BoolArray; - use crate::compute::unary::fill_forward; + use crate::compute::fill_forward; use crate::validity::{ArrayValidity, Validity}; use crate::{IntoArrayData, IntoArrayVariant}; diff --git a/vortex-array/src/array/primitive/compute/mod.rs b/vortex-array/src/array/primitive/compute/mod.rs index b74368e1c6..8c693784f9 100644 --- a/vortex-array/src/array/primitive/compute/mod.rs +++ b/vortex-array/src/array/primitive/compute/mod.rs @@ -1,6 +1,8 @@ use crate::array::PrimitiveEncoding; -use crate::compute::unary::{CastFn, FillForwardFn, ScalarAtFn, SubtractScalarFn}; -use crate::compute::{ComputeVTable, FilterFn, SearchSortedFn, SliceFn, TakeFn}; +use crate::compute::{ + CastFn, ComputeVTable, FillForwardFn, FilterFn, ScalarAtFn, SearchSortedFn, SliceFn, + SubtractScalarFn, TakeFn, +}; use crate::ArrayData; mod cast; diff --git a/vortex-array/src/array/primitive/compute/scalar_at.rs b/vortex-array/src/array/primitive/compute/scalar_at.rs index c3cb84d4fa..5372108974 100644 --- a/vortex-array/src/array/primitive/compute/scalar_at.rs +++ b/vortex-array/src/array/primitive/compute/scalar_at.rs @@ -4,7 +4,7 @@ use vortex_scalar::Scalar; use crate::array::primitive::PrimitiveArray; use crate::array::PrimitiveEncoding; -use crate::compute::unary::ScalarAtFn; +use crate::compute::ScalarAtFn; use crate::variants::PrimitiveArrayTrait; use crate::ArrayDType; diff --git a/vortex-array/src/array/primitive/compute/subtract_scalar.rs b/vortex-array/src/array/primitive/compute/subtract_scalar.rs index 6952544d6e..74120a75a1 100644 --- a/vortex-array/src/array/primitive/compute/subtract_scalar.rs +++ b/vortex-array/src/array/primitive/compute/subtract_scalar.rs @@ -7,7 +7,7 @@ use vortex_scalar::{PrimitiveScalar, Scalar}; use crate::array::constant::ConstantArray; use crate::array::primitive::PrimitiveArray; use crate::array::PrimitiveEncoding; -use crate::compute::unary::SubtractScalarFn; +use crate::compute::SubtractScalarFn; use crate::validity::ArrayValidity; use crate::variants::PrimitiveArrayTrait; use crate::{ArrayDType, ArrayData, ArrayLen, IntoArrayData}; @@ -85,7 +85,7 @@ mod test { use itertools::Itertools; use crate::array::primitive::PrimitiveArray; - use crate::compute::unary::subtract_scalar; + use crate::compute::subtract_scalar; use crate::{ArrayLen, IntoArrayData, IntoArrayVariant}; #[test] diff --git a/vortex-array/src/array/sparse/compute/mod.rs b/vortex-array/src/array/sparse/compute/mod.rs index 463142abc2..17c6951e8c 100644 --- a/vortex-array/src/array/sparse/compute/mod.rs +++ b/vortex-array/src/array/sparse/compute/mod.rs @@ -4,10 +4,9 @@ use vortex_scalar::Scalar; use crate::array::sparse::SparseArray; use crate::array::{PrimitiveArray, SparseEncoding}; -use crate::compute::unary::{scalar_at, ScalarAtFn}; use crate::compute::{ - search_sorted, take, ComputeVTable, FilterFn, FilterMask, SearchResult, SearchSortedFn, - SearchSortedSide, SliceFn, TakeFn, TakeOptions, + scalar_at, search_sorted, take, ComputeVTable, FilterFn, FilterMask, ScalarAtFn, SearchResult, + SearchSortedFn, SearchSortedSide, SliceFn, TakeFn, TakeOptions, }; use crate::variants::PrimitiveArrayTrait; use crate::{ArrayData, IntoArrayData, IntoArrayVariant}; diff --git a/vortex-array/src/array/sparse/mod.rs b/vortex-array/src/array/sparse/mod.rs index db420820bd..df6bb552d5 100644 --- a/vortex-array/src/array/sparse/mod.rs +++ b/vortex-array/src/array/sparse/mod.rs @@ -6,8 +6,7 @@ use vortex_error::{vortex_bail, vortex_panic, VortexExpect as _, VortexResult}; use vortex_scalar::{Scalar, ScalarValue}; use crate::array::constant::ConstantArray; -use crate::compute::unary::scalar_at; -use crate::compute::{search_sorted, SearchResult, SearchSortedSide}; +use crate::compute::{scalar_at, search_sorted, SearchResult, SearchSortedSide}; use crate::encoding::ids; use crate::stats::{ArrayStatistics, Stat, StatisticsVTable, StatsSet}; use crate::validity::{LogicalValidity, ValidityVTable}; @@ -257,8 +256,7 @@ mod test { use vortex_scalar::Scalar; use crate::array::sparse::SparseArray; - use crate::compute::slice; - use crate::compute::unary::{scalar_at, try_cast}; + use crate::compute::{scalar_at, slice, try_cast}; use crate::{ArrayData, IntoArrayData, IntoArrayVariant}; fn nullable_fill() -> Scalar { diff --git a/vortex-array/src/array/struct_/compute.rs b/vortex-array/src/array/struct_/compute.rs index ba6c7025df..3d0a08dc4e 100644 --- a/vortex-array/src/array/struct_/compute.rs +++ b/vortex-array/src/array/struct_/compute.rs @@ -4,9 +4,9 @@ use vortex_scalar::Scalar; use crate::array::struct_::StructArray; use crate::array::StructEncoding; -use crate::compute::unary::{scalar_at, ScalarAtFn}; use crate::compute::{ - filter, slice, take, ComputeVTable, FilterFn, FilterMask, SliceFn, TakeFn, TakeOptions, + filter, scalar_at, slice, take, ComputeVTable, FilterFn, FilterMask, ScalarAtFn, SliceFn, + TakeFn, TakeOptions, }; use crate::variants::StructArrayTrait; use crate::{ArrayDType, ArrayData, IntoArrayData}; diff --git a/vortex-array/src/array/varbin/arrow.rs b/vortex-array/src/array/varbin/arrow.rs index 057243c1a0..a55dc1f046 100644 --- a/vortex-array/src/array/varbin/arrow.rs +++ b/vortex-array/src/array/varbin/arrow.rs @@ -6,7 +6,7 @@ use vortex_error::{vortex_bail, VortexResult}; use crate::array::VarBinArray; use crate::arrow::wrappers::as_offset_buffer; -use crate::compute::unary::try_cast; +use crate::compute::try_cast; use crate::validity::ArrayValidity; use crate::variants::PrimitiveArrayTrait; use crate::{ArrayDType, IntoArrayVariant, ToArrayData}; diff --git a/vortex-array/src/array/varbin/builder.rs b/vortex-array/src/array/varbin/builder.rs index af8ee52294..30a7087aab 100644 --- a/vortex-array/src/array/varbin/builder.rs +++ b/vortex-array/src/array/varbin/builder.rs @@ -102,7 +102,7 @@ mod test { use vortex_scalar::Scalar; use crate::array::varbin::builder::VarBinBuilder; - use crate::compute::unary::scalar_at; + use crate::compute::scalar_at; use crate::{ArrayDType, IntoArrayData}; #[test] diff --git a/vortex-array/src/array/varbin/compute/filter.rs b/vortex-array/src/array/varbin/compute/filter.rs index aa4c1b0f62..d785e8910c 100644 --- a/vortex-array/src/array/varbin/compute/filter.rs +++ b/vortex-array/src/array/varbin/compute/filter.rs @@ -185,8 +185,7 @@ mod test { }; use crate::array::varbin::VarBinArray; use crate::array::BoolArray; - use crate::compute::unary::scalar_at; - use crate::compute::FilterMask; + use crate::compute::{scalar_at, FilterMask}; use crate::validity::Validity; use crate::ToArrayData; diff --git a/vortex-array/src/array/varbin/compute/mod.rs b/vortex-array/src/array/varbin/compute/mod.rs index 7348134bdd..03d1a60a48 100644 --- a/vortex-array/src/array/varbin/compute/mod.rs +++ b/vortex-array/src/array/varbin/compute/mod.rs @@ -3,8 +3,7 @@ use vortex_scalar::Scalar; use crate::array::varbin::{varbin_scalar, VarBinArray}; use crate::array::VarBinEncoding; -use crate::compute::unary::ScalarAtFn; -use crate::compute::{ComputeVTable, FilterFn, SliceFn, TakeFn}; +use crate::compute::{ComputeVTable, FilterFn, ScalarAtFn, SliceFn, TakeFn}; use crate::{ArrayDType, ArrayData}; mod filter; diff --git a/vortex-array/src/array/varbin/mod.rs b/vortex-array/src/array/varbin/mod.rs index 18fba05a8f..02e2f54736 100644 --- a/vortex-array/src/array/varbin/mod.rs +++ b/vortex-array/src/array/varbin/mod.rs @@ -13,8 +13,7 @@ use vortex_scalar::Scalar; use crate::array::primitive::PrimitiveArray; use crate::array::varbin::builder::VarBinBuilder; -use crate::compute::slice; -use crate::compute::unary::scalar_at; +use crate::compute::{scalar_at, slice}; use crate::encoding::ids; use crate::stats::StatsSet; use crate::validity::{Validity, ValidityMetadata}; @@ -293,8 +292,7 @@ mod test { use crate::array::primitive::PrimitiveArray; use crate::array::varbin::VarBinArray; - use crate::compute::slice; - use crate::compute::unary::scalar_at; + use crate::compute::{scalar_at, slice}; use crate::validity::Validity; use crate::{ArrayData, IntoArrayData}; diff --git a/vortex-array/src/array/varbin/stats.rs b/vortex-array/src/array/varbin/stats.rs index e330827212..1e4198774a 100644 --- a/vortex-array/src/array/varbin/stats.rs +++ b/vortex-array/src/array/varbin/stats.rs @@ -8,7 +8,7 @@ use super::varbin_scalar; use crate::accessor::ArrayAccessor; use crate::array::varbin::VarBinArray; use crate::array::VarBinEncoding; -use crate::compute::unary::scalar_at; +use crate::compute::scalar_at; use crate::stats::{Stat, StatisticsVTable, StatsSet}; use crate::ArrayTrait; diff --git a/vortex-array/src/array/varbinview/compute/mod.rs b/vortex-array/src/array/varbinview/compute/mod.rs index e797e91a38..68bcea8850 100644 --- a/vortex-array/src/array/varbinview/compute/mod.rs +++ b/vortex-array/src/array/varbinview/compute/mod.rs @@ -9,8 +9,7 @@ use vortex_scalar::Scalar; use crate::array::varbin::varbin_scalar; use crate::array::varbinview::{VarBinViewArray, VIEW_SIZE_BYTES}; use crate::array::{PrimitiveArray, VarBinViewEncoding}; -use crate::compute::unary::ScalarAtFn; -use crate::compute::{slice, ComputeVTable, SliceFn, TakeFn, TakeOptions}; +use crate::compute::{slice, ComputeVTable, ScalarAtFn, SliceFn, TakeFn, TakeOptions}; use crate::validity::Validity; use crate::variants::PrimitiveArrayTrait; use crate::{ArrayDType, ArrayData, IntoArrayData, IntoArrayVariant}; diff --git a/vortex-array/src/array/varbinview/mod.rs b/vortex-array/src/array/varbinview/mod.rs index dcaf82fe4b..f57a9d7a0a 100644 --- a/vortex-array/src/array/varbinview/mod.rs +++ b/vortex-array/src/array/varbinview/mod.rs @@ -636,8 +636,7 @@ mod test { use vortex_scalar::Scalar; use crate::array::varbinview::{BinaryView, VarBinViewArray, VIEW_SIZE_BYTES}; - use crate::compute::slice; - use crate::compute::unary::scalar_at; + use crate::compute::{scalar_at, slice}; use crate::{ArrayLen, Canonical, IntoArrayData, IntoCanonical}; #[test] diff --git a/vortex-array/src/canonical.rs b/vortex-array/src/canonical.rs index 4a58a92630..0fb725cf45 100644 --- a/vortex-array/src/canonical.rs +++ b/vortex-array/src/canonical.rs @@ -24,7 +24,7 @@ use crate::array::{ TemporalArray, VarBinViewArray, }; use crate::arrow::{infer_data_type, FromArrowArray}; -use crate::compute::unary::try_cast; +use crate::compute::try_cast; use crate::encoding::Encoding; use crate::stats::ArrayStatistics; use crate::validity::ArrayValidity; diff --git a/vortex-array/src/compute/boolean.rs b/vortex-array/src/compute/boolean.rs index e47e34430f..df49995054 100644 --- a/vortex-array/src/compute/boolean.rs +++ b/vortex-array/src/compute/boolean.rs @@ -154,7 +154,7 @@ mod tests { use super::*; use crate::array::BoolArray; - use crate::compute::unary::scalar_at; + use crate::compute::scalar_at; use crate::IntoArrayData; #[rstest] diff --git a/vortex-array/src/compute/unary/cast.rs b/vortex-array/src/compute/cast.rs similarity index 100% rename from vortex-array/src/compute/unary/cast.rs rename to vortex-array/src/compute/cast.rs diff --git a/vortex-array/src/compute/unary/fill_forward.rs b/vortex-array/src/compute/fill_forward.rs similarity index 100% rename from vortex-array/src/compute/unary/fill_forward.rs rename to vortex-array/src/compute/fill_forward.rs diff --git a/vortex-array/src/compute/mod.rs b/vortex-array/src/compute/mod.rs index 041e0d276e..bf24c85621 100644 --- a/vortex-array/src/compute/mod.rs +++ b/vortex-array/src/compute/mod.rs @@ -8,24 +8,29 @@ //! from Arrow. pub use boolean::{and, and_kleene, or, or_kleene, BinaryBooleanFn, BinaryOperator}; +pub use cast::{try_cast, CastFn}; pub use compare::{compare, scalar_cmp, CompareFn, Operator}; +pub use fill_forward::{fill_forward, FillForwardFn}; pub use filter::*; +pub use scalar_at::{scalar_at, ScalarAtFn}; +pub use scalar_subtract::{subtract_scalar, SubtractScalarFn}; pub use search_sorted::*; pub use slice::{slice, SliceFn}; pub use take::*; -use unary::{CastFn, FillForwardFn, ScalarAtFn, SubtractScalarFn}; use crate::ArrayData; mod boolean; +mod cast; mod compare; +mod fill_forward; mod filter; +mod scalar_at; +mod scalar_subtract; mod search_sorted; mod slice; mod take; -pub mod unary; - /// VTable for dispatching compute functions to Vortex encodings. pub trait ComputeVTable { /// Implementation of binary boolean logic operations. diff --git a/vortex-array/src/compute/unary/scalar_at.rs b/vortex-array/src/compute/scalar_at.rs similarity index 100% rename from vortex-array/src/compute/unary/scalar_at.rs rename to vortex-array/src/compute/scalar_at.rs diff --git a/vortex-array/src/compute/unary/scalar_subtract.rs b/vortex-array/src/compute/scalar_subtract.rs similarity index 100% rename from vortex-array/src/compute/unary/scalar_subtract.rs rename to vortex-array/src/compute/scalar_subtract.rs diff --git a/vortex-array/src/compute/search_sorted.rs b/vortex-array/src/compute/search_sorted.rs index bccc70a690..4ff193bbae 100644 --- a/vortex-array/src/compute/search_sorted.rs +++ b/vortex-array/src/compute/search_sorted.rs @@ -7,7 +7,7 @@ use itertools::Itertools; use vortex_error::{vortex_bail, vortex_err, VortexError, VortexResult}; use vortex_scalar::Scalar; -use crate::compute::unary::scalar_at; +use crate::compute::scalar_at; use crate::encoding::Encoding; use crate::{ArrayDType, ArrayData}; diff --git a/vortex-array/src/compute/unary/mod.rs b/vortex-array/src/compute/unary/mod.rs deleted file mode 100644 index d59959b99f..0000000000 --- a/vortex-array/src/compute/unary/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub use cast::{try_cast, CastFn}; -pub use fill_forward::{fill_forward, FillForwardFn}; -pub use scalar_at::{scalar_at, ScalarAtFn}; -pub use scalar_subtract::{subtract_scalar, SubtractScalarFn}; - -mod cast; -mod fill_forward; -mod scalar_at; -mod scalar_subtract; diff --git a/vortex-array/src/data/mod.rs b/vortex-array/src/data/mod.rs index cab2b70da2..b878c2071e 100644 --- a/vortex-array/src/data/mod.rs +++ b/vortex-array/src/data/mod.rs @@ -15,7 +15,7 @@ use crate::array::{ BoolEncoding, ExtensionEncoding, NullEncoding, PrimitiveEncoding, StructEncoding, VarBinEncoding, VarBinViewEncoding, }; -use crate::compute::unary::scalar_at; +use crate::compute::scalar_at; use crate::encoding::{EncodingId, EncodingRef, EncodingVTable}; use crate::iter::{ArrayIterator, ArrayIteratorAdapter}; use crate::stats::{ArrayStatistics, Stat, Statistics, StatsSet}; diff --git a/vortex-array/src/stream/take_rows.rs b/vortex-array/src/stream/take_rows.rs index 2ccc2b5b6c..babccaf23b 100644 --- a/vortex-array/src/stream/take_rows.rs +++ b/vortex-array/src/stream/take_rows.rs @@ -7,8 +7,7 @@ use vortex_dtype::match_each_integer_ptype; use vortex_error::{vortex_bail, VortexResult}; use vortex_scalar::Scalar; -use crate::compute::unary::subtract_scalar; -use crate::compute::{search_sorted, slice, take, SearchSortedSide, TakeOptions}; +use crate::compute::{search_sorted, slice, subtract_scalar, take, SearchSortedSide, TakeOptions}; use crate::stats::{ArrayStatistics, Stat}; use crate::stream::ArrayStream; use crate::variants::PrimitiveArrayTrait; diff --git a/vortex-array/src/validity.rs b/vortex-array/src/validity.rs index 271ea1fae5..52664e9841 100644 --- a/vortex-array/src/validity.rs +++ b/vortex-array/src/validity.rs @@ -12,8 +12,7 @@ use vortex_error::{ }; use crate::array::{BoolArray, ConstantArray}; -use crate::compute::unary::scalar_at; -use crate::compute::{filter, slice, take, FilterMask, TakeOptions}; +use crate::compute::{filter, scalar_at, slice, take, FilterMask, TakeOptions}; use crate::encoding::Encoding; use crate::stats::ArrayStatistics; use crate::{ArrayDType, ArrayData, IntoArrayData, IntoArrayVariant}; diff --git a/vortex-file/src/chunked_reader/mod.rs b/vortex-file/src/chunked_reader/mod.rs index 09f28d489f..1f7fae512e 100644 --- a/vortex-file/src/chunked_reader/mod.rs +++ b/vortex-file/src/chunked_reader/mod.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use vortex_array::compute::unary::scalar_at; +use vortex_array::compute::scalar_at; use vortex_array::stream::ArrayStream; use vortex_array::{ArrayData, Context}; use vortex_dtype::DType; diff --git a/vortex-file/src/chunked_reader/take_rows.rs b/vortex-file/src/chunked_reader/take_rows.rs index da373aed6d..d5781a218f 100644 --- a/vortex-file/src/chunked_reader/take_rows.rs +++ b/vortex-file/src/chunked_reader/take_rows.rs @@ -4,8 +4,9 @@ use futures_util::{stream, StreamExt, TryStreamExt}; use itertools::Itertools; use vortex_array::aliases::hash_map::HashMap; use vortex_array::array::{ChunkedArray, PrimitiveArray}; -use vortex_array::compute::unary::{subtract_scalar, try_cast}; -use vortex_array::compute::{search_sorted, slice, take, SearchSortedSide, TakeOptions}; +use vortex_array::compute::{ + search_sorted, slice, subtract_scalar, take, try_cast, SearchSortedSide, TakeOptions, +}; use vortex_array::stats::ArrayStatistics; use vortex_array::stream::{ArrayStream, ArrayStreamExt}; use vortex_array::{ArrayDType, ArrayData, ArrayLen, IntoArrayData, IntoArrayVariant}; diff --git a/vortex-file/src/read/mask.rs b/vortex-file/src/read/mask.rs index a805a29bb6..594df9aefd 100644 --- a/vortex-file/src/read/mask.rs +++ b/vortex-file/src/read/mask.rs @@ -3,8 +3,7 @@ use std::fmt::{Display, Formatter}; use arrow_buffer::BooleanBuffer; use vortex_array::array::{BoolArray, PrimitiveArray, SparseArray}; -use vortex_array::compute::unary::try_cast; -use vortex_array::compute::{and, filter, slice, take, FilterMask, TakeOptions}; +use vortex_array::compute::{and, filter, slice, take, try_cast, FilterMask, TakeOptions}; use vortex_array::stats::ArrayStatistics; use vortex_array::validity::LogicalValidity; use vortex_array::{ArrayDType, ArrayData, IntoArrayData, IntoArrayVariant}; diff --git a/vortex-file/src/read/metadata.rs b/vortex-file/src/read/metadata.rs index 2177ebb3a4..b967621f68 100644 --- a/vortex-file/src/read/metadata.rs +++ b/vortex-file/src/read/metadata.rs @@ -109,7 +109,7 @@ mod test { use std::sync::{Arc, RwLock}; use vortex_array::array::{ChunkedArray, StructArray}; - use vortex_array::compute::unary::scalar_at; + use vortex_array::compute::scalar_at; use vortex_array::{ArrayDType as _, ArrayData, IntoArrayData as _}; use vortex_buffer::{Buffer, BufferString}; use vortex_io::IoDispatcher; diff --git a/vortex-file/src/tests.rs b/vortex-file/src/tests.rs index 2b9daf71f0..2dedad5003 100644 --- a/vortex-file/src/tests.rs +++ b/vortex-file/src/tests.rs @@ -6,7 +6,7 @@ use futures::StreamExt; use itertools::Itertools; use vortex_array::accessor::ArrayAccessor; use vortex_array::array::{ChunkedArray, PrimitiveArray, StructArray, VarBinArray}; -use vortex_array::compute::unary::scalar_at; +use vortex_array::compute::scalar_at; use vortex_array::validity::Validity; use vortex_array::variants::{PrimitiveArrayTrait, StructArrayTrait}; use vortex_array::{ArrayDType, ArrayData, ArrayLen, IntoArrayData, IntoArrayVariant, ToArrayData};