From 9e175aadb4839e6f69fb8b763e98ae525613276b Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 21 Oct 2024 17:52:32 +0100 Subject: [PATCH 01/12] . --- vortex-array/src/arrow/dtype.rs | 2 +- vortex-array/src/arrow/mod.rs | 2 +- vortex-array/src/lib.rs | 2 +- vortex-array/src/stats/mod.rs | 2 ++ vortex-scalar/src/lib.rs | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/vortex-array/src/arrow/dtype.rs b/vortex-array/src/arrow/dtype.rs index 704f9a592..f84826037 100644 --- a/vortex-array/src/arrow/dtype.rs +++ b/vortex-array/src/arrow/dtype.rs @@ -131,7 +131,7 @@ pub fn infer_schema(dtype: &DType) -> VortexResult { Ok(builder.finish()) } -/// Try to convert a Vortex [`DType`] into an a Arrow [`DataType`] +/// Try to convert a Vortex [`DType`] into an Arrow [`DataType`] pub fn infer_data_type(dtype: &DType) -> VortexResult { Ok(match dtype { DType::Null => DataType::Null, diff --git a/vortex-array/src/arrow/mod.rs b/vortex-array/src/arrow/mod.rs index 12a607313..d4bd7ac1e 100644 --- a/vortex-array/src/arrow/mod.rs +++ b/vortex-array/src/arrow/mod.rs @@ -1,4 +1,4 @@ -//! Utilities to work with `Arrow` data and types +//! Utilities to work with `Arrow` data and types. use vortex_error::VortexResult; diff --git a/vortex-array/src/lib.rs b/vortex-array/src/lib.rs index 00e66c9c3..f24313dcc 100644 --- a/vortex-array/src/lib.rs +++ b/vortex-array/src/lib.rs @@ -61,7 +61,7 @@ pub mod flatbuffers { pub use vortex_flatbuffers::array::*; } -/// A central type for all Vortex arrays, which are known length sequences of compressed data. +/// A central type for all Vortex arrays, which are known length sequences of typed and possibly compressed data. /// /// This is the main entrypoint for working with in-memory Vortex data, and dispatches work over the underlying encoding or memory representations. #[derive(Debug, Clone)] diff --git a/vortex-array/src/stats/mod.rs b/vortex-array/src/stats/mod.rs index d0eb21af0..2a02d1032 100644 --- a/vortex-array/src/stats/mod.rs +++ b/vortex-array/src/stats/mod.rs @@ -1,3 +1,5 @@ +//! Traits and utilities to compute and access array statistics. + use std::fmt::{Display, Formatter}; use std::hash::Hash; diff --git a/vortex-scalar/src/lib.rs b/vortex-scalar/src/lib.rs index 77fc2856c..e2a46b1aa 100644 --- a/vortex-scalar/src/lib.rs +++ b/vortex-scalar/src/lib.rs @@ -32,6 +32,7 @@ pub use utf8::*; pub use value::*; use vortex_error::{vortex_bail, VortexResult}; +/// A single logical item, composed of both a [`ScalarValue`] and a logical [`DType`]. #[derive(Debug, Clone)] #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] pub struct Scalar { From fd6ede7fce5379ad968ff3d4415b69d76589c3c8 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 21 Oct 2024 18:01:02 +0100 Subject: [PATCH 02/12] Move some things around --- vortex-array/src/{encoding.rs => encoding/mod.rs} | 2 ++ vortex-array/src/{ => encoding}/opaque.rs | 0 vortex-array/src/lib.rs | 6 ++++-- vortex-array/src/view.rs | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) rename vortex-array/src/{encoding.rs => encoding/mod.rs} (99%) rename vortex-array/src/{ => encoding}/opaque.rs (100%) diff --git a/vortex-array/src/encoding.rs b/vortex-array/src/encoding/mod.rs similarity index 99% rename from vortex-array/src/encoding.rs rename to vortex-array/src/encoding/mod.rs index 804be0011..62e26e0a4 100644 --- a/vortex-array/src/encoding.rs +++ b/vortex-array/src/encoding/mod.rs @@ -8,6 +8,8 @@ use vortex_error::{vortex_panic, VortexResult}; use crate::canonical::{Canonical, IntoCanonical}; use crate::{Array, ArrayDef, ArrayTrait}; +pub mod opaque; + // 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/opaque.rs b/vortex-array/src/encoding/opaque.rs similarity index 100% rename from vortex-array/src/opaque.rs rename to vortex-array/src/encoding/opaque.rs diff --git a/vortex-array/src/lib.rs b/vortex-array/src/lib.rs index f24313dcc..54c1c37da 100644 --- a/vortex-array/src/lib.rs +++ b/vortex-array/src/lib.rs @@ -46,7 +46,6 @@ pub mod encoding; mod implementation; pub mod iter; mod metadata; -pub mod opaque; pub mod stats; pub mod stream; mod tree; @@ -256,6 +255,9 @@ pub trait ToArray { fn to_array(&self) -> Array; } +/// Consume `self` and turn it into an [`Array`] infallibly. +/// +/// Implementation of this array should never fail. pub trait IntoArray { fn into_array(self) -> Array; } @@ -264,7 +266,7 @@ pub trait ToArrayData { fn to_array_data(&self) -> ArrayData; } -/// Collects together the behaviour of an array. +/// Collects together the behavior of an array. pub trait ArrayTrait: ArrayEncodingRef + ArrayCompute diff --git a/vortex-array/src/view.rs b/vortex-array/src/view.rs index 341fb74a6..ecb5675ab 100644 --- a/vortex-array/src/view.rs +++ b/vortex-array/src/view.rs @@ -9,8 +9,8 @@ use vortex_dtype::{DType, Nullability}; use vortex_error::{vortex_err, VortexError, VortexExpect as _, VortexResult}; use vortex_scalar::{PValue, Scalar, ScalarValue}; +use crate::encoding::opaque::OpaqueEncoding; use crate::encoding::EncodingRef; -use crate::opaque::OpaqueEncoding; use crate::stats::{Stat, Statistics, StatsSet}; use crate::visitor::ArrayVisitor; use crate::{flatbuffers as fb, Array, Context, IntoArray, ToArray}; From 2cdb093e12dcfc03eefe6d54b75e85a3e4dcb804 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 21 Oct 2024 18:05:01 +0100 Subject: [PATCH 03/12] . --- vortex-array/src/canonical.rs | 2 ++ vortex-array/src/variants.rs | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/vortex-array/src/canonical.rs b/vortex-array/src/canonical.rs index a0c442be4..b9038a8fa 100644 --- a/vortex-array/src/canonical.rs +++ b/vortex-array/src/canonical.rs @@ -1,3 +1,5 @@ +//! Encoding that enable sharing data with Arrow with zero-copy. + use std::sync::Arc; use arrow_array::types::{ diff --git a/vortex-array/src/variants.rs b/vortex-array/src/variants.rs index ad01b69e6..676dca700 100644 --- a/vortex-array/src/variants.rs +++ b/vortex-array/src/variants.rs @@ -87,12 +87,12 @@ pub trait BoolArrayTrait: ArrayTrait { .unwrap_or_else(|| self.maybe_null_indices_iter().count()) } - // An iterator over the sorted indices of set values in the underlying boolean array - // good to array with low number of set values. + /// An iterator over the sorted indices of set values in the underlying boolean array + /// good to array with low number of set values. fn maybe_null_indices_iter<'a>(&'a self) -> Box + 'a>; - // An iterator over the sorted disjoint contiguous range set values in the underlying boolean - // array good for arrays with only long runs of set values. + /// An iterator over the sorted disjoint contiguous range set values in the underlying boolean + /// array good for arrays with only long runs of set values. fn maybe_null_slices_iter<'a>(&'a self) -> Box + 'a>; // Other possible iterators include: @@ -218,8 +218,10 @@ pub trait StructArrayTrait: ArrayTrait { self.names().len() } + /// Return a field's array by index fn field(&self, idx: usize) -> Option; + /// Return a field's array by name fn field_by_name(&self, name: &str) -> Option { let field_idx = self .names() @@ -235,6 +237,7 @@ pub trait StructArrayTrait: ArrayTrait { pub trait ListArrayTrait: ArrayTrait {} pub trait ExtensionArrayTrait: ArrayTrait { + /// Returns the extension logical [`DType`] fn ext_dtype(&self) -> &ExtDType { let DType::Extension(ext_dtype, _nullability) = self.dtype() else { vortex_panic!("Expected ExtDType") @@ -242,5 +245,6 @@ pub trait ExtensionArrayTrait: ArrayTrait { ext_dtype } + /// Returns the underlying fn storage_array(&self) -> Array; } From 519a99dd48902b3620c0646497c4b39f5e8bfe74 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 21 Oct 2024 18:06:04 +0100 Subject: [PATCH 04/12] . --- vortex-array/src/array/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vortex-array/src/array/mod.rs b/vortex-array/src/array/mod.rs index c890e0f7d..7b0b8b204 100644 --- a/vortex-array/src/array/mod.rs +++ b/vortex-array/src/array/mod.rs @@ -1,3 +1,5 @@ +/// All built-in encoding schemes and arrays. + #[cfg(test)] mod assertions; From 446ac724fa34acfcca802fde8596f5230ec1a0a5 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 21 Oct 2024 18:09:24 +0100 Subject: [PATCH 05/12] . --- vortex-array/src/array/mod.rs | 2 +- vortex-array/src/implementation.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/vortex-array/src/array/mod.rs b/vortex-array/src/array/mod.rs index 7b0b8b204..19e45f395 100644 --- a/vortex-array/src/array/mod.rs +++ b/vortex-array/src/array/mod.rs @@ -1,4 +1,4 @@ -/// All built-in encoding schemes and arrays. +//! All the built-in encoding schemes and arrays. #[cfg(test)] mod assertions; diff --git a/vortex-array/src/implementation.rs b/vortex-array/src/implementation.rs index 2235d9508..814b88827 100644 --- a/vortex-array/src/implementation.rs +++ b/vortex-array/src/implementation.rs @@ -1,3 +1,5 @@ +//! The core Vortex macro to create new encodings and array types. + use vortex_buffer::Buffer; use vortex_dtype::DType; use vortex_error::{vortex_bail, VortexError, VortexExpect as _, VortexResult}; From d6df3bcc14f22c14d8a9d414a96bc31999260f01 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 21 Oct 2024 18:31:29 +0100 Subject: [PATCH 06/12] . --- vortex-array/src/variants.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vortex-array/src/variants.rs b/vortex-array/src/variants.rs index 676dca700..8e2db7641 100644 --- a/vortex-array/src/variants.rs +++ b/vortex-array/src/variants.rs @@ -237,7 +237,7 @@ pub trait StructArrayTrait: ArrayTrait { pub trait ListArrayTrait: ArrayTrait {} pub trait ExtensionArrayTrait: ArrayTrait { - /// Returns the extension logical [`DType`] + /// Returns the extension logical [`DType`]. fn ext_dtype(&self) -> &ExtDType { let DType::Extension(ext_dtype, _nullability) = self.dtype() else { vortex_panic!("Expected ExtDType") @@ -245,6 +245,6 @@ pub trait ExtensionArrayTrait: ArrayTrait { ext_dtype } - /// Returns the underlying + /// Returns the underlying [`Array`], without the [`ExtDType`]. fn storage_array(&self) -> Array; } From 7483d3dc46b3d4b26289eb58d1d5ef11f67de430 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 21 Oct 2024 18:59:39 +0100 Subject: [PATCH 07/12] . --- vortex-array/src/implementation.rs | 2 +- vortex-array/src/lib.rs | 3 ++- vortex-array/src/vendored.rs | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 vortex-array/src/vendored.rs diff --git a/vortex-array/src/implementation.rs b/vortex-array/src/implementation.rs index 814b88827..7cb61b6b5 100644 --- a/vortex-array/src/implementation.rs +++ b/vortex-array/src/implementation.rs @@ -30,7 +30,7 @@ pub trait ArrayDef { #[macro_export] macro_rules! impl_encoding { ($id:literal, $code:expr, $Name:ident) => { - $crate::vendored::paste::paste! { + $crate::paste::paste! { /// The array definition trait #[derive(std::fmt::Debug, Clone)] pub struct $Name; diff --git a/vortex-array/src/lib.rs b/vortex-array/src/lib.rs index 54c1c37da..9e1b22fea 100644 --- a/vortex-array/src/lib.rs +++ b/vortex-array/src/lib.rs @@ -18,6 +18,7 @@ pub use data::*; pub use implementation::*; use itertools::Itertools; pub use metadata::*; +pub use paste; pub use typed::*; pub use view::*; use vortex_buffer::Buffer; @@ -52,11 +53,11 @@ mod tree; mod typed; pub mod validity; pub mod variants; -pub mod vendored; mod view; pub mod visitor; pub mod flatbuffers { + //! Re-exported autogenerated code from the core Vortex flatbuffer definitions. pub use vortex_flatbuffers::array::*; } diff --git a/vortex-array/src/vendored.rs b/vortex-array/src/vendored.rs deleted file mode 100644 index 31e699914..000000000 --- a/vortex-array/src/vendored.rs +++ /dev/null @@ -1 +0,0 @@ -pub use paste; From f648d6554793665c0037ddca00687080028a76e1 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 21 Oct 2024 19:05:13 +0100 Subject: [PATCH 08/12] . --- vortex-array/src/encoding/mod.rs | 2 +- vortex-array/src/validity.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/vortex-array/src/encoding/mod.rs b/vortex-array/src/encoding/mod.rs index 62e26e0a4..2672d3907 100644 --- a/vortex-array/src/encoding/mod.rs +++ b/vortex-array/src/encoding/mod.rs @@ -1,4 +1,4 @@ -//! Traits and types to define shared unique encoding identifiers +//! Traits and types to define shared unique encoding identifiers. use std::fmt::{Debug, Display, Formatter}; use std::hash::{Hash, Hasher}; diff --git a/vortex-array/src/validity.rs b/vortex-array/src/validity.rs index 3dec73ec9..5389a5d60 100644 --- a/vortex-array/src/validity.rs +++ b/vortex-array/src/validity.rs @@ -1,3 +1,5 @@ +//! Array validity and nullability behavior, used by arrays and compute functions. + use std::fmt::{Debug, Display}; use std::ops::BitAnd; From 67dd3415c2a23e49ada2ad48ab97ab780ac94a36 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 21 Oct 2024 19:08:55 +0100 Subject: [PATCH 09/12] Move things around --- encodings/alp/src/alp/array.rs | 2 +- encodings/alp/src/alp_rd/array.rs | 2 +- encodings/bytebool/src/array.rs | 2 +- encodings/datetime-parts/src/array.rs | 2 +- encodings/dict/src/array.rs | 2 +- encodings/fastlanes/src/bitpacking/mod.rs | 2 +- encodings/fastlanes/src/delta/mod.rs | 2 +- encodings/fastlanes/src/for/mod.rs | 2 +- encodings/fsst/src/array.rs | 4 ++-- encodings/roaring/src/boolean/mod.rs | 2 +- encodings/roaring/src/integer/mod.rs | 2 +- encodings/runend-bool/src/array.rs | 2 +- encodings/runend/src/array.rs | 2 +- encodings/zigzag/src/array.rs | 2 +- vortex-array/src/array/bool/mod.rs | 2 +- vortex-array/src/array/chunked/mod.rs | 2 +- vortex-array/src/array/constant/mod.rs | 2 +- vortex-array/src/array/extension/mod.rs | 2 +- vortex-array/src/array/mod.rs | 2 ++ vortex-array/src/array/null/mod.rs | 2 +- vortex-array/src/array/primitive/mod.rs | 2 +- vortex-array/src/array/sparse/mod.rs | 2 +- vortex-array/src/array/struct_/mod.rs | 2 +- vortex-array/src/array/varbin/array.rs | 2 +- vortex-array/src/array/varbinview/mod.rs | 2 +- vortex-array/src/{ => array}/visitor.rs | 0 vortex-array/src/implementation.rs | 2 +- vortex-array/src/lib.rs | 3 +-- vortex-array/src/tree.rs | 2 +- vortex-array/src/view.rs | 2 +- 30 files changed, 31 insertions(+), 30 deletions(-) rename vortex-array/src/{ => array}/visitor.rs (100%) diff --git a/encodings/alp/src/alp/array.rs b/encodings/alp/src/alp/array.rs index 4c707089e..45d77d72b 100644 --- a/encodings/alp/src/alp/array.rs +++ b/encodings/alp/src/alp/array.rs @@ -2,13 +2,13 @@ use std::fmt::{Debug, Display}; use std::sync::Arc; use serde::{Deserialize, Serialize}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::array::PrimitiveArray; use vortex::encoding::ids; use vortex::iter::{Accessor, AccessorRef}; use vortex::stats::ArrayStatisticsCompute; use vortex::validity::{ArrayValidity, LogicalValidity, Validity}; use vortex::variants::{ArrayVariants, PrimitiveArrayTrait}; -use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoCanonical}; use vortex_dtype::{DType, PType}; use vortex_error::{vortex_bail, vortex_panic, VortexExpect as _, VortexResult}; diff --git a/encodings/alp/src/alp_rd/array.rs b/encodings/alp/src/alp_rd/array.rs index ff9cdcb14..f3d561122 100644 --- a/encodings/alp/src/alp_rd/array.rs +++ b/encodings/alp/src/alp_rd/array.rs @@ -1,11 +1,11 @@ use std::fmt::{Debug, Display}; use serde::{Deserialize, Serialize}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::array::{PrimitiveArray, SparseArray}; use vortex::encoding::ids; use vortex::stats::{ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity}; -use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoCanonical}; use vortex_dtype::{DType, Nullability, PType}; use vortex_error::{vortex_bail, VortexExpect, VortexResult}; diff --git a/encodings/bytebool/src/array.rs b/encodings/bytebool/src/array.rs index 9baf84f4a..38b3fa3c4 100644 --- a/encodings/bytebool/src/array.rs +++ b/encodings/bytebool/src/array.rs @@ -8,7 +8,7 @@ use vortex::encoding::ids; use vortex::stats::StatsSet; use vortex::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use vortex::variants::{ArrayVariants, BoolArrayTrait}; -use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, ArrayTrait, Canonical, IntoCanonical, TypedArray}; use vortex_buffer::Buffer; use vortex_dtype::DType; diff --git a/encodings/datetime-parts/src/array.rs b/encodings/datetime-parts/src/array.rs index 95492f1df..dc278445d 100644 --- a/encodings/datetime-parts/src/array.rs +++ b/encodings/datetime-parts/src/array.rs @@ -7,7 +7,7 @@ use vortex::encoding::ids; use vortex::stats::{ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity}; use vortex::variants::{ArrayVariants, ExtensionArrayTrait}; -use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoCanonical}; use vortex_dtype::{DType, PType}; use vortex_error::{vortex_bail, VortexExpect as _, VortexResult, VortexUnwrap}; diff --git a/encodings/dict/src/array.rs b/encodings/dict/src/array.rs index 206b18cd7..c04a074cf 100644 --- a/encodings/dict/src/array.rs +++ b/encodings/dict/src/array.rs @@ -8,7 +8,7 @@ use vortex::compute::unary::scalar_at; use vortex::encoding::ids; use vortex::stats::StatsSet; use vortex::validity::{ArrayValidity, LogicalValidity}; -use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{ impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoArrayVariant, IntoCanonical, diff --git a/encodings/fastlanes/src/bitpacking/mod.rs b/encodings/fastlanes/src/bitpacking/mod.rs index b81e3839c..780a1d4a7 100644 --- a/encodings/fastlanes/src/bitpacking/mod.rs +++ b/encodings/fastlanes/src/bitpacking/mod.rs @@ -8,7 +8,7 @@ use vortex::encoding::ids; use vortex::stats::{ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use vortex::variants::{ArrayVariants, PrimitiveArrayTrait}; -use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoCanonical, TypedArray}; use vortex_buffer::Buffer; use vortex_dtype::{DType, NativePType, Nullability, PType}; diff --git a/encodings/fastlanes/src/delta/mod.rs b/encodings/fastlanes/src/delta/mod.rs index 9bc2522e4..4d354b86d 100644 --- a/encodings/fastlanes/src/delta/mod.rs +++ b/encodings/fastlanes/src/delta/mod.rs @@ -7,7 +7,7 @@ use vortex::encoding::ids; use vortex::stats::{ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use vortex::variants::{ArrayVariants, PrimitiveArrayTrait}; -use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoCanonical}; use vortex_dtype::{match_each_unsigned_integer_ptype, NativePType}; use vortex_error::{vortex_bail, vortex_panic, VortexExpect as _, VortexResult}; diff --git a/encodings/fastlanes/src/for/mod.rs b/encodings/fastlanes/src/for/mod.rs index 4ddc2832d..4a828690e 100644 --- a/encodings/fastlanes/src/for/mod.rs +++ b/encodings/fastlanes/src/for/mod.rs @@ -6,7 +6,7 @@ use vortex::encoding::ids; use vortex::stats::{ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity}; use vortex::variants::{ArrayVariants, PrimitiveArrayTrait}; -use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoCanonical}; use vortex_dtype::{DType, PType}; use vortex_error::{vortex_bail, vortex_panic, VortexExpect as _, VortexResult}; diff --git a/encodings/fsst/src/array.rs b/encodings/fsst/src/array.rs index 70bc89540..d7586f2e6 100644 --- a/encodings/fsst/src/array.rs +++ b/encodings/fsst/src/array.rs @@ -3,12 +3,12 @@ use std::sync::Arc; use fsst::{Decompressor, Symbol}; use serde::{Deserialize, Serialize}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::array::VarBinArray; use vortex::encoding::ids; use vortex::stats::{ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity}; use vortex::variants::{ArrayVariants, BinaryArrayTrait, Utf8ArrayTrait}; -use vortex::visitor::AcceptArrayVisitor; use vortex::{impl_encoding, Array, ArrayDType, ArrayTrait, IntoCanonical}; use vortex_dtype::{DType, Nullability, PType}; use vortex_error::{vortex_bail, VortexExpect, VortexResult}; @@ -183,7 +183,7 @@ impl FSSTArray { } impl AcceptArrayVisitor for FSSTArray { - fn accept(&self, visitor: &mut dyn vortex::visitor::ArrayVisitor) -> VortexResult<()> { + fn accept(&self, visitor: &mut dyn ArrayVisitor) -> VortexResult<()> { visitor.visit_child("symbols", &self.symbols())?; visitor.visit_child("symbol_lengths", &self.symbol_lengths())?; visitor.visit_child("codes", &self.codes())?; diff --git a/encodings/roaring/src/boolean/mod.rs b/encodings/roaring/src/boolean/mod.rs index 0c7498994..bc4f3655e 100644 --- a/encodings/roaring/src/boolean/mod.rs +++ b/encodings/roaring/src/boolean/mod.rs @@ -11,7 +11,7 @@ use vortex::encoding::ids; use vortex::stats::{Stat, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity}; use vortex::variants::{ArrayVariants, BoolArrayTrait}; -use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, Array, ArrayTrait, Canonical, IntoArray, IntoCanonical, TypedArray}; use vortex_buffer::Buffer; use vortex_dtype::DType; diff --git a/encodings/roaring/src/integer/mod.rs b/encodings/roaring/src/integer/mod.rs index dedcd458d..88fb73ad8 100644 --- a/encodings/roaring/src/integer/mod.rs +++ b/encodings/roaring/src/integer/mod.rs @@ -9,7 +9,7 @@ use vortex::encoding::ids; use vortex::stats::{ArrayStatistics, ArrayStatisticsCompute, Stat, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity}; use vortex::variants::{ArrayVariants, PrimitiveArrayTrait}; -use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{ impl_encoding, Array, ArrayDType as _, ArrayTrait, Canonical, IntoArray, IntoCanonical, TypedArray, diff --git a/encodings/runend-bool/src/array.rs b/encodings/runend-bool/src/array.rs index cc1ffe0c3..201dfaff7 100644 --- a/encodings/runend-bool/src/array.rs +++ b/encodings/runend-bool/src/array.rs @@ -7,7 +7,7 @@ use vortex::encoding::ids; use vortex::stats::{ArrayStatistics, ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use vortex::variants::{ArrayVariants, BoolArrayTrait}; -use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{ impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArrayVariant, IntoCanonical, }; diff --git a/encodings/runend/src/array.rs b/encodings/runend/src/array.rs index 4eb8e0343..0a99913aa 100644 --- a/encodings/runend/src/array.rs +++ b/encodings/runend/src/array.rs @@ -8,7 +8,7 @@ use vortex::encoding::ids; use vortex::stats::{ArrayStatistics, ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use vortex::variants::{ArrayVariants, PrimitiveArrayTrait}; -use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{ impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoArrayVariant, IntoCanonical, diff --git a/encodings/zigzag/src/array.rs b/encodings/zigzag/src/array.rs index 7dcce7c57..89d8a59db 100644 --- a/encodings/zigzag/src/array.rs +++ b/encodings/zigzag/src/array.rs @@ -6,7 +6,7 @@ use vortex::encoding::ids; use vortex::stats::{ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity}; use vortex::variants::{ArrayVariants, PrimitiveArrayTrait}; -use vortex::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{ impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoArrayVariant, IntoCanonical, diff --git a/vortex-array/src/array/bool/mod.rs b/vortex-array/src/array/bool/mod.rs index 90ea09729..0e42f4ab4 100644 --- a/vortex-array/src/array/bool/mod.rs +++ b/vortex-array/src/array/bool/mod.rs @@ -12,7 +12,7 @@ use crate::encoding::ids; use crate::stats::StatsSet; use crate::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use crate::variants::{ArrayVariants, BoolArrayTrait}; -use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, ArrayTrait, Canonical, IntoCanonical, TypedArray}; mod accessors; diff --git a/vortex-array/src/array/chunked/mod.rs b/vortex-array/src/array/chunked/mod.rs index e5a5e192e..3aef5ba34 100644 --- a/vortex-array/src/array/chunked/mod.rs +++ b/vortex-array/src/array/chunked/mod.rs @@ -20,7 +20,7 @@ use crate::stats::StatsSet; use crate::stream::{ArrayStream, ArrayStreamAdapter}; use crate::validity::Validity::NonNullable; use crate::validity::{ArrayValidity, LogicalValidity, Validity}; -use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, Array, ArrayDType, ArrayTrait, IntoArray, IntoCanonical}; mod canonical; diff --git a/vortex-array/src/array/constant/mod.rs b/vortex-array/src/array/constant/mod.rs index 93503e705..b4c7924fc 100644 --- a/vortex-array/src/array/constant/mod.rs +++ b/vortex-array/src/array/constant/mod.rs @@ -8,7 +8,7 @@ use vortex_scalar::{Scalar, ScalarValue}; use crate::encoding::ids; use crate::stats::{Stat, StatsSet}; use crate::validity::{ArrayValidity, LogicalValidity}; -use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, ArrayDType, ArrayTrait}; mod canonical; diff --git a/vortex-array/src/array/extension/mod.rs b/vortex-array/src/array/extension/mod.rs index 66c6e5b0d..1d5377e90 100644 --- a/vortex-array/src/array/extension/mod.rs +++ b/vortex-array/src/array/extension/mod.rs @@ -8,7 +8,7 @@ use crate::encoding::ids; use crate::stats::ArrayStatisticsCompute; use crate::validity::{ArrayValidity, LogicalValidity}; use crate::variants::{ArrayVariants, ExtensionArrayTrait}; -use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoCanonical}; mod compute; diff --git a/vortex-array/src/array/mod.rs b/vortex-array/src/array/mod.rs index 19e45f395..34440bca8 100644 --- a/vortex-array/src/array/mod.rs +++ b/vortex-array/src/array/mod.rs @@ -15,6 +15,8 @@ mod struct_; mod varbin; mod varbinview; +pub mod visitor; + #[cfg(feature = "arbitrary")] pub mod arbitrary; diff --git a/vortex-array/src/array/null/mod.rs b/vortex-array/src/array/null/mod.rs index 4cf6083bf..de2ab86b7 100644 --- a/vortex-array/src/array/null/mod.rs +++ b/vortex-array/src/array/null/mod.rs @@ -8,7 +8,7 @@ use crate::encoding::ids; use crate::stats::{ArrayStatisticsCompute, Stat, StatsSet}; use crate::validity::{ArrayValidity, LogicalValidity, Validity}; use crate::variants::{ArrayVariants, NullArrayTrait}; -use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, ArrayTrait, Canonical, IntoCanonical}; mod compute; diff --git a/vortex-array/src/array/primitive/mod.rs b/vortex-array/src/array/primitive/mod.rs index 1b62e6ff6..a052074dd 100644 --- a/vortex-array/src/array/primitive/mod.rs +++ b/vortex-array/src/array/primitive/mod.rs @@ -18,7 +18,7 @@ use crate::iter::{Accessor, AccessorRef, Batch, ITER_BATCH_SIZE}; use crate::stats::StatsSet; use crate::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use crate::variants::{ArrayVariants, PrimitiveArrayTrait}; -use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{ impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoCanonical, TypedArray, }; diff --git a/vortex-array/src/array/sparse/mod.rs b/vortex-array/src/array/sparse/mod.rs index c9ef62081..7379217f7 100644 --- a/vortex-array/src/array/sparse/mod.rs +++ b/vortex-array/src/array/sparse/mod.rs @@ -6,12 +6,12 @@ use vortex_error::{vortex_bail, vortex_panic, VortexExpect as _, VortexResult}; use vortex_scalar::{Scalar, ScalarValue}; use crate::array::constant::ConstantArray; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::compute::unary::scalar_at; use crate::compute::{search_sorted, SearchResult, SearchSortedSide}; use crate::encoding::ids; use crate::stats::{ArrayStatisticsCompute, StatsSet}; use crate::validity::{ArrayValidity, LogicalValidity}; -use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, Array, ArrayDType, ArrayTrait, IntoArray, IntoArrayVariant}; mod compute; diff --git a/vortex-array/src/array/struct_/mod.rs b/vortex-array/src/array/struct_/mod.rs index 08303b0e4..f4c8c995d 100644 --- a/vortex-array/src/array/struct_/mod.rs +++ b/vortex-array/src/array/struct_/mod.rs @@ -9,7 +9,7 @@ use crate::encoding::ids; use crate::stats::{ArrayStatisticsCompute, StatsSet}; use crate::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use crate::variants::{ArrayVariants, StructArrayTrait}; -use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoCanonical}; mod compute; diff --git a/vortex-array/src/array/varbin/array.rs b/vortex-array/src/array/varbin/array.rs index 655377d6c..7124200e9 100644 --- a/vortex-array/src/array/varbin/array.rs +++ b/vortex-array/src/array/varbin/array.rs @@ -1,8 +1,8 @@ use vortex_error::VortexResult; use crate::array::varbin::VarBinArray; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::validity::{ArrayValidity, LogicalValidity}; -use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; impl ArrayValidity for VarBinArray { fn is_valid(&self, index: usize) -> bool { diff --git a/vortex-array/src/array/varbinview/mod.rs b/vortex-array/src/array/varbinview/mod.rs index 61c78a50c..7081def6a 100644 --- a/vortex-array/src/array/varbinview/mod.rs +++ b/vortex-array/src/array/varbinview/mod.rs @@ -13,12 +13,12 @@ use vortex_dtype::{DType, PType}; use vortex_error::{vortex_bail, vortex_panic, VortexError, VortexExpect as _, VortexResult}; use crate::array::varbin::VarBinArray; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::arrow::FromArrowArray; use crate::compute::slice; use crate::encoding::ids; use crate::stats::StatsSet; use crate::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; -use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{ impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArrayVariant, IntoCanonical, }; diff --git a/vortex-array/src/visitor.rs b/vortex-array/src/array/visitor.rs similarity index 100% rename from vortex-array/src/visitor.rs rename to vortex-array/src/array/visitor.rs diff --git a/vortex-array/src/implementation.rs b/vortex-array/src/implementation.rs index 7cb61b6b5..b845762b9 100644 --- a/vortex-array/src/implementation.rs +++ b/vortex-array/src/implementation.rs @@ -4,9 +4,9 @@ use vortex_buffer::Buffer; use vortex_dtype::DType; use vortex_error::{vortex_bail, VortexError, VortexExpect as _, VortexResult}; +use crate::array::visitor::ArrayVisitor; use crate::encoding::{ArrayEncoding, ArrayEncodingExt, ArrayEncodingRef, EncodingId, EncodingRef}; use crate::stats::{ArrayStatistics, Statistics}; -use crate::visitor::ArrayVisitor; use crate::{ Array, ArrayDType, ArrayData, ArrayLen, ArrayMetadata, ArrayTrait, GetArrayMetadata, IntoArray, ToArrayData, TryDeserializeArrayMetadata, diff --git a/vortex-array/src/lib.rs b/vortex-array/src/lib.rs index 9e1b22fea..4827dcb76 100644 --- a/vortex-array/src/lib.rs +++ b/vortex-array/src/lib.rs @@ -25,6 +25,7 @@ use vortex_buffer::Buffer; use vortex_dtype::DType; use vortex_error::{vortex_panic, VortexExpect, VortexResult}; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::compute::ArrayCompute; use crate::encoding::{ArrayEncodingRef, EncodingId, EncodingRef}; use crate::iter::{ArrayIterator, ArrayIteratorAdapter}; @@ -32,7 +33,6 @@ use crate::stats::{ArrayStatistics, ArrayStatisticsCompute}; use crate::stream::{ArrayStream, ArrayStreamAdapter}; use crate::validity::ArrayValidity; use crate::variants::ArrayVariants; -use crate::visitor::{AcceptArrayVisitor, ArrayVisitor}; pub mod accessor; pub mod array; @@ -54,7 +54,6 @@ mod typed; pub mod validity; pub mod variants; mod view; -pub mod visitor; pub mod flatbuffers { //! Re-exported autogenerated code from the core Vortex flatbuffer definitions. diff --git a/vortex-array/src/tree.rs b/vortex-array/src/tree.rs index bdc6d7a0b..eaaeaeafa 100644 --- a/vortex-array/src/tree.rs +++ b/vortex-array/src/tree.rs @@ -5,8 +5,8 @@ use serde::ser::Error; use vortex_buffer::Buffer; use vortex_error::{VortexError, VortexResult}; +use crate::array::visitor::ArrayVisitor; use crate::array::ChunkedArray; -use crate::visitor::ArrayVisitor; use crate::{Array, ArrayData}; impl Array { diff --git a/vortex-array/src/view.rs b/vortex-array/src/view.rs index ecb5675ab..55c47b53f 100644 --- a/vortex-array/src/view.rs +++ b/vortex-array/src/view.rs @@ -9,10 +9,10 @@ use vortex_dtype::{DType, Nullability}; use vortex_error::{vortex_err, VortexError, VortexExpect as _, VortexResult}; use vortex_scalar::{PValue, Scalar, ScalarValue}; +use crate::array::visitor::ArrayVisitor; use crate::encoding::opaque::OpaqueEncoding; use crate::encoding::EncodingRef; use crate::stats::{Stat, Statistics, StatsSet}; -use crate::visitor::ArrayVisitor; use crate::{flatbuffers as fb, Array, Context, IntoArray, ToArray}; /// Zero-copy view over flatbuffer-encoded array data, created without eager serialization. From 5bc036fde3bd94ca09763bed75f6b875cd6bc3f9 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 21 Oct 2024 19:15:01 +0100 Subject: [PATCH 10/12] . --- vortex-array/src/typed.rs | 1 + vortex-array/src/view.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/vortex-array/src/typed.rs b/vortex-array/src/typed.rs index c60ad2338..4b9594f8b 100644 --- a/vortex-array/src/typed.rs +++ b/vortex-array/src/typed.rs @@ -7,6 +7,7 @@ use vortex_error::{vortex_bail, vortex_panic, VortexError, VortexResult}; use crate::stats::StatsSet; use crate::{Array, ArrayData, ArrayDef, IntoArray, ToArray, TryDeserializeArrayMetadata}; +/// Container for an array with all the associated implementation type information (encoding reference and ID, actual array type, metadata type). #[derive(Debug, Clone)] pub struct TypedArray { array: Array, diff --git a/vortex-array/src/view.rs b/vortex-array/src/view.rs index 55c47b53f..055502e87 100644 --- a/vortex-array/src/view.rs +++ b/vortex-array/src/view.rs @@ -172,7 +172,7 @@ impl ArrayView { } #[derive(Default, Debug)] -pub struct ChildrenCollector { +struct ChildrenCollector { children: Vec, } From bcba0aae7ba84f96bcd2310573640442d98b75de Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 21 Oct 2024 19:19:10 +0100 Subject: [PATCH 11/12] fmt --- encodings/bytebool/src/array.rs | 2 +- encodings/datetime-parts/src/array.rs | 2 +- encodings/dict/src/array.rs | 2 +- encodings/fastlanes/src/bitpacking/mod.rs | 2 +- encodings/fastlanes/src/delta/mod.rs | 2 +- encodings/fastlanes/src/for/mod.rs | 2 +- encodings/roaring/src/boolean/mod.rs | 2 +- encodings/roaring/src/integer/mod.rs | 2 +- encodings/runend-bool/src/array.rs | 2 +- encodings/runend/src/array.rs | 2 +- encodings/zigzag/src/array.rs | 2 +- vortex-array/src/array/bool/mod.rs | 2 +- vortex-array/src/array/chunked/mod.rs | 2 +- vortex-array/src/array/constant/mod.rs | 2 +- vortex-array/src/array/extension/mod.rs | 2 +- vortex-array/src/array/null/mod.rs | 2 +- vortex-array/src/array/primitive/mod.rs | 2 +- vortex-array/src/array/struct_/mod.rs | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/encodings/bytebool/src/array.rs b/encodings/bytebool/src/array.rs index 38b3fa3c4..bd7fa871e 100644 --- a/encodings/bytebool/src/array.rs +++ b/encodings/bytebool/src/array.rs @@ -3,12 +3,12 @@ use std::mem::ManuallyDrop; use arrow_buffer::BooleanBuffer; use serde::{Deserialize, Serialize}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::array::BoolArray; use vortex::encoding::ids; use vortex::stats::StatsSet; use vortex::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use vortex::variants::{ArrayVariants, BoolArrayTrait}; -use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, ArrayTrait, Canonical, IntoCanonical, TypedArray}; use vortex_buffer::Buffer; use vortex_dtype::DType; diff --git a/encodings/datetime-parts/src/array.rs b/encodings/datetime-parts/src/array.rs index dc278445d..a1aa4616c 100644 --- a/encodings/datetime-parts/src/array.rs +++ b/encodings/datetime-parts/src/array.rs @@ -1,13 +1,13 @@ use std::fmt::{Debug, Display}; use serde::{Deserialize, Serialize}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::array::StructArray; use vortex::compute::unary::try_cast; use vortex::encoding::ids; use vortex::stats::{ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity}; use vortex::variants::{ArrayVariants, ExtensionArrayTrait}; -use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoCanonical}; use vortex_dtype::{DType, PType}; use vortex_error::{vortex_bail, VortexExpect as _, VortexResult, VortexUnwrap}; diff --git a/encodings/dict/src/array.rs b/encodings/dict/src/array.rs index c04a074cf..598aa96e3 100644 --- a/encodings/dict/src/array.rs +++ b/encodings/dict/src/array.rs @@ -2,13 +2,13 @@ use std::fmt::{Debug, Display}; use arrow_buffer::BooleanBuffer; use serde::{Deserialize, Serialize}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::array::BoolArray; use vortex::compute::take; use vortex::compute::unary::scalar_at; use vortex::encoding::ids; use vortex::stats::StatsSet; use vortex::validity::{ArrayValidity, LogicalValidity}; -use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{ impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoArrayVariant, IntoCanonical, diff --git a/encodings/fastlanes/src/bitpacking/mod.rs b/encodings/fastlanes/src/bitpacking/mod.rs index 780a1d4a7..a16b234fa 100644 --- a/encodings/fastlanes/src/bitpacking/mod.rs +++ b/encodings/fastlanes/src/bitpacking/mod.rs @@ -3,12 +3,12 @@ use std::fmt::{Debug, Display}; use ::serde::{Deserialize, Serialize}; pub use compress::*; use fastlanes::BitPacking; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::array::{PrimitiveArray, SparseArray}; use vortex::encoding::ids; use vortex::stats::{ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use vortex::variants::{ArrayVariants, PrimitiveArrayTrait}; -use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoCanonical, TypedArray}; use vortex_buffer::Buffer; use vortex_dtype::{DType, NativePType, Nullability, PType}; diff --git a/encodings/fastlanes/src/delta/mod.rs b/encodings/fastlanes/src/delta/mod.rs index 4d354b86d..ef0776411 100644 --- a/encodings/fastlanes/src/delta/mod.rs +++ b/encodings/fastlanes/src/delta/mod.rs @@ -2,12 +2,12 @@ use std::fmt::{Debug, Display}; pub use compress::*; use serde::{Deserialize, Serialize}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::array::PrimitiveArray; use vortex::encoding::ids; use vortex::stats::{ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use vortex::variants::{ArrayVariants, PrimitiveArrayTrait}; -use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoCanonical}; use vortex_dtype::{match_each_unsigned_integer_ptype, NativePType}; use vortex_error::{vortex_bail, vortex_panic, VortexExpect as _, VortexResult}; diff --git a/encodings/fastlanes/src/for/mod.rs b/encodings/fastlanes/src/for/mod.rs index 4a828690e..a30d7a3bd 100644 --- a/encodings/fastlanes/src/for/mod.rs +++ b/encodings/fastlanes/src/for/mod.rs @@ -2,11 +2,11 @@ use std::fmt::{Debug, Display}; pub use compress::*; use serde::{Deserialize, Serialize}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::encoding::ids; use vortex::stats::{ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity}; use vortex::variants::{ArrayVariants, PrimitiveArrayTrait}; -use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoCanonical}; use vortex_dtype::{DType, PType}; use vortex_error::{vortex_bail, vortex_panic, VortexExpect as _, VortexResult}; diff --git a/encodings/roaring/src/boolean/mod.rs b/encodings/roaring/src/boolean/mod.rs index bc4f3655e..b2de436f2 100644 --- a/encodings/roaring/src/boolean/mod.rs +++ b/encodings/roaring/src/boolean/mod.rs @@ -6,12 +6,12 @@ pub use compress::*; use croaring::Native; pub use croaring::{Bitmap, Portable}; use serde::{Deserialize, Serialize}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::array::BoolArray; use vortex::encoding::ids; use vortex::stats::{Stat, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity}; use vortex::variants::{ArrayVariants, BoolArrayTrait}; -use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{impl_encoding, Array, ArrayTrait, Canonical, IntoArray, IntoCanonical, TypedArray}; use vortex_buffer::Buffer; use vortex_dtype::DType; diff --git a/encodings/roaring/src/integer/mod.rs b/encodings/roaring/src/integer/mod.rs index 88fb73ad8..f504c240c 100644 --- a/encodings/roaring/src/integer/mod.rs +++ b/encodings/roaring/src/integer/mod.rs @@ -3,13 +3,13 @@ use std::fmt::{Debug, Display}; pub use compress::*; use croaring::{Bitmap, Portable}; use serde::{Deserialize, Serialize}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::array::PrimitiveArray; use vortex::compute::unary::try_cast; use vortex::encoding::ids; use vortex::stats::{ArrayStatistics, ArrayStatisticsCompute, Stat, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity}; use vortex::variants::{ArrayVariants, PrimitiveArrayTrait}; -use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{ impl_encoding, Array, ArrayDType as _, ArrayTrait, Canonical, IntoArray, IntoCanonical, TypedArray, diff --git a/encodings/runend-bool/src/array.rs b/encodings/runend-bool/src/array.rs index 201dfaff7..03c9b23df 100644 --- a/encodings/runend-bool/src/array.rs +++ b/encodings/runend-bool/src/array.rs @@ -1,13 +1,13 @@ use std::fmt::{Debug, Display}; use serde::{Deserialize, Serialize}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::compute::unary::scalar_at; use vortex::compute::{search_sorted, SearchSortedSide}; use vortex::encoding::ids; use vortex::stats::{ArrayStatistics, ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use vortex::variants::{ArrayVariants, BoolArrayTrait}; -use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{ impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArrayVariant, IntoCanonical, }; diff --git a/encodings/runend/src/array.rs b/encodings/runend/src/array.rs index 0a99913aa..25c89220c 100644 --- a/encodings/runend/src/array.rs +++ b/encodings/runend/src/array.rs @@ -1,6 +1,7 @@ use std::fmt::{Debug, Display}; use serde::{Deserialize, Serialize}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::array::PrimitiveArray; use vortex::compute::unary::scalar_at; use vortex::compute::{search_sorted, search_sorted_u64_many, SearchSortedSide}; @@ -8,7 +9,6 @@ use vortex::encoding::ids; use vortex::stats::{ArrayStatistics, ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use vortex::variants::{ArrayVariants, PrimitiveArrayTrait}; -use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{ impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoArrayVariant, IntoCanonical, diff --git a/encodings/zigzag/src/array.rs b/encodings/zigzag/src/array.rs index 89d8a59db..a2e9419d2 100644 --- a/encodings/zigzag/src/array.rs +++ b/encodings/zigzag/src/array.rs @@ -1,12 +1,12 @@ use std::fmt::Display; use serde::{Deserialize, Serialize}; +use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::array::PrimitiveArray; use vortex::encoding::ids; use vortex::stats::{ArrayStatisticsCompute, StatsSet}; use vortex::validity::{ArrayValidity, LogicalValidity}; use vortex::variants::{ArrayVariants, PrimitiveArrayTrait}; -use vortex::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use vortex::{ impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoArrayVariant, IntoCanonical, diff --git a/vortex-array/src/array/bool/mod.rs b/vortex-array/src/array/bool/mod.rs index 0e42f4ab4..ea3c2c2e6 100644 --- a/vortex-array/src/array/bool/mod.rs +++ b/vortex-array/src/array/bool/mod.rs @@ -8,11 +8,11 @@ use vortex_buffer::Buffer; use vortex_dtype::DType; use vortex_error::{VortexExpect as _, VortexResult}; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::encoding::ids; use crate::stats::StatsSet; use crate::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use crate::variants::{ArrayVariants, BoolArrayTrait}; -use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, ArrayTrait, Canonical, IntoCanonical, TypedArray}; mod accessors; diff --git a/vortex-array/src/array/chunked/mod.rs b/vortex-array/src/array/chunked/mod.rs index 3aef5ba34..35a291b17 100644 --- a/vortex-array/src/array/chunked/mod.rs +++ b/vortex-array/src/array/chunked/mod.rs @@ -12,6 +12,7 @@ use vortex_error::{vortex_bail, vortex_panic, VortexExpect as _, VortexResult}; use vortex_scalar::Scalar; use crate::array::primitive::PrimitiveArray; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::compute::unary::{scalar_at, scalar_at_unchecked, subtract_scalar, SubtractScalarFn}; use crate::compute::{search_sorted, SearchSortedSide}; use crate::encoding::ids; @@ -20,7 +21,6 @@ use crate::stats::StatsSet; use crate::stream::{ArrayStream, ArrayStreamAdapter}; use crate::validity::Validity::NonNullable; use crate::validity::{ArrayValidity, LogicalValidity, Validity}; -use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, Array, ArrayDType, ArrayTrait, IntoArray, IntoCanonical}; mod canonical; diff --git a/vortex-array/src/array/constant/mod.rs b/vortex-array/src/array/constant/mod.rs index b4c7924fc..4adb81613 100644 --- a/vortex-array/src/array/constant/mod.rs +++ b/vortex-array/src/array/constant/mod.rs @@ -5,10 +5,10 @@ use serde::{Deserialize, Serialize}; use vortex_error::{vortex_panic, VortexResult}; use vortex_scalar::{Scalar, ScalarValue}; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::encoding::ids; use crate::stats::{Stat, StatsSet}; use crate::validity::{ArrayValidity, LogicalValidity}; -use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, ArrayDType, ArrayTrait}; mod canonical; diff --git a/vortex-array/src/array/extension/mod.rs b/vortex-array/src/array/extension/mod.rs index 1d5377e90..b742feaa7 100644 --- a/vortex-array/src/array/extension/mod.rs +++ b/vortex-array/src/array/extension/mod.rs @@ -4,11 +4,11 @@ use serde::{Deserialize, Serialize}; use vortex_dtype::{DType, ExtDType, ExtID}; use vortex_error::{VortexExpect as _, VortexResult}; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::encoding::ids; use crate::stats::ArrayStatisticsCompute; use crate::validity::{ArrayValidity, LogicalValidity}; use crate::variants::{ArrayVariants, ExtensionArrayTrait}; -use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoCanonical}; mod compute; diff --git a/vortex-array/src/array/null/mod.rs b/vortex-array/src/array/null/mod.rs index de2ab86b7..d8ed71dbd 100644 --- a/vortex-array/src/array/null/mod.rs +++ b/vortex-array/src/array/null/mod.rs @@ -4,11 +4,11 @@ use serde::{Deserialize, Serialize}; use vortex_dtype::DType; use vortex_error::{VortexExpect as _, VortexResult}; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::encoding::ids; use crate::stats::{ArrayStatisticsCompute, Stat, StatsSet}; use crate::validity::{ArrayValidity, LogicalValidity, Validity}; use crate::variants::{ArrayVariants, NullArrayTrait}; -use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, ArrayTrait, Canonical, IntoCanonical}; mod compute; diff --git a/vortex-array/src/array/primitive/mod.rs b/vortex-array/src/array/primitive/mod.rs index a052074dd..5e538451b 100644 --- a/vortex-array/src/array/primitive/mod.rs +++ b/vortex-array/src/array/primitive/mod.rs @@ -12,13 +12,13 @@ use vortex_buffer::Buffer; use vortex_dtype::{match_each_native_ptype, DType, NativePType, PType}; use vortex_error::{vortex_bail, vortex_panic, VortexError, VortexExpect as _, VortexResult}; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::elementwise::{dyn_cast_array_iter, BinaryFn, UnaryFn}; use crate::encoding::ids; use crate::iter::{Accessor, AccessorRef, Batch, ITER_BATCH_SIZE}; use crate::stats::StatsSet; use crate::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use crate::variants::{ArrayVariants, PrimitiveArrayTrait}; -use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{ impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoCanonical, TypedArray, }; diff --git a/vortex-array/src/array/struct_/mod.rs b/vortex-array/src/array/struct_/mod.rs index f4c8c995d..cf31fbb76 100644 --- a/vortex-array/src/array/struct_/mod.rs +++ b/vortex-array/src/array/struct_/mod.rs @@ -5,11 +5,11 @@ use vortex_dtype::field::Field; use vortex_dtype::{DType, FieldName, FieldNames, StructDType}; use vortex_error::{vortex_bail, vortex_err, vortex_panic, VortexExpect as _, VortexResult}; +use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::encoding::ids; use crate::stats::{ArrayStatisticsCompute, StatsSet}; use crate::validity::{ArrayValidity, LogicalValidity, Validity, ValidityMetadata}; use crate::variants::{ArrayVariants, StructArrayTrait}; -use crate::array::visitor::{AcceptArrayVisitor, ArrayVisitor}; use crate::{impl_encoding, Array, ArrayDType, ArrayTrait, Canonical, IntoArray, IntoCanonical}; mod compute; From ef63ba0d79d08220a780d06a17f7a85277fe27ac Mon Sep 17 00:00:00 2001 From: Will Manning Date: Mon, 21 Oct 2024 14:29:24 -0400 Subject: [PATCH 12/12] Update canonical.rs --- vortex-array/src/canonical.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vortex-array/src/canonical.rs b/vortex-array/src/canonical.rs index b9038a8fa..547f0c985 100644 --- a/vortex-array/src/canonical.rs +++ b/vortex-array/src/canonical.rs @@ -1,4 +1,4 @@ -//! Encoding that enable sharing data with Arrow with zero-copy. +//! Encodings that enable zero-copy sharing of data with Arrow. use std::sync::Arc;