diff --git a/bench-vortex/src/reader.rs b/bench-vortex/src/reader.rs index 337d3cb0a..c25c94a48 100644 --- a/bench-vortex/src/reader.rs +++ b/bench-vortex/src/reader.rs @@ -32,8 +32,7 @@ use vortex_buffer::Buffer; use vortex_dtype::DType; use vortex_error::{vortex_err, VortexResult}; use vortex_ipc::chunked_reader::ChunkedArrayReader; -use vortex_ipc::io::ObjectStoreExt; -use vortex_ipc::io::{TokioAdapter, VortexReadAt, VortexWrite}; +use vortex_ipc::io::{ObjectStoreExt, TokioAdapter, VortexReadAt, VortexWrite}; use vortex_ipc::writer::ArrayWriter; use vortex_ipc::MessageReader; use vortex_sampling_compressor::SamplingCompressor; diff --git a/encodings/alp/src/compute.rs b/encodings/alp/src/compute.rs index 0d23ddedd..ff3de2d5d 100644 --- a/encodings/alp/src/compute.rs +++ b/encodings/alp/src/compute.rs @@ -4,8 +4,7 @@ use vortex::{Array, IntoArray}; use vortex_error::VortexResult; use vortex_scalar::Scalar; -use crate::ALPFloat; -use crate::{match_each_alp_float_ptype, ALPArray}; +use crate::{match_each_alp_float_ptype, ALPArray, ALPFloat}; impl ArrayCompute for ALPArray { fn scalar_at(&self) -> Option<&dyn ScalarAtFn> { diff --git a/encodings/byte_bool/src/compute/mod.rs b/encodings/byte_bool/src/compute/mod.rs index c61a47c86..9ce844983 100644 --- a/encodings/byte_bool/src/compute/mod.rs +++ b/encodings/byte_bool/src/compute/mod.rs @@ -3,17 +3,13 @@ use std::sync::Arc; use arrow_buffer::BooleanBuffer; use num_traits::AsPrimitive; +use vortex::compute::unary::fill_forward::FillForwardFn; +use vortex::compute::unary::scalar_at::ScalarAtFn; use vortex::compute::{ArrayCompute, CompareFn, SliceFn, TakeFn}; -use vortex::validity::Validity; -use vortex::Array; -use vortex::{ - compute::{unary::fill_forward::FillForwardFn, unary::scalar_at::ScalarAtFn}, - encoding::ArrayEncodingRef, - stats::StatsSet, - validity::ArrayValidity, - ArrayDType, ArrayData, IntoArray, -}; -use vortex::{IntoArrayVariant, ToArrayData}; +use vortex::encoding::ArrayEncodingRef; +use vortex::stats::StatsSet; +use vortex::validity::{ArrayValidity, Validity}; +use vortex::{Array, ArrayDType, ArrayData, IntoArray, IntoArrayVariant, ToArrayData}; use vortex_dtype::{match_each_integer_ptype, Nullability}; use vortex_error::{vortex_bail, VortexResult}; use vortex_expr::Operator; @@ -186,11 +182,9 @@ impl FillForwardFn for ByteBoolArray { #[cfg(test)] mod tests { - use vortex::{ - compute::unary::scalar_at::scalar_at, - compute::{compare, slice}, - AsArray as _, - }; + use vortex::compute::unary::scalar_at::scalar_at; + use vortex::compute::{compare, slice}; + use vortex::AsArray as _; use super::*; diff --git a/encodings/byte_bool/src/lib.rs b/encodings/byte_bool/src/lib.rs index 01a6296e7..5c0bec147 100644 --- a/encodings/byte_bool/src/lib.rs +++ b/encodings/byte_bool/src/lib.rs @@ -3,13 +3,10 @@ use std::mem::ManuallyDrop; use arrow_buffer::BooleanBuffer; use serde::{Deserialize, Serialize}; use vortex::array::bool::BoolArray; +use vortex::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use vortex::variants::{ArrayVariants, BoolArrayTrait}; -use vortex::{ - impl_encoding, - validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}, - visitor::{AcceptArrayVisitor, ArrayVisitor}, -}; -use vortex::{Canonical, IntoCanonical}; +use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use vortex::{impl_encoding, Canonical, IntoCanonical}; use vortex_buffer::Buffer; mod compute; diff --git a/encodings/byte_bool/src/stats.rs b/encodings/byte_bool/src/stats.rs index 925de0563..235a47f20 100644 --- a/encodings/byte_bool/src/stats.rs +++ b/encodings/byte_bool/src/stats.rs @@ -1,7 +1,5 @@ -use vortex::{ - stats::{ArrayStatisticsCompute, Stat, StatsSet}, - AsArray, IntoArrayVariant, -}; +use vortex::stats::{ArrayStatisticsCompute, Stat, StatsSet}; +use vortex::{AsArray, IntoArrayVariant}; use vortex_error::VortexResult; use super::ByteBoolArray; diff --git a/encodings/datetime-parts/src/compute.rs b/encodings/datetime-parts/src/compute.rs index 725828eca..15e035c1c 100644 --- a/encodings/datetime-parts/src/compute.rs +++ b/encodings/datetime-parts/src/compute.rs @@ -2,8 +2,7 @@ use vortex::array::datetime::temporal::TemporalMetadata; use vortex::array::datetime::{TemporalArray, TimeUnit}; use vortex::array::primitive::PrimitiveArray; use vortex::compute::unary::scalar_at::{scalar_at, ScalarAtFn}; -use vortex::compute::ArrayCompute; -use vortex::compute::{slice, take, SliceFn, TakeFn}; +use vortex::compute::{slice, take, ArrayCompute, SliceFn, TakeFn}; use vortex::validity::ArrayValidity; use vortex::{Array, ArrayDType, IntoArray, IntoArrayVariant}; use vortex_dtype::DType; diff --git a/encodings/dict/src/compress.rs b/encodings/dict/src/compress.rs index d868f25f2..e4b4ad476 100644 --- a/encodings/dict/src/compress.rs +++ b/encodings/dict/src/compress.rs @@ -9,8 +9,7 @@ use vortex::array::primitive::PrimitiveArray; use vortex::array::varbin::VarBinArray; use vortex::validity::Validity; use vortex::{ArrayDType, IntoArray}; -use vortex_dtype::{match_each_native_ptype, DType}; -use vortex_dtype::{NativePType, ToBytes}; +use vortex_dtype::{match_each_native_ptype, DType, NativePType, ToBytes}; #[derive(Debug)] struct Value(T); diff --git a/encodings/fastlanes/src/bitpacking/compress.rs b/encodings/fastlanes/src/bitpacking/compress.rs index ef5ad9b04..b07a81ae1 100644 --- a/encodings/fastlanes/src/bitpacking/compress.rs +++ b/encodings/fastlanes/src/bitpacking/compress.rs @@ -5,8 +5,7 @@ use vortex::array::primitive::PrimitiveArray; use vortex::array::sparse::{Sparse, SparseArray}; use vortex::stats::ArrayStatistics; use vortex::validity::Validity; -use vortex::IntoArrayVariant; -use vortex::{Array, ArrayDType, ArrayDef, IntoArray}; +use vortex::{Array, ArrayDType, ArrayDef, IntoArray, IntoArrayVariant}; use vortex_dtype::{ match_each_integer_ptype, match_each_unsigned_integer_ptype, NativePType, PType, }; @@ -307,8 +306,7 @@ pub fn count_exceptions(bit_width: usize, bit_width_freq: &[usize]) -> usize { #[cfg(test)] mod test { - use vortex::IntoArrayVariant; - use vortex::ToArray; + use vortex::{IntoArrayVariant, ToArray}; use vortex_scalar::PrimitiveScalar; use super::*; diff --git a/encodings/fastlanes/src/bitpacking/compute/mod.rs b/encodings/fastlanes/src/bitpacking/compute/mod.rs index fe1b22543..5689e187a 100644 --- a/encodings/fastlanes/src/bitpacking/compute/mod.rs +++ b/encodings/fastlanes/src/bitpacking/compute/mod.rs @@ -1,6 +1,5 @@ use vortex::compute::unary::scalar_at::{scalar_at, ScalarAtFn}; -use vortex::compute::ArrayCompute; -use vortex::compute::{SearchSortedFn, SliceFn, TakeFn}; +use vortex::compute::{ArrayCompute, SearchSortedFn, SliceFn, TakeFn}; use vortex::ArrayDType; use vortex_error::{vortex_err, VortexResult}; use vortex_scalar::Scalar; diff --git a/encodings/fastlanes/src/delta/compress.rs b/encodings/fastlanes/src/delta/compress.rs index 0073c1271..a3c84009d 100644 --- a/encodings/fastlanes/src/delta/compress.rs +++ b/encodings/fastlanes/src/delta/compress.rs @@ -5,8 +5,7 @@ use vortex::array::primitive::PrimitiveArray; use vortex::compute::unary::fill_forward::fill_forward; use vortex::validity::Validity; use vortex::IntoArrayVariant; -use vortex_dtype::NativePType; -use vortex_dtype::{match_each_unsigned_integer_ptype, Nullability}; +use vortex_dtype::{match_each_unsigned_integer_ptype, NativePType, Nullability}; use vortex_error::VortexResult; use crate::DeltaArray; diff --git a/encodings/fastlanes/src/delta/mod.rs b/encodings/fastlanes/src/delta/mod.rs index 79e2949ea..c5d5db67f 100644 --- a/encodings/fastlanes/src/delta/mod.rs +++ b/encodings/fastlanes/src/delta/mod.rs @@ -1,8 +1,7 @@ pub use compress::*; use serde::{Deserialize, Serialize}; use vortex::stats::ArrayStatisticsCompute; -use vortex::validity::ValidityMetadata; -use vortex::validity::{ArrayValidity, LogicalValidity, Validity}; +use vortex::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use vortex::variants::{ArrayVariants, PrimitiveArrayTrait}; use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, ArrayDType, Canonical, IntoCanonical}; diff --git a/encodings/roaring/src/boolean/mod.rs b/encodings/roaring/src/boolean/mod.rs index 6641febb2..c7ab4f7f3 100644 --- a/encodings/roaring/src/boolean/mod.rs +++ b/encodings/roaring/src/boolean/mod.rs @@ -1,5 +1,4 @@ -use arrow_buffer::BooleanBuffer; -use arrow_buffer::Buffer as ArrowBuffer; +use arrow_buffer::{BooleanBuffer, Buffer as ArrowBuffer}; pub use compress::*; use croaring::{Bitmap, Portable}; use serde::{Deserialize, Serialize}; @@ -10,8 +9,7 @@ use vortex::variants::{ArrayVariants, BoolArrayTrait}; use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, ArrayDType, Canonical, IntoCanonical}; use vortex_buffer::Buffer; -use vortex_dtype::Nullability::NonNullable; -use vortex_dtype::Nullability::Nullable; +use vortex_dtype::Nullability::{NonNullable, Nullable}; use vortex_error::{vortex_bail, vortex_err}; mod compress; diff --git a/encodings/runend/src/compress.rs b/encodings/runend/src/compress.rs index 1acfc3400..4e35ceae8 100644 --- a/encodings/runend/src/compress.rs +++ b/encodings/runend/src/compress.rs @@ -6,8 +6,7 @@ use vortex::array::primitive::PrimitiveArray; use vortex::stats::{ArrayStatistics, Stat}; use vortex::validity::Validity; use vortex::ArrayDType; -use vortex_dtype::Nullability; -use vortex_dtype::{match_each_integer_ptype, match_each_native_ptype, NativePType}; +use vortex_dtype::{match_each_integer_ptype, match_each_native_ptype, NativePType, Nullability}; use vortex_error::VortexResult; pub fn runend_encode(array: &PrimitiveArray) -> (PrimitiveArray, PrimitiveArray) { diff --git a/encodings/runend/src/compute.rs b/encodings/runend/src/compute.rs index ab75f6eae..5a951480b 100644 --- a/encodings/runend/src/compute.rs +++ b/encodings/runend/src/compute.rs @@ -1,7 +1,6 @@ use vortex::array::primitive::PrimitiveArray; use vortex::compute::unary::scalar_at::{scalar_at, ScalarAtFn}; -use vortex::compute::ArrayCompute; -use vortex::compute::{slice, take, SliceFn, TakeFn}; +use vortex::compute::{slice, take, ArrayCompute, SliceFn, TakeFn}; use vortex::{Array, IntoArray, IntoArrayVariant}; use vortex_dtype::match_each_integer_ptype; use vortex_error::VortexResult; diff --git a/pyvortex/src/array.rs b/pyvortex/src/array.rs index 6ad943fde..86576a499 100644 --- a/pyvortex/src/array.rs +++ b/pyvortex/src/array.rs @@ -10,9 +10,7 @@ use vortex::array::varbin::{VarBin, VarBinArray, VarBinEncoding}; use vortex::array::varbinview::{VarBinView, VarBinViewArray, VarBinViewEncoding}; use vortex::compute::take; use vortex::encoding::EncodingRef; -use vortex::ToArray; -use vortex::{Array, ArrayDType, ArrayData, IntoArray}; -use vortex::{ArrayDef, IntoArrayData}; +use vortex::{Array, ArrayDType, ArrayData, ArrayDef, IntoArray, IntoArrayData, ToArray}; use vortex_alp::{ALPArray, ALPEncoding, ALP}; use vortex_dict::{Dict, DictArray, DictEncoding}; use vortex_fastlanes::{ diff --git a/rustfmt.toml b/rustfmt.toml index 607c9ae0c..9fccaf427 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -3,4 +3,5 @@ format_macro_matchers = true format_macro_bodies = true group_imports = "StdExternalCrate" unstable_features = true -use_field_init_shorthand = true \ No newline at end of file +use_field_init_shorthand = true +imports_granularity = "Module" diff --git a/vortex-array/benches/filter_indices.rs b/vortex-array/benches/filter_indices.rs index a20ec6db5..97d6eafd7 100644 --- a/vortex-array/benches/filter_indices.rs +++ b/vortex-array/benches/filter_indices.rs @@ -5,8 +5,7 @@ use rand::{thread_rng, Rng}; use vortex::IntoArray; use vortex_dtype::field::FieldPath; use vortex_error::VortexError; -use vortex_expr::FieldPathOperations; -use vortex_expr::{lit, Conjunction, Disjunction}; +use vortex_expr::{lit, Conjunction, Disjunction, FieldPathOperations}; fn filter_indices(c: &mut Criterion) { let mut group = c.benchmark_group("filter_indices"); diff --git a/vortex-array/src/array/bool/compute/slice.rs b/vortex-array/src/array/bool/compute/slice.rs index ccb5c39be..a6a373ed8 100644 --- a/vortex-array/src/array/bool/compute/slice.rs +++ b/vortex-array/src/array/bool/compute/slice.rs @@ -19,8 +19,9 @@ mod tests { use super::*; use crate::compute::slice; + use crate::compute::unary::scalar_at::scalar_at; use crate::validity::ArrayValidity; - use crate::{compute::unary::scalar_at::scalar_at, AsArray}; + use crate::AsArray; #[test] fn test_slice() { diff --git a/vortex-array/src/array/bool/compute/take.rs b/vortex-array/src/array/bool/compute/take.rs index ac5da4c6d..3a0715d37 100644 --- a/vortex-array/src/array/bool/compute/take.rs +++ b/vortex-array/src/array/bool/compute/take.rs @@ -5,9 +5,7 @@ use vortex_error::VortexResult; use crate::array::bool::BoolArray; use crate::compute::TakeFn; -use crate::Array; -use crate::IntoArray; -use crate::{AsArray, IntoArrayVariant}; +use crate::{Array, AsArray, IntoArray, IntoArrayVariant}; impl TakeFn for BoolArray { fn take(&self, indices: &Array) -> VortexResult { diff --git a/vortex-array/src/array/bool/mod.rs b/vortex-array/src/array/bool/mod.rs index 2997d2f24..4391d5079 100644 --- a/vortex-array/src/array/bool/mod.rs +++ b/vortex-array/src/array/bool/mod.rs @@ -3,8 +3,7 @@ use itertools::Itertools; use serde::{Deserialize, Serialize}; use vortex_buffer::Buffer; -use crate::validity::{ArrayValidity, ValidityMetadata}; -use crate::validity::{LogicalValidity, Validity}; +use crate::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use crate::variants::{ArrayVariants, BoolArrayTrait}; use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, Canonical, IntoCanonical}; diff --git a/vortex-array/src/array/chunked/compute/take.rs b/vortex-array/src/array/chunked/compute/take.rs index 0b701bf04..2ebdc732c 100644 --- a/vortex-array/src/array/chunked/compute/take.rs +++ b/vortex-array/src/array/chunked/compute/take.rs @@ -10,8 +10,7 @@ use crate::compute::unary::scalar_at::scalar_at; use crate::compute::unary::scalar_subtract::subtract_scalar; use crate::compute::{search_sorted, slice, take, SearchSortedSide, TakeFn}; use crate::stats::ArrayStatistics; -use crate::ArrayDType; -use crate::{Array, IntoArray, ToArray}; +use crate::{Array, ArrayDType, IntoArray, ToArray}; impl TakeFn for ChunkedArray { fn take(&self, indices: &Array) -> VortexResult { diff --git a/vortex-array/src/array/chunked/mod.rs b/vortex-array/src/array/chunked/mod.rs index b56aabe10..e714f7ea9 100644 --- a/vortex-array/src/array/chunked/mod.rs +++ b/vortex-array/src/array/chunked/mod.rs @@ -162,8 +162,7 @@ impl SubtractScalarFn for ChunkedArray { #[cfg(test)] mod test { - use vortex_dtype::{DType, Nullability}; - use vortex_dtype::{NativePType, PType}; + use vortex_dtype::{DType, NativePType, Nullability, PType}; use crate::array::chunked::ChunkedArray; use crate::compute::slice; diff --git a/vortex-array/src/array/chunked/stats.rs b/vortex-array/src/array/chunked/stats.rs index ee4aa8306..a93df8e6d 100644 --- a/vortex-array/src/array/chunked/stats.rs +++ b/vortex-array/src/array/chunked/stats.rs @@ -1,8 +1,7 @@ use vortex_error::VortexResult; use crate::array::chunked::ChunkedArray; -use crate::stats::ArrayStatistics; -use crate::stats::{ArrayStatisticsCompute, Stat, StatsSet}; +use crate::stats::{ArrayStatistics, ArrayStatisticsCompute, Stat, StatsSet}; impl ArrayStatisticsCompute for ChunkedArray { fn compute_statistics(&self, stat: Stat) -> VortexResult { diff --git a/vortex-array/src/array/constant/canonical.rs b/vortex-array/src/array/constant/canonical.rs index 867341871..0e55173ad 100644 --- a/vortex-array/src/array/constant/canonical.rs +++ b/vortex-array/src/array/constant/canonical.rs @@ -9,8 +9,7 @@ use crate::array::constant::ConstantArray; use crate::array::primitive::PrimitiveArray; use crate::array::varbin::VarBinArray; use crate::validity::Validity; -use crate::ArrayDType; -use crate::{Canonical, IntoCanonical}; +use crate::{ArrayDType, Canonical, IntoCanonical}; impl IntoCanonical for ConstantArray { fn into_canonical(self) -> VortexResult { diff --git a/vortex-array/src/array/constant/compute.rs b/vortex-array/src/array/constant/compute.rs index a34abd5a6..d4c20f2fa 100644 --- a/vortex-array/src/array/constant/compute.rs +++ b/vortex-array/src/array/constant/compute.rs @@ -5,8 +5,9 @@ use vortex_scalar::Scalar; use crate::array::constant::ConstantArray; use crate::compute::unary::scalar_at::ScalarAtFn; -use crate::compute::{ArrayCompute, SliceFn, TakeFn}; -use crate::compute::{SearchResult, SearchSortedFn, SearchSortedSide}; +use crate::compute::{ + ArrayCompute, SearchResult, SearchSortedFn, SearchSortedSide, SliceFn, TakeFn, +}; use crate::{Array, IntoArray}; impl ArrayCompute for ConstantArray { diff --git a/vortex-array/src/array/extension/compute.rs b/vortex-array/src/array/extension/compute.rs index 4fa991aeb..7a28fe8a9 100644 --- a/vortex-array/src/array/extension/compute.rs +++ b/vortex-array/src/array/extension/compute.rs @@ -4,8 +4,7 @@ use vortex_scalar::Scalar; use crate::array::extension::ExtensionArray; use crate::compute::unary::cast::CastFn; use crate::compute::unary::scalar_at::{scalar_at, ScalarAtFn}; -use crate::compute::ArrayCompute; -use crate::compute::{slice, take, SliceFn, TakeFn}; +use crate::compute::{slice, take, ArrayCompute, SliceFn, TakeFn}; use crate::{Array, IntoArray}; impl ArrayCompute for ExtensionArray { diff --git a/vortex-array/src/array/null/compute.rs b/vortex-array/src/array/null/compute.rs index 0c3f6afa9..6c256ec46 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::compute::unary::scalar_at::ScalarAtFn; -use crate::compute::ArrayCompute; -use crate::compute::{SliceFn, TakeFn}; +use crate::compute::{ArrayCompute, SliceFn, TakeFn}; use crate::{Array, IntoArray, IntoArrayVariant}; impl ArrayCompute for NullArray { @@ -57,9 +56,8 @@ mod test { use vortex_dtype::DType; use crate::array::null::NullArray; - use crate::compute::slice; - use crate::compute::take; use crate::compute::unary::scalar_at::scalar_at; + use crate::compute::{slice, take}; use crate::validity::{ArrayValidity, LogicalValidity}; use crate::IntoArray; diff --git a/vortex-array/src/array/primitive/compute/cast.rs b/vortex-array/src/array/primitive/compute/cast.rs index 906f295b6..620004f07 100644 --- a/vortex-array/src/array/primitive/compute/cast.rs +++ b/vortex-array/src/array/primitive/compute/cast.rs @@ -1,12 +1,10 @@ -use vortex_dtype::{match_each_native_ptype, DType}; -use vortex_dtype::{NativePType, PType}; +use vortex_dtype::{match_each_native_ptype, DType, NativePType, PType}; use vortex_error::{vortex_err, VortexResult}; use crate::array::primitive::PrimitiveArray; use crate::compute::unary::cast::CastFn; use crate::validity::Validity; -use crate::IntoArray; -use crate::{Array, ArrayDType}; +use crate::{Array, ArrayDType, IntoArray}; impl CastFn for PrimitiveArray { fn cast(&self, dtype: &DType) -> VortexResult { diff --git a/vortex-array/src/array/primitive/compute/mod.rs b/vortex-array/src/array/primitive/compute/mod.rs index aea4d0def..9661361c1 100644 --- a/vortex-array/src/array/primitive/compute/mod.rs +++ b/vortex-array/src/array/primitive/compute/mod.rs @@ -3,9 +3,7 @@ use crate::compute::unary::cast::CastFn; use crate::compute::unary::fill_forward::FillForwardFn; use crate::compute::unary::scalar_at::ScalarAtFn; use crate::compute::unary::scalar_subtract::SubtractScalarFn; -use crate::compute::FilterIndicesFn; -use crate::compute::SearchSortedFn; -use crate::compute::{ArrayCompute, CompareFn, SliceFn, TakeFn}; +use crate::compute::{ArrayCompute, CompareFn, FilterIndicesFn, SearchSortedFn, SliceFn, TakeFn}; mod cast; mod compare; diff --git a/vortex-array/src/array/primitive/compute/slice.rs b/vortex-array/src/array/primitive/compute/slice.rs index 88e5475ab..7ba1f7696 100644 --- a/vortex-array/src/array/primitive/compute/slice.rs +++ b/vortex-array/src/array/primitive/compute/slice.rs @@ -2,8 +2,7 @@ use vortex_error::VortexResult; use crate::array::primitive::PrimitiveArray; use crate::compute::SliceFn; -use crate::Array; -use crate::IntoArray; +use crate::{Array, IntoArray}; impl SliceFn for PrimitiveArray { fn slice(&self, start: usize, stop: usize) -> VortexResult { diff --git a/vortex-array/src/array/primitive/compute/subtract_scalar.rs b/vortex-array/src/array/primitive/compute/subtract_scalar.rs index 2509122df..a512219b6 100644 --- a/vortex-array/src/array/primitive/compute/subtract_scalar.rs +++ b/vortex-array/src/array/primitive/compute/subtract_scalar.rs @@ -2,8 +2,7 @@ use itertools::Itertools; use num_traits::WrappingSub; use vortex_dtype::{match_each_float_ptype, match_each_integer_ptype, NativePType}; use vortex_error::{vortex_bail, vortex_err, VortexError, VortexResult}; -use vortex_scalar::PrimitiveScalar; -use vortex_scalar::Scalar; +use vortex_scalar::{PrimitiveScalar, Scalar}; use crate::array::constant::ConstantArray; use crate::array::primitive::PrimitiveArray; diff --git a/vortex-array/src/array/primitive/compute/take.rs b/vortex-array/src/array/primitive/compute/take.rs index dd2a18305..ded5a28d1 100644 --- a/vortex-array/src/array/primitive/compute/take.rs +++ b/vortex-array/src/array/primitive/compute/take.rs @@ -1,12 +1,10 @@ use num_traits::PrimInt; -use vortex_dtype::NativePType; -use vortex_dtype::{match_each_integer_ptype, match_each_native_ptype}; +use vortex_dtype::{match_each_integer_ptype, match_each_native_ptype, NativePType}; use vortex_error::VortexResult; use crate::array::primitive::PrimitiveArray; use crate::compute::TakeFn; -use crate::Array; -use crate::{IntoArray, IntoArrayVariant}; +use crate::{Array, IntoArray, IntoArrayVariant}; impl TakeFn for PrimitiveArray { fn take(&self, indices: &Array) -> VortexResult { diff --git a/vortex-array/src/array/primitive/mod.rs b/vortex-array/src/array/primitive/mod.rs index 92500614f..8f4640ed4 100644 --- a/vortex-array/src/array/primitive/mod.rs +++ b/vortex-array/src/array/primitive/mod.rs @@ -9,8 +9,7 @@ use vortex_error::vortex_bail; use crate::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use crate::variants::{ArrayVariants, PrimitiveArrayTrait}; use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; -use crate::{impl_encoding, ArrayDType}; -use crate::{Canonical, IntoCanonical}; +use crate::{impl_encoding, ArrayDType, Canonical, IntoCanonical}; mod accessor; mod compute; diff --git a/vortex-array/src/array/primitive/stats.rs b/vortex-array/src/array/primitive/stats.rs index d86f6cfd9..1533f7502 100644 --- a/vortex-array/src/array/primitive/stats.rs +++ b/vortex-array/src/array/primitive/stats.rs @@ -10,8 +10,7 @@ use vortex_scalar::Scalar; use crate::array::primitive::PrimitiveArray; use crate::stats::{ArrayStatisticsCompute, Stat, StatsSet}; -use crate::validity::ArrayValidity; -use crate::validity::LogicalValidity; +use crate::validity::{ArrayValidity, LogicalValidity}; use crate::{ArrayDType, IntoArrayVariant}; trait PStatsType: NativePType + Into + BitWidth {} diff --git a/vortex-array/src/array/sparse/compute/mod.rs b/vortex-array/src/array/sparse/compute/mod.rs index 7b3a08c73..f30232c9e 100644 --- a/vortex-array/src/array/sparse/compute/mod.rs +++ b/vortex-array/src/array/sparse/compute/mod.rs @@ -3,8 +3,9 @@ use vortex_scalar::Scalar; use crate::array::sparse::SparseArray; use crate::compute::unary::scalar_at::{scalar_at, ScalarAtFn}; -use crate::compute::{search_sorted, SearchResult, SearchSortedFn, SearchSortedSide}; -use crate::compute::{ArrayCompute, SliceFn, TakeFn}; +use crate::compute::{ + search_sorted, ArrayCompute, SearchResult, SearchSortedFn, SearchSortedSide, SliceFn, TakeFn, +}; use crate::ArrayDType; mod slice; @@ -64,8 +65,7 @@ mod test { use crate::array::primitive::PrimitiveArray; use crate::array::sparse::SparseArray; - use crate::compute::slice; - use crate::compute::{search_sorted, SearchResult, SearchSortedSide}; + use crate::compute::{search_sorted, slice, SearchResult, SearchSortedSide}; use crate::validity::Validity; use crate::{Array, IntoArray}; diff --git a/vortex-array/src/array/sparse/compute/slice.rs b/vortex-array/src/array/sparse/compute/slice.rs index 7e33bdc76..c423b4a03 100644 --- a/vortex-array/src/array/sparse/compute/slice.rs +++ b/vortex-array/src/array/sparse/compute/slice.rs @@ -1,8 +1,7 @@ use vortex_error::VortexResult; use crate::array::sparse::SparseArray; -use crate::compute::{search_sorted, SearchSortedSide}; -use crate::compute::{slice, SliceFn}; +use crate::compute::{search_sorted, slice, SearchSortedSide, SliceFn}; use crate::{Array, IntoArray}; impl SliceFn for SparseArray { diff --git a/vortex-array/src/array/struct_/mod.rs b/vortex-array/src/array/struct_/mod.rs index dceec7e18..e3466aaa3 100644 --- a/vortex-array/src/array/struct_/mod.rs +++ b/vortex-array/src/array/struct_/mod.rs @@ -6,8 +6,7 @@ use crate::stats::ArrayStatisticsCompute; use crate::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use crate::variants::{ArrayVariants, StructArrayTrait}; use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; -use crate::{impl_encoding, ArrayDType}; -use crate::{Canonical, IntoCanonical}; +use crate::{impl_encoding, ArrayDType, Canonical, IntoCanonical}; mod compute; diff --git a/vortex-array/src/array/varbin/builder.rs b/vortex-array/src/array/varbin/builder.rs index b70292907..acda474b5 100644 --- a/vortex-array/src/array/varbin/builder.rs +++ b/vortex-array/src/array/varbin/builder.rs @@ -1,8 +1,7 @@ use std::mem; use arrow_buffer::NullBufferBuilder; -use vortex_dtype::DType; -use vortex_dtype::NativePType; +use vortex_dtype::{DType, NativePType}; use crate::array::primitive::PrimitiveArray; use crate::array::varbin::VarBinArray; diff --git a/vortex-array/src/array/varbin/compute/take.rs b/vortex-array/src/array/varbin/compute/take.rs index d57ea9241..f1f0c916c 100644 --- a/vortex-array/src/array/varbin/compute/take.rs +++ b/vortex-array/src/array/varbin/compute/take.rs @@ -1,16 +1,12 @@ use arrow_buffer::NullBuffer; -use vortex_dtype::match_each_integer_ptype; -use vortex_dtype::DType; -use vortex_dtype::NativePType; +use vortex_dtype::{match_each_integer_ptype, DType, NativePType}; use vortex_error::VortexResult; use crate::array::varbin::builder::VarBinBuilder; use crate::array::varbin::VarBinArray; use crate::compute::TakeFn; use crate::validity::Validity; -use crate::Array; -use crate::IntoArray; -use crate::{ArrayDType, IntoArrayVariant}; +use crate::{Array, ArrayDType, IntoArray, IntoArrayVariant}; impl TakeFn for VarBinArray { fn take(&self, indices: &Array) -> VortexResult { diff --git a/vortex-array/src/array/varbin/mod.rs b/vortex-array/src/array/varbin/mod.rs index 16d927939..c5cc8a0b5 100644 --- a/vortex-array/src/array/varbin/mod.rs +++ b/vortex-array/src/array/varbin/mod.rs @@ -2,8 +2,7 @@ use num_traits::AsPrimitive; use serde::{Deserialize, Serialize}; pub use stats::compute_stats; use vortex_buffer::Buffer; -use vortex_dtype::Nullability; -use vortex_dtype::{match_each_native_ptype, NativePType}; +use vortex_dtype::{match_each_native_ptype, NativePType, Nullability}; use vortex_error::vortex_bail; use vortex_scalar::Scalar; diff --git a/vortex-array/src/array/varbinview/mod.rs b/vortex-array/src/array/varbinview/mod.rs index c73bcb596..c2039da09 100644 --- a/vortex-array/src/array/varbinview/mod.rs +++ b/vortex-array/src/array/varbinview/mod.rs @@ -15,8 +15,7 @@ use crate::array::varbin::VarBinArray; use crate::array::varbinview::builder::VarBinViewBuilder; use crate::arrow::FromArrowArray; use crate::compute::slice; -use crate::validity::Validity; -use crate::validity::{ArrayValidity, LogicalValidity, ValidityMetadata}; +use crate::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, ArrayDType, ArrayData, Canonical, IntoArrayVariant, IntoCanonical}; diff --git a/vortex-array/src/arrow/array.rs b/vortex-array/src/arrow/array.rs index ce9eed263..6307ba663 100644 --- a/vortex-array/src/arrow/array.rs +++ b/vortex-array/src/arrow/array.rs @@ -1,27 +1,23 @@ use arrow_array::array::{ - Array as ArrowArray, ArrayRef as ArrowArrayRef, BooleanArray as ArrowBooleanArray, - GenericByteArray, NullArray as ArrowNullArray, PrimitiveArray as ArrowPrimitiveArray, - StructArray as ArrowStructArray, + Array as ArrowArray, ArrayRef as ArrowArrayRef, ArrowPrimitiveType, + BooleanArray as ArrowBooleanArray, GenericByteArray, NullArray as ArrowNullArray, + OffsetSizeTrait, PrimitiveArray as ArrowPrimitiveArray, StructArray as ArrowStructArray, }; -use arrow_array::array::{ArrowPrimitiveType, OffsetSizeTrait}; use arrow_array::cast::{as_null_array, AsArray}; use arrow_array::types::{ ByteArrayType, ByteViewType, Date32Type, Date64Type, DurationMicrosecondType, - DurationMillisecondType, DurationNanosecondType, DurationSecondType, Time32MillisecondType, + DurationMillisecondType, DurationNanosecondType, DurationSecondType, Float16Type, Float32Type, + Float64Type, Int16Type, Int32Type, Int64Type, Int8Type, Time32MillisecondType, Time32SecondType, Time64MicrosecondType, Time64NanosecondType, TimestampMicrosecondType, - TimestampMillisecondType, TimestampNanosecondType, TimestampSecondType, -}; -use arrow_array::types::{ - Float16Type, Float32Type, Float64Type, Int16Type, Int32Type, Int64Type, Int8Type, UInt16Type, - UInt32Type, UInt64Type, UInt8Type, + TimestampMillisecondType, TimestampNanosecondType, TimestampSecondType, UInt16Type, UInt32Type, + UInt64Type, UInt8Type, }; use arrow_array::{BinaryViewArray, GenericByteViewArray, StringViewArray}; use arrow_buffer::buffer::{NullBuffer, OffsetBuffer}; use arrow_buffer::{ArrowNativeType, Buffer, ScalarBuffer}; use arrow_schema::{DataType, TimeUnit as ArrowTimeUnit}; use itertools::Itertools; -use vortex_dtype::NativePType; -use vortex_dtype::{DType, PType}; +use vortex_dtype::{DType, NativePType, PType}; use crate::array::bool::BoolArray; use crate::array::datetime::temporal::TemporalArray; diff --git a/vortex-array/src/arrow/dtype.rs b/vortex-array/src/arrow/dtype.rs index 3b379f0d2..439290163 100644 --- a/vortex-array/src/arrow/dtype.rs +++ b/vortex-array/src/arrow/dtype.rs @@ -1,10 +1,8 @@ use std::sync::Arc; -use arrow_schema::TimeUnit as ArrowTimeUnit; -use arrow_schema::{DataType, Field, SchemaRef}; +use arrow_schema::{DataType, Field, SchemaRef, TimeUnit as ArrowTimeUnit}; use itertools::Itertools; -use vortex_dtype::{DType, Nullability}; -use vortex_dtype::{PType, StructDType}; +use vortex_dtype::{DType, Nullability, PType, StructDType}; use vortex_error::{vortex_err, VortexResult}; use crate::array::datetime::{make_temporal_ext_dtype, TimeUnit}; diff --git a/vortex-array/src/compute/compare.rs b/vortex-array/src/compute/compare.rs index b566bb888..093a665a8 100644 --- a/vortex-array/src/compute/compare.rs +++ b/vortex-array/src/compute/compare.rs @@ -2,7 +2,8 @@ use arrow_ord::cmp; use vortex_error::VortexResult; use vortex_expr::Operator; -use crate::{arrow::FromArrowArray, Array, ArrayData, IntoArray, IntoCanonical}; +use crate::arrow::FromArrowArray; +use crate::{Array, ArrayData, IntoArray, IntoCanonical}; pub trait CompareFn { fn compare(&self, array: &Array, operator: Operator) -> VortexResult; diff --git a/vortex-array/src/encoding.rs b/vortex-array/src/encoding.rs index ea2662b83..e537a5865 100644 --- a/vortex-array/src/encoding.rs +++ b/vortex-array/src/encoding.rs @@ -4,8 +4,7 @@ use std::hash::{Hash, Hasher}; use vortex_error::VortexResult; use crate::canonical::{Canonical, IntoCanonical}; -use crate::ArrayDef; -use crate::{Array, ArrayTrait}; +use crate::{Array, ArrayDef, ArrayTrait}; // TODO(robert): Outline how you create a well known encoding id /// EncodingId is a unique name and numerical code of the array diff --git a/vortex-array/src/implementation.rs b/vortex-array/src/implementation.rs index 7ccc9fa9b..0dcdafc1e 100644 --- a/vortex-array/src/implementation.rs +++ b/vortex-array/src/implementation.rs @@ -2,15 +2,13 @@ use vortex_buffer::Buffer; use vortex_dtype::DType; use vortex_error::{vortex_bail, VortexError, VortexResult}; -use crate::encoding::{ArrayEncoding, ArrayEncodingRef, EncodingRef}; -use crate::encoding::{ArrayEncodingExt, EncodingId}; +use crate::encoding::{ArrayEncoding, ArrayEncodingExt, ArrayEncodingRef, EncodingId, EncodingRef}; use crate::stats::{ArrayStatistics, Statistics}; use crate::visitor::ArrayVisitor; use crate::{ - Array, ArrayDType, ArrayData, ArrayMetadata, AsArray, GetArrayMetadata, IntoArray, - IntoArrayData, ToArrayData, + Array, ArrayDType, ArrayData, ArrayMetadata, ArrayTrait, AsArray, GetArrayMetadata, IntoArray, + IntoArrayData, ToArrayData, TryDeserializeArrayMetadata, }; -use crate::{ArrayTrait, TryDeserializeArrayMetadata}; /// Trait the defines the set of types relating to an array. /// Because it has associated types it can't be used as a trait object. diff --git a/vortex-array/src/stream/ext.rs b/vortex-array/src/stream/ext.rs index 9b7c6ed48..2938e06b1 100644 --- a/vortex-array/src/stream/ext.rs +++ b/vortex-array/src/stream/ext.rs @@ -5,8 +5,7 @@ use vortex_error::VortexResult; use crate::array::chunked::ChunkedArray; use crate::stream::take_rows::TakeRows; -use crate::stream::ArrayStream; -use crate::stream::ArrayStreamAdapter; +use crate::stream::{ArrayStream, ArrayStreamAdapter}; use crate::Array; pub trait ArrayStreamExt: ArrayStream { diff --git a/vortex-array/src/stream/take_rows.rs b/vortex-array/src/stream/take_rows.rs index 785eeaf4b..5c2bba928 100644 --- a/vortex-array/src/stream/take_rows.rs +++ b/vortex-array/src/stream/take_rows.rs @@ -7,14 +7,11 @@ use vortex_dtype::match_each_integer_ptype; use vortex_error::{vortex_bail, VortexResult}; use vortex_scalar::Scalar; -use crate::compute::slice; -use crate::compute::take; use crate::compute::unary::scalar_subtract::subtract_scalar; -use crate::compute::{search_sorted, SearchSortedSide}; +use crate::compute::{search_sorted, slice, take, SearchSortedSide}; use crate::stats::{ArrayStatistics, Stat}; use crate::stream::ArrayStream; -use crate::IntoArray; -use crate::{Array, ArrayDType, IntoArrayVariant}; +use crate::{Array, ArrayDType, IntoArray, IntoArrayVariant}; #[pin_project] pub struct TakeRows { diff --git a/vortex-array/src/validity.rs b/vortex-array/src/validity.rs index e6d151bda..7f7288412 100644 --- a/vortex-array/src/validity.rs +++ b/vortex-array/src/validity.rs @@ -4,9 +4,8 @@ use vortex_dtype::{DType, Nullability}; use vortex_error::{vortex_bail, VortexResult}; use crate::array::bool::BoolArray; -use crate::compute::slice; -use crate::compute::take; use crate::compute::unary::scalar_at::scalar_at; +use crate::compute::{slice, take}; use crate::stats::ArrayStatistics; use crate::{Array, IntoArray, IntoArrayVariant}; diff --git a/vortex-array/src/view.rs b/vortex-array/src/view.rs index 30075ea54..058c19059 100644 --- a/vortex-array/src/view.rs +++ b/vortex-array/src/view.rs @@ -10,11 +10,9 @@ use vortex_error::{vortex_bail, vortex_err, VortexError, VortexResult}; use vortex_scalar::{PValue, Scalar, ScalarValue}; use crate::encoding::EncodingRef; -use crate::flatbuffers as fb; use crate::stats::{Stat, Statistics, StatsSet}; use crate::visitor::ArrayVisitor; -use crate::Context; -use crate::{Array, IntoArray, ToArray}; +use crate::{flatbuffers as fb, Array, Context, IntoArray, ToArray}; #[derive(Clone)] pub struct ArrayView { diff --git a/vortex-datafusion/src/eval.rs b/vortex-datafusion/src/eval.rs index 98878c9f9..b90eea3d9 100644 --- a/vortex-datafusion/src/eval.rs +++ b/vortex-datafusion/src/eval.rs @@ -1,9 +1,8 @@ use datafusion_expr::{Expr, Operator as DFOperator}; -use vortex::{ - array::{bool::BoolArray, constant::ConstantArray}, - compute::compare, - Array, IntoArray, IntoArrayVariant, -}; +use vortex::array::bool::BoolArray; +use vortex::array::constant::ConstantArray; +use vortex::compute::compare; +use vortex::{Array, IntoArray, IntoArrayVariant}; use vortex_error::{vortex_bail, vortex_err, VortexResult}; use vortex_expr::Operator; diff --git a/vortex-dtype/src/serde/flatbuffers.rs b/vortex-dtype/src/serde/flatbuffers.rs index ffb11f040..01309199d 100644 --- a/vortex-dtype/src/serde/flatbuffers.rs +++ b/vortex-dtype/src/serde/flatbuffers.rs @@ -7,8 +7,7 @@ use itertools::Itertools; use vortex_error::{vortex_bail, vortex_err, VortexError, VortexResult}; use vortex_flatbuffers::{FlatBufferRoot, WriteFlatBuffer}; -use crate::{flatbuffers as fb, ExtDType, ExtID, ExtMetadata, PType}; -use crate::{DType, StructDType}; +use crate::{flatbuffers as fb, DType, ExtDType, ExtID, ExtMetadata, PType, StructDType}; impl TryFrom> for DType { type Error = VortexError; @@ -228,8 +227,7 @@ mod test { use vortex_flatbuffers::FlatBufferToBytes; use crate::nullability::Nullability; - use crate::DType; - use crate::{flatbuffers as fb, PType, StructDType}; + use crate::{flatbuffers as fb, DType, PType, StructDType}; fn roundtrip_dtype(dtype: DType) { let bytes = dtype.with_flatbuffer_bytes(|bytes| bytes.to_vec()); diff --git a/vortex-dtype/src/serde/proto.rs b/vortex-dtype/src/serde/proto.rs index b1f192544..3714027d1 100644 --- a/vortex-dtype/src/serde/proto.rs +++ b/vortex-dtype/src/serde/proto.rs @@ -5,9 +5,10 @@ use std::sync::Arc; use vortex_error::{vortex_err, VortexError, VortexResult}; use crate::field::{Field, FieldPath}; +use crate::proto::dtype as pb; use crate::proto::dtype::d_type::DtypeType; use crate::proto::dtype::field::FieldType; -use crate::{proto::dtype as pb, DType, ExtDType, ExtID, ExtMetadata, PType, StructDType}; +use crate::{DType, ExtDType, ExtID, ExtMetadata, PType, StructDType}; impl TryFrom<&pb::DType> for DType { type Error = VortexError; diff --git a/vortex-scalar/src/pvalue.rs b/vortex-scalar/src/pvalue.rs index c077294f3..2362db857 100644 --- a/vortex-scalar/src/pvalue.rs +++ b/vortex-scalar/src/pvalue.rs @@ -3,8 +3,7 @@ use std::mem; use num_traits::NumCast; use vortex_dtype::half::f16; use vortex_dtype::PType; -use vortex_error::vortex_err; -use vortex_error::VortexError; +use vortex_error::{vortex_err, VortexError}; #[derive(Debug, Clone, Copy, PartialEq, PartialOrd)] pub enum PValue { diff --git a/vortex-scalar/src/serde/flatbuffers.rs b/vortex-scalar/src/serde/flatbuffers.rs index 4dad79a79..51967e34c 100644 --- a/vortex-scalar/src/serde/flatbuffers.rs +++ b/vortex-scalar/src/serde/flatbuffers.rs @@ -7,8 +7,7 @@ use vortex_dtype::DType; use vortex_error::VortexError; use vortex_flatbuffers::WriteFlatBuffer; -use crate::flatbuffers as fb; -use crate::{Scalar, ScalarValue}; +use crate::{flatbuffers as fb, Scalar, ScalarValue}; impl TryFrom> for Scalar { type Error = VortexError; diff --git a/vortex-scalar/src/serde/proto.rs b/vortex-scalar/src/serde/proto.rs index 4de7110d8..e82fadcbd 100644 --- a/vortex-scalar/src/serde/proto.rs +++ b/vortex-scalar/src/serde/proto.rs @@ -4,10 +4,11 @@ use vortex_buffer::{Buffer, BufferString}; use vortex_dtype::DType; use vortex_error::{vortex_err, VortexError}; +use crate::proto::scalar as pb; use crate::proto::scalar::scalar_value::Kind; use crate::proto::scalar::ListValue; use crate::pvalue::PValue; -use crate::{proto::scalar as pb, Scalar, ScalarValue}; +use crate::{Scalar, ScalarValue}; impl From<&Scalar> for pb::Scalar { fn from(value: &Scalar) -> Self { @@ -148,8 +149,7 @@ mod test { use vortex_dtype::PType::I32; use vortex_dtype::{DType, Nullability}; - use crate::Scalar; - use crate::{proto as pb, ScalarValue}; + use crate::{proto as pb, Scalar, ScalarValue}; fn round_trip(scalar: Scalar) { Scalar::try_from(&pb::scalar::Scalar::from(&scalar)).unwrap(); diff --git a/vortex-scalar/src/utf8.rs b/vortex-scalar/src/utf8.rs index 720c2c2d1..1e02f909c 100644 --- a/vortex-scalar/src/utf8.rs +++ b/vortex-scalar/src/utf8.rs @@ -1,7 +1,6 @@ use vortex_buffer::BufferString; -use vortex_dtype::DType; -use vortex_dtype::Nullability; use vortex_dtype::Nullability::NonNullable; +use vortex_dtype::{DType, Nullability}; use vortex_error::{vortex_bail, vortex_err, VortexError, VortexResult}; use crate::value::ScalarValue;