From bc6909eccc54a169845487f69714dc785f5cc617 Mon Sep 17 00:00:00 2001 From: Joe Isaacs Date: Tue, 10 Mar 2026 19:44:44 +0000 Subject: [PATCH 1/4] fix Signed-off-by: Joe Isaacs --- encodings/alp/public-api.lock | 16 + encodings/alp/src/alp/array.rs | 59 +- encodings/alp/src/alp_rd/array.rs | 74 ++- encodings/bytebool/public-api.lock | 8 + encodings/bytebool/src/array.rs | 28 + encodings/datetime-parts/public-api.lock | 8 + encodings/datetime-parts/src/array.rs | 90 +++- encodings/decimal-byte-parts/public-api.lock | 8 + .../src/decimal_byte_parts/compute/compare.rs | 10 +- .../src/decimal_byte_parts/compute/filter.rs | 2 +- .../decimal_byte_parts/compute/is_constant.rs | 2 +- .../src/decimal_byte_parts/compute/mask.rs | 4 +- .../src/decimal_byte_parts/compute/take.rs | 7 +- .../src/decimal_byte_parts/mod.rs | 62 ++- .../src/decimal_byte_parts/rules.rs | 2 +- encodings/fastlanes/public-api.lock | 32 ++ .../fastlanes/src/bitpacking/array/mod.rs | 5 + .../fastlanes/src/bitpacking/vtable/mod.rs | 26 + encodings/fastlanes/src/delta/array/mod.rs | 26 +- encodings/fastlanes/src/delta/vtable/mod.rs | 37 +- encodings/fastlanes/src/for/array/mod.rs | 15 +- encodings/fastlanes/src/for/vtable/mod.rs | 33 +- encodings/fastlanes/src/for/vtable/rules.rs | 4 +- encodings/fastlanes/src/rle/array/mod.rs | 47 +- encodings/fastlanes/src/rle/vtable/mod.rs | 32 +- encodings/fsst/public-api.lock | 8 + encodings/fsst/src/array.rs | 48 +- encodings/pco/public-api.lock | 8 + encodings/pco/src/array.rs | 28 + encodings/runend/public-api.lock | 8 + encodings/runend/src/array.rs | 69 ++- encodings/sequence/public-api.lock | 8 + encodings/sequence/src/array.rs | 28 + encodings/sparse/public-api.lock | 8 + encodings/sparse/src/lib.rs | 30 ++ encodings/zigzag/public-api.lock | 8 + encodings/zigzag/src/array.rs | 43 +- encodings/zstd/public-api.lock | 8 + encodings/zstd/src/array.rs | 28 + encodings/zstd/src/zstd_buffers.rs | 51 +- vortex-array/public-api.lock | 506 +++++++++++++++++- vortex-array/src/array/mod.rs | 21 + vortex-array/src/array/visitor.rs | 14 + vortex-array/src/arrays/bool/array.rs | 8 +- vortex-array/src/arrays/bool/vtable/mod.rs | 25 + vortex-array/src/arrays/chunked/array.rs | 62 ++- .../src/arrays/chunked/compute/aggregate.rs | 2 +- .../src/arrays/chunked/compute/filter.rs | 2 +- .../src/arrays/chunked/compute/is_sorted.rs | 2 +- .../src/arrays/chunked/compute/mask.rs | 2 +- .../src/arrays/chunked/compute/rules.rs | 8 +- .../src/arrays/chunked/compute/sum.rs | 2 +- .../src/arrays/chunked/vtable/canonical.rs | 5 +- vortex-array/src/arrays/chunked/vtable/mod.rs | 62 ++- vortex-array/src/arrays/constant/array.rs | 6 + .../src/arrays/constant/vtable/mod.rs | 26 + vortex-array/src/arrays/decimal/array.rs | 6 + vortex-array/src/arrays/decimal/vtable/mod.rs | 25 + vortex-array/src/arrays/dict/array.rs | 27 +- vortex-array/src/arrays/dict/compute/rules.rs | 15 +- vortex-array/src/arrays/dict/vtable/mod.rs | 47 +- vortex-array/src/arrays/extension/array.rs | 14 +- .../src/arrays/extension/vtable/mod.rs | 36 +- .../src/arrays/extension/vtable/validity.rs | 2 +- vortex-array/src/arrays/filter/array.rs | 18 +- vortex-array/src/arrays/filter/execute/mod.rs | 2 +- vortex-array/src/arrays/filter/rules.rs | 4 +- vortex-array/src/arrays/filter/vtable.rs | 49 +- .../src/arrays/fixed_size_list/array.rs | 26 +- .../src/arrays/fixed_size_list/vtable/mod.rs | 28 + vortex-array/src/arrays/list/array.rs | 27 +- vortex-array/src/arrays/list/vtable/mod.rs | 35 +- vortex-array/src/arrays/listview/array.rs | 75 +-- .../src/arrays/listview/vtable/mod.rs | 25 + vortex-array/src/arrays/masked/array.rs | 13 +- .../src/arrays/masked/compute/filter.rs | 2 +- .../src/arrays/masked/compute/mask.rs | 4 +- .../src/arrays/masked/compute/slice.rs | 13 +- .../src/arrays/masked/compute/take.rs | 4 +- vortex-array/src/arrays/masked/execute.rs | 2 +- vortex-array/src/arrays/masked/vtable/mod.rs | 35 +- .../src/arrays/masked/vtable/operations.rs | 2 +- vortex-array/src/arrays/null/mod.rs | 29 + .../src/arrays/primitive/array/mod.rs | 8 + .../src/arrays/primitive/vtable/mod.rs | 25 + vortex-array/src/arrays/scalar_fn/array.rs | 16 +- vortex-array/src/arrays/scalar_fn/rules.rs | 10 +- vortex-array/src/arrays/scalar_fn/slice.rs | 2 +- .../src/arrays/scalar_fn/vtable/mod.rs | 40 +- .../src/arrays/scalar_fn/vtable/operations.rs | 2 +- .../src/arrays/scalar_fn/vtable/validity.rs | 2 +- vortex-array/src/arrays/shared/array.rs | 24 +- vortex-array/src/arrays/shared/vtable.rs | 28 +- vortex-array/src/arrays/slice/array.rs | 16 +- vortex-array/src/arrays/slice/vtable.rs | 50 +- vortex-array/src/arrays/struct_/array.rs | 58 +- .../src/arrays/struct_/compute/mask.rs | 2 +- .../src/arrays/struct_/compute/take.rs | 2 +- vortex-array/src/arrays/struct_/tests.rs | 10 +- vortex-array/src/arrays/struct_/vtable/mod.rs | 46 +- vortex-array/src/arrays/varbin/array.rs | 17 +- vortex-array/src/arrays/varbin/vtable/mod.rs | 30 +- vortex-array/src/arrays/varbinview/array.rs | 6 + .../src/arrays/varbinview/vtable/mod.rs | 26 + vortex-array/src/arrow/executor/struct_.rs | 2 +- vortex-array/src/executor.rs | 80 +-- vortex-array/src/vtable/dyn_.rs | 9 + vortex-array/src/vtable/mod.rs | 67 ++- 108 files changed, 2405 insertions(+), 509 deletions(-) diff --git a/encodings/alp/public-api.lock b/encodings/alp/public-api.lock index 95c4f3ad885..9a4e80e5672 100644 --- a/encodings/alp/public-api.lock +++ b/encodings/alp/public-api.lock @@ -218,14 +218,22 @@ pub fn vortex_alp::ALPRDVTable::nbuffers(_array: &vortex_alp::ALPRDArray) -> usi pub fn vortex_alp::ALPRDVTable::nchildren(array: &vortex_alp::ALPRDArray) -> usize +pub fn vortex_alp::ALPRDVTable::nslots(_array: &vortex_alp::ALPRDArray) -> usize + pub fn vortex_alp::ALPRDVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_alp::ALPRDVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_alp::ALPRDVTable::slot(array: &vortex_alp::ALPRDArray, idx: usize) -> &core::option::Option + +pub fn vortex_alp::ALPRDVTable::slot_name(_array: &vortex_alp::ALPRDArray, idx: usize) -> &str + pub fn vortex_alp::ALPRDVTable::stats(array: &vortex_alp::ALPRDArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_alp::ALPRDVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_alp::ALPRDVTable::with_slots(array: &mut vortex_alp::ALPRDArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_alp::ALPRDVTable pub fn vortex_alp::ALPRDVTable::scalar_at(array: &vortex_alp::ALPRDArray, index: usize) -> vortex_error::VortexResult @@ -322,14 +330,22 @@ pub fn vortex_alp::ALPVTable::nbuffers(_array: &vortex_alp::ALPArray) -> usize pub fn vortex_alp::ALPVTable::nchildren(array: &vortex_alp::ALPArray) -> usize +pub fn vortex_alp::ALPVTable::nslots(_array: &vortex_alp::ALPArray) -> usize + pub fn vortex_alp::ALPVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_alp::ALPVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_alp::ALPVTable::slot(array: &vortex_alp::ALPArray, idx: usize) -> &core::option::Option + +pub fn vortex_alp::ALPVTable::slot_name(_array: &vortex_alp::ALPArray, idx: usize) -> &str + pub fn vortex_alp::ALPVTable::stats(array: &vortex_alp::ALPArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_alp::ALPVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_alp::ALPVTable::with_slots(array: &mut vortex_alp::ALPArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_alp::ALPVTable pub fn vortex_alp::ALPVTable::scalar_at(array: &vortex_alp::ALPArray, index: usize) -> vortex_error::VortexResult diff --git a/encodings/alp/src/alp/array.rs b/encodings/alp/src/alp/array.rs index 99e166bac18..b27c8beadcb 100644 --- a/encodings/alp/src/alp/array.rs +++ b/encodings/alp/src/alp/array.rs @@ -59,7 +59,7 @@ impl VTable for ALPVTable { } fn len(array: &ALPArray) -> usize { - array.encoded.len() + array.encoded().len() } fn dtype(array: &ALPArray) -> &DType { @@ -72,14 +72,14 @@ impl VTable for ALPVTable { fn array_hash(array: &ALPArray, state: &mut H, precision: Precision) { array.dtype.hash(state); - array.encoded.array_hash(state, precision); + array.encoded().array_hash(state, precision); array.exponents.hash(state); array.patches.array_hash(state, precision); } fn array_eq(array: &ALPArray, other: &ALPArray, precision: Precision) -> bool { array.dtype == other.dtype - && array.encoded.array_eq(&other.encoded, precision) + && array.encoded().array_eq(other.encoded(), precision) && array.exponents == other.exponents && array.patches.array_eq(&other.patches, precision) } @@ -96,6 +96,29 @@ impl VTable for ALPVTable { None } + fn nslots(_array: &ALPArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &ALPArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &ALPArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + + fn with_slots(array: &mut ALPArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "ALPArray expects {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn nchildren(array: &ALPArray) -> usize { 1 + array.patches().map_or(0, patches_nchildren) } @@ -210,9 +233,11 @@ impl VTable for ALPVTable { ); let mut children_iter = children.into_iter(); - array.encoded = children_iter - .next() - .ok_or_else(|| vortex_err!("Expected encoded child"))?; + array.slots[ENCODED_SLOT] = Some( + children_iter + .next() + .ok_or_else(|| vortex_err!("Expected encoded child"))?, + ); if let Some((array_len, offset, _has_chunk_offsets)) = patches_info { let indices = children_iter @@ -260,9 +285,13 @@ impl VTable for ALPVTable { } } +pub(super) const ENCODED_SLOT: usize = 0; +pub(super) const NUM_SLOTS: usize = 1; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["encoded"]; + #[derive(Clone, Debug)] pub struct ALPArray { - encoded: ArrayRef, + slots: Vec>, patches: Option, dtype: DType, exponents: Exponents, @@ -433,7 +462,7 @@ impl ALPArray { Ok(Self { dtype, - encoded, + slots: vec![Some(encoded)], exponents, patches, stats_set: Default::default(), @@ -452,7 +481,7 @@ impl ALPArray { ) -> Self { Self { dtype, - encoded, + slots: vec![Some(encoded)], exponents, patches, stats_set: Default::default(), @@ -464,7 +493,9 @@ impl ALPArray { } pub fn encoded(&self) -> &ArrayRef { - &self.encoded + self.slots[ENCODED_SLOT] + .as_ref() + .vortex_expect("ALPArray encoded slot") } #[inline] @@ -479,7 +510,13 @@ impl ALPArray { /// Consumes the array and returns its parts. #[inline] pub fn into_parts(self) -> (ArrayRef, Exponents, Option, DType) { - (self.encoded, self.exponents, self.patches, self.dtype) + let encoded = self + .slots + .into_iter() + .next() + .flatten() + .vortex_expect("ALPArray encoded slot"); + (encoded, self.exponents, self.patches, self.dtype) } } diff --git a/encodings/alp/src/alp_rd/array.rs b/encodings/alp/src/alp_rd/array.rs index d98b596eaa8..a4b51a39136 100644 --- a/encodings/alp/src/alp_rd/array.rs +++ b/encodings/alp/src/alp_rd/array.rs @@ -36,6 +36,7 @@ use vortex_array::vtable::patches_child; use vortex_array::vtable::patches_child_name; use vortex_array::vtable::patches_nchildren; use vortex_buffer::Buffer; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -76,7 +77,7 @@ impl VTable for ALPRDVTable { } fn len(array: &ALPRDArray) -> usize { - array.left_parts.len() + array.left_parts().len() } fn dtype(array: &ALPRDArray) -> &DType { @@ -89,20 +90,20 @@ impl VTable for ALPRDVTable { fn array_hash(array: &ALPRDArray, state: &mut H, precision: Precision) { array.dtype.hash(state); - array.left_parts.array_hash(state, precision); + array.left_parts().array_hash(state, precision); array.left_parts_dictionary.array_hash(state, precision); - array.right_parts.array_hash(state, precision); + array.right_parts().array_hash(state, precision); array.right_bit_width.hash(state); array.left_parts_patches.array_hash(state, precision); } fn array_eq(array: &ALPRDArray, other: &ALPRDArray, precision: Precision) -> bool { array.dtype == other.dtype - && array.left_parts.array_eq(&other.left_parts, precision) + && array.left_parts().array_eq(other.left_parts(), precision) && array .left_parts_dictionary .array_eq(&other.left_parts_dictionary, precision) - && array.right_parts.array_eq(&other.right_parts, precision) + && array.right_parts().array_eq(other.right_parts(), precision) && array.right_bit_width == other.right_bit_width && array .left_parts_patches @@ -162,7 +163,7 @@ impl VTable for ALPRDVTable { right_bit_width: array.right_bit_width() as u32, dict_len: array.left_parts_dictionary().len() as u32, dict, - left_parts_ptype: array.left_parts.dtype().as_ptype() as i32, + left_parts_ptype: array.left_parts().dtype().as_ptype() as i32, patches: array .left_parts_patches() .map(|p| p.to_metadata(array.len(), array.left_parts().dtype())) @@ -255,6 +256,29 @@ impl VTable for ALPRDVTable { ) } + fn nslots(_array: &ALPRDArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &ALPRDArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &ALPRDArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + + fn with_slots(array: &mut ALPRDArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "ALPRDArray expects {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { // Children: left_parts, right_parts, patches (if present): indices, values let patches_info = array @@ -272,12 +296,16 @@ impl VTable for ALPRDVTable { ); let mut children_iter = children.into_iter(); - array.left_parts = children_iter - .next() - .ok_or_else(|| vortex_err!("Expected left_parts child"))?; - array.right_parts = children_iter - .next() - .ok_or_else(|| vortex_err!("Expected right_parts child"))?; + array.slots[LEFT_PARTS_SLOT] = Some( + children_iter + .next() + .ok_or_else(|| vortex_err!("Expected left_parts child"))?, + ); + array.slots[RIGHT_PARTS_SLOT] = Some( + children_iter + .next() + .ok_or_else(|| vortex_err!("Expected right_parts child"))?, + ); if let Some((array_len, offset)) = patches_info { let indices = children_iter @@ -356,13 +384,17 @@ impl VTable for ALPRDVTable { } } +pub(super) const LEFT_PARTS_SLOT: usize = 0; +pub(super) const RIGHT_PARTS_SLOT: usize = 1; +pub(super) const NUM_SLOTS: usize = 2; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["left_parts", "right_parts"]; + #[derive(Clone, Debug)] pub struct ALPRDArray { dtype: DType, - left_parts: ArrayRef, + slots: Vec>, left_parts_patches: Option, left_parts_dictionary: Buffer, - right_parts: ArrayRef, right_bit_width: u8, stats_set: ArrayStats, } @@ -431,9 +463,8 @@ impl ALPRDArray { Ok(Self { dtype, - left_parts, + slots: vec![Some(left_parts), Some(right_parts)], left_parts_dictionary, - right_parts, right_bit_width, left_parts_patches, stats_set: Default::default(), @@ -452,10 +483,9 @@ impl ALPRDArray { ) -> Self { Self { dtype, - left_parts, + slots: vec![Some(left_parts), Some(right_parts)], left_parts_patches, left_parts_dictionary, - right_parts, right_bit_width, stats_set: Default::default(), } @@ -474,12 +504,16 @@ impl ALPRDArray { /// These are bit-packed and dictionary encoded, and cannot directly be interpreted without /// the metadata of this array. pub fn left_parts(&self) -> &ArrayRef { - &self.left_parts + self.slots[LEFT_PARTS_SLOT] + .as_ref() + .vortex_expect("ALPRDArray left_parts slot") } /// The rightmost (least significant) bits of the floating point values stored in the array. pub fn right_parts(&self) -> &ArrayRef { - &self.right_parts + self.slots[RIGHT_PARTS_SLOT] + .as_ref() + .vortex_expect("ALPRDArray right_parts slot") } #[inline] diff --git a/encodings/bytebool/public-api.lock b/encodings/bytebool/public-api.lock index e751eaca6c2..f02d268471c 100644 --- a/encodings/bytebool/public-api.lock +++ b/encodings/bytebool/public-api.lock @@ -122,14 +122,22 @@ pub fn vortex_bytebool::ByteBoolVTable::nbuffers(_array: &vortex_bytebool::ByteB pub fn vortex_bytebool::ByteBoolVTable::nchildren(array: &vortex_bytebool::ByteBoolArray) -> usize +pub fn vortex_bytebool::ByteBoolVTable::nslots(_array: &vortex_bytebool::ByteBoolArray) -> usize + pub fn vortex_bytebool::ByteBoolVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_bytebool::ByteBoolVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_bytebool::ByteBoolVTable::slot(_array: &vortex_bytebool::ByteBoolArray, idx: usize) -> &core::option::Option + +pub fn vortex_bytebool::ByteBoolVTable::slot_name(_array: &vortex_bytebool::ByteBoolArray, idx: usize) -> &str + pub fn vortex_bytebool::ByteBoolVTable::stats(array: &vortex_bytebool::ByteBoolArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_bytebool::ByteBoolVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_bytebool::ByteBoolVTable::with_slots(array: &mut vortex_bytebool::ByteBoolArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_bytebool::ByteBoolVTable pub fn vortex_bytebool::ByteBoolVTable::scalar_at(array: &vortex_bytebool::ByteBoolArray, index: usize) -> vortex_error::VortexResult diff --git a/encodings/bytebool/src/array.rs b/encodings/bytebool/src/array.rs index 8c5c7c9fa31..114f3529d55 100644 --- a/encodings/bytebool/src/array.rs +++ b/encodings/bytebool/src/array.rs @@ -175,6 +175,29 @@ impl VTable for ByteBoolVTable { Ok(()) } + fn nslots(_array: &ByteBoolArray) -> usize { + NUM_SLOTS + } + + fn slot(_array: &ByteBoolArray, idx: usize) -> &Option { + vortex_panic!("ByteBoolArray has no slots, requested index {idx}") + } + + fn slot_name(_array: &ByteBoolArray, idx: usize) -> &str { + let _ = SLOT_NAMES; + vortex_panic!("ByteBoolArray has no slots, requested index {idx}") + } + + fn with_slots(array: &mut ByteBoolArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.is_empty(), + "ByteBoolArray expects 0 slots, got {}", + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn reduce_parent( array: &Self::Array, parent: &ArrayRef, @@ -201,11 +224,15 @@ impl VTable for ByteBoolVTable { } } +pub(super) const NUM_SLOTS: usize = 0; +pub(super) const SLOT_NAMES: [&str; 0] = []; + #[derive(Clone, Debug)] pub struct ByteBoolArray { dtype: DType, buffer: BufferHandle, validity: Validity, + pub(super) slots: Vec>, stats_set: ArrayStats, } @@ -232,6 +259,7 @@ impl ByteBoolArray { dtype: DType::Bool(validity.nullability()), buffer, validity, + slots: vec![], stats_set: Default::default(), } } diff --git a/encodings/datetime-parts/public-api.lock b/encodings/datetime-parts/public-api.lock index 6451e5c99d9..2374e4e96e2 100644 --- a/encodings/datetime-parts/public-api.lock +++ b/encodings/datetime-parts/public-api.lock @@ -196,14 +196,22 @@ pub fn vortex_datetime_parts::DateTimePartsVTable::nbuffers(_array: &vortex_date pub fn vortex_datetime_parts::DateTimePartsVTable::nchildren(_array: &vortex_datetime_parts::DateTimePartsArray) -> usize +pub fn vortex_datetime_parts::DateTimePartsVTable::nslots(_array: &vortex_datetime_parts::DateTimePartsArray) -> usize + pub fn vortex_datetime_parts::DateTimePartsVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_datetime_parts::DateTimePartsVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_datetime_parts::DateTimePartsVTable::slot(array: &vortex_datetime_parts::DateTimePartsArray, idx: usize) -> &core::option::Option + +pub fn vortex_datetime_parts::DateTimePartsVTable::slot_name(_array: &vortex_datetime_parts::DateTimePartsArray, idx: usize) -> &str + pub fn vortex_datetime_parts::DateTimePartsVTable::stats(array: &vortex_datetime_parts::DateTimePartsArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_datetime_parts::DateTimePartsVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_datetime_parts::DateTimePartsVTable::with_slots(array: &mut vortex_datetime_parts::DateTimePartsArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_datetime_parts::DateTimePartsVTable pub fn vortex_datetime_parts::DateTimePartsVTable::scalar_at(array: &vortex_datetime_parts::DateTimePartsArray, index: usize) -> vortex_error::VortexResult diff --git a/encodings/datetime-parts/src/array.rs b/encodings/datetime-parts/src/array.rs index e1f51d5ab66..4b919eb07ee 100644 --- a/encodings/datetime-parts/src/array.rs +++ b/encodings/datetime-parts/src/array.rs @@ -83,7 +83,7 @@ impl VTable for DateTimePartsVTable { } fn len(array: &DateTimePartsArray) -> usize { - array.days.len() + array.days().len() } fn dtype(array: &DateTimePartsArray) -> &DType { @@ -100,9 +100,9 @@ impl VTable for DateTimePartsVTable { precision: Precision, ) { array.dtype.hash(state); - array.days.array_hash(state, precision); - array.seconds.array_hash(state, precision); - array.subseconds.array_hash(state, precision); + array.days().array_hash(state, precision); + array.seconds().array_hash(state, precision); + array.subseconds().array_hash(state, precision); } fn array_eq( @@ -111,9 +111,9 @@ impl VTable for DateTimePartsVTable { precision: Precision, ) -> bool { array.dtype == other.dtype - && array.days.array_eq(&other.days, precision) - && array.seconds.array_eq(&other.seconds, precision) - && array.subseconds.array_eq(&other.subseconds, precision) + && array.days().array_eq(other.days(), precision) + && array.seconds().array_eq(other.seconds(), precision) + && array.subseconds().array_eq(other.subseconds(), precision) } fn nbuffers(_array: &DateTimePartsArray) -> usize { @@ -207,6 +207,32 @@ impl VTable for DateTimePartsVTable { DateTimePartsArray::try_new(dtype.clone(), days, seconds, subseconds) } + fn nslots(_array: &DateTimePartsArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &DateTimePartsArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &DateTimePartsArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + + fn with_slots( + array: &mut DateTimePartsArray, + slots: Vec>, + ) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "DateTimePartsArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 3, @@ -215,9 +241,11 @@ impl VTable for DateTimePartsVTable { ); let mut children_iter = children.into_iter(); - array.days = children_iter.next().vortex_expect("checked"); - array.seconds = children_iter.next().vortex_expect("checked"); - array.subseconds = children_iter.next().vortex_expect("checked"); + array.slots = vec![ + Some(children_iter.next().vortex_expect("days child")), + Some(children_iter.next().vortex_expect("seconds child")), + Some(children_iter.next().vortex_expect("subseconds child")), + ]; Ok(()) } @@ -246,12 +274,16 @@ impl VTable for DateTimePartsVTable { } } +pub(super) const DAYS_SLOT: usize = 0; +pub(super) const SECONDS_SLOT: usize = 1; +pub(super) const SUBSECONDS_SLOT: usize = 2; +pub(super) const NUM_SLOTS: usize = 3; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["days", "seconds", "subseconds"]; + #[derive(Clone, Debug)] pub struct DateTimePartsArray { dtype: DType, - days: ArrayRef, - seconds: ArrayRef, - subseconds: ArrayRef, + pub(super) slots: Vec>, stats_set: ArrayStats, } @@ -303,9 +335,7 @@ impl DateTimePartsArray { Ok(Self { dtype, - days, - seconds, - subseconds, + slots: vec![Some(days), Some(seconds), Some(subseconds)], stats_set: Default::default(), }) } @@ -318,9 +348,7 @@ impl DateTimePartsArray { ) -> Self { Self { dtype, - days, - seconds, - subseconds, + slots: vec![Some(days), Some(seconds), Some(subseconds)], stats_set: Default::default(), } } @@ -328,22 +356,34 @@ impl DateTimePartsArray { pub fn into_parts(self) -> DateTimePartsArrayParts { DateTimePartsArrayParts { dtype: self.dtype, - days: self.days, - seconds: self.seconds, - subseconds: self.subseconds, + days: self.slots[DAYS_SLOT] + .clone() + .vortex_expect("DateTimePartsArray days slot"), + seconds: self.slots[SECONDS_SLOT] + .clone() + .vortex_expect("DateTimePartsArray seconds slot"), + subseconds: self.slots[SUBSECONDS_SLOT] + .clone() + .vortex_expect("DateTimePartsArray subseconds slot"), } } pub fn days(&self) -> &ArrayRef { - &self.days + self.slots[DAYS_SLOT] + .as_ref() + .vortex_expect("DateTimePartsArray days slot") } pub fn seconds(&self) -> &ArrayRef { - &self.seconds + self.slots[SECONDS_SLOT] + .as_ref() + .vortex_expect("DateTimePartsArray seconds slot") } pub fn subseconds(&self) -> &ArrayRef { - &self.subseconds + self.slots[SUBSECONDS_SLOT] + .as_ref() + .vortex_expect("DateTimePartsArray subseconds slot") } } diff --git a/encodings/decimal-byte-parts/public-api.lock b/encodings/decimal-byte-parts/public-api.lock index 6ee1ebc7e5f..ac4812e441f 100644 --- a/encodings/decimal-byte-parts/public-api.lock +++ b/encodings/decimal-byte-parts/public-api.lock @@ -126,14 +126,22 @@ pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::nbuffers(_array: &vort pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::nchildren(_array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> usize +pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::nslots(_array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> usize + pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::slot(array: &vortex_decimal_byte_parts::DecimalBytePartsArray, idx: usize) -> &core::option::Option + +pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::slot_name(_array: &vortex_decimal_byte_parts::DecimalBytePartsArray, idx: usize) -> &str + pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::stats(array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::with_slots(array: &mut vortex_decimal_byte_parts::DecimalBytePartsArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_decimal_byte_parts::DecimalBytePartsVTable pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::scalar_at(array: &vortex_decimal_byte_parts::DecimalBytePartsArray, index: usize) -> vortex_error::VortexResult diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/compare.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/compare.rs index da61d1689c9..d8b953bd9f4 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/compare.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/compare.rs @@ -39,19 +39,21 @@ impl CompareKernel for DecimalBytePartsVTable { }; let nullability = lhs.dtype.nullability() | rhs.dtype().nullability(); - let scalar_type = lhs.msp.dtype().with_nullability(nullability); + let scalar_type = lhs.msp().dtype().with_nullability(nullability); let rhs_decimal = rhs_const .as_decimal() .decimal_value() .vortex_expect("checked for null in entry func"); - match decimal_value_wrapper_to_primitive(rhs_decimal, lhs.msp.as_primitive_typed().ptype()) - { + match decimal_value_wrapper_to_primitive( + rhs_decimal, + lhs.msp().as_primitive_typed().ptype(), + ) { Ok(value) => { let encoded_scalar = Scalar::try_new(scalar_type, Some(value))?; let encoded_const = ConstantArray::new(encoded_scalar, rhs.len()); - lhs.msp + lhs.msp() .binary(encoded_const.into_array(), Operator::from(operator)) .map(Some) } diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/filter.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/filter.rs index be10cf3f882..7c088e0b813 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/filter.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/filter.rs @@ -12,7 +12,7 @@ use crate::DecimalBytePartsVTable; impl FilterReduce for DecimalBytePartsVTable { fn filter(array: &DecimalBytePartsArray, mask: &Mask) -> VortexResult> { - DecimalBytePartsArray::try_new(array.msp.filter(mask.clone())?, *array.decimal_dtype()) + DecimalBytePartsArray::try_new(array.msp().filter(mask.clone())?, *array.decimal_dtype()) .map(|d| Some(d.into_array())) } } diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/is_constant.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/is_constant.rs index 30e00d4bb5b..2d9ec0af9da 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/is_constant.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/is_constant.rs @@ -17,7 +17,7 @@ impl IsConstantKernel for DecimalBytePartsVTable { array: &DecimalBytePartsArray, opts: &IsConstantOpts, ) -> VortexResult> { - is_constant_opts(&array.msp, opts) + is_constant_opts(array.msp(), opts) } } diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/mask.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/mask.rs index 8fd3557499d..cde230333ba 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/mask.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/mask.rs @@ -15,9 +15,9 @@ use crate::DecimalBytePartsVTable; impl MaskReduce for DecimalBytePartsVTable { fn mask(array: &DecimalBytePartsArray, mask: &ArrayRef) -> VortexResult> { let masked_msp = MaskExpr.try_new_array( - array.msp.len(), + array.msp().len(), EmptyOptions, - [array.msp.clone(), mask.clone()], + [array.msp().clone(), mask.clone()], )?; Ok(Some( DecimalBytePartsArray::try_new(masked_msp, *array.decimal_dtype())?.into_array(), diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/take.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/take.rs index bf75bbb4768..13d437c5661 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/take.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/take.rs @@ -17,7 +17,10 @@ impl TakeExecute for DecimalBytePartsVTable { indices: &ArrayRef, _ctx: &mut ExecutionCtx, ) -> VortexResult> { - DecimalBytePartsArray::try_new(array.msp.take(indices.to_array())?, *array.decimal_dtype()) - .map(|a| Some(a.into_array())) + DecimalBytePartsArray::try_new( + array.msp().take(indices.to_array())?, + *array.decimal_dtype(), + ) + .map(|a| Some(a.into_array())) } } diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs index 79e24e1b0cd..1787ab2a690 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs @@ -70,7 +70,7 @@ impl VTable for DecimalBytePartsVTable { } fn len(array: &DecimalBytePartsArray) -> usize { - array.msp.len() + array.msp().len() } fn dtype(array: &DecimalBytePartsArray) -> &DType { @@ -87,7 +87,7 @@ impl VTable for DecimalBytePartsVTable { precision: Precision, ) { array.dtype.hash(state); - array.msp.array_hash(state, precision); + array.msp().array_hash(state, precision); } fn array_eq( @@ -95,7 +95,7 @@ impl VTable for DecimalBytePartsVTable { other: &DecimalBytePartsArray, precision: Precision, ) -> bool { - array.dtype == other.dtype && array.msp.array_eq(&other.msp, precision) + array.dtype == other.dtype && array.msp().array_eq(other.msp(), precision) } fn nbuffers(_array: &DecimalBytePartsArray) -> usize { @@ -116,7 +116,7 @@ impl VTable for DecimalBytePartsVTable { fn child(array: &DecimalBytePartsArray, idx: usize) -> ArrayRef { match idx { - 0 => array.msp.clone(), + 0 => array.msp().clone(), _ => vortex_panic!("DecimalBytePartsArray child index {idx} out of bounds"), } } @@ -130,7 +130,7 @@ impl VTable for DecimalBytePartsVTable { fn metadata(array: &DecimalBytePartsArray) -> VortexResult { Ok(ProstMetadata(DecimalBytesPartsMetadata { - zeroth_child_ptype: PType::try_from(array.msp.dtype())? as i32, + zeroth_child_ptype: PType::try_from(array.msp().dtype())? as i32, lower_part_count: 0, })) } @@ -172,13 +172,39 @@ impl VTable for DecimalBytePartsVTable { DecimalBytePartsArray::try_new(msp, *decimal_dtype) } + fn nslots(_array: &DecimalBytePartsArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &DecimalBytePartsArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &DecimalBytePartsArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + + fn with_slots( + array: &mut DecimalBytePartsArray, + slots: Vec>, + ) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "DecimalBytePartsArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 1, "DecimalBytePartsArray expects exactly 1 child (msp), got {}", children.len() ); - array.msp = children.into_iter().next().vortex_expect("checked"); + array.slots = vec![Some(children.into_iter().next().vortex_expect("checked"))]; Ok(()) } @@ -204,6 +230,10 @@ impl VTable for DecimalBytePartsVTable { } } +pub(super) const MSP_SLOT: usize = 0; +pub(super) const NUM_SLOTS: usize = 1; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["msp"]; + /// This array encodes decimals as between 1-4 columns of primitive typed children. /// The most significant part (msp) sorting the most significant decimal bits. /// This array must be signed and is nullable iff the decimal is nullable. @@ -211,7 +241,7 @@ impl VTable for DecimalBytePartsVTable { /// e.g. for a decimal i128 \[ 127..64 | 64..0 \] msp = 127..64 and lower_part\[0\] = 64..0 #[derive(Clone, Debug)] pub struct DecimalBytePartsArray { - msp: ArrayRef, + pub(super) slots: Vec>, // NOTE: the lower_parts is currently unused, we reserve this field so that it is properly // read/written during serde, but provide no constructor to initialize this to anything // other than the empty Vec. @@ -234,7 +264,7 @@ impl DecimalBytePartsArray { let nullable = msp.dtype().nullability(); Ok(Self { - msp, + slots: vec![Some(msp)], _lower_parts: Vec::new(), dtype: DType::Decimal(decimal_dtype, nullable), stats_set: Default::default(), @@ -244,7 +274,7 @@ impl DecimalBytePartsArray { pub(crate) unsafe fn new_unchecked(msp: ArrayRef, decimal_dtype: DecimalDType) -> Self { let nullable = msp.dtype().nullability(); Self { - msp, + slots: vec![Some(msp)], _lower_parts: Vec::new(), dtype: DType::Decimal(decimal_dtype, nullable), stats_set: Default::default(), @@ -254,7 +284,9 @@ impl DecimalBytePartsArray { /// If `_lower_parts` is supported check all calls use this correctly. pub fn into_parts(self) -> DecimalBytePartsArrayParts { DecimalBytePartsArrayParts { - msp: self.msp, + msp: self.slots[MSP_SLOT] + .clone() + .vortex_expect("DecimalBytePartsArray msp slot"), dtype: self.dtype, } } @@ -266,7 +298,9 @@ impl DecimalBytePartsArray { } pub(crate) fn msp(&self) -> &ArrayRef { - &self.msp + self.slots[MSP_SLOT] + .as_ref() + .vortex_expect("DecimalBytePartsArray msp slot") } } @@ -283,7 +317,7 @@ fn to_canonical_decimal( ctx: &mut ExecutionCtx, ) -> VortexResult { // TODO(joe): support parts len != 1 - let prim = array.msp.clone().execute::(ctx)?; + let prim = array.msp().clone().execute::(ctx)?; // Depending on the decimal type and the min/max of the primitive array we can choose // the correct buffer size @@ -304,7 +338,7 @@ fn to_canonical_decimal( impl OperationsVTable for DecimalBytePartsVTable { fn scalar_at(array: &DecimalBytePartsArray, index: usize) -> VortexResult { // TODO(joe): support parts len != 1 - let scalar = array.msp.scalar_at(index)?; + let scalar = array.msp().scalar_at(index)?; // Note. values in msp, can only be signed integers upto size i64. let primitive_scalar = scalar.as_primitive(); @@ -320,7 +354,7 @@ impl OperationsVTable for DecimalBytePartsVTable { impl ValidityChild for DecimalBytePartsVTable { fn validity_child(array: &DecimalBytePartsArray) -> &ArrayRef { // validity stored in 0th child - &array.msp + array.msp() } } diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/rules.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/rules.rs index 14bf0a076d9..b673ef2efa8 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/rules.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/rules.rs @@ -43,7 +43,7 @@ impl ArrayParentReduceRule for DecimalBytePartsFilterPus return Ok(None); } - let new_msp = child.msp.filter(parent.filter_mask().clone())?; + let new_msp = child.msp().filter(parent.filter_mask().clone())?; let new_child = DecimalBytePartsArray::try_new(new_msp, *child.decimal_dtype())?.into_array(); Ok(Some(new_child)) diff --git a/encodings/fastlanes/public-api.lock b/encodings/fastlanes/public-api.lock index 6c84558c737..d7a44b8b886 100644 --- a/encodings/fastlanes/public-api.lock +++ b/encodings/fastlanes/public-api.lock @@ -256,14 +256,22 @@ pub fn vortex_fastlanes::BitPackedVTable::nbuffers(_array: &vortex_fastlanes::Bi pub fn vortex_fastlanes::BitPackedVTable::nchildren(array: &vortex_fastlanes::BitPackedArray) -> usize +pub fn vortex_fastlanes::BitPackedVTable::nslots(_array: &vortex_fastlanes::BitPackedArray) -> usize + pub fn vortex_fastlanes::BitPackedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::BitPackedVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_fastlanes::BitPackedVTable::slot(_array: &vortex_fastlanes::BitPackedArray, idx: usize) -> &core::option::Option + +pub fn vortex_fastlanes::BitPackedVTable::slot_name(_array: &vortex_fastlanes::BitPackedArray, idx: usize) -> &str + pub fn vortex_fastlanes::BitPackedVTable::stats(array: &vortex_fastlanes::BitPackedArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_fastlanes::BitPackedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::BitPackedVTable::with_slots(array: &mut vortex_fastlanes::BitPackedArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_fastlanes::BitPackedVTable pub fn vortex_fastlanes::BitPackedVTable::scalar_at(array: &vortex_fastlanes::BitPackedArray, index: usize) -> vortex_error::VortexResult @@ -384,14 +392,22 @@ pub fn vortex_fastlanes::DeltaVTable::nbuffers(_array: &vortex_fastlanes::DeltaA pub fn vortex_fastlanes::DeltaVTable::nchildren(_array: &vortex_fastlanes::DeltaArray) -> usize +pub fn vortex_fastlanes::DeltaVTable::nslots(_array: &vortex_fastlanes::DeltaArray) -> usize + pub fn vortex_fastlanes::DeltaVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::DeltaVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_fastlanes::DeltaVTable::slot(array: &vortex_fastlanes::DeltaArray, idx: usize) -> &core::option::Option + +pub fn vortex_fastlanes::DeltaVTable::slot_name(_array: &vortex_fastlanes::DeltaArray, idx: usize) -> &str + pub fn vortex_fastlanes::DeltaVTable::stats(array: &vortex_fastlanes::DeltaArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_fastlanes::DeltaVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::DeltaVTable::with_slots(array: &mut vortex_fastlanes::DeltaArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_fastlanes::DeltaVTable pub fn vortex_fastlanes::DeltaVTable::scalar_at(array: &vortex_fastlanes::DeltaArray, index: usize) -> vortex_error::VortexResult @@ -524,14 +540,22 @@ pub fn vortex_fastlanes::FoRVTable::nbuffers(_array: &vortex_fastlanes::FoRArray pub fn vortex_fastlanes::FoRVTable::nchildren(_array: &vortex_fastlanes::FoRArray) -> usize +pub fn vortex_fastlanes::FoRVTable::nslots(_array: &vortex_fastlanes::FoRArray) -> usize + pub fn vortex_fastlanes::FoRVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::FoRVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_fastlanes::FoRVTable::slot(array: &vortex_fastlanes::FoRArray, idx: usize) -> &core::option::Option + +pub fn vortex_fastlanes::FoRVTable::slot_name(_array: &vortex_fastlanes::FoRArray, idx: usize) -> &str + pub fn vortex_fastlanes::FoRVTable::stats(array: &vortex_fastlanes::FoRArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_fastlanes::FoRVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::FoRVTable::with_slots(array: &mut vortex_fastlanes::FoRArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_fastlanes::FoRVTable pub fn vortex_fastlanes::FoRVTable::scalar_at(array: &vortex_fastlanes::FoRArray, index: usize) -> vortex_error::VortexResult @@ -660,14 +684,22 @@ pub fn vortex_fastlanes::RLEVTable::nbuffers(_array: &vortex_fastlanes::RLEArray pub fn vortex_fastlanes::RLEVTable::nchildren(_array: &vortex_fastlanes::RLEArray) -> usize +pub fn vortex_fastlanes::RLEVTable::nslots(array: &vortex_fastlanes::RLEArray) -> usize + pub fn vortex_fastlanes::RLEVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::RLEVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_fastlanes::RLEVTable::slot(array: &vortex_fastlanes::RLEArray, idx: usize) -> &core::option::Option + +pub fn vortex_fastlanes::RLEVTable::slot_name(_array: &vortex_fastlanes::RLEArray, idx: usize) -> &str + pub fn vortex_fastlanes::RLEVTable::stats(array: &vortex_fastlanes::RLEArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_fastlanes::RLEVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::RLEVTable::with_slots(array: &mut vortex_fastlanes::RLEArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_fastlanes::RLEVTable pub fn vortex_fastlanes::RLEVTable::scalar_at(array: &vortex_fastlanes::RLEArray, index: usize) -> vortex_error::VortexResult diff --git a/encodings/fastlanes/src/bitpacking/array/mod.rs b/encodings/fastlanes/src/bitpacking/array/mod.rs index cffeac17090..42461b710ac 100644 --- a/encodings/fastlanes/src/bitpacking/array/mod.rs +++ b/encodings/fastlanes/src/bitpacking/array/mod.rs @@ -23,6 +23,9 @@ use crate::bitpack_compress::bitpack_encode; use crate::unpack_iter::BitPacked; use crate::unpack_iter::BitUnpackedChunks; +pub(super) const NUM_SLOTS: usize = 0; +pub(super) const SLOT_NAMES: [&str; 0] = []; + pub struct BitPackedArrayParts { pub offset: u16, pub bit_width: u8, @@ -34,6 +37,7 @@ pub struct BitPackedArrayParts { #[derive(Clone, Debug)] pub struct BitPackedArray { + pub(super) slots: Vec>, /// The offset within the first block (created with a slice). /// 0 <= offset < 1024 pub(super) offset: u16, @@ -77,6 +81,7 @@ impl BitPackedArray { offset: u16, ) -> Self { Self { + slots: vec![], offset, len, dtype, diff --git a/encodings/fastlanes/src/bitpacking/vtable/mod.rs b/encodings/fastlanes/src/bitpacking/vtable/mod.rs index facb2aa5a4f..1ad996de261 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/mod.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/mod.rs @@ -43,6 +43,8 @@ use vortex_session::VortexSession; use crate::BitPackedArray; use crate::bitpack_decompress::unpack_array; use crate::bitpack_decompress::unpack_into_primitive_builder; +use crate::bitpacking::array::NUM_SLOTS; +use crate::bitpacking::array::SLOT_NAMES; use crate::bitpacking::vtable::kernels::PARENT_KERNELS; use crate::bitpacking::vtable::rules::RULES; mod kernels; @@ -235,6 +237,30 @@ impl VTable for BitPackedVTable { Ok(()) } + fn nslots(_array: &BitPackedArray) -> usize { + NUM_SLOTS + } + + fn slot(_array: &BitPackedArray, idx: usize) -> &Option { + let _ = SLOT_NAMES; + vortex_panic!("BitPackedArray has no slots, requested index {idx}") + } + + fn slot_name(_array: &BitPackedArray, idx: usize) -> &str { + let _ = SLOT_NAMES; + vortex_panic!("BitPackedArray has no slots, requested index {idx}") + } + + fn with_slots(array: &mut BitPackedArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.is_empty(), + "BitPackedArray expects 0 slots, got {}", + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn metadata(array: &BitPackedArray) -> VortexResult { Ok(ProstMetadata(BitPackedMetadata { bit_width: array.bit_width() as u32, diff --git a/encodings/fastlanes/src/delta/array/mod.rs b/encodings/fastlanes/src/delta/array/mod.rs index 66e3208c926..1ef57f3b9e5 100644 --- a/encodings/fastlanes/src/delta/array/mod.rs +++ b/encodings/fastlanes/src/delta/array/mod.rs @@ -19,6 +19,11 @@ use vortex_error::vortex_bail; pub mod delta_compress; pub mod delta_decompress; +pub(super) const BASES_SLOT: usize = 0; +pub(super) const DELTAS_SLOT: usize = 1; +pub(super) const NUM_SLOTS: usize = 2; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["bases", "deltas"]; + /// A FastLanes-style delta-encoded array of primitive values. /// /// A [`DeltaArray`] comprises a sequence of _chunks_ each representing 1,024 delta-encoded values, @@ -58,8 +63,7 @@ pub struct DeltaArray { pub(super) offset: usize, pub(super) len: usize, pub(super) dtype: DType, - pub(super) bases: ArrayRef, - pub(super) deltas: ArrayRef, + pub(super) slots: Vec>, pub(super) stats_set: ArrayStats, } @@ -141,24 +145,28 @@ impl DeltaArray { offset: usize, logical_len: usize, ) -> Self { + let dtype = bases.dtype().with_nullability(deltas.dtype().nullability()); Self { offset, len: logical_len, - dtype: bases.dtype().with_nullability(deltas.dtype().nullability()), - bases, - deltas, + dtype, + slots: vec![Some(bases), Some(deltas)], stats_set: Default::default(), } } #[inline] pub fn bases(&self) -> &ArrayRef { - &self.bases + self.slots[BASES_SLOT] + .as_ref() + .vortex_expect("DeltaArray bases slot") } #[inline] pub fn deltas(&self) -> &ArrayRef { - &self.deltas + self.slots[DELTAS_SLOT] + .as_ref() + .vortex_expect("DeltaArray deltas slot") } #[inline] @@ -191,12 +199,12 @@ impl DeltaArray { #[inline] pub(crate) fn bases_len(&self) -> usize { - self.bases.len() + self.bases().len() } #[inline] pub(crate) fn deltas_len(&self) -> usize { - self.deltas.len() + self.deltas().len() } #[inline] diff --git a/encodings/fastlanes/src/delta/vtable/mod.rs b/encodings/fastlanes/src/delta/vtable/mod.rs index 5bf67a561c5..9ee6b96e5a2 100644 --- a/encodings/fastlanes/src/delta/vtable/mod.rs +++ b/encodings/fastlanes/src/delta/vtable/mod.rs @@ -23,6 +23,7 @@ use vortex_array::vtable; use vortex_array::vtable::ArrayId; use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityVTableFromChildSliceHelper; +use vortex_error::VortexExpect as _; use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_err; @@ -30,6 +31,8 @@ use vortex_error::vortex_panic; use vortex_session::VortexSession; use crate::DeltaArray; +use crate::delta::array::NUM_SLOTS; +use crate::delta::array::SLOT_NAMES; use crate::delta::array::delta_decompress::delta_decompress; mod operations; @@ -128,19 +131,41 @@ impl VTable for DeltaVTable { rules::RULES.evaluate(array, parent, child_idx) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - // DeltaArray children order (from visit_children): - // 1. bases - // 2. deltas + fn nslots(_array: &DeltaArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &DeltaArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &DeltaArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + fn with_slots(array: &mut DeltaArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "DeltaArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 2, "Expected 2 children for Delta encoding, got {}", children.len() ); - array.bases = children[0].clone(); - array.deltas = children[1].clone(); + let mut children_iter = children.into_iter(); + array.slots = vec![ + Some(children_iter.next().vortex_expect("bases child")), + Some(children_iter.next().vortex_expect("deltas child")), + ]; Ok(()) } diff --git a/encodings/fastlanes/src/for/array/mod.rs b/encodings/fastlanes/src/for/array/mod.rs index 18f4e6ee415..507efb8fd32 100644 --- a/encodings/fastlanes/src/for/array/mod.rs +++ b/encodings/fastlanes/src/for/array/mod.rs @@ -5,19 +5,24 @@ use vortex_array::ArrayRef; use vortex_array::dtype::PType; use vortex_array::scalar::Scalar; use vortex_array::stats::ArrayStats; +use vortex_error::VortexExpect as _; use vortex_error::VortexResult; use vortex_error::vortex_bail; pub mod for_compress; pub mod for_decompress; +pub(super) const ENCODED_SLOT: usize = 0; +pub(super) const NUM_SLOTS: usize = 1; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["encoded"]; + /// Frame of Reference (FoR) encoded array. /// /// This encoding stores values as offsets from a reference value, which can significantly reduce /// storage requirements when values are clustered around a specific point. #[derive(Clone, Debug)] pub struct FoRArray { - pub(super) encoded: ArrayRef, + pub(super) slots: Vec>, pub(super) reference: Scalar, pub(super) stats_set: ArrayStats, } @@ -34,7 +39,7 @@ impl FoRArray { )?; Ok(Self { - encoded, + slots: vec![Some(encoded)], reference, stats_set: Default::default(), }) @@ -42,7 +47,7 @@ impl FoRArray { pub(crate) unsafe fn new_unchecked(encoded: ArrayRef, reference: Scalar) -> Self { Self { - encoded, + slots: vec![Some(encoded)], reference, stats_set: Default::default(), } @@ -55,7 +60,9 @@ impl FoRArray { #[inline] pub fn encoded(&self) -> &ArrayRef { - &self.encoded + self.slots[ENCODED_SLOT] + .as_ref() + .vortex_expect("FoRArray encoded slot") } #[inline] diff --git a/encodings/fastlanes/src/for/vtable/mod.rs b/encodings/fastlanes/src/for/vtable/mod.rs index 1560c721e21..0b1525250a4 100644 --- a/encodings/fastlanes/src/for/vtable/mod.rs +++ b/encodings/fastlanes/src/for/vtable/mod.rs @@ -21,6 +21,7 @@ use vortex_array::vtable; use vortex_array::vtable::ArrayId; use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityVTableFromChild; +use vortex_error::VortexExpect as _; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -28,6 +29,8 @@ use vortex_error::vortex_panic; use vortex_session::VortexSession; use crate::FoRArray; +use crate::r#for::array::NUM_SLOTS; +use crate::r#for::array::SLOT_NAMES; use crate::r#for::array::for_decompress::decompress; use crate::r#for::vtable::kernels::PARENT_KERNELS; use crate::r#for::vtable::rules::PARENT_RULES; @@ -104,17 +107,39 @@ impl VTable for FoRVTable { } } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - // FoRArray children order (from visit_children): - // 1. encoded + fn nslots(_array: &FoRArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &FoRArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &FoRArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + fn with_slots(array: &mut FoRArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "FoRArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 1, "Expected 1 child for FoR encoding, got {}", children.len() ); - array.encoded = children[0].clone(); + array.slots = vec![Some( + children.into_iter().next().vortex_expect("encoded child"), + )]; Ok(()) } diff --git a/encodings/fastlanes/src/for/vtable/rules.rs b/encodings/fastlanes/src/for/vtable/rules.rs index a7f3650659a..1aacbbe83d9 100644 --- a/encodings/fastlanes/src/for/vtable/rules.rs +++ b/encodings/fastlanes/src/for/vtable/rules.rs @@ -38,8 +38,8 @@ impl ArrayParentReduceRule for FoRFilterPushDownRule { ) -> VortexResult> { let new_array = unsafe { FoRArray::new_unchecked( - child.encoded.filter(parent.filter_mask().clone())?, - child.reference.clone(), + child.encoded().filter(parent.filter_mask().clone())?, + child.reference_scalar().clone(), ) }; Ok(Some(new_array.into_array())) diff --git a/encodings/fastlanes/src/rle/array/mod.rs b/encodings/fastlanes/src/rle/array/mod.rs index 83f75ad45ae..bd7ab8f4bfe 100644 --- a/encodings/fastlanes/src/rle/array/mod.rs +++ b/encodings/fastlanes/src/rle/array/mod.rs @@ -6,6 +6,7 @@ use vortex_array::DynArray; use vortex_array::dtype::DType; use vortex_array::dtype::PType; use vortex_array::stats::ArrayStats; +use vortex_error::VortexExpect as _; use vortex_error::VortexResult; use vortex_error::vortex_ensure; @@ -14,24 +15,16 @@ use crate::FL_CHUNK_SIZE; pub mod rle_compress; pub mod rle_decompress; +pub(super) const VALUES_SLOT: usize = 0; +pub(super) const INDICES_SLOT: usize = 1; +pub(super) const VALUES_IDX_OFFSETS_SLOT: usize = 2; +pub(super) const NUM_SLOTS: usize = 3; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["values", "indices", "values_idx_offsets"]; + #[derive(Clone, Debug)] pub struct RLEArray { pub(super) dtype: DType, - /// Run value in the dictionary. - pub(super) values: ArrayRef, - /// Chunk-local indices from all chunks. The start of each chunk is looked up in `values_idx_offsets`. - pub(super) indices: ArrayRef, - /// Index start positions of each value chunk. - /// - /// # Example - /// ``` - /// // Chunk 0: [10, 20] (starts at index 0) - /// // Chunk 1: [30, 40] (starts at index 2) - /// let values = [10, 20, 30, 40]; // Global values array - /// let values_idx_offsets = [0, 2]; // Chunk 0 starts at index 0, Chunk 1 starts at index 2 - /// ``` - pub(super) values_idx_offsets: ArrayRef, - + pub(super) slots: Vec>, pub(super) stats_set: ArrayStats, // Offset relative to the start of the chunk. pub(super) offset: usize, @@ -109,9 +102,7 @@ impl RLEArray { Ok(Self { dtype, - values, - indices, - values_idx_offsets, + slots: vec![Some(values), Some(indices), Some(values_idx_offsets)], stats_set: ArrayStats::default(), offset, length, @@ -137,9 +128,7 @@ impl RLEArray { ) -> Self { Self { dtype, - values, - indices, - values_idx_offsets, + slots: vec![Some(values), Some(indices), Some(values_idx_offsets)], stats_set: ArrayStats::default(), offset, length, @@ -163,17 +152,23 @@ impl RLEArray { #[inline] pub fn values(&self) -> &ArrayRef { - &self.values + self.slots[VALUES_SLOT] + .as_ref() + .vortex_expect("RLEArray values slot must be populated") } #[inline] pub fn indices(&self) -> &ArrayRef { - &self.indices + self.slots[INDICES_SLOT] + .as_ref() + .vortex_expect("RLEArray indices slot must be populated") } #[inline] pub fn values_idx_offsets(&self) -> &ArrayRef { - &self.values_idx_offsets + self.slots[VALUES_IDX_OFFSETS_SLOT] + .as_ref() + .vortex_expect("RLEArray values_idx_offsets slot must be populated") } /// Values index offset relative to the first chunk. @@ -186,14 +181,14 @@ impl RLEArray { reason = "expect is safe here as scalar_at returns a valid primitive" )] pub(crate) fn values_idx_offset(&self, chunk_idx: usize) -> usize { - self.values_idx_offsets + self.values_idx_offsets() .scalar_at(chunk_idx) .expect("index must be in bounds") .as_primitive() .as_::() .expect("index must be of type usize") - self - .values_idx_offsets + .values_idx_offsets() .scalar_at(0) .expect("index must be in bounds") .as_primitive() diff --git a/encodings/fastlanes/src/rle/vtable/mod.rs b/encodings/fastlanes/src/rle/vtable/mod.rs index ab12a22294d..b255fc1e7a1 100644 --- a/encodings/fastlanes/src/rle/vtable/mod.rs +++ b/encodings/fastlanes/src/rle/vtable/mod.rs @@ -141,21 +141,37 @@ impl VTable for RLEVTable { } fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - // RLEArray children order (from visit_children): - // 1. values - // 2. indices - // 3. values_idx_offsets - vortex_ensure!( children.len() == 3, "Expected 3 children for RLE encoding, got {}", children.len() ); - array.values = children[0].clone(); - array.indices = children[1].clone(); - array.values_idx_offsets = children[2].clone(); + array.slots = children.into_iter().map(Some).collect(); + + Ok(()) + } + + fn nslots(array: &RLEArray) -> usize { + array.slots.len() + } + + fn slot(array: &RLEArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &RLEArray, idx: usize) -> &str { + crate::rle::array::SLOT_NAMES[idx] + } + fn with_slots(array: &mut RLEArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == crate::rle::array::NUM_SLOTS, + "RLEArray expects {} slots, got {}", + crate::rle::array::NUM_SLOTS, + slots.len() + ); + array.slots = slots; Ok(()) } diff --git a/encodings/fsst/public-api.lock b/encodings/fsst/public-api.lock index 95ba95464c7..8d204b1cc0c 100644 --- a/encodings/fsst/public-api.lock +++ b/encodings/fsst/public-api.lock @@ -160,14 +160,22 @@ pub fn vortex_fsst::FSSTVTable::nbuffers(_array: &vortex_fsst::FSSTArray) -> usi pub fn vortex_fsst::FSSTVTable::nchildren(array: &vortex_fsst::FSSTArray) -> usize +pub fn vortex_fsst::FSSTVTable::nslots(_array: &vortex_fsst::FSSTArray) -> usize + pub fn vortex_fsst::FSSTVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fsst::FSSTVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_fsst::FSSTVTable::slot(array: &vortex_fsst::FSSTArray, idx: usize) -> &core::option::Option + +pub fn vortex_fsst::FSSTVTable::slot_name(_array: &vortex_fsst::FSSTArray, idx: usize) -> &str + pub fn vortex_fsst::FSSTVTable::stats(array: &vortex_fsst::FSSTArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_fsst::FSSTVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fsst::FSSTVTable::with_slots(array: &mut vortex_fsst::FSSTArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_fsst::FSSTVTable pub fn vortex_fsst::FSSTVTable::scalar_at(array: &vortex_fsst::FSSTArray, index: usize) -> vortex_error::VortexResult diff --git a/encodings/fsst/src/array.rs b/encodings/fsst/src/array.rs index 2f10b0b1a47..9712bc99ae9 100644 --- a/encodings/fsst/src/array.rs +++ b/encodings/fsst/src/array.rs @@ -44,6 +44,7 @@ use vortex_array::vtable::validity_nchildren; use vortex_array::vtable::validity_to_child; use vortex_buffer::Buffer; use vortex_buffer::ByteBuffer; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -102,7 +103,7 @@ impl VTable for FSSTVTable { array.symbols.array_hash(state, precision); array.symbol_lengths.array_hash(state, precision); array.codes.as_ref().array_hash(state, precision); - array.uncompressed_lengths.array_hash(state, precision); + array.uncompressed_lengths().array_hash(state, precision); } fn array_eq(array: &FSSTArray, other: &FSSTArray, precision: Precision) -> bool { @@ -116,8 +117,8 @@ impl VTable for FSSTVTable { .as_ref() .array_eq(other.codes.as_ref(), precision) && array - .uncompressed_lengths - .array_eq(&other.uncompressed_lengths, precision) + .uncompressed_lengths() + .array_eq(other.uncompressed_lengths(), precision) } fn nbuffers(_array: &FSSTArray) -> usize { @@ -308,6 +309,29 @@ impl VTable for FSSTVTable { ); } + fn nslots(_array: &FSSTArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &FSSTArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &FSSTArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + + fn with_slots(array: &mut FSSTArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "FSSTArray expects {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 2, @@ -334,7 +358,7 @@ impl VTable for FSSTVTable { .ok_or_else(|| vortex_err!("FSSTArray with_children missing uncompressed_lengths"))?; array.codes = codes; - array.uncompressed_lengths = uncompressed_lengths; + array.slots[UNCOMPRESSED_LENGTHS_SLOT] = Some(uncompressed_lengths); Ok(()) } @@ -361,6 +385,10 @@ impl VTable for FSSTVTable { } } +pub(crate) const UNCOMPRESSED_LENGTHS_SLOT: usize = 0; +pub(crate) const NUM_SLOTS: usize = 1; +pub(crate) const SLOT_NAMES: [&str; NUM_SLOTS] = ["uncompressed_lengths"]; + #[derive(Clone)] pub struct FSSTArray { dtype: DType, @@ -370,7 +398,7 @@ pub struct FSSTArray { /// NOTE(ngates): this === codes, but is stored as an ArrayRef so we can return &ArrayRef! codes_array: ArrayRef, /// Lengths of the original values before compression, can be compressed. - uncompressed_lengths: ArrayRef, + slots: Vec>, stats_set: ArrayStats, /// Memoized compressor used for push-down of compute by compressing the RHS. @@ -384,7 +412,7 @@ impl Debug for FSSTArray { .field("symbols", &self.symbols) .field("symbol_lengths", &self.symbol_lengths) .field("codes", &self.codes) - .field("uncompressed_lengths", &self.uncompressed_lengths) + .field("uncompressed_lengths", self.uncompressed_lengths()) .finish() } } @@ -466,7 +494,7 @@ impl FSSTArray { symbol_lengths, codes, codes_array, - uncompressed_lengths, + slots: vec![Some(uncompressed_lengths)], stats_set: Default::default(), compressor, } @@ -495,13 +523,15 @@ impl FSSTArray { /// Get the uncompressed length for each element in the array. pub fn uncompressed_lengths(&self) -> &ArrayRef { - &self.uncompressed_lengths + self.slots[UNCOMPRESSED_LENGTHS_SLOT] + .as_ref() + .vortex_expect("FSSTArray uncompressed_lengths slot") } /// Get the DType of the uncompressed lengths array #[inline] pub fn uncompressed_lengths_dtype(&self) -> &DType { - self.uncompressed_lengths.dtype() + self.uncompressed_lengths().dtype() } /// Build a [`Decompressor`][fsst::Decompressor] that can be used to decompress values from diff --git a/encodings/pco/public-api.lock b/encodings/pco/public-api.lock index 2931d32021b..5c091bf4b2e 100644 --- a/encodings/pco/public-api.lock +++ b/encodings/pco/public-api.lock @@ -172,14 +172,22 @@ pub fn vortex_pco::PcoVTable::nbuffers(array: &vortex_pco::PcoArray) -> usize pub fn vortex_pco::PcoVTable::nchildren(array: &vortex_pco::PcoArray) -> usize +pub fn vortex_pco::PcoVTable::nslots(_array: &vortex_pco::PcoArray) -> usize + pub fn vortex_pco::PcoVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_pco::PcoVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_pco::PcoVTable::slot(_array: &vortex_pco::PcoArray, idx: usize) -> &core::option::Option + +pub fn vortex_pco::PcoVTable::slot_name(_array: &vortex_pco::PcoArray, idx: usize) -> &str + pub fn vortex_pco::PcoVTable::stats(array: &vortex_pco::PcoArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_pco::PcoVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_pco::PcoVTable::with_slots(array: &mut vortex_pco::PcoArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_pco::PcoVTable pub fn vortex_pco::PcoVTable::scalar_at(array: &vortex_pco::PcoArray, index: usize) -> vortex_error::VortexResult diff --git a/encodings/pco/src/array.rs b/encodings/pco/src/array.rs index 4b87e49eb70..bccba3ea53d 100644 --- a/encodings/pco/src/array.rs +++ b/encodings/pco/src/array.rs @@ -263,6 +263,29 @@ impl VTable for PcoVTable { Ok(()) } + fn nslots(_array: &PcoArray) -> usize { + NUM_SLOTS + } + + fn slot(_array: &PcoArray, idx: usize) -> &Option { + vortex_panic!("PcoArray has no slots, requested index {idx}") + } + + fn slot_name(_array: &PcoArray, idx: usize) -> &str { + let _ = SLOT_NAMES; + vortex_panic!("PcoArray has no slots, requested index {idx}") + } + + fn with_slots(array: &mut PcoArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.is_empty(), + "PcoArray expects 0 slots, got {}", + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn execute(array: &Self::Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionStep::Done(array.decompress()?.into_array())) } @@ -313,6 +336,9 @@ impl PcoVTable { pub const ID: ArrayId = ArrayId::new_ref("vortex.pco"); } +pub(super) const NUM_SLOTS: usize = 0; +pub(super) const SLOT_NAMES: [&str; 0] = []; + #[derive(Clone, Debug)] pub struct PcoArray { pub(crate) chunk_metas: Vec, @@ -321,6 +347,7 @@ pub struct PcoArray { dtype: DType, pub(crate) unsliced_validity: Validity, unsliced_n_rows: usize, + pub(super) slots: Vec>, stats_set: ArrayStats, slice_start: usize, slice_stop: usize, @@ -342,6 +369,7 @@ impl PcoArray { dtype, unsliced_validity: validity, unsliced_n_rows: len, + slots: vec![], stats_set: Default::default(), slice_start: 0, slice_stop: len, diff --git a/encodings/runend/public-api.lock b/encodings/runend/public-api.lock index 4f9516a32fc..18398e75237 100644 --- a/encodings/runend/public-api.lock +++ b/encodings/runend/public-api.lock @@ -196,14 +196,22 @@ pub fn vortex_runend::RunEndVTable::nbuffers(_array: &vortex_runend::RunEndArray pub fn vortex_runend::RunEndVTable::nchildren(_array: &vortex_runend::RunEndArray) -> usize +pub fn vortex_runend::RunEndVTable::nslots(_array: &vortex_runend::RunEndArray) -> usize + pub fn vortex_runend::RunEndVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_runend::RunEndVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_runend::RunEndVTable::slot(array: &vortex_runend::RunEndArray, idx: usize) -> &core::option::Option + +pub fn vortex_runend::RunEndVTable::slot_name(_array: &vortex_runend::RunEndArray, idx: usize) -> &str + pub fn vortex_runend::RunEndVTable::stats(array: &vortex_runend::RunEndArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_runend::RunEndVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_runend::RunEndVTable::with_slots(array: &mut vortex_runend::RunEndArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_runend::RunEndVTable pub fn vortex_runend::RunEndVTable::scalar_at(array: &vortex_runend::RunEndArray, index: usize) -> vortex_error::VortexResult diff --git a/encodings/runend/src/array.rs b/encodings/runend/src/array.rs index f943b747cda..09f5ec2368c 100644 --- a/encodings/runend/src/array.rs +++ b/encodings/runend/src/array.rs @@ -74,7 +74,7 @@ impl VTable for RunEndVTable { } fn dtype(array: &RunEndArray) -> &DType { - array.values.dtype() + array.values().dtype() } fn stats(array: &RunEndArray) -> StatsSetRef<'_> { @@ -82,15 +82,15 @@ impl VTable for RunEndVTable { } fn array_hash(array: &RunEndArray, state: &mut H, precision: Precision) { - array.ends.array_hash(state, precision); - array.values.array_hash(state, precision); + array.ends().array_hash(state, precision); + array.values().array_hash(state, precision); array.offset.hash(state); array.length.hash(state); } fn array_eq(array: &RunEndArray, other: &RunEndArray, precision: Precision) -> bool { - array.ends.array_eq(&other.ends, precision) - && array.values.array_eq(&other.values, precision) + array.ends().array_eq(other.ends(), precision) + && array.values().array_eq(other.values(), precision) && array.offset == other.offset && array.length == other.length } @@ -172,6 +172,29 @@ impl VTable for RunEndVTable { ) } + fn nslots(_array: &RunEndArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &RunEndArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &RunEndArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + + fn with_slots(array: &mut RunEndArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "RunEndArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 2, @@ -180,8 +203,10 @@ impl VTable for RunEndVTable { ); let mut children_iter = children.into_iter(); - array.ends = children_iter.next().vortex_expect("ends child"); - array.values = children_iter.next().vortex_expect("values child"); + array.slots = vec![ + Some(children_iter.next().vortex_expect("ends child")), + Some(children_iter.next().vortex_expect("values child")), + ]; Ok(()) } @@ -208,10 +233,14 @@ impl VTable for RunEndVTable { } } +pub(super) const ENDS_SLOT: usize = 0; +pub(super) const VALUES_SLOT: usize = 1; +pub(super) const NUM_SLOTS: usize = 2; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["ends", "values"]; + #[derive(Clone, Debug)] pub struct RunEndArray { - ends: ArrayRef, - values: ArrayRef, + pub(super) slots: Vec>, offset: usize, length: usize, stats_set: ArrayStats, @@ -362,8 +391,7 @@ impl RunEndArray { Self::validate(&ends, &values, offset, length)?; Ok(Self { - ends, - values, + slots: vec![Some(ends), Some(values)], offset, length, stats_set: Default::default(), @@ -385,8 +413,7 @@ impl RunEndArray { length: usize, ) -> Self { Self { - ends, - values, + slots: vec![Some(ends), Some(values)], offset, length, stats_set: Default::default(), @@ -437,7 +464,9 @@ impl RunEndArray { /// at `ends[i]` (inclusive) and terminating at `ends[i+1]` (exclusive). #[inline] pub fn ends(&self) -> &ArrayRef { - &self.ends + self.slots[ENDS_SLOT] + .as_ref() + .vortex_expect("RunEndArray ends slot") } /// The scalar values. @@ -446,15 +475,21 @@ impl RunEndArray { /// at `ends[i]` (inclusive) and terminates at `ends[i+1]` (exclusive). #[inline] pub fn values(&self) -> &ArrayRef { - &self.values + self.slots[VALUES_SLOT] + .as_ref() + .vortex_expect("RunEndArray values slot") } /// Split an `RunEndArray` into parts. #[inline] pub fn into_parts(self) -> RunEndArrayParts { RunEndArrayParts { - ends: self.ends, - values: self.values, + ends: self.slots[ENDS_SLOT] + .clone() + .vortex_expect("RunEndArray ends slot"), + values: self.slots[VALUES_SLOT] + .clone() + .vortex_expect("RunEndArray values slot"), } } } diff --git a/encodings/sequence/public-api.lock b/encodings/sequence/public-api.lock index e865020c1c8..b7cf896700a 100644 --- a/encodings/sequence/public-api.lock +++ b/encodings/sequence/public-api.lock @@ -146,14 +146,22 @@ pub fn vortex_sequence::SequenceVTable::nbuffers(_array: &vortex_sequence::Seque pub fn vortex_sequence::SequenceVTable::nchildren(_array: &vortex_sequence::SequenceArray) -> usize +pub fn vortex_sequence::SequenceVTable::nslots(_array: &vortex_sequence::SequenceArray) -> usize + pub fn vortex_sequence::SequenceVTable::reduce_parent(array: &vortex_sequence::SequenceArray, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_sequence::SequenceVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_sequence::SequenceVTable::slot(_array: &vortex_sequence::SequenceArray, idx: usize) -> &core::option::Option + +pub fn vortex_sequence::SequenceVTable::slot_name(_array: &vortex_sequence::SequenceArray, idx: usize) -> &str + pub fn vortex_sequence::SequenceVTable::stats(array: &vortex_sequence::SequenceArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_sequence::SequenceVTable::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_sequence::SequenceVTable::with_slots(array: &mut vortex_sequence::SequenceArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_sequence::SequenceVTable pub fn vortex_sequence::SequenceVTable::scalar_at(array: &vortex_sequence::SequenceArray, index: usize) -> vortex_error::VortexResult diff --git a/encodings/sequence/src/array.rs b/encodings/sequence/src/array.rs index d7149bb3dab..5d469706b93 100644 --- a/encodings/sequence/src/array.rs +++ b/encodings/sequence/src/array.rs @@ -72,6 +72,9 @@ pub struct SequenceArrayParts { pub nullability: Nullability, } +pub(super) const NUM_SLOTS: usize = 0; +pub(super) const SLOT_NAMES: [&str; 0] = []; + #[derive(Clone, Debug)] /// An array representing the equation `A[i] = base + i * multiplier`. pub struct SequenceArray { @@ -79,6 +82,7 @@ pub struct SequenceArray { multiplier: PValue, dtype: DType, pub(crate) len: usize, + pub(super) slots: Vec>, stats_set: ArrayStats, } @@ -167,6 +171,7 @@ impl SequenceArray { multiplier, dtype, len: length, + slots: vec![], stats_set: ArrayStats::from(stats_set), } } @@ -381,6 +386,29 @@ impl VTable for SequenceVTable { Ok(()) } + fn nslots(_array: &SequenceArray) -> usize { + NUM_SLOTS + } + + fn slot(_array: &SequenceArray, idx: usize) -> &Option { + vortex_panic!("SequenceArray has no slots, requested index {idx}") + } + + fn slot_name(_array: &SequenceArray, idx: usize) -> &str { + let _ = SLOT_NAMES; + vortex_panic!("SequenceArray has no slots, requested index {idx}") + } + + fn with_slots(array: &mut SequenceArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.is_empty(), + "SequenceArray expects 0 slots, got {}", + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn execute(array: &Self::Array, _ctx: &mut ExecutionCtx) -> VortexResult { sequence_decompress(array).map(ExecutionStep::Done) } diff --git a/encodings/sparse/public-api.lock b/encodings/sparse/public-api.lock index 50ad3d9a77a..1ef5ffdff79 100644 --- a/encodings/sparse/public-api.lock +++ b/encodings/sparse/public-api.lock @@ -144,14 +144,22 @@ pub fn vortex_sparse::SparseVTable::nbuffers(_array: &vortex_sparse::SparseArray pub fn vortex_sparse::SparseVTable::nchildren(array: &vortex_sparse::SparseArray) -> usize +pub fn vortex_sparse::SparseVTable::nslots(_array: &vortex_sparse::SparseArray) -> usize + pub fn vortex_sparse::SparseVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_sparse::SparseVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_sparse::SparseVTable::slot(_array: &vortex_sparse::SparseArray, idx: usize) -> &core::option::Option + +pub fn vortex_sparse::SparseVTable::slot_name(_array: &vortex_sparse::SparseArray, idx: usize) -> &str + pub fn vortex_sparse::SparseVTable::stats(array: &vortex_sparse::SparseArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_sparse::SparseVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_sparse::SparseVTable::with_slots(array: &mut vortex_sparse::SparseArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_sparse::SparseVTable pub fn vortex_sparse::SparseVTable::scalar_at(array: &vortex_sparse::SparseArray, index: usize) -> vortex_error::VortexResult diff --git a/encodings/sparse/src/lib.rs b/encodings/sparse/src/lib.rs index b2bf1e81ae9..671464f392b 100644 --- a/encodings/sparse/src/lib.rs +++ b/encodings/sparse/src/lib.rs @@ -216,6 +216,29 @@ impl VTable for SparseVTable { ) } + fn nslots(_array: &SparseArray) -> usize { + NUM_SLOTS + } + + fn slot(_array: &SparseArray, idx: usize) -> &Option { + vortex_panic!("SparseArray has no slots, requested index {idx}") + } + + fn slot_name(_array: &SparseArray, idx: usize) -> &str { + let _ = SLOT_NAMES; + vortex_panic!("SparseArray has no slots, requested index {idx}") + } + + fn with_slots(array: &mut SparseArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.is_empty(), + "SparseArray expects 0 slots, got {}", + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure_eq!( children.len(), @@ -261,8 +284,12 @@ impl VTable for SparseVTable { } } +pub(crate) const NUM_SLOTS: usize = 0; +pub(crate) const SLOT_NAMES: [&str; 0] = []; + #[derive(Clone, Debug)] pub struct SparseArray { + pub(crate) slots: Vec>, patches: Patches, fill_value: Scalar, stats_set: ArrayStats, @@ -308,6 +335,7 @@ impl SparseArray { } Ok(Self { + slots: vec![], // TODO(0ax1): handle chunk offsets patches: Patches::new(len, 0, indices, values, None)?, fill_value, @@ -326,6 +354,7 @@ impl SparseArray { ); Ok(Self { + slots: vec![], patches, fill_value, stats_set: Default::default(), @@ -334,6 +363,7 @@ impl SparseArray { pub(crate) unsafe fn new_unchecked(patches: Patches, fill_value: Scalar) -> Self { Self { + slots: vec![], patches, fill_value, stats_set: Default::default(), diff --git a/encodings/zigzag/public-api.lock b/encodings/zigzag/public-api.lock index d3f94f2b73a..d99e2ecc112 100644 --- a/encodings/zigzag/public-api.lock +++ b/encodings/zigzag/public-api.lock @@ -114,14 +114,22 @@ pub fn vortex_zigzag::ZigZagVTable::nbuffers(_array: &vortex_zigzag::ZigZagArray pub fn vortex_zigzag::ZigZagVTable::nchildren(_array: &vortex_zigzag::ZigZagArray) -> usize +pub fn vortex_zigzag::ZigZagVTable::nslots(_array: &vortex_zigzag::ZigZagArray) -> usize + pub fn vortex_zigzag::ZigZagVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_zigzag::ZigZagVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_zigzag::ZigZagVTable::slot(array: &vortex_zigzag::ZigZagArray, idx: usize) -> &core::option::Option + +pub fn vortex_zigzag::ZigZagVTable::slot_name(_array: &vortex_zigzag::ZigZagArray, idx: usize) -> &str + pub fn vortex_zigzag::ZigZagVTable::stats(array: &vortex_zigzag::ZigZagArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_zigzag::ZigZagVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_zigzag::ZigZagVTable::with_slots(array: &mut vortex_zigzag::ZigZagArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_zigzag::ZigZagVTable pub fn vortex_zigzag::ZigZagVTable::scalar_at(array: &vortex_zigzag::ZigZagArray, index: usize) -> vortex_error::VortexResult diff --git a/encodings/zigzag/src/array.rs b/encodings/zigzag/src/array.rs index f8139246880..18466c89d81 100644 --- a/encodings/zigzag/src/array.rs +++ b/encodings/zigzag/src/array.rs @@ -53,7 +53,7 @@ impl VTable for ZigZagVTable { } fn len(array: &ZigZagArray) -> usize { - array.encoded.len() + array.encoded().len() } fn dtype(array: &ZigZagArray) -> &DType { @@ -66,11 +66,11 @@ impl VTable for ZigZagVTable { fn array_hash(array: &ZigZagArray, state: &mut H, precision: Precision) { array.dtype.hash(state); - array.encoded.array_hash(state, precision); + array.encoded().array_hash(state, precision); } fn array_eq(array: &ZigZagArray, other: &ZigZagArray, precision: Precision) -> bool { - array.dtype == other.dtype && array.encoded.array_eq(&other.encoded, precision) + array.dtype == other.dtype && array.encoded().array_eq(other.encoded(), precision) } fn nbuffers(_array: &ZigZagArray) -> usize { @@ -139,13 +139,36 @@ impl VTable for ZigZagVTable { ZigZagArray::try_new(encoded) } + fn nslots(_array: &ZigZagArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &ZigZagArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &ZigZagArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + + fn with_slots(array: &mut ZigZagArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "ZigZagArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 1, "ZigZagArray expects exactly 1 child (encoded), got {}", children.len() ); - array.encoded = children.into_iter().next().vortex_expect("checked"); + array.slots = vec![Some(children.into_iter().next().vortex_expect("checked"))]; Ok(()) } @@ -173,10 +196,14 @@ impl VTable for ZigZagVTable { } } +pub(super) const ENCODED_SLOT: usize = 0; +pub(super) const NUM_SLOTS: usize = 1; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["encoded"]; + #[derive(Clone, Debug)] pub struct ZigZagArray { dtype: DType, - encoded: ArrayRef, + pub(super) slots: Vec>, stats_set: ArrayStats, } @@ -203,7 +230,7 @@ impl ZigZagArray { Ok(Self { dtype, - encoded, + slots: vec![Some(encoded)], stats_set: Default::default(), }) } @@ -213,7 +240,9 @@ impl ZigZagArray { } pub fn encoded(&self) -> &ArrayRef { - &self.encoded + self.slots[ENCODED_SLOT] + .as_ref() + .vortex_expect("ZigZagArray encoded slot") } } diff --git a/encodings/zstd/public-api.lock b/encodings/zstd/public-api.lock index 142a350991a..0dfd6cbd204 100644 --- a/encodings/zstd/public-api.lock +++ b/encodings/zstd/public-api.lock @@ -212,14 +212,22 @@ pub fn vortex_zstd::ZstdVTable::nbuffers(array: &vortex_zstd::ZstdArray) -> usiz pub fn vortex_zstd::ZstdVTable::nchildren(array: &vortex_zstd::ZstdArray) -> usize +pub fn vortex_zstd::ZstdVTable::nslots(_array: &vortex_zstd::ZstdArray) -> usize + pub fn vortex_zstd::ZstdVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_zstd::ZstdVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_zstd::ZstdVTable::slot(_array: &vortex_zstd::ZstdArray, idx: usize) -> &core::option::Option + +pub fn vortex_zstd::ZstdVTable::slot_name(_array: &vortex_zstd::ZstdArray, idx: usize) -> &str + pub fn vortex_zstd::ZstdVTable::stats(array: &vortex_zstd::ZstdArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_zstd::ZstdVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_zstd::ZstdVTable::with_slots(array: &mut vortex_zstd::ZstdArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::operations::OperationsVTable for vortex_zstd::ZstdVTable pub fn vortex_zstd::ZstdVTable::scalar_at(array: &vortex_zstd::ZstdArray, index: usize) -> vortex_error::VortexResult diff --git a/encodings/zstd/src/array.rs b/encodings/zstd/src/array.rs index 52665408abb..fd52a6af40a 100644 --- a/encodings/zstd/src/array.rs +++ b/encodings/zstd/src/array.rs @@ -272,6 +272,29 @@ impl VTable for ZstdVTable { Ok(()) } + fn nslots(_array: &ZstdArray) -> usize { + NUM_SLOTS + } + + fn slot(_array: &ZstdArray, idx: usize) -> &Option { + vortex_panic!("ZstdArray has no slots, requested index {idx}") + } + + fn slot_name(_array: &ZstdArray, idx: usize) -> &str { + let _ = SLOT_NAMES; + vortex_panic!("ZstdArray has no slots, requested index {idx}") + } + + fn with_slots(array: &mut ZstdArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.is_empty(), + "ZstdArray expects 0 slots, got {}", + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn execute(array: &Self::Array, ctx: &mut ExecutionCtx) -> VortexResult { array .decompress()? @@ -295,6 +318,9 @@ impl ZstdVTable { pub const ID: ArrayId = ArrayId::new_ref("vortex.zstd"); } +pub(super) const NUM_SLOTS: usize = 0; +pub(super) const SLOT_NAMES: [&str; 0] = []; + #[derive(Clone, Debug)] pub struct ZstdArray { pub(crate) dictionary: Option, @@ -303,6 +329,7 @@ pub struct ZstdArray { dtype: DType, pub(crate) unsliced_validity: Validity, unsliced_n_rows: usize, + pub(super) slots: Vec>, stats_set: ArrayStats, slice_start: usize, slice_stop: usize, @@ -418,6 +445,7 @@ impl ZstdArray { dtype, unsliced_validity: validity, unsliced_n_rows: n_rows, + slots: vec![], stats_set: Default::default(), slice_start: 0, slice_stop: n_rows, diff --git a/encodings/zstd/src/zstd_buffers.rs b/encodings/zstd/src/zstd_buffers.rs index ff733475a95..fad69be5ca7 100644 --- a/encodings/zstd/src/zstd_buffers.rs +++ b/encodings/zstd/src/zstd_buffers.rs @@ -28,9 +28,11 @@ use vortex_array::vtable::ValidityVTable; use vortex_buffer::Alignment; use vortex_buffer::ByteBuffer; use vortex_buffer::ByteBufferMut; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_ensure_eq; use vortex_error::vortex_err; +use vortex_error::vortex_panic; use vortex_session::VortexSession; use crate::ZstdBuffersMetadata; @@ -56,7 +58,7 @@ pub struct ZstdBuffersArray { compressed_buffers: Vec, uncompressed_sizes: Vec, buffer_alignments: Vec, - children: Vec, + pub(crate) slots: Vec>, dtype: DType, len: usize, stats_set: ArrayStats, @@ -172,7 +174,7 @@ impl ZstdBuffersArray { compressed_buffers, uncompressed_sizes, buffer_alignments, - children, + slots: children.into_iter().map(Some).collect(), dtype: array.dtype().clone(), len: array.len(), stats_set: Default::default(), @@ -248,14 +250,14 @@ impl ZstdBuffersArray { .find(&self.inner_encoding_id) .ok_or_else(|| vortex_err!("Unknown inner encoding: {}", self.inner_encoding_id))?; - let children = self.children.as_slice(); + let children: Vec = self.slots.iter().flatten().cloned().collect(); inner_vtable.build( self.inner_encoding_id.clone(), &self.dtype, self.len, &self.inner_metadata, buffer_handles, - &children, + &children.as_slice(), session, ) } @@ -360,7 +362,7 @@ impl VTable for ZstdBuffersVTable { array.buffer_alignments.hash(state); array.dtype.hash(state); array.len.hash(state); - for child in &array.children { + for child in array.slots.iter().flatten() { child.array_hash(state, precision); } } @@ -378,11 +380,12 @@ impl VTable for ZstdBuffersVTable { && array.buffer_alignments == other.buffer_alignments && array.dtype == other.dtype && array.len == other.len - && array.children.len() == other.children.len() + && array.slots.len() == other.slots.len() && array - .children + .slots .iter() - .zip(&other.children) + .flatten() + .zip(other.slots.iter().flatten()) .all(|(a, b)| a.array_eq(b, precision)) } @@ -399,17 +402,37 @@ impl VTable for ZstdBuffersVTable { } fn nchildren(array: &ZstdBuffersArray) -> usize { - array.children.len() + array.slots.len() } fn child(array: &ZstdBuffersArray, idx: usize) -> ArrayRef { - array.children[idx].clone() + array.slots[idx] + .as_ref() + .vortex_expect("ZstdBuffersArray child slot is None") + .clone() } fn child_name(_array: &ZstdBuffersArray, idx: usize) -> String { format!("child_{idx}") } + fn nslots(array: &ZstdBuffersArray) -> usize { + array.slots.len() + } + + fn slot(array: &ZstdBuffersArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &ZstdBuffersArray, idx: usize) -> &str { + vortex_panic!("ZstdBuffersArray slot names are dynamic, index {idx}") + } + + fn with_slots(array: &mut ZstdBuffersArray, slots: Vec>) -> VortexResult<()> { + array.slots = slots; + Ok(()) + } + fn metadata(array: &ZstdBuffersArray) -> VortexResult { Ok(ProstMetadata(ZstdBuffersMetadata { inner_encoding_id: array.inner_encoding_id.to_string(), @@ -442,8 +465,8 @@ impl VTable for ZstdBuffersVTable { ) -> VortexResult { let compressed_buffers: Vec = buffers.to_vec(); - let child_arrays: Vec = (0..children.len()) - .map(|i| children.get(i, dtype, len)) + let child_arrays: Vec> = (0..children.len()) + .map(|i| children.get(i, dtype, len).map(Some)) .collect::>>()?; let array = ZstdBuffersArray { @@ -452,7 +475,7 @@ impl VTable for ZstdBuffersVTable { compressed_buffers, uncompressed_sizes: metadata.0.uncompressed_sizes.clone(), buffer_alignments: metadata.0.buffer_alignments.clone(), - children: child_arrays, + slots: child_arrays, dtype: dtype.clone(), len, stats_set: Default::default(), @@ -463,7 +486,7 @@ impl VTable for ZstdBuffersVTable { } fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - array.children = children; + array.slots = children.into_iter().map(Some).collect(); Ok(()) } diff --git a/vortex-array/public-api.lock b/vortex-array/public-api.lock index e2e6584f6bd..49ecb2136bb 100644 --- a/vortex-array/public-api.lock +++ b/vortex-array/public-api.lock @@ -612,16 +612,24 @@ pub fn vortex_array::arrays::BoolVTable::nbuffers(_array: &vortex_array::arrays: pub fn vortex_array::arrays::BoolVTable::nchildren(array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::BoolVTable::nslots(_array: &vortex_array::arrays::BoolArray) -> usize + pub fn vortex_array::arrays::BoolVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::BoolVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::BoolVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::BoolVTable::slot(_array: &vortex_array::arrays::BoolArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::BoolVTable::slot_name(_array: &vortex_array::arrays::BoolArray, idx: usize) -> &str + pub fn vortex_array::arrays::BoolVTable::stats(array: &vortex_array::arrays::BoolArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::BoolVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::BoolVTable::with_slots(array: &mut vortex_array::arrays::BoolArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub mod vortex_array::arrays::chunked pub struct vortex_array::arrays::chunked::ChunkedArray @@ -636,7 +644,7 @@ pub fn vortex_array::arrays::ChunkedArray::chunk(&self, idx: usize) -> &vortex_a pub fn vortex_array::arrays::ChunkedArray::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer -pub fn vortex_array::arrays::ChunkedArray::chunks(&self) -> &[vortex_array::ArrayRef] +pub fn vortex_array::arrays::ChunkedArray::chunks(&self) -> alloc::vec::Vec pub fn vortex_array::arrays::ChunkedArray::nchunks(&self) -> usize @@ -788,16 +796,24 @@ pub fn vortex_array::arrays::ChunkedVTable::nbuffers(_array: &vortex_array::arra pub fn vortex_array::arrays::ChunkedVTable::nchildren(array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::ChunkedVTable::nslots(array: &vortex_array::arrays::ChunkedArray) -> usize + pub fn vortex_array::arrays::ChunkedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ChunkedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ChunkedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ChunkedVTable::slot(array: &vortex_array::arrays::ChunkedArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ChunkedVTable::slot_name(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> &str + pub fn vortex_array::arrays::ChunkedVTable::stats(array: &vortex_array::arrays::ChunkedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ChunkedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ChunkedVTable::with_slots(array: &mut vortex_array::arrays::ChunkedArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::ChunkedVTable pub fn vortex_array::arrays::ChunkedVTable::validity(array: &vortex_array::arrays::ChunkedArray) -> vortex_error::VortexResult @@ -942,16 +958,24 @@ pub fn vortex_array::arrays::ConstantVTable::nbuffers(_array: &vortex_array::arr pub fn vortex_array::arrays::ConstantVTable::nchildren(_array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::ConstantVTable::nslots(_array: &vortex_array::arrays::ConstantArray) -> usize + pub fn vortex_array::arrays::ConstantVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ConstantVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ConstantVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ConstantVTable::slot(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ConstantVTable::slot_name(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> &str + pub fn vortex_array::arrays::ConstantVTable::stats(array: &vortex_array::arrays::ConstantArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ConstantVTable::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ConstantVTable::with_slots(array: &mut vortex_array::arrays::ConstantArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::ConstantVTable pub fn vortex_array::arrays::ConstantVTable::validity(array: &vortex_array::arrays::ConstantArray) -> vortex_error::VortexResult @@ -1228,16 +1252,24 @@ pub fn vortex_array::arrays::DecimalVTable::nbuffers(_array: &vortex_array::arra pub fn vortex_array::arrays::DecimalVTable::nchildren(array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::DecimalVTable::nslots(_array: &vortex_array::arrays::DecimalArray) -> usize + pub fn vortex_array::arrays::DecimalVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::DecimalVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::DecimalVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::DecimalVTable::slot(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::DecimalVTable::slot_name(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> &str + pub fn vortex_array::arrays::DecimalVTable::stats(array: &vortex_array::arrays::DecimalArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::DecimalVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::DecimalVTable::with_slots(array: &mut vortex_array::arrays::DecimalArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub fn vortex_array::arrays::decimal::narrowed_decimal(decimal_array: vortex_array::arrays::DecimalArray) -> vortex_array::arrays::DecimalArray pub mod vortex_array::arrays::dict @@ -1348,16 +1380,24 @@ pub fn vortex_array::arrays::dict::DictVTable::nbuffers(_array: &vortex_array::a pub fn vortex_array::arrays::dict::DictVTable::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::DictVTable::nslots(_array: &vortex_array::arrays::dict::DictArray) -> usize + pub fn vortex_array::arrays::dict::DictVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::dict::DictVTable::slot(array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::dict::DictVTable::slot_name(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &str + pub fn vortex_array::arrays::dict::DictVTable::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::dict::DictVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::DictVTable::with_slots(array: &mut vortex_array::arrays::dict::DictArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::dict::DictVTable pub fn vortex_array::arrays::dict::DictVTable::validity(array: &vortex_array::arrays::dict::DictArray) -> vortex_error::VortexResult @@ -1562,16 +1602,24 @@ pub fn vortex_array::arrays::dict::DictVTable::nbuffers(_array: &vortex_array::a pub fn vortex_array::arrays::dict::DictVTable::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::DictVTable::nslots(_array: &vortex_array::arrays::dict::DictArray) -> usize + pub fn vortex_array::arrays::dict::DictVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::dict::DictVTable::slot(array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::dict::DictVTable::slot_name(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &str + pub fn vortex_array::arrays::dict::DictVTable::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::dict::DictVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::DictVTable::with_slots(array: &mut vortex_array::arrays::dict::DictArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::dict::DictVTable pub fn vortex_array::arrays::dict::DictVTable::validity(array: &vortex_array::arrays::dict::DictArray) -> vortex_error::VortexResult @@ -1840,16 +1888,24 @@ pub fn vortex_array::arrays::ExtensionVTable::nbuffers(_array: &vortex_array::ar pub fn vortex_array::arrays::ExtensionVTable::nchildren(_array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::ExtensionVTable::nslots(_array: &vortex_array::arrays::ExtensionArray) -> usize + pub fn vortex_array::arrays::ExtensionVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ExtensionVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ExtensionVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ExtensionVTable::slot(array: &vortex_array::arrays::ExtensionArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ExtensionVTable::slot_name(_array: &vortex_array::arrays::ExtensionArray, idx: usize) -> &str + pub fn vortex_array::arrays::ExtensionVTable::stats(array: &vortex_array::arrays::ExtensionArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ExtensionVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ExtensionVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityChild for vortex_array::arrays::ExtensionVTable pub fn vortex_array::arrays::ExtensionVTable::validity_child(array: &vortex_array::arrays::ExtensionArray) -> &vortex_array::ArrayRef @@ -1996,16 +2052,24 @@ pub fn vortex_array::arrays::FilterVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::FilterVTable::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::FilterVTable::nslots(_array: &Self::Array) -> usize + pub fn vortex_array::arrays::FilterVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FilterVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FilterVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::FilterVTable::slot(array: &Self::Array, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::FilterVTable::slot_name(_array: &Self::Array, idx: usize) -> &str + pub fn vortex_array::arrays::FilterVTable::stats(array: &vortex_array::arrays::FilterArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::FilterVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FilterVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::FilterVTable pub fn vortex_array::arrays::FilterVTable::validity(array: &vortex_array::arrays::FilterArray) -> vortex_error::VortexResult @@ -2202,16 +2266,24 @@ pub fn vortex_array::arrays::FixedSizeListVTable::nbuffers(_array: &vortex_array pub fn vortex_array::arrays::FixedSizeListVTable::nchildren(array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeListVTable::nslots(_array: &vortex_array::arrays::FixedSizeListArray) -> usize + pub fn vortex_array::arrays::FixedSizeListVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeListVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeListVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::FixedSizeListVTable::slot(array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::FixedSizeListVTable::slot_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> &str + pub fn vortex_array::arrays::FixedSizeListVTable::stats(array: &vortex_array::arrays::FixedSizeListArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::FixedSizeListVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeListVTable::with_slots(array: &mut vortex_array::arrays::FixedSizeListArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub mod vortex_array::arrays::list pub struct vortex_array::arrays::list::ListArray @@ -2378,16 +2450,24 @@ pub fn vortex_array::arrays::ListVTable::nbuffers(_array: &vortex_array::arrays: pub fn vortex_array::arrays::ListVTable::nchildren(array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::ListVTable::nslots(_array: &vortex_array::arrays::ListArray) -> usize + pub fn vortex_array::arrays::ListVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ListVTable::slot(array: &vortex_array::arrays::ListArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ListVTable::slot_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> &str + pub fn vortex_array::arrays::ListVTable::stats(array: &vortex_array::arrays::ListArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ListVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListVTable::with_slots(array: &mut vortex_array::arrays::ListArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub mod vortex_array::arrays::listview pub enum vortex_array::arrays::listview::ListViewRebuildMode @@ -2574,16 +2654,24 @@ pub fn vortex_array::arrays::ListViewVTable::nbuffers(_array: &vortex_array::arr pub fn vortex_array::arrays::ListViewVTable::nchildren(array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListViewVTable::nslots(_array: &vortex_array::arrays::ListViewArray) -> usize + pub fn vortex_array::arrays::ListViewVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListViewVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListViewVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ListViewVTable::slot(array: &vortex_array::arrays::ListViewArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ListViewVTable::slot_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> &str + pub fn vortex_array::arrays::ListViewVTable::stats(array: &vortex_array::arrays::ListViewArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ListViewVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListViewVTable::with_slots(array: &mut vortex_array::arrays::ListViewArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub fn vortex_array::arrays::listview::list_from_list_view(list_view: vortex_array::arrays::ListViewArray) -> vortex_error::VortexResult pub fn vortex_array::arrays::listview::list_view_from_list(list: vortex_array::arrays::ListArray, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -2708,16 +2796,24 @@ pub fn vortex_array::arrays::MaskedVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::MaskedVTable::nchildren(array: &Self::Array) -> usize +pub fn vortex_array::arrays::MaskedVTable::nslots(_array: &vortex_array::arrays::MaskedArray) -> usize + pub fn vortex_array::arrays::MaskedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::MaskedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::MaskedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::MaskedVTable::slot(array: &vortex_array::arrays::MaskedArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::MaskedVTable::slot_name(_array: &vortex_array::arrays::MaskedArray, idx: usize) -> &str + pub fn vortex_array::arrays::MaskedVTable::stats(array: &vortex_array::arrays::MaskedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::MaskedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::MaskedVTable::with_slots(array: &mut vortex_array::arrays::MaskedArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub fn vortex_array::arrays::masked::mask_validity_canonical(canonical: vortex_array::Canonical, validity_mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult pub mod vortex_array::arrays::null @@ -2848,16 +2944,24 @@ pub fn vortex_array::arrays::null::NullVTable::nbuffers(_array: &vortex_array::a pub fn vortex_array::arrays::null::NullVTable::nchildren(_array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::NullVTable::nslots(_array: &vortex_array::arrays::null::NullArray) -> usize + pub fn vortex_array::arrays::null::NullVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::NullVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::NullVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::null::NullVTable::slot(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::null::NullVTable::slot_name(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> &str + pub fn vortex_array::arrays::null::NullVTable::stats(array: &vortex_array::arrays::null::NullArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::null::NullVTable::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::NullVTable::with_slots(array: &mut vortex_array::arrays::null::NullArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::null::NullVTable pub fn vortex_array::arrays::null::NullVTable::validity(_array: &vortex_array::arrays::null::NullArray) -> vortex_error::VortexResult @@ -3174,16 +3278,24 @@ pub fn vortex_array::arrays::PrimitiveVTable::nbuffers(_array: &vortex_array::ar pub fn vortex_array::arrays::PrimitiveVTable::nchildren(array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::PrimitiveVTable::nslots(_array: &vortex_array::arrays::PrimitiveArray) -> usize + pub fn vortex_array::arrays::PrimitiveVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::PrimitiveVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::PrimitiveVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::PrimitiveVTable::slot(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::PrimitiveVTable::slot_name(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> &str + pub fn vortex_array::arrays::PrimitiveVTable::stats(array: &vortex_array::arrays::PrimitiveArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::PrimitiveVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::PrimitiveVTable::with_slots(array: &mut vortex_array::arrays::PrimitiveArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub const vortex_array::arrays::primitive::IS_CONST_LANE_WIDTH: usize pub fn vortex_array::arrays::primitive::chunk_range(chunk_idx: usize, offset: usize, array_len: usize) -> core::ops::range::Range @@ -3230,7 +3342,7 @@ pub struct vortex_array::arrays::scalar_fn::ScalarFnArray impl vortex_array::arrays::scalar_fn::ScalarFnArray -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::children(&self) -> &[vortex_array::ArrayRef] +pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::children(&self) -> alloc::vec::Vec pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::scalar_fn(&self) -> &vortex_array::scalar_fn::ScalarFnRef @@ -3352,16 +3464,24 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nbuffers(_array: &vortex pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nchildren(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nslots(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize + pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray, _idx: usize) -> &str + pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_slots(array: &mut vortex_array::arrays::scalar_fn::ScalarFnArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::scalar_fn::ScalarFnVTable pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validity(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_error::VortexResult @@ -3474,16 +3594,24 @@ pub fn vortex_array::arrays::SharedVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::SharedVTable::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::SharedVTable::nslots(_array: &vortex_array::arrays::SharedArray) -> usize + pub fn vortex_array::arrays::SharedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::SharedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::SharedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::SharedVTable::slot(array: &vortex_array::arrays::SharedArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::SharedVTable::slot_name(_array: &vortex_array::arrays::SharedArray, idx: usize) -> &str + pub fn vortex_array::arrays::SharedVTable::stats(array: &vortex_array::arrays::SharedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::SharedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::SharedVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::SharedVTable pub fn vortex_array::arrays::SharedVTable::validity(array: &vortex_array::arrays::SharedArray) -> vortex_error::VortexResult @@ -3640,16 +3768,24 @@ pub fn vortex_array::arrays::slice::SliceVTable::nbuffers(_array: &Self::Array) pub fn vortex_array::arrays::slice::SliceVTable::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::slice::SliceVTable::nslots(_array: &Self::Array) -> usize + pub fn vortex_array::arrays::slice::SliceVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::SliceVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::SliceVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::slice::SliceVTable::slot(array: &Self::Array, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::slice::SliceVTable::slot_name(_array: &Self::Array, idx: usize) -> &str + pub fn vortex_array::arrays::slice::SliceVTable::stats(array: &vortex_array::arrays::slice::SliceArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::slice::SliceVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::SliceVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::slice::SliceVTable pub fn vortex_array::arrays::slice::SliceVTable::validity(array: &vortex_array::arrays::slice::SliceArray) -> vortex_error::VortexResult @@ -3768,7 +3904,7 @@ pub fn vortex_array::arrays::StructArray::unmasked_field_by_name(&self, name: im pub fn vortex_array::arrays::StructArray::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> -pub fn vortex_array::arrays::StructArray::unmasked_fields(&self) -> &alloc::sync::Arc<[vortex_array::ArrayRef]> +pub fn vortex_array::arrays::StructArray::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> pub fn vortex_array::arrays::StructArray::validate(fields: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::StructFields, length: usize, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> @@ -3910,16 +4046,24 @@ pub fn vortex_array::arrays::StructVTable::nbuffers(_array: &vortex_array::array pub fn vortex_array::arrays::StructVTable::nchildren(array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::StructVTable::nslots(array: &vortex_array::arrays::StructArray) -> usize + pub fn vortex_array::arrays::StructVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::StructVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::StructVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::StructVTable::slot(array: &vortex_array::arrays::StructArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::StructVTable::slot_name(array: &vortex_array::arrays::StructArray, idx: usize) -> &str + pub fn vortex_array::arrays::StructVTable::stats(array: &vortex_array::arrays::StructArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::StructVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::StructVTable::with_slots(array: &mut vortex_array::arrays::StructArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub mod vortex_array::arrays::varbin pub mod vortex_array::arrays::varbin::builder @@ -4176,16 +4320,24 @@ pub fn vortex_array::arrays::VarBinVTable::nbuffers(_array: &vortex_array::array pub fn vortex_array::arrays::VarBinVTable::nchildren(array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBinVTable::nslots(_array: &vortex_array::arrays::VarBinArray) -> usize + pub fn vortex_array::arrays::VarBinVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::VarBinVTable::slot(array: &vortex_array::arrays::VarBinArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::VarBinVTable::slot_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> &str + pub fn vortex_array::arrays::VarBinVTable::stats(array: &vortex_array::arrays::VarBinArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::VarBinVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinVTable::with_slots(array: &mut vortex_array::arrays::VarBinArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub fn vortex_array::arrays::varbin::varbin_scalar(value: vortex_buffer::ByteBuffer, dtype: &vortex_array::dtype::DType) -> vortex_array::scalar::Scalar pub mod vortex_array::arrays::varbinview @@ -4584,16 +4736,24 @@ pub fn vortex_array::arrays::VarBinViewVTable::nbuffers(array: &vortex_array::ar pub fn vortex_array::arrays::VarBinViewVTable::nchildren(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinViewVTable::nslots(_array: &vortex_array::arrays::VarBinViewArray) -> usize + pub fn vortex_array::arrays::VarBinViewVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinViewVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinViewVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::VarBinViewVTable::slot(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::VarBinViewVTable::slot_name(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> &str + pub fn vortex_array::arrays::VarBinViewVTable::stats(array: &vortex_array::arrays::VarBinViewArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::VarBinViewVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinViewVTable::with_slots(array: &mut vortex_array::arrays::VarBinViewArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub struct vortex_array::arrays::BoolArray impl vortex_array::arrays::BoolArray @@ -4784,16 +4944,24 @@ pub fn vortex_array::arrays::BoolVTable::nbuffers(_array: &vortex_array::arrays: pub fn vortex_array::arrays::BoolVTable::nchildren(array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::BoolVTable::nslots(_array: &vortex_array::arrays::BoolArray) -> usize + pub fn vortex_array::arrays::BoolVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::BoolVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::BoolVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::BoolVTable::slot(_array: &vortex_array::arrays::BoolArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::BoolVTable::slot_name(_array: &vortex_array::arrays::BoolArray, idx: usize) -> &str + pub fn vortex_array::arrays::BoolVTable::stats(array: &vortex_array::arrays::BoolArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::BoolVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::BoolVTable::with_slots(array: &mut vortex_array::arrays::BoolArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub struct vortex_array::arrays::ChunkedArray impl vortex_array::arrays::ChunkedArray @@ -4806,7 +4974,7 @@ pub fn vortex_array::arrays::ChunkedArray::chunk(&self, idx: usize) -> &vortex_a pub fn vortex_array::arrays::ChunkedArray::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer -pub fn vortex_array::arrays::ChunkedArray::chunks(&self) -> &[vortex_array::ArrayRef] +pub fn vortex_array::arrays::ChunkedArray::chunks(&self) -> alloc::vec::Vec pub fn vortex_array::arrays::ChunkedArray::nchunks(&self) -> usize @@ -4958,16 +5126,24 @@ pub fn vortex_array::arrays::ChunkedVTable::nbuffers(_array: &vortex_array::arra pub fn vortex_array::arrays::ChunkedVTable::nchildren(array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::ChunkedVTable::nslots(array: &vortex_array::arrays::ChunkedArray) -> usize + pub fn vortex_array::arrays::ChunkedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ChunkedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ChunkedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ChunkedVTable::slot(array: &vortex_array::arrays::ChunkedArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ChunkedVTable::slot_name(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> &str + pub fn vortex_array::arrays::ChunkedVTable::stats(array: &vortex_array::arrays::ChunkedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ChunkedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ChunkedVTable::with_slots(array: &mut vortex_array::arrays::ChunkedArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::ChunkedVTable pub fn vortex_array::arrays::ChunkedVTable::validity(array: &vortex_array::arrays::ChunkedArray) -> vortex_error::VortexResult @@ -5110,16 +5286,24 @@ pub fn vortex_array::arrays::ConstantVTable::nbuffers(_array: &vortex_array::arr pub fn vortex_array::arrays::ConstantVTable::nchildren(_array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::ConstantVTable::nslots(_array: &vortex_array::arrays::ConstantArray) -> usize + pub fn vortex_array::arrays::ConstantVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ConstantVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ConstantVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ConstantVTable::slot(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ConstantVTable::slot_name(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> &str + pub fn vortex_array::arrays::ConstantVTable::stats(array: &vortex_array::arrays::ConstantArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ConstantVTable::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ConstantVTable::with_slots(array: &mut vortex_array::arrays::ConstantArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::ConstantVTable pub fn vortex_array::arrays::ConstantVTable::validity(array: &vortex_array::arrays::ConstantArray) -> vortex_error::VortexResult @@ -5306,16 +5490,24 @@ pub fn vortex_array::arrays::DecimalVTable::nbuffers(_array: &vortex_array::arra pub fn vortex_array::arrays::DecimalVTable::nchildren(array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::DecimalVTable::nslots(_array: &vortex_array::arrays::DecimalArray) -> usize + pub fn vortex_array::arrays::DecimalVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::DecimalVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::DecimalVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::DecimalVTable::slot(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::DecimalVTable::slot_name(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> &str + pub fn vortex_array::arrays::DecimalVTable::stats(array: &vortex_array::arrays::DecimalArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::DecimalVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::DecimalVTable::with_slots(array: &mut vortex_array::arrays::DecimalArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub struct vortex_array::arrays::DictArray impl vortex_array::arrays::dict::DictArray @@ -5478,16 +5670,24 @@ pub fn vortex_array::arrays::dict::DictVTable::nbuffers(_array: &vortex_array::a pub fn vortex_array::arrays::dict::DictVTable::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::DictVTable::nslots(_array: &vortex_array::arrays::dict::DictArray) -> usize + pub fn vortex_array::arrays::dict::DictVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::dict::DictVTable::slot(array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::dict::DictVTable::slot_name(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &str + pub fn vortex_array::arrays::dict::DictVTable::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::dict::DictVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::DictVTable::with_slots(array: &mut vortex_array::arrays::dict::DictArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::dict::DictVTable pub fn vortex_array::arrays::dict::DictVTable::validity(array: &vortex_array::arrays::dict::DictArray) -> vortex_error::VortexResult @@ -5652,16 +5852,24 @@ pub fn vortex_array::arrays::ExtensionVTable::nbuffers(_array: &vortex_array::ar pub fn vortex_array::arrays::ExtensionVTable::nchildren(_array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::ExtensionVTable::nslots(_array: &vortex_array::arrays::ExtensionArray) -> usize + pub fn vortex_array::arrays::ExtensionVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ExtensionVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ExtensionVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ExtensionVTable::slot(array: &vortex_array::arrays::ExtensionArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ExtensionVTable::slot_name(_array: &vortex_array::arrays::ExtensionArray, idx: usize) -> &str + pub fn vortex_array::arrays::ExtensionVTable::stats(array: &vortex_array::arrays::ExtensionArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ExtensionVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ExtensionVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityChild for vortex_array::arrays::ExtensionVTable pub fn vortex_array::arrays::ExtensionVTable::validity_child(array: &vortex_array::arrays::ExtensionArray) -> &vortex_array::ArrayRef @@ -5768,16 +5976,24 @@ pub fn vortex_array::arrays::FilterVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::FilterVTable::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::FilterVTable::nslots(_array: &Self::Array) -> usize + pub fn vortex_array::arrays::FilterVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FilterVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FilterVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::FilterVTable::slot(array: &Self::Array, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::FilterVTable::slot_name(_array: &Self::Array, idx: usize) -> &str + pub fn vortex_array::arrays::FilterVTable::stats(array: &vortex_array::arrays::FilterArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::FilterVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FilterVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::FilterVTable pub fn vortex_array::arrays::FilterVTable::validity(array: &vortex_array::arrays::FilterArray) -> vortex_error::VortexResult @@ -5928,16 +6144,24 @@ pub fn vortex_array::arrays::FixedSizeListVTable::nbuffers(_array: &vortex_array pub fn vortex_array::arrays::FixedSizeListVTable::nchildren(array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeListVTable::nslots(_array: &vortex_array::arrays::FixedSizeListArray) -> usize + pub fn vortex_array::arrays::FixedSizeListVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeListVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeListVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::FixedSizeListVTable::slot(array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::FixedSizeListVTable::slot_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> &str + pub fn vortex_array::arrays::FixedSizeListVTable::stats(array: &vortex_array::arrays::FixedSizeListArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::FixedSizeListVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeListVTable::with_slots(array: &mut vortex_array::arrays::FixedSizeListArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub struct vortex_array::arrays::ListArray impl vortex_array::arrays::ListArray @@ -6092,16 +6316,24 @@ pub fn vortex_array::arrays::ListVTable::nbuffers(_array: &vortex_array::arrays: pub fn vortex_array::arrays::ListVTable::nchildren(array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::ListVTable::nslots(_array: &vortex_array::arrays::ListArray) -> usize + pub fn vortex_array::arrays::ListVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ListVTable::slot(array: &vortex_array::arrays::ListArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ListVTable::slot_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> &str + pub fn vortex_array::arrays::ListVTable::stats(array: &vortex_array::arrays::ListArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ListVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListVTable::with_slots(array: &mut vortex_array::arrays::ListArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub struct vortex_array::arrays::ListViewArray impl vortex_array::arrays::ListViewArray @@ -6264,16 +6496,24 @@ pub fn vortex_array::arrays::ListViewVTable::nbuffers(_array: &vortex_array::arr pub fn vortex_array::arrays::ListViewVTable::nchildren(array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListViewVTable::nslots(_array: &vortex_array::arrays::ListViewArray) -> usize + pub fn vortex_array::arrays::ListViewVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListViewVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListViewVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ListViewVTable::slot(array: &vortex_array::arrays::ListViewArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ListViewVTable::slot_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> &str + pub fn vortex_array::arrays::ListViewVTable::stats(array: &vortex_array::arrays::ListViewArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ListViewVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListViewVTable::with_slots(array: &mut vortex_array::arrays::ListViewArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub struct vortex_array::arrays::MaskedArray impl vortex_array::arrays::MaskedArray @@ -6390,16 +6630,24 @@ pub fn vortex_array::arrays::MaskedVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::MaskedVTable::nchildren(array: &Self::Array) -> usize +pub fn vortex_array::arrays::MaskedVTable::nslots(_array: &vortex_array::arrays::MaskedArray) -> usize + pub fn vortex_array::arrays::MaskedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::MaskedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::MaskedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::MaskedVTable::slot(array: &vortex_array::arrays::MaskedArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::MaskedVTable::slot_name(_array: &vortex_array::arrays::MaskedArray, idx: usize) -> &str + pub fn vortex_array::arrays::MaskedVTable::stats(array: &vortex_array::arrays::MaskedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::MaskedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::MaskedVTable::with_slots(array: &mut vortex_array::arrays::MaskedArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub struct vortex_array::arrays::NullArray impl vortex_array::arrays::null::NullArray @@ -6526,16 +6774,24 @@ pub fn vortex_array::arrays::null::NullVTable::nbuffers(_array: &vortex_array::a pub fn vortex_array::arrays::null::NullVTable::nchildren(_array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::NullVTable::nslots(_array: &vortex_array::arrays::null::NullArray) -> usize + pub fn vortex_array::arrays::null::NullVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::NullVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::NullVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::null::NullVTable::slot(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::null::NullVTable::slot_name(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> &str + pub fn vortex_array::arrays::null::NullVTable::stats(array: &vortex_array::arrays::null::NullArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::null::NullVTable::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::NullVTable::with_slots(array: &mut vortex_array::arrays::null::NullArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::null::NullVTable pub fn vortex_array::arrays::null::NullVTable::validity(_array: &vortex_array::arrays::null::NullArray) -> vortex_error::VortexResult @@ -6760,21 +7016,29 @@ pub fn vortex_array::arrays::PrimitiveVTable::nbuffers(_array: &vortex_array::ar pub fn vortex_array::arrays::PrimitiveVTable::nchildren(array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::PrimitiveVTable::nslots(_array: &vortex_array::arrays::PrimitiveArray) -> usize + pub fn vortex_array::arrays::PrimitiveVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::PrimitiveVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::PrimitiveVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::PrimitiveVTable::slot(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::PrimitiveVTable::slot_name(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> &str + pub fn vortex_array::arrays::PrimitiveVTable::stats(array: &vortex_array::arrays::PrimitiveArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::PrimitiveVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::PrimitiveVTable::with_slots(array: &mut vortex_array::arrays::PrimitiveArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub struct vortex_array::arrays::ScalarFnArray impl vortex_array::arrays::scalar_fn::ScalarFnArray -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::children(&self) -> &[vortex_array::ArrayRef] +pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::children(&self) -> alloc::vec::Vec pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::scalar_fn(&self) -> &vortex_array::scalar_fn::ScalarFnRef @@ -6884,16 +7148,24 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nbuffers(_array: &vortex pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nchildren(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nslots(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize + pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray, _idx: usize) -> &str + pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_slots(array: &mut vortex_array::arrays::scalar_fn::ScalarFnArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::scalar_fn::ScalarFnVTable pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validity(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_error::VortexResult @@ -6996,16 +7268,24 @@ pub fn vortex_array::arrays::SharedVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::SharedVTable::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::SharedVTable::nslots(_array: &vortex_array::arrays::SharedArray) -> usize + pub fn vortex_array::arrays::SharedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::SharedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::SharedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::SharedVTable::slot(array: &vortex_array::arrays::SharedArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::SharedVTable::slot_name(_array: &vortex_array::arrays::SharedArray, idx: usize) -> &str + pub fn vortex_array::arrays::SharedVTable::stats(array: &vortex_array::arrays::SharedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::SharedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::SharedVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::SharedVTable pub fn vortex_array::arrays::SharedVTable::validity(array: &vortex_array::arrays::SharedArray) -> vortex_error::VortexResult @@ -7116,16 +7396,24 @@ pub fn vortex_array::arrays::slice::SliceVTable::nbuffers(_array: &Self::Array) pub fn vortex_array::arrays::slice::SliceVTable::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::slice::SliceVTable::nslots(_array: &Self::Array) -> usize + pub fn vortex_array::arrays::slice::SliceVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::SliceVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::SliceVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::slice::SliceVTable::slot(array: &Self::Array, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::slice::SliceVTable::slot_name(_array: &Self::Array, idx: usize) -> &str + pub fn vortex_array::arrays::slice::SliceVTable::stats(array: &vortex_array::arrays::slice::SliceArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::slice::SliceVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::SliceVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::slice::SliceVTable pub fn vortex_array::arrays::slice::SliceVTable::validity(array: &vortex_array::arrays::slice::SliceArray) -> vortex_error::VortexResult @@ -7166,7 +7454,7 @@ pub fn vortex_array::arrays::StructArray::unmasked_field_by_name(&self, name: im pub fn vortex_array::arrays::StructArray::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> -pub fn vortex_array::arrays::StructArray::unmasked_fields(&self) -> &alloc::sync::Arc<[vortex_array::ArrayRef]> +pub fn vortex_array::arrays::StructArray::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> pub fn vortex_array::arrays::StructArray::validate(fields: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::StructFields, length: usize, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> @@ -7300,16 +7588,24 @@ pub fn vortex_array::arrays::StructVTable::nbuffers(_array: &vortex_array::array pub fn vortex_array::arrays::StructVTable::nchildren(array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::StructVTable::nslots(array: &vortex_array::arrays::StructArray) -> usize + pub fn vortex_array::arrays::StructVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::StructVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::StructVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::StructVTable::slot(array: &vortex_array::arrays::StructArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::StructVTable::slot_name(array: &vortex_array::arrays::StructArray, idx: usize) -> &str + pub fn vortex_array::arrays::StructVTable::stats(array: &vortex_array::arrays::StructArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::StructVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::StructVTable::with_slots(array: &mut vortex_array::arrays::StructArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub struct vortex_array::arrays::TemporalArray impl vortex_array::arrays::datetime::TemporalArray @@ -7598,16 +7894,24 @@ pub fn vortex_array::arrays::VarBinVTable::nbuffers(_array: &vortex_array::array pub fn vortex_array::arrays::VarBinVTable::nchildren(array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBinVTable::nslots(_array: &vortex_array::arrays::VarBinArray) -> usize + pub fn vortex_array::arrays::VarBinVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::VarBinVTable::slot(array: &vortex_array::arrays::VarBinArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::VarBinVTable::slot_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> &str + pub fn vortex_array::arrays::VarBinVTable::stats(array: &vortex_array::arrays::VarBinArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::VarBinVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinVTable::with_slots(array: &mut vortex_array::arrays::VarBinArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub struct vortex_array::arrays::VarBinViewArray impl vortex_array::arrays::VarBinViewArray @@ -7810,16 +8114,24 @@ pub fn vortex_array::arrays::VarBinViewVTable::nbuffers(array: &vortex_array::ar pub fn vortex_array::arrays::VarBinViewVTable::nchildren(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinViewVTable::nslots(_array: &vortex_array::arrays::VarBinViewArray) -> usize + pub fn vortex_array::arrays::VarBinViewVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinViewVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinViewVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::VarBinViewVTable::slot(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::VarBinViewVTable::slot_name(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> &str + pub fn vortex_array::arrays::VarBinViewVTable::stats(array: &vortex_array::arrays::VarBinViewArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::VarBinViewVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinViewVTable::with_slots(array: &mut vortex_array::arrays::VarBinViewArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub mod vortex_array::arrow pub mod vortex_array::arrow::bool @@ -20322,6 +20634,8 @@ pub fn vortex_array::vtable::DynVTable::reduce_parent(&self, array: &vortex_arra pub fn vortex_array::vtable::DynVTable::with_children(&self, array: &vortex_array::ArrayRef, children: alloc::vec::Vec) -> vortex_error::VortexResult +pub fn vortex_array::vtable::DynVTable::with_slots(&self, array: &vortex_array::ArrayRef, slots: alloc::vec::Vec>) -> vortex_error::VortexResult + pub trait vortex_array::vtable::OperationsVTable pub fn vortex_array::vtable::OperationsVTable::scalar_at(array: &::Array, index: usize) -> vortex_error::VortexResult @@ -20450,16 +20764,24 @@ pub fn vortex_array::vtable::VTable::nbuffers(array: &Self::Array) -> usize pub fn vortex_array::vtable::VTable::nchildren(array: &Self::Array) -> usize +pub fn vortex_array::vtable::VTable::nslots(array: &Self::Array) -> usize + pub fn vortex_array::vtable::VTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::vtable::VTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::vtable::VTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::vtable::VTable::slot(array: &Self::Array, idx: usize) -> &core::option::Option + +pub fn vortex_array::vtable::VTable::slot_name(array: &Self::Array, idx: usize) -> &str + pub fn vortex_array::vtable::VTable::stats(array: &Self::Array) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::vtable::VTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::vtable::VTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::BoolVTable pub type vortex_array::arrays::BoolVTable::Array = vortex_array::arrays::BoolArray @@ -20504,16 +20826,24 @@ pub fn vortex_array::arrays::BoolVTable::nbuffers(_array: &vortex_array::arrays: pub fn vortex_array::arrays::BoolVTable::nchildren(array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::BoolVTable::nslots(_array: &vortex_array::arrays::BoolArray) -> usize + pub fn vortex_array::arrays::BoolVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::BoolVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::BoolVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::BoolVTable::slot(_array: &vortex_array::arrays::BoolArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::BoolVTable::slot_name(_array: &vortex_array::arrays::BoolArray, idx: usize) -> &str + pub fn vortex_array::arrays::BoolVTable::stats(array: &vortex_array::arrays::BoolArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::BoolVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::BoolVTable::with_slots(array: &mut vortex_array::arrays::BoolArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::ChunkedVTable pub type vortex_array::arrays::ChunkedVTable::Array = vortex_array::arrays::ChunkedArray @@ -20558,16 +20888,24 @@ pub fn vortex_array::arrays::ChunkedVTable::nbuffers(_array: &vortex_array::arra pub fn vortex_array::arrays::ChunkedVTable::nchildren(array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::ChunkedVTable::nslots(array: &vortex_array::arrays::ChunkedArray) -> usize + pub fn vortex_array::arrays::ChunkedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ChunkedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ChunkedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ChunkedVTable::slot(array: &vortex_array::arrays::ChunkedArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ChunkedVTable::slot_name(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> &str + pub fn vortex_array::arrays::ChunkedVTable::stats(array: &vortex_array::arrays::ChunkedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ChunkedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ChunkedVTable::with_slots(array: &mut vortex_array::arrays::ChunkedArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::ConstantVTable pub type vortex_array::arrays::ConstantVTable::Array = vortex_array::arrays::ConstantArray @@ -20612,16 +20950,24 @@ pub fn vortex_array::arrays::ConstantVTable::nbuffers(_array: &vortex_array::arr pub fn vortex_array::arrays::ConstantVTable::nchildren(_array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::ConstantVTable::nslots(_array: &vortex_array::arrays::ConstantArray) -> usize + pub fn vortex_array::arrays::ConstantVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ConstantVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ConstantVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ConstantVTable::slot(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ConstantVTable::slot_name(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> &str + pub fn vortex_array::arrays::ConstantVTable::stats(array: &vortex_array::arrays::ConstantArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ConstantVTable::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ConstantVTable::with_slots(array: &mut vortex_array::arrays::ConstantArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::DecimalVTable pub type vortex_array::arrays::DecimalVTable::Array = vortex_array::arrays::DecimalArray @@ -20666,16 +21012,24 @@ pub fn vortex_array::arrays::DecimalVTable::nbuffers(_array: &vortex_array::arra pub fn vortex_array::arrays::DecimalVTable::nchildren(array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::DecimalVTable::nslots(_array: &vortex_array::arrays::DecimalArray) -> usize + pub fn vortex_array::arrays::DecimalVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::DecimalVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::DecimalVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::DecimalVTable::slot(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::DecimalVTable::slot_name(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> &str + pub fn vortex_array::arrays::DecimalVTable::stats(array: &vortex_array::arrays::DecimalArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::DecimalVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::DecimalVTable::with_slots(array: &mut vortex_array::arrays::DecimalArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::ExtensionVTable pub type vortex_array::arrays::ExtensionVTable::Array = vortex_array::arrays::ExtensionArray @@ -20720,16 +21074,24 @@ pub fn vortex_array::arrays::ExtensionVTable::nbuffers(_array: &vortex_array::ar pub fn vortex_array::arrays::ExtensionVTable::nchildren(_array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::ExtensionVTable::nslots(_array: &vortex_array::arrays::ExtensionArray) -> usize + pub fn vortex_array::arrays::ExtensionVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ExtensionVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ExtensionVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ExtensionVTable::slot(array: &vortex_array::arrays::ExtensionArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ExtensionVTable::slot_name(_array: &vortex_array::arrays::ExtensionArray, idx: usize) -> &str + pub fn vortex_array::arrays::ExtensionVTable::stats(array: &vortex_array::arrays::ExtensionArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ExtensionVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ExtensionVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::FilterVTable pub type vortex_array::arrays::FilterVTable::Array = vortex_array::arrays::FilterArray @@ -20774,16 +21136,24 @@ pub fn vortex_array::arrays::FilterVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::FilterVTable::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::FilterVTable::nslots(_array: &Self::Array) -> usize + pub fn vortex_array::arrays::FilterVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FilterVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FilterVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::FilterVTable::slot(array: &Self::Array, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::FilterVTable::slot_name(_array: &Self::Array, idx: usize) -> &str + pub fn vortex_array::arrays::FilterVTable::stats(array: &vortex_array::arrays::FilterArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::FilterVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FilterVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::FixedSizeListVTable pub type vortex_array::arrays::FixedSizeListVTable::Array = vortex_array::arrays::FixedSizeListArray @@ -20828,16 +21198,24 @@ pub fn vortex_array::arrays::FixedSizeListVTable::nbuffers(_array: &vortex_array pub fn vortex_array::arrays::FixedSizeListVTable::nchildren(array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeListVTable::nslots(_array: &vortex_array::arrays::FixedSizeListArray) -> usize + pub fn vortex_array::arrays::FixedSizeListVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeListVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeListVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::FixedSizeListVTable::slot(array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::FixedSizeListVTable::slot_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> &str + pub fn vortex_array::arrays::FixedSizeListVTable::stats(array: &vortex_array::arrays::FixedSizeListArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::FixedSizeListVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeListVTable::with_slots(array: &mut vortex_array::arrays::FixedSizeListArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::ListVTable pub type vortex_array::arrays::ListVTable::Array = vortex_array::arrays::ListArray @@ -20882,16 +21260,24 @@ pub fn vortex_array::arrays::ListVTable::nbuffers(_array: &vortex_array::arrays: pub fn vortex_array::arrays::ListVTable::nchildren(array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::ListVTable::nslots(_array: &vortex_array::arrays::ListArray) -> usize + pub fn vortex_array::arrays::ListVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ListVTable::slot(array: &vortex_array::arrays::ListArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ListVTable::slot_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> &str + pub fn vortex_array::arrays::ListVTable::stats(array: &vortex_array::arrays::ListArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ListVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListVTable::with_slots(array: &mut vortex_array::arrays::ListArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::ListViewVTable pub type vortex_array::arrays::ListViewVTable::Array = vortex_array::arrays::ListViewArray @@ -20936,16 +21322,24 @@ pub fn vortex_array::arrays::ListViewVTable::nbuffers(_array: &vortex_array::arr pub fn vortex_array::arrays::ListViewVTable::nchildren(array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListViewVTable::nslots(_array: &vortex_array::arrays::ListViewArray) -> usize + pub fn vortex_array::arrays::ListViewVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListViewVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListViewVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::ListViewVTable::slot(array: &vortex_array::arrays::ListViewArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::ListViewVTable::slot_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> &str + pub fn vortex_array::arrays::ListViewVTable::stats(array: &vortex_array::arrays::ListViewArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ListViewVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListViewVTable::with_slots(array: &mut vortex_array::arrays::ListViewArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::MaskedVTable pub type vortex_array::arrays::MaskedVTable::Array = vortex_array::arrays::MaskedArray @@ -20990,16 +21384,24 @@ pub fn vortex_array::arrays::MaskedVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::MaskedVTable::nchildren(array: &Self::Array) -> usize +pub fn vortex_array::arrays::MaskedVTable::nslots(_array: &vortex_array::arrays::MaskedArray) -> usize + pub fn vortex_array::arrays::MaskedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::MaskedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::MaskedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::MaskedVTable::slot(array: &vortex_array::arrays::MaskedArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::MaskedVTable::slot_name(_array: &vortex_array::arrays::MaskedArray, idx: usize) -> &str + pub fn vortex_array::arrays::MaskedVTable::stats(array: &vortex_array::arrays::MaskedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::MaskedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::MaskedVTable::with_slots(array: &mut vortex_array::arrays::MaskedArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::PrimitiveVTable pub type vortex_array::arrays::PrimitiveVTable::Array = vortex_array::arrays::PrimitiveArray @@ -21044,16 +21446,24 @@ pub fn vortex_array::arrays::PrimitiveVTable::nbuffers(_array: &vortex_array::ar pub fn vortex_array::arrays::PrimitiveVTable::nchildren(array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::PrimitiveVTable::nslots(_array: &vortex_array::arrays::PrimitiveArray) -> usize + pub fn vortex_array::arrays::PrimitiveVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::PrimitiveVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::PrimitiveVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::PrimitiveVTable::slot(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::PrimitiveVTable::slot_name(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> &str + pub fn vortex_array::arrays::PrimitiveVTable::stats(array: &vortex_array::arrays::PrimitiveArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::PrimitiveVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::PrimitiveVTable::with_slots(array: &mut vortex_array::arrays::PrimitiveArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::SharedVTable pub type vortex_array::arrays::SharedVTable::Array = vortex_array::arrays::SharedArray @@ -21098,16 +21508,24 @@ pub fn vortex_array::arrays::SharedVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::SharedVTable::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::SharedVTable::nslots(_array: &vortex_array::arrays::SharedArray) -> usize + pub fn vortex_array::arrays::SharedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::SharedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::SharedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::SharedVTable::slot(array: &vortex_array::arrays::SharedArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::SharedVTable::slot_name(_array: &vortex_array::arrays::SharedArray, idx: usize) -> &str + pub fn vortex_array::arrays::SharedVTable::stats(array: &vortex_array::arrays::SharedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::SharedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::SharedVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::StructVTable pub type vortex_array::arrays::StructVTable::Array = vortex_array::arrays::StructArray @@ -21152,16 +21570,24 @@ pub fn vortex_array::arrays::StructVTable::nbuffers(_array: &vortex_array::array pub fn vortex_array::arrays::StructVTable::nchildren(array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::StructVTable::nslots(array: &vortex_array::arrays::StructArray) -> usize + pub fn vortex_array::arrays::StructVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::StructVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::StructVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::StructVTable::slot(array: &vortex_array::arrays::StructArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::StructVTable::slot_name(array: &vortex_array::arrays::StructArray, idx: usize) -> &str + pub fn vortex_array::arrays::StructVTable::stats(array: &vortex_array::arrays::StructArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::StructVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::StructVTable::with_slots(array: &mut vortex_array::arrays::StructArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::VarBinVTable pub type vortex_array::arrays::VarBinVTable::Array = vortex_array::arrays::VarBinArray @@ -21206,16 +21632,24 @@ pub fn vortex_array::arrays::VarBinVTable::nbuffers(_array: &vortex_array::array pub fn vortex_array::arrays::VarBinVTable::nchildren(array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBinVTable::nslots(_array: &vortex_array::arrays::VarBinArray) -> usize + pub fn vortex_array::arrays::VarBinVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::VarBinVTable::slot(array: &vortex_array::arrays::VarBinArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::VarBinVTable::slot_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> &str + pub fn vortex_array::arrays::VarBinVTable::stats(array: &vortex_array::arrays::VarBinArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::VarBinVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinVTable::with_slots(array: &mut vortex_array::arrays::VarBinArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::VarBinViewVTable pub type vortex_array::arrays::VarBinViewVTable::Array = vortex_array::arrays::VarBinViewArray @@ -21260,16 +21694,24 @@ pub fn vortex_array::arrays::VarBinViewVTable::nbuffers(array: &vortex_array::ar pub fn vortex_array::arrays::VarBinViewVTable::nchildren(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinViewVTable::nslots(_array: &vortex_array::arrays::VarBinViewArray) -> usize + pub fn vortex_array::arrays::VarBinViewVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinViewVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinViewVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::VarBinViewVTable::slot(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::VarBinViewVTable::slot_name(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> &str + pub fn vortex_array::arrays::VarBinViewVTable::stats(array: &vortex_array::arrays::VarBinViewArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::VarBinViewVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinViewVTable::with_slots(array: &mut vortex_array::arrays::VarBinViewArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::dict::DictVTable pub type vortex_array::arrays::dict::DictVTable::Array = vortex_array::arrays::dict::DictArray @@ -21314,16 +21756,24 @@ pub fn vortex_array::arrays::dict::DictVTable::nbuffers(_array: &vortex_array::a pub fn vortex_array::arrays::dict::DictVTable::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::DictVTable::nslots(_array: &vortex_array::arrays::dict::DictArray) -> usize + pub fn vortex_array::arrays::dict::DictVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::dict::DictVTable::slot(array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::dict::DictVTable::slot_name(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &str + pub fn vortex_array::arrays::dict::DictVTable::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::dict::DictVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::DictVTable::with_slots(array: &mut vortex_array::arrays::dict::DictArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::null::NullVTable pub type vortex_array::arrays::null::NullVTable::Array = vortex_array::arrays::null::NullArray @@ -21368,16 +21818,24 @@ pub fn vortex_array::arrays::null::NullVTable::nbuffers(_array: &vortex_array::a pub fn vortex_array::arrays::null::NullVTable::nchildren(_array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::NullVTable::nslots(_array: &vortex_array::arrays::null::NullArray) -> usize + pub fn vortex_array::arrays::null::NullVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::NullVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::NullVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::null::NullVTable::slot(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::null::NullVTable::slot_name(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> &str + pub fn vortex_array::arrays::null::NullVTable::stats(array: &vortex_array::arrays::null::NullArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::null::NullVTable::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::NullVTable::with_slots(array: &mut vortex_array::arrays::null::NullArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::scalar_fn::ScalarFnVTable pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::Array = vortex_array::arrays::scalar_fn::ScalarFnArray @@ -21422,16 +21880,24 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nbuffers(_array: &vortex pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nchildren(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nslots(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize + pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray, _idx: usize) -> &str + pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_slots(array: &mut vortex_array::arrays::scalar_fn::ScalarFnArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + impl vortex_array::vtable::VTable for vortex_array::arrays::slice::SliceVTable pub type vortex_array::arrays::slice::SliceVTable::Array = vortex_array::arrays::slice::SliceArray @@ -21476,16 +21942,24 @@ pub fn vortex_array::arrays::slice::SliceVTable::nbuffers(_array: &Self::Array) pub fn vortex_array::arrays::slice::SliceVTable::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::slice::SliceVTable::nslots(_array: &Self::Array) -> usize + pub fn vortex_array::arrays::slice::SliceVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::SliceVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::SliceVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> +pub fn vortex_array::arrays::slice::SliceVTable::slot(array: &Self::Array, idx: usize) -> &core::option::Option + +pub fn vortex_array::arrays::slice::SliceVTable::slot_name(_array: &Self::Array, idx: usize) -> &str + pub fn vortex_array::arrays::slice::SliceVTable::stats(array: &vortex_array::arrays::slice::SliceArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::slice::SliceVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::SliceVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> + pub trait vortex_array::vtable::ValidityChild pub fn vortex_array::vtable::ValidityChild::validity_child(array: &::Array) -> &vortex_array::ArrayRef @@ -21814,13 +22288,13 @@ pub enum vortex_array::ExecutionStep pub vortex_array::ExecutionStep::Done(vortex_array::ArrayRef) -pub vortex_array::ExecutionStep::ExecuteChild(usize, vortex_array::DonePredicate) +pub vortex_array::ExecutionStep::ExecuteSlot(usize, vortex_array::DonePredicate) impl vortex_array::ExecutionStep pub fn vortex_array::ExecutionStep::done(result: vortex_array::ArrayRef) -> Self -pub fn vortex_array::ExecutionStep::execute_child(child_idx: usize) -> Self +pub fn vortex_array::ExecutionStep::execute_slot(slot_idx: usize) -> Self impl core::fmt::Debug for vortex_array::ExecutionStep @@ -21906,8 +22380,12 @@ pub fn vortex_array::ArrayAdapter::nbuffers(&self) -> usize pub fn vortex_array::ArrayAdapter::nchildren(&self) -> usize +pub fn vortex_array::ArrayAdapter::nslots(&self) -> usize + pub fn vortex_array::ArrayAdapter::nth_child(&self, idx: usize) -> core::option::Option +pub fn vortex_array::ArrayAdapter::slot(&self, idx: usize) -> core::option::Option + impl vortex_array::DynArray for vortex_array::ArrayAdapter pub fn vortex_array::ArrayAdapter::all_invalid(&self) -> vortex_error::VortexResult @@ -22198,8 +22676,12 @@ pub fn vortex_array::ArrayVisitor::nbuffers(&self) -> usize pub fn vortex_array::ArrayVisitor::nchildren(&self) -> usize +pub fn vortex_array::ArrayVisitor::nslots(&self) -> usize + pub fn vortex_array::ArrayVisitor::nth_child(&self, idx: usize) -> core::option::Option +pub fn vortex_array::ArrayVisitor::slot(&self, idx: usize) -> core::option::Option + impl vortex_array::ArrayVisitor for alloc::sync::Arc pub fn alloc::sync::Arc::buffer_handles(&self) -> alloc::vec::Vec @@ -22226,8 +22708,12 @@ pub fn alloc::sync::Arc::nbuffers(&self) -> usize pub fn alloc::sync::Arc::nchildren(&self) -> usize +pub fn alloc::sync::Arc::nslots(&self) -> usize + pub fn alloc::sync::Arc::nth_child(&self, idx: usize) -> core::option::Option +pub fn alloc::sync::Arc::slot(&self, idx: usize) -> core::option::Option + impl vortex_array::ArrayVisitor for vortex_array::ArrayAdapter pub fn vortex_array::ArrayAdapter::buffer_handles(&self) -> alloc::vec::Vec @@ -22254,8 +22740,12 @@ pub fn vortex_array::ArrayAdapter::nbuffers(&self) -> usize pub fn vortex_array::ArrayAdapter::nchildren(&self) -> usize +pub fn vortex_array::ArrayAdapter::nslots(&self) -> usize + pub fn vortex_array::ArrayAdapter::nth_child(&self, idx: usize) -> core::option::Option +pub fn vortex_array::ArrayAdapter::slot(&self, idx: usize) -> core::option::Option + pub trait vortex_array::ArrayVisitorExt: vortex_array::DynArray pub fn vortex_array::ArrayVisitorExt::depth_first_traversal(&self) -> impl core::iter::traits::iterator::Iterator diff --git a/vortex-array/src/array/mod.rs b/vortex-array/src/array/mod.rs index fa141141e33..fb461b4a712 100644 --- a/vortex-array/src/array/mod.rs +++ b/vortex-array/src/array/mod.rs @@ -366,6 +366,19 @@ impl dyn DynArray + '_ { children[child_idx] = replacement; self.with_children(children) } + + /// Returns a new array with the slot at `slot_idx` replaced by `replacement`. + pub fn with_slot(&self, slot_idx: usize, replacement: ArrayRef) -> VortexResult { + vortex_ensure!( + slot_idx < self.nslots(), + "slot index {} out of bounds for array with {} slots", + slot_idx, + self.nslots() + ); + let mut slots: Vec> = (0..self.nslots()).map(|i| self.slot(i)).collect(); + slots[slot_idx] = Some(replacement); + self.vtable().with_slots(&self.to_array(), slots) + } } /// Trait for converting a type into a Vortex [`ArrayRef`]. @@ -730,6 +743,14 @@ impl ArrayVisitor for ArrayAdapter { V::nbuffers(&self.0) } + fn nslots(&self) -> usize { + V::nslots(&self.0) + } + + fn slot(&self, idx: usize) -> Option { + V::slot(&self.0, idx).clone() + } + fn metadata(&self) -> VortexResult>> { V::serialize(V::metadata(&self.0)?) } diff --git a/vortex-array/src/array/visitor.rs b/vortex-array/src/array/visitor.rs index 24440a99ada..0168bc1cac2 100644 --- a/vortex-array/src/array/visitor.rs +++ b/vortex-array/src/array/visitor.rs @@ -26,6 +26,12 @@ pub trait ArrayVisitor { /// Returns the names of the children of the array. fn children_names(&self) -> Vec; + /// Returns the number of slots in the array. + fn nslots(&self) -> usize; + + /// Returns a clone of the slot at the given index, or `None` if the slot is empty. + fn slot(&self, idx: usize) -> Option; + /// Returns the array's children with their names. fn named_children(&self) -> Vec<(String, ArrayRef)>; @@ -74,6 +80,14 @@ impl ArrayVisitor for Arc { self.as_ref().children_names() } + fn nslots(&self) -> usize { + self.as_ref().nslots() + } + + fn slot(&self, idx: usize) -> Option { + self.as_ref().slot(idx) + } + fn named_children(&self) -> Vec<(String, ArrayRef)> { self.as_ref().named_children() } diff --git a/vortex-array/src/arrays/bool/array.rs b/vortex-array/src/arrays/bool/array.rs index 124aa3f2427..60b93af8012 100644 --- a/vortex-array/src/arrays/bool/array.rs +++ b/vortex-array/src/arrays/bool/array.rs @@ -11,12 +11,14 @@ use vortex_mask::Mask; use crate::ArrayRef; use crate::IntoArray; -use crate::arrays::bool; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::stats::ArrayStats; use crate::validity::Validity; +pub(super) const NUM_SLOTS: usize = 0; +pub(super) const SLOT_NAMES: [&str; 0] = []; + /// A boolean array that stores true/false values in a compact bit-packed format. /// /// This mirrors the Apache Arrow Boolean array encoding, where each boolean value @@ -51,6 +53,7 @@ use crate::validity::Validity; /// ``` #[derive(Clone, Debug)] pub struct BoolArray { + pub(super) slots: Vec>, pub(super) dtype: DType, pub(super) bits: BufferHandle, pub(super) offset: usize, @@ -101,6 +104,7 @@ impl BoolArray { let (offset, len, buffer) = bits.into_inner(); Ok(Self { + slots: vec![], dtype: DType::Bool(validity.nullability()), bits: BufferHandle::new_host(buffer), offset, @@ -138,6 +142,7 @@ impl BoolArray { ); Ok(Self { + slots: vec![], dtype: DType::Bool(validity.nullability()), bits, offset, @@ -159,6 +164,7 @@ impl BoolArray { let (offset, len, buffer) = bits.into_inner(); Self { + slots: vec![], dtype: DType::Bool(validity.nullability()), bits: BufferHandle::new_host(buffer), offset, diff --git a/vortex-array/src/arrays/bool/vtable/mod.rs b/vortex-array/src/arrays/bool/vtable/mod.rs index 9063bd384bc..b323b8bc278 100644 --- a/vortex-array/src/arrays/bool/vtable/mod.rs +++ b/vortex-array/src/arrays/bool/vtable/mod.rs @@ -17,6 +17,8 @@ use crate::IntoArray; use crate::ProstMetadata; use crate::SerializeMetadata; use crate::arrays::BoolArray; +use crate::arrays::bool::array::NUM_SLOTS; +use crate::arrays::bool::array::SLOT_NAMES; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::serde::ArrayChildren; @@ -169,6 +171,29 @@ impl VTable for BoolVTable { BoolArray::try_new_from_handle(buffer, metadata.offset as usize, len, validity) } + fn nslots(_array: &BoolArray) -> usize { + NUM_SLOTS + } + + fn slot(_array: &BoolArray, idx: usize) -> &Option { + vortex_panic!("BoolArray has no slots, requested index {idx}") + } + + fn slot_name(_array: &BoolArray, idx: usize) -> &str { + let _ = SLOT_NAMES; + vortex_panic!("BoolArray has no slots, requested index {idx}") + } + + fn with_slots(array: &mut BoolArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.is_empty(), + "BoolArray expects 0 slots, got {}", + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() <= 1, diff --git a/vortex-array/src/arrays/chunked/array.rs b/vortex-array/src/arrays/chunked/array.rs index 1f37712b991..be33073ba14 100644 --- a/vortex-array/src/arrays/chunked/array.rs +++ b/vortex-array/src/arrays/chunked/array.rs @@ -10,13 +10,14 @@ use std::fmt::Debug; use futures::stream; use vortex_buffer::Buffer; use vortex_buffer::BufferMut; -use vortex_error::VortexExpect as _; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use crate::ArrayRef; use crate::DynArray; use crate::IntoArray; +use crate::ToCanonical; use crate::arrays::PrimitiveArray; use crate::dtype::DType; use crate::iter::ArrayIterator; @@ -28,12 +29,15 @@ use crate::stream::ArrayStream; use crate::stream::ArrayStreamAdapter; use crate::validity::Validity; +// ChunkedArray has a variable number of slots: +// slots[0] = chunk_offsets +// slots[1..] = chunks + #[derive(Clone, Debug)] pub struct ChunkedArray { pub(super) dtype: DType, pub(super) len: usize, - pub(super) chunk_offsets: PrimitiveArray, - pub(super) chunks: Vec, + pub(super) slots: Vec>, pub(super) stats_set: ArrayStats, } @@ -78,15 +82,19 @@ impl ChunkedArray { unsafe { chunk_offsets_buf.push_unchecked(curr_offset) } } - let chunk_offsets = PrimitiveArray::new(chunk_offsets_buf.freeze(), Validity::NonNullable); + let chunk_offsets = + PrimitiveArray::new(chunk_offsets_buf.freeze(), Validity::NonNullable).into_array(); + + let mut slots = Vec::with_capacity(1 + nchunks); + slots.push(Some(chunk_offsets)); + slots.extend(chunks.into_iter().map(Some)); Self { dtype, len: curr_offset .try_into() .vortex_expect("chunk offset must fit in usize"), - chunk_offsets, - chunks, + slots, stats_set: Default::default(), } } @@ -108,16 +116,26 @@ impl ChunkedArray { pub fn chunk(&self, idx: usize) -> &ArrayRef { assert!(idx < self.nchunks(), "chunk index {idx} out of bounds"); - &self.chunks[idx] + self.slots[idx + 1] + .as_ref() + .vortex_expect("ChunkedArray chunk slot") } pub fn nchunks(&self) -> usize { - self.chunks.len() + self.slots.len().saturating_sub(1) + } + + /// Returns the chunk offsets as a primitive array. + pub(crate) fn chunk_offsets_array(&self) -> PrimitiveArray { + self.slots[0] + .as_ref() + .vortex_expect("ChunkedArray chunk_offsets slot") + .to_primitive() } #[inline] pub fn chunk_offsets(&self) -> Buffer { - self.chunk_offsets.to_buffer() + self.chunk_offsets_array().to_buffer() } pub(crate) fn find_chunk_idx(&self, index: usize) -> VortexResult<(usize, usize)> { @@ -138,22 +156,38 @@ impl ChunkedArray { Ok((index_chunk, index_in_chunk)) } - pub fn chunks(&self) -> &[ArrayRef] { - &self.chunks + /// Returns the chunks as a vector of owned references. + pub fn chunks(&self) -> Vec { + self.slots[1..] + .iter() + .map(|s| s.as_ref().vortex_expect("ChunkedArray chunk slot").clone()) + .collect() } pub fn non_empty_chunks(&self) -> impl Iterator + '_ { - self.chunks().iter().filter(|c| !c.is_empty()) + self.slots[1..] + .iter() + .filter_map(|s| s.as_ref()) + .filter(|c| !c.is_empty()) } pub fn array_iterator(&self) -> impl ArrayIterator + '_ { - ArrayIteratorAdapter::new(self.dtype().clone(), self.chunks().iter().cloned().map(Ok)) + ArrayIteratorAdapter::new( + self.dtype().clone(), + self.slots[1..] + .iter() + .map(|s| Ok(s.as_ref().vortex_expect("ChunkedArray chunk slot").clone())), + ) } pub fn array_stream(&self) -> impl ArrayStream + '_ { ArrayStreamAdapter::new( self.dtype().clone(), - stream::iter(self.chunks().iter().cloned().map(Ok)), + stream::iter( + self.slots[1..] + .iter() + .map(|s| Ok(s.as_ref().vortex_expect("ChunkedArray chunk slot").clone())), + ), ) } diff --git a/vortex-array/src/arrays/chunked/compute/aggregate.rs b/vortex-array/src/arrays/chunked/compute/aggregate.rs index 08f600dd00d..66ac55615ae 100644 --- a/vortex-array/src/arrays/chunked/compute/aggregate.rs +++ b/vortex-array/src/arrays/chunked/compute/aggregate.rs @@ -26,7 +26,7 @@ impl DynAggregateKernel for ChunkedArrayAggregate { let mut acc = aggregate_fn.accumulator(chunked.dtype(), ctx.session())?; for chunk in chunked.chunks() { - acc.accumulate(chunk)?; + acc.accumulate(&chunk)?; } Ok(Some(acc.finish()?)) } diff --git a/vortex-array/src/arrays/chunked/compute/filter.rs b/vortex-array/src/arrays/chunked/compute/filter.rs index 05b513940a8..a63b448f1d2 100644 --- a/vortex-array/src/arrays/chunked/compute/filter.rs +++ b/vortex-array/src/arrays/chunked/compute/filter.rs @@ -70,7 +70,7 @@ fn filter_slices( let chunk_filters = chunk_filters(array, slices)?; // Now, apply the chunk filter to every slice. - for (chunk, chunk_filter) in array.chunks().iter().zip(chunk_filters.into_iter()) { + for (chunk, chunk_filter) in array.chunks().into_iter().zip(chunk_filters.into_iter()) { match chunk_filter { // All => preserve the entire chunk unfiltered. ChunkFilter::All => result.push(chunk.clone()), diff --git a/vortex-array/src/arrays/chunked/compute/is_sorted.rs b/vortex-array/src/arrays/chunked/compute/is_sorted.rs index be06d84a83a..477ab1a380f 100644 --- a/vortex-array/src/arrays/chunked/compute/is_sorted.rs +++ b/vortex-array/src/arrays/chunked/compute/is_sorted.rs @@ -52,7 +52,7 @@ fn is_sorted_impl( } for chunk in array.chunks() { - match reentry_fn(chunk)? { + match reentry_fn(&chunk)? { None => { return Ok(None); } diff --git a/vortex-array/src/arrays/chunked/compute/mask.rs b/vortex-array/src/arrays/chunked/compute/mask.rs index 225072cabf3..810a259f398 100644 --- a/vortex-array/src/arrays/chunked/compute/mask.rs +++ b/vortex-array/src/arrays/chunked/compute/mask.rs @@ -22,7 +22,7 @@ impl MaskKernel for ChunkedVTable { let chunk_offsets = array.chunk_offsets(); let new_chunks: Vec = array .chunks() - .iter() + .into_iter() .enumerate() .map(|(i, chunk)| { let start: usize = chunk_offsets[i].try_into()?; diff --git a/vortex-array/src/arrays/chunked/compute/rules.rs b/vortex-array/src/arrays/chunked/compute/rules.rs index 6e51bc0f611..fada170c55d 100644 --- a/vortex-array/src/arrays/chunked/compute/rules.rs +++ b/vortex-array/src/arrays/chunked/compute/rules.rs @@ -42,8 +42,8 @@ impl ArrayParentReduceRule for ChunkedUnaryScalarFnPushDownRule { } let new_chunks: Vec<_> = array - .chunks - .iter() + .chunks() + .into_iter() .map(|chunk| { ScalarFnArray::try_new( parent.scalar_fn().clone(), @@ -83,8 +83,8 @@ impl ArrayParentReduceRule for ChunkedConstantScalarFnPushDownRul } let new_chunks: Vec<_> = array - .chunks - .iter() + .chunks() + .into_iter() .map(|chunk| { let new_children: Vec<_> = parent .children() diff --git a/vortex-array/src/arrays/chunked/compute/sum.rs b/vortex-array/src/arrays/chunked/compute/sum.rs index 3b7f504c03d..e308b77c144 100644 --- a/vortex-array/src/arrays/chunked/compute/sum.rs +++ b/vortex-array/src/arrays/chunked/compute/sum.rs @@ -14,7 +14,7 @@ use crate::scalar::Scalar; impl SumKernel for ChunkedVTable { fn sum(&self, array: &ChunkedArray, accumulator: &Scalar) -> VortexResult { array - .chunks + .chunks() .iter() .try_fold(accumulator.clone(), |result, chunk| { sum_with_accumulator(chunk, &result) diff --git a/vortex-array/src/arrays/chunked/vtable/canonical.rs b/vortex-array/src/arrays/chunked/vtable/canonical.rs index d165dc0be6e..a3a971f1c16 100644 --- a/vortex-array/src/arrays/chunked/vtable/canonical.rs +++ b/vortex-array/src/arrays/chunked/vtable/canonical.rs @@ -34,10 +34,11 @@ pub(super) fn _canonicalize( return array.chunks()[0].clone().execute::(ctx); } + let owned_chunks = array.chunks(); Ok(match array.dtype() { DType::Struct(struct_dtype, _) => { let struct_array = pack_struct_chunks( - array.chunks(), + &owned_chunks, Validity::copy_from_array(&array.clone().into_array())?, struct_dtype, ctx, @@ -45,7 +46,7 @@ pub(super) fn _canonicalize( Canonical::Struct(struct_array) } DType::List(elem_dtype, _) => Canonical::List(swizzle_list_chunks( - array.chunks(), + &owned_chunks, Validity::copy_from_array(&array.clone().into_array())?, elem_dtype, ctx, diff --git a/vortex-array/src/arrays/chunked/vtable/mod.rs b/vortex-array/src/arrays/chunked/vtable/mod.rs index d5b6b6259da..dac27f8eb79 100644 --- a/vortex-array/src/arrays/chunked/vtable/mod.rs +++ b/vortex-array/src/arrays/chunked/vtable/mod.rs @@ -74,8 +74,11 @@ impl VTable for ChunkedVTable { fn array_hash(array: &ChunkedArray, state: &mut H, precision: Precision) { array.dtype.hash(state); array.len.hash(state); - array.chunk_offsets.as_ref().array_hash(state, precision); - for chunk in &array.chunks { + array + .chunk_offsets_array() + .as_ref() + .array_hash(state, precision); + for chunk in array.chunks() { chunk.array_hash(state, precision); } } @@ -84,14 +87,14 @@ impl VTable for ChunkedVTable { array.dtype == other.dtype && array.len == other.len && array - .chunk_offsets + .chunk_offsets_array() .as_ref() - .array_eq(other.chunk_offsets.as_ref(), precision) - && array.chunks.len() == other.chunks.len() + .array_eq(other.chunk_offsets_array().as_ref(), precision) + && array.nchunks() == other.nchunks() && array - .chunks + .chunks() .iter() - .zip(&other.chunks) + .zip(other.chunks().iter()) .all(|(a, b)| a.array_eq(b, precision)) } @@ -113,7 +116,7 @@ impl VTable for ChunkedVTable { fn child(array: &ChunkedArray, idx: usize) -> ArrayRef { match idx { - 0 => array.chunk_offsets.clone().into_array(), + 0 => array.chunk_offsets_array().into_array(), n => array.chunks()[n - 1].clone(), } } @@ -169,7 +172,7 @@ impl VTable for ChunkedVTable { let chunk_offsets_buf = chunk_offsets_array.to_buffer::(); // The remaining children contain the actual data of the chunks - let chunks = chunk_offsets_buf + let chunks: Vec = chunk_offsets_buf .iter() .tuple_windows() .enumerate() @@ -188,12 +191,14 @@ impl VTable for ChunkedVTable { let len = usize::try_from(*total_len) .map_err(|_| vortex_err!("total length {} exceeds usize range", total_len))?; - // Construct directly using the struct fields to avoid recomputing chunk_offsets + // Construct directly using slots to avoid recomputing chunk_offsets + let mut slots = Vec::with_capacity(1 + chunks.len()); + slots.push(Some(chunk_offsets.into_array())); + slots.extend(chunks.into_iter().map(Some)); Ok(ChunkedArray { dtype: dtype.clone(), len, - chunk_offsets, - chunks, + slots, stats_set: Default::default(), }) } @@ -216,9 +221,12 @@ impl VTable for ChunkedVTable { chunk_offsets_buf.len() ); - let chunks = children.into_iter().skip(1).collect(); - array.chunk_offsets = PrimitiveArray::new(chunk_offsets_buf.clone(), Validity::NonNullable); - array.chunks = chunks; + let mut slots = Vec::with_capacity(children.len()); + slots.push(Some( + PrimitiveArray::new(chunk_offsets_buf.clone(), Validity::NonNullable).into_array(), + )); + slots.extend(children.into_iter().skip(1).map(Some)); + array.slots = slots; let total_len = chunk_offsets_buf .last() @@ -244,10 +252,30 @@ impl VTable for ChunkedVTable { Ok(ExecutionStep::Done(_canonicalize(array, ctx)?.into_array())) } + fn nslots(array: &ChunkedArray) -> usize { + array.slots.len() + } + + fn slot(array: &ChunkedArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &ChunkedArray, idx: usize) -> &str { + match idx { + 0 => "chunk_offsets", + _ => "chunk", + } + } + + fn with_slots(array: &mut ChunkedArray, slots: Vec>) -> VortexResult<()> { + array.slots = slots; + Ok(()) + } + fn reduce(array: &Self::Array) -> VortexResult> { - Ok(match array.chunks.len() { + Ok(match array.nchunks() { 0 => Some(Canonical::empty(array.dtype()).into_array()), - 1 => Some(array.chunks[0].clone()), + 1 => Some(array.chunk(0).clone()), _ => None, }) } diff --git a/vortex-array/src/arrays/constant/array.rs b/vortex-array/src/arrays/constant/array.rs index e8bcb7d88c6..336f973f140 100644 --- a/vortex-array/src/arrays/constant/array.rs +++ b/vortex-array/src/arrays/constant/array.rs @@ -1,13 +1,18 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use crate::ArrayRef; use crate::scalar::Scalar; use crate::stats::ArrayStats; +pub(super) const NUM_SLOTS: usize = 0; +pub(super) const SLOT_NAMES: [&str; 0] = []; + #[derive(Clone, Debug)] pub struct ConstantArray { pub(super) scalar: Scalar, pub(super) len: usize, + pub(super) slots: Vec>, pub(super) stats_set: ArrayStats, } @@ -20,6 +25,7 @@ impl ConstantArray { Self { scalar, len, + slots: vec![], stats_set: Default::default(), } } diff --git a/vortex-array/src/arrays/constant/vtable/mod.rs b/vortex-array/src/arrays/constant/vtable/mod.rs index 12fee7869d2..4da4a6df8ec 100644 --- a/vortex-array/src/arrays/constant/vtable/mod.rs +++ b/vortex-array/src/arrays/constant/vtable/mod.rs @@ -17,6 +17,8 @@ use crate::ExecutionStep; use crate::IntoArray; use crate::Precision; use crate::arrays::ConstantArray; +use crate::arrays::constant::array::NUM_SLOTS; +use crate::arrays::constant::array::SLOT_NAMES; use crate::arrays::constant::compute::rules::PARENT_RULES; use crate::arrays::constant::vtable::canonical::constant_canonicalize; use crate::buffer::BufferHandle; @@ -119,6 +121,30 @@ impl VTable for ConstantVTable { vortex_panic!("ConstantArray child_name index {idx} out of bounds") } + fn nslots(_array: &ConstantArray) -> usize { + NUM_SLOTS + } + + fn slot(_array: &ConstantArray, idx: usize) -> &Option { + let _ = SLOT_NAMES; + vortex_panic!("ConstantArray slot index {idx} out of bounds") + } + + fn slot_name(_array: &ConstantArray, idx: usize) -> &str { + vortex_panic!("ConstantArray slot_name index {idx} out of bounds") + } + + fn with_slots(array: &mut ConstantArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "ConstantArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn metadata(array: &ConstantArray) -> VortexResult { Ok(array.scalar().clone()) } diff --git a/vortex-array/src/arrays/decimal/array.rs b/vortex-array/src/arrays/decimal/array.rs index 9f1be7e487a..68f23d0a28e 100644 --- a/vortex-array/src/arrays/decimal/array.rs +++ b/vortex-array/src/arrays/decimal/array.rs @@ -11,6 +11,7 @@ use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_panic; +use crate::ArrayRef; use crate::ExecutionCtx; use crate::IntoArray; use crate::arrays::PrimitiveArray; @@ -28,6 +29,9 @@ use crate::stats::ArrayStats; use crate::validity::Validity; use crate::vtable::ValidityHelper; +pub(super) const NUM_SLOTS: usize = 0; +pub(super) const SLOT_NAMES: [&str; 0] = []; + /// A decimal array that stores fixed-precision decimal numbers with configurable scale. /// /// This mirrors the Apache Arrow Decimal encoding and provides exact arithmetic for @@ -87,6 +91,7 @@ use crate::vtable::ValidityHelper; /// ``` #[derive(Clone, Debug)] pub struct DecimalArray { + pub(super) slots: Vec>, pub(super) dtype: DType, pub(super) values: BufferHandle, pub(super) values_type: DecimalType, @@ -223,6 +228,7 @@ impl DecimalArray { } Self { + slots: vec![], values, values_type, dtype: DType::Decimal(decimal_dtype, validity.nullability()), diff --git a/vortex-array/src/arrays/decimal/vtable/mod.rs b/vortex-array/src/arrays/decimal/vtable/mod.rs index 7eb78acb832..85fdf3ed7d5 100644 --- a/vortex-array/src/arrays/decimal/vtable/mod.rs +++ b/vortex-array/src/arrays/decimal/vtable/mod.rs @@ -18,6 +18,8 @@ use crate::IntoArray; use crate::ProstMetadata; use crate::SerializeMetadata; use crate::arrays::DecimalArray; +use crate::arrays::decimal::array::NUM_SLOTS; +use crate::arrays::decimal::array::SLOT_NAMES; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::dtype::DecimalType; @@ -187,6 +189,29 @@ impl VTable for DecimalVTable { }) } + fn nslots(_array: &DecimalArray) -> usize { + NUM_SLOTS + } + + fn slot(_array: &DecimalArray, idx: usize) -> &Option { + vortex_panic!("DecimalArray has no slots, requested index {idx}") + } + + fn slot_name(_array: &DecimalArray, idx: usize) -> &str { + let _ = SLOT_NAMES; + vortex_panic!("DecimalArray has no slots, requested index {idx}") + } + + fn with_slots(array: &mut DecimalArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.is_empty(), + "DecimalArray expects 0 slots, got {}", + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() <= 1, diff --git a/vortex-array/src/arrays/dict/array.rs b/vortex-array/src/arrays/dict/array.rs index 59662528240..628d49890bf 100644 --- a/vortex-array/src/arrays/dict/array.rs +++ b/vortex-array/src/arrays/dict/array.rs @@ -31,10 +31,14 @@ pub struct DictMetadata { pub(super) all_values_referenced: Option, } +pub(super) const CODES_SLOT: usize = 0; +pub(super) const VALUES_SLOT: usize = 1; +pub(super) const NUM_SLOTS: usize = 2; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["codes", "values"]; + #[derive(Debug, Clone)] pub struct DictArray { - pub(super) codes: ArrayRef, - pub(super) values: ArrayRef, + pub(super) slots: Vec>, pub(super) stats_set: ArrayStats, pub(super) dtype: DType, /// Indicates whether all dictionary values are definitely referenced by at least one code. @@ -63,8 +67,7 @@ impl DictArray { .dtype() .union_nullability(codes.dtype().nullability()); Self { - codes, - values, + slots: vec![Some(codes), Some(values)], stats_set: Default::default(), dtype, all_values_referenced: false, @@ -122,20 +125,28 @@ impl DictArray { pub fn into_parts(self) -> DictArrayParts { DictArrayParts { - codes: self.codes, - values: self.values, + codes: self.slots[CODES_SLOT] + .clone() + .vortex_expect("DictArray codes slot"), + values: self.slots[VALUES_SLOT] + .clone() + .vortex_expect("DictArray values slot"), dtype: self.dtype, } } #[inline] pub fn codes(&self) -> &ArrayRef { - &self.codes + self.slots[CODES_SLOT] + .as_ref() + .vortex_expect("DictArray codes slot") } #[inline] pub fn values(&self) -> &ArrayRef { - &self.values + self.slots[VALUES_SLOT] + .as_ref() + .vortex_expect("DictArray values slot") } /// Returns `true` if all dictionary values are definitely referenced by at least one code. diff --git a/vortex-array/src/arrays/dict/compute/rules.rs b/vortex-array/src/arrays/dict/compute/rules.rs index e29be087497..b77e99b2c89 100644 --- a/vortex-array/src/arrays/dict/compute/rules.rs +++ b/vortex-array/src/arrays/dict/compute/rules.rs @@ -95,7 +95,9 @@ impl ArrayParentReduceRule for DictionaryScalarFnValuesPushDownRule // If the scalar function is null-sensitive, then we cannot push it down to values if // we have any nulls in the codes. - if array.codes.dtype().is_nullable() && !array.codes.all_valid()? && sig.is_null_sensitive() + if array.codes().dtype().is_nullable() + && !array.codes().all_valid()? + && sig.is_null_sensitive() { tracing::trace!( "Not pushing down null-sensitive scalar function {} over dictionary with null codes {}", @@ -184,10 +186,13 @@ impl ArrayParentReduceRule for DictionaryScalarFnCodesPullUpRule { } } - let new_values = - ScalarFnArray::try_new(parent.scalar_fn().clone(), new_children, array.values.len())? - .into_array() - .optimize()?; + let new_values = ScalarFnArray::try_new( + parent.scalar_fn().clone(), + new_children, + array.values().len(), + )? + .into_array() + .optimize()?; let new_dict = unsafe { DictArray::new_unchecked(array.codes().clone(), new_values) }.into_array(); diff --git a/vortex-array/src/arrays/dict/vtable/mod.rs b/vortex-array/src/arrays/dict/vtable/mod.rs index ffde0e4223b..a949bfc6831 100644 --- a/vortex-array/src/arrays/dict/vtable/mod.rs +++ b/vortex-array/src/arrays/dict/vtable/mod.rs @@ -13,6 +13,8 @@ use vortex_session::VortexSession; use super::DictArray; use super::DictMetadata; +use super::array::NUM_SLOTS; +use super::array::SLOT_NAMES; use super::take_canonical; use crate::ArrayRef; use crate::Canonical; @@ -63,7 +65,7 @@ impl VTable for DictVTable { } fn len(array: &DictArray) -> usize { - array.codes.len() + array.codes().len() } fn dtype(array: &DictArray) -> &DType { @@ -76,14 +78,14 @@ impl VTable for DictVTable { fn array_hash(array: &DictArray, state: &mut H, precision: Precision) { array.dtype.hash(state); - array.codes.array_hash(state, precision); - array.values.array_hash(state, precision); + array.codes().array_hash(state, precision); + array.values().array_hash(state, precision); } fn array_eq(array: &DictArray, other: &DictArray, precision: Precision) -> bool { array.dtype == other.dtype - && array.codes.array_eq(&other.codes, precision) - && array.values.array_eq(&other.values, precision) + && array.codes().array_eq(other.codes(), precision) + && array.values().array_eq(other.values(), precision) } fn nbuffers(_array: &DictArray) -> usize { @@ -177,6 +179,29 @@ impl VTable for DictVTable { }) } + fn nslots(_array: &DictArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &DictArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &DictArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + + fn with_slots(array: &mut DictArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "DictArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 2, @@ -186,8 +211,7 @@ impl VTable for DictVTable { let [codes, values]: [ArrayRef; 2] = children .try_into() .map_err(|_| vortex_err!("Failed to convert children to array"))?; - array.codes = codes; - array.values = values; + array.slots = vec![Some(codes), Some(values)]; Ok(()) } @@ -246,10 +270,13 @@ pub(super) fn execute_fast_path( } // All codes are null - result is all nulls - if array.codes.all_invalid()? { + if array.codes().all_invalid()? { return Ok(Some( - ConstantArray::new(Scalar::null(array.dtype().as_nullable()), array.codes.len()) - .into_array(), + ConstantArray::new( + Scalar::null(array.dtype().as_nullable()), + array.codes().len(), + ) + .into_array(), )); } diff --git a/vortex-array/src/arrays/extension/array.rs b/vortex-array/src/arrays/extension/array.rs index 8df5963a5e9..e2a57a631af 100644 --- a/vortex-array/src/arrays/extension/array.rs +++ b/vortex-array/src/arrays/extension/array.rs @@ -1,12 +1,18 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use vortex_error::VortexExpect; + use crate::ArrayRef; use crate::dtype::DType; use crate::dtype::extension::ExtDTypeRef; use crate::dtype::extension::ExtId; use crate::stats::ArrayStats; +pub(super) const STORAGE_SLOT: usize = 0; +pub(super) const NUM_SLOTS: usize = 1; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["storage"]; + /// An extension array that wraps another array with additional type information. /// /// **⚠️ Unstable API**: This is an experimental feature that may change significantly @@ -48,7 +54,7 @@ use crate::stats::ArrayStats; #[derive(Clone, Debug)] pub struct ExtensionArray { pub(super) dtype: DType, - pub(super) storage: ArrayRef, + pub(super) slots: Vec>, pub(super) stats_set: ArrayStats, } @@ -61,7 +67,7 @@ impl ExtensionArray { ); Self { dtype: DType::Extension(ext_dtype), - storage, + slots: vec![Some(storage)], stats_set: ArrayStats::default(), } } @@ -74,7 +80,9 @@ impl ExtensionArray { } pub fn storage(&self) -> &ArrayRef { - &self.storage + self.slots[STORAGE_SLOT] + .as_ref() + .vortex_expect("ExtensionArray storage slot") } #[inline] diff --git a/vortex-array/src/arrays/extension/vtable/mod.rs b/vortex-array/src/arrays/extension/vtable/mod.rs index e99db442573..4771bed3796 100644 --- a/vortex-array/src/arrays/extension/vtable/mod.rs +++ b/vortex-array/src/arrays/extension/vtable/mod.rs @@ -22,6 +22,8 @@ use crate::ExecutionStep; use crate::IntoArray; use crate::Precision; use crate::arrays::ExtensionArray; +use crate::arrays::extension::array::NUM_SLOTS; +use crate::arrays::extension::array::SLOT_NAMES; use crate::arrays::extension::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -48,7 +50,7 @@ impl VTable for ExtensionVTable { } fn len(array: &ExtensionArray) -> usize { - array.storage.len() + array.storage().len() } fn dtype(array: &ExtensionArray) -> &DType { @@ -65,11 +67,11 @@ impl VTable for ExtensionVTable { precision: Precision, ) { array.dtype.hash(state); - array.storage.array_hash(state, precision); + array.storage().array_hash(state, precision); } fn array_eq(array: &ExtensionArray, other: &ExtensionArray, precision: Precision) -> bool { - array.dtype == other.dtype && array.storage.array_eq(&other.storage, precision) + array.dtype == other.dtype && array.storage().array_eq(other.storage(), precision) } fn nbuffers(_array: &ExtensionArray) -> usize { @@ -90,7 +92,7 @@ impl VTable for ExtensionVTable { fn child(array: &ExtensionArray, idx: usize) -> ArrayRef { match idx { - 0 => array.storage.clone(), + 0 => array.storage().clone(), _ => vortex_panic!("ExtensionArray child index {idx} out of bounds"), } } @@ -102,6 +104,18 @@ impl VTable for ExtensionVTable { } } + fn nslots(_array: &ExtensionArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &ExtensionArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &ExtensionArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + fn metadata(_array: &ExtensionArray) -> VortexResult { Ok(EmptyMetadata) } @@ -137,16 +151,28 @@ impl VTable for ExtensionVTable { Ok(ExtensionArray::new(ext_dtype.clone(), storage)) } + fn with_slots(array: &mut Self::Array, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "ExtensionArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 1, "ExtensionArray expects exactly 1 child (storage), got {}", children.len() ); - array.storage = children + let storage = children .into_iter() .next() .vortex_expect("children length already validated"); + array.slots = vec![Some(storage)]; Ok(()) } diff --git a/vortex-array/src/arrays/extension/vtable/validity.rs b/vortex-array/src/arrays/extension/vtable/validity.rs index 98269f854b3..fce521f23fc 100644 --- a/vortex-array/src/arrays/extension/vtable/validity.rs +++ b/vortex-array/src/arrays/extension/vtable/validity.rs @@ -8,6 +8,6 @@ use crate::vtable::ValidityChild; impl ValidityChild for ExtensionVTable { fn validity_child(array: &ExtensionArray) -> &ArrayRef { - &array.storage + array.storage() } } diff --git a/vortex-array/src/arrays/filter/array.rs b/vortex-array/src/arrays/filter/array.rs index 40857487a65..fdbe28754b4 100644 --- a/vortex-array/src/arrays/filter/array.rs +++ b/vortex-array/src/arrays/filter/array.rs @@ -9,6 +9,10 @@ use vortex_mask::Mask; use crate::ArrayRef; use crate::stats::ArrayStats; +pub(super) const CHILD_SLOT: usize = 0; +pub(super) const NUM_SLOTS: usize = 1; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["child"]; + /// Decomposed parts of the filter array. pub struct FilterArrayParts { /// Child array that is filtered by the mask @@ -24,8 +28,8 @@ pub struct FilterArrayParts { /// The resulting array contains only the elements where the mask is true. #[derive(Clone, Debug)] pub struct FilterArray { - /// The source array being filtered. - pub(super) child: ArrayRef, + /// The slots holding child arrays. + pub(super) slots: Vec>, /// The boolean mask selecting which elements to keep. pub(super) mask: Mask, @@ -49,7 +53,7 @@ impl FilterArray { ); Ok(Self { - child: array, + slots: vec![Some(array)], mask, stats: ArrayStats::default(), }) @@ -57,7 +61,9 @@ impl FilterArray { /// The child array being filtered. pub fn child(&self) -> &ArrayRef { - &self.child + self.slots[CHILD_SLOT] + .as_ref() + .vortex_expect("FilterArray child slot") } /// The mask used to filter the child array. @@ -68,7 +74,9 @@ impl FilterArray { /// Consume the array and return its individual components. pub fn into_parts(self) -> FilterArrayParts { FilterArrayParts { - child: self.child, + child: self.slots[CHILD_SLOT] + .clone() + .vortex_expect("FilterArray child slot"), mask: self.mask, } } diff --git a/vortex-array/src/arrays/filter/execute/mod.rs b/vortex-array/src/arrays/filter/execute/mod.rs index 0863e6f0cc7..04601cf5b86 100644 --- a/vortex-array/src/arrays/filter/execute/mod.rs +++ b/vortex-array/src/arrays/filter/execute/mod.rs @@ -60,7 +60,7 @@ pub(super) fn execute_filter_fast_paths( // If the mask selects everything, then we can just fully decompress the whole thing. if true_count == array.mask.len() { - return Ok(Some(array.child.clone())); + return Ok(Some(array.child().clone())); } // Also check if the array itself is completely null, in which case we only care about the total diff --git a/vortex-array/src/arrays/filter/rules.rs b/vortex-array/src/arrays/filter/rules.rs index 98d5c6e68a3..a5e553e6620 100644 --- a/vortex-array/src/arrays/filter/rules.rs +++ b/vortex-array/src/arrays/filter/rules.rs @@ -39,7 +39,7 @@ impl ArrayParentReduceRule for FilterFilterRule { _child_idx: usize, ) -> VortexResult> { let combined_mask = child.mask.intersect_by_rank(&parent.mask); - let new_array = child.child.filter(combined_mask)?; + let new_array = child.child().filter(combined_mask)?; Ok(Some(new_array.into_array())) } @@ -51,7 +51,7 @@ struct TrivialFilterRule; impl ArrayReduceRule for TrivialFilterRule { fn reduce(&self, array: &FilterArray) -> VortexResult> { match array.filter_mask() { - Mask::AllTrue(_) => Ok(Some(array.child.clone())), + Mask::AllTrue(_) => Ok(Some(array.child().clone())), Mask::AllFalse(_) => Ok(Some(Canonical::empty(array.dtype()).into_array())), Mask::Values(_) => Ok(None), } diff --git a/vortex-array/src/arrays/filter/vtable.rs b/vortex-array/src/arrays/filter/vtable.rs index 28d31c60d2b..7485a578669 100644 --- a/vortex-array/src/arrays/filter/vtable.rs +++ b/vortex-array/src/arrays/filter/vtable.rs @@ -20,6 +20,8 @@ use crate::DynArray; use crate::IntoArray; use crate::Precision; use crate::arrays::filter::array::FilterArray; +use crate::arrays::filter::array::NUM_SLOTS; +use crate::arrays::filter::array::SLOT_NAMES; use crate::arrays::filter::execute::execute_filter; use crate::arrays::filter::execute::execute_filter_fast_paths; use crate::arrays::filter::rules::PARENT_RULES; @@ -61,7 +63,7 @@ impl VTable for FilterVTable { } fn dtype(array: &FilterArray) -> &DType { - array.child.dtype() + array.child().dtype() } fn stats(array: &FilterArray) -> StatsSetRef<'_> { @@ -69,12 +71,13 @@ impl VTable for FilterVTable { } fn array_hash(array: &FilterArray, state: &mut H, precision: Precision) { - array.child.array_hash(state, precision); + array.child().array_hash(state, precision); array.mask.array_hash(state, precision); } fn array_eq(array: &FilterArray, other: &FilterArray, precision: Precision) -> bool { - array.child.array_eq(&other.child, precision) && array.mask.array_eq(&other.mask, precision) + array.child().array_eq(other.child(), precision) + && array.mask.array_eq(&other.mask, precision) } fn nbuffers(_array: &Self::Array) -> usize { @@ -95,7 +98,7 @@ impl VTable for FilterVTable { fn child(array: &Self::Array, idx: usize) -> ArrayRef { match idx { - 0 => array.child.clone(), + 0 => array.child().clone(), _ => vortex_panic!("FilterArray child index {idx} out of bounds"), } } @@ -107,6 +110,18 @@ impl VTable for FilterVTable { } } + fn nslots(_array: &Self::Array) -> usize { + NUM_SLOTS + } + + fn slot(array: &Self::Array, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &Self::Array, idx: usize) -> &str { + SLOT_NAMES[idx] + } + fn metadata(array: &Self::Array) -> VortexResult { Ok(FilterMetadata(array.mask.clone())) } @@ -135,11 +150,18 @@ impl VTable for FilterVTable { ) -> VortexResult { assert_eq!(len, metadata.0.true_count()); let child = children.get(0, dtype, metadata.0.len())?; - Ok(FilterArray { - child, - mask: metadata.0.clone(), - stats: Default::default(), - }) + FilterArray::try_new(child, metadata.0.clone()) + } + + fn with_slots(array: &mut Self::Array, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "FilterArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) } fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { @@ -148,10 +170,11 @@ impl VTable for FilterVTable { "FilterArray expects exactly 1 child, got {}", children.len() ); - array.child = children + let child = children .into_iter() .next() .vortex_expect("children length already validated"); + array.slots = vec![Some(child)]; Ok(()) } @@ -166,7 +189,7 @@ impl VTable for FilterVTable { // We rely on the optimization pass that runs prior to this execution for filter pushdown, // so now we can just execute the filter without worrying. Ok(ExecutionStep::Done( - execute_filter(array.child.clone().execute(ctx)?, mask_values).into_array(), + execute_filter(array.child().clone().execute(ctx)?, mask_values).into_array(), )) } @@ -185,13 +208,13 @@ impl VTable for FilterVTable { impl OperationsVTable for FilterVTable { fn scalar_at(array: &FilterArray, index: usize) -> VortexResult { let rank_idx = array.mask.rank(index); - array.child.scalar_at(rank_idx) + array.child().scalar_at(rank_idx) } } impl ValidityVTable for FilterVTable { fn validity(array: &FilterArray) -> VortexResult { - array.child.validity()?.filter(&array.mask) + array.child().validity()?.filter(&array.mask) } } diff --git a/vortex-array/src/arrays/fixed_size_list/array.rs b/vortex-array/src/arrays/fixed_size_list/array.rs index 12a9e044c11..1d33758976c 100644 --- a/vortex-array/src/arrays/fixed_size_list/array.rs +++ b/vortex-array/src/arrays/fixed_size_list/array.rs @@ -13,6 +13,10 @@ use crate::dtype::DType; use crate::stats::ArrayStats; use crate::validity::Validity; +pub(super) const ELEMENTS_SLOT: usize = 0; +pub(super) const NUM_SLOTS: usize = 1; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["elements"]; + /// The canonical encoding for fixed-size list arrays. /// /// A fixed-size list array stores lists where each list has the same number of elements. This is @@ -67,12 +71,8 @@ pub struct FixedSizeListArray { /// This type **must** be the variant [`DType::FixedSizeList`]. pub(super) dtype: DType, - /// The `elements` data array, where each fixed-size list scalar is a _slice_ of the `elements` - /// array, and each inner list element is a _scalar_ of the `elements` array. - /// - /// The fixed-size list scalars (or the elements of the array) are contiguous (regardless of - /// nullability for easy lookups), each with equal size in memory. - elements: ArrayRef, + /// Slots holding [elements]. + pub(super) slots: Vec>, /// The size of each fixed-size list scalar in the array. /// @@ -161,7 +161,7 @@ impl FixedSizeListArray { Self { dtype: DType::FixedSizeList(Arc::new(elements.dtype().clone()), list_size, nullability), - elements, + slots: vec![Some(elements)], list_size, validity, len, @@ -170,7 +170,13 @@ impl FixedSizeListArray { } pub fn into_parts(self) -> (ArrayRef, Validity, DType) { - (self.elements, self.validity, self.dtype) + ( + self.slots[ELEMENTS_SLOT] + .clone() + .vortex_expect("FixedSizeListArray elements slot"), + self.validity, + self.dtype, + ) } /// Validates the components that would be used to create a [`FixedSizeListArray`]. @@ -211,7 +217,9 @@ impl FixedSizeListArray { /// Returns the elements array. pub fn elements(&self) -> &ArrayRef { - &self.elements + self.slots[ELEMENTS_SLOT] + .as_ref() + .vortex_expect("FixedSizeListArray elements slot") } /// The size of each fixed-size list scalar in the array. diff --git a/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs b/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs index 6922bd12e7f..c22424e5b8c 100644 --- a/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs +++ b/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs @@ -17,6 +17,8 @@ use crate::ExecutionStep; use crate::IntoArray; use crate::Precision; use crate::arrays::FixedSizeListArray; +use crate::arrays::fixed_size_list::array::NUM_SLOTS; +use crate::arrays::fixed_size_list::array::SLOT_NAMES; use crate::arrays::fixed_size_list::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -196,6 +198,32 @@ impl VTable for FixedSizeListVTable { FixedSizeListArray::try_new(elements, *list_size, validity, len) } + fn nslots(_array: &FixedSizeListArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &FixedSizeListArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &FixedSizeListArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + + fn with_slots( + array: &mut FixedSizeListArray, + slots: Vec>, + ) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "FixedSizeListArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 1 || children.len() == 2, diff --git a/vortex-array/src/arrays/list/array.rs b/vortex-array/src/arrays/list/array.rs index cdca1ae04f2..0e224962ea7 100644 --- a/vortex-array/src/arrays/list/array.rs +++ b/vortex-array/src/arrays/list/array.rs @@ -26,6 +26,11 @@ use crate::scalar_fn::fns::operators::Operator; use crate::stats::ArrayStats; use crate::validity::Validity; +pub(super) const ELEMENTS_SLOT: usize = 0; +pub(super) const OFFSETS_SLOT: usize = 1; +pub(super) const NUM_SLOTS: usize = 2; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["elements", "offsets"]; + /// A list array that stores variable-length lists of elements, similar to `Vec>`. /// /// This mirrors the Apache Arrow List array encoding and provides efficient storage @@ -81,8 +86,7 @@ use crate::validity::Validity; #[derive(Clone, Debug)] pub struct ListArray { pub(super) dtype: DType, - pub(super) elements: ArrayRef, - pub(super) offsets: ArrayRef, + pub(super) slots: Vec>, pub(super) validity: Validity, pub(super) stats_set: ArrayStats, } @@ -147,8 +151,7 @@ impl ListArray { Self { dtype: DType::List(Arc::new(elements.dtype().clone()), validity.nullability()), - elements, - offsets, + slots: vec![Some(elements), Some(offsets)], validity, stats_set: Default::default(), } @@ -242,8 +245,12 @@ impl ListArray { pub fn into_parts(self) -> ListArrayParts { ListArrayParts { dtype: self.dtype, - elements: self.elements, - offsets: self.offsets, + elements: self.slots[ELEMENTS_SLOT] + .clone() + .vortex_expect("ListArray elements slot"), + offsets: self.slots[OFFSETS_SLOT] + .clone() + .vortex_expect("ListArray offsets slot"), validity: self.validity, } } @@ -290,7 +297,9 @@ impl ListArray { /// Returns the offsets array. pub fn offsets(&self) -> &ArrayRef { - &self.offsets + self.slots[OFFSETS_SLOT] + .as_ref() + .vortex_expect("ListArray offsets slot") } /// Returns the element dtype of the list array. @@ -303,7 +312,9 @@ impl ListArray { /// Returns the elements array. pub fn elements(&self) -> &ArrayRef { - &self.elements + self.slots[ELEMENTS_SLOT] + .as_ref() + .vortex_expect("ListArray elements slot") } // TODO(connor)[ListView]: Create 2 functions `reset_offsets` and `recursive_reset_offsets`, diff --git a/vortex-array/src/arrays/list/vtable/mod.rs b/vortex-array/src/arrays/list/vtable/mod.rs index 13c5afcd2e0..184c61e7cc9 100644 --- a/vortex-array/src/arrays/list/vtable/mod.rs +++ b/vortex-array/src/arrays/list/vtable/mod.rs @@ -18,6 +18,8 @@ use crate::IntoArray; use crate::Precision; use crate::ProstMetadata; use crate::arrays::ListArray; +use crate::arrays::list::array::NUM_SLOTS; +use crate::arrays::list::array::SLOT_NAMES; use crate::arrays::list::compute::PARENT_KERNELS; use crate::arrays::list::compute::rules::PARENT_RULES; use crate::arrays::listview::list_view_from_list; @@ -61,7 +63,7 @@ impl VTable for ListVTable { } fn len(array: &ListArray) -> usize { - array.offsets.len().saturating_sub(1) + array.offsets().len().saturating_sub(1) } fn dtype(array: &ListArray) -> &DType { @@ -74,15 +76,15 @@ impl VTable for ListVTable { fn array_hash(array: &ListArray, state: &mut H, precision: Precision) { array.dtype.hash(state); - array.elements.array_hash(state, precision); - array.offsets.array_hash(state, precision); + array.elements().array_hash(state, precision); + array.offsets().array_hash(state, precision); array.validity.array_hash(state, precision); } fn array_eq(array: &ListArray, other: &ListArray, precision: Precision) -> bool { array.dtype == other.dtype - && array.elements.array_eq(&other.elements, precision) - && array.offsets.array_eq(&other.offsets, precision) + && array.elements().array_eq(other.elements(), precision) + && array.offsets().array_eq(other.offsets(), precision) && array.validity.array_eq(&other.validity, precision) } @@ -186,6 +188,29 @@ impl VTable for ListVTable { ListArray::try_new(elements, offsets, validity) } + fn nslots(_array: &ListArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &ListArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &ListArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + + fn with_slots(array: &mut ListArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "ListArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 2 || children.len() == 3, diff --git a/vortex-array/src/arrays/listview/array.rs b/vortex-array/src/arrays/listview/array.rs index 2d43320bd95..3d59ebd9821 100644 --- a/vortex-array/src/arrays/listview/array.rs +++ b/vortex-array/src/arrays/listview/array.rs @@ -22,6 +22,12 @@ use crate::match_each_integer_ptype; use crate::stats::ArrayStats; use crate::validity::Validity; +pub(super) const ELEMENTS_SLOT: usize = 0; +pub(super) const OFFSETS_SLOT: usize = 1; +pub(super) const SIZES_SLOT: usize = 2; +pub(super) const NUM_SLOTS: usize = 3; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["elements", "offsets", "sizes"]; + /// The canonical encoding for variable-length list arrays. /// /// The `ListViewArray` encoding differs from [`ListArray`] in that it stores a child `sizes` array @@ -91,21 +97,8 @@ pub struct ListViewArray { /// This type **must** be the variant [`DType::List`]. pub(super) dtype: DType, - /// The `elements` data array, where each list scalar is a _slice_ of the `elements` array, and - /// each inner list element is a _scalar_ of the `elements` array. - elements: ArrayRef, - - /// The `offsets` array indicating the start position of each list in elements. - /// - /// Since we also store `sizes`, this `offsets` field is allowed to be stored out-of-order - /// (which is different from [`ListArray`](crate::arrays::ListArray)), - offsets: ArrayRef, - - /// The `sizes` array indicating the length of each list. - /// - /// This field is intended to be paired with a corresponding offset to determine the list scalar - /// we want to access. - sizes: ArrayRef, + /// Slots holding [elements, offsets, sizes]. + pub(super) slots: Vec>, // TODO(connor)[ListView]: Add the n+1 memory allocation optimization. /// A flag denoting if the array is zero-copyable* to a [`ListArray`](crate::arrays::ListArray). @@ -171,9 +164,7 @@ impl ListViewArray { Ok(Self { dtype: DType::List(Arc::new(elements.dtype().clone()), validity.nullability()), - elements, - offsets, - sizes, + slots: vec![Some(elements), Some(offsets), Some(sizes)], validity, is_zero_copy_to_list: false, stats_set: Default::default(), @@ -212,9 +203,7 @@ impl ListViewArray { Self { dtype: DType::List(Arc::new(elements.dtype().clone()), validity.nullability()), - elements, - offsets, - sizes, + slots: vec![Some(elements), Some(offsets), Some(sizes)], validity, is_zero_copy_to_list: false, stats_set: Default::default(), @@ -305,9 +294,9 @@ impl ListViewArray { pub unsafe fn with_zero_copy_to_list(mut self, is_zctl: bool) -> Self { if cfg!(debug_assertions) && is_zctl { validate_zctl( - &self.elements, - self.offsets.to_primitive(), - self.sizes.to_primitive(), + self.elements(), + self.offsets().to_primitive(), + self.sizes().to_primitive(), ) .vortex_expect("Failed to validate zero-copy to list flag"); } @@ -334,9 +323,9 @@ impl ListViewArray { /// [`with_zero_copy_to_list`]: Self::with_zero_copy_to_list pub fn verify_is_zero_copy_to_list(&self) -> bool { validate_zctl( - &self.elements, - self.offsets.to_primitive(), - self.sizes.to_primitive(), + self.elements(), + self.offsets().to_primitive(), + self.sizes().to_primitive(), ) .is_ok() } @@ -345,9 +334,15 @@ impl ListViewArray { let dtype = self.dtype.into_list_element_opt().vortex_expect("is list"); ListViewArrayParts { elements_dtype: dtype, - elements: self.elements, - offsets: self.offsets, - sizes: self.sizes, + elements: self.slots[ELEMENTS_SLOT] + .clone() + .vortex_expect("ListViewArray elements slot"), + offsets: self.slots[OFFSETS_SLOT] + .clone() + .vortex_expect("ListViewArray offsets slot"), + sizes: self.slots[SIZES_SLOT] + .clone() + .vortex_expect("ListViewArray sizes slot"), validity: self.validity, } } @@ -365,12 +360,12 @@ impl ListViewArray { ); // Fast path for `PrimitiveArray`. - self.offsets + self.offsets() .as_opt::() .map(|p| match_each_integer_ptype!(p.ptype(), |P| { p.as_slice::

()[index].as_() })) .unwrap_or_else(|| { // Slow path: use `scalar_at` if we can't downcast directly to `PrimitiveArray`. - self.offsets + self.offsets() .scalar_at(index) .vortex_expect("offsets must support scalar_at") .as_primitive() @@ -393,12 +388,12 @@ impl ListViewArray { ); // Fast path for `PrimitiveArray`. - self.sizes + self.sizes() .as_opt::() .map(|p| match_each_integer_ptype!(p.ptype(), |P| { p.as_slice::

()[index].as_() })) .unwrap_or_else(|| { // Slow path: use `scalar_at` if we can't downcast directly to `PrimitiveArray`. - self.sizes + self.sizes() .scalar_at(index) .vortex_expect("sizes must support scalar_at") .as_primitive() @@ -420,17 +415,23 @@ impl ListViewArray { /// Returns the offsets array. pub fn offsets(&self) -> &ArrayRef { - &self.offsets + self.slots[OFFSETS_SLOT] + .as_ref() + .vortex_expect("ListViewArray offsets slot") } /// Returns the sizes array. pub fn sizes(&self) -> &ArrayRef { - &self.sizes + self.slots[SIZES_SLOT] + .as_ref() + .vortex_expect("ListViewArray sizes slot") } /// Returns the elements array. pub fn elements(&self) -> &ArrayRef { - &self.elements + self.slots[ELEMENTS_SLOT] + .as_ref() + .vortex_expect("ListViewArray elements slot") } /// Returns true if the `ListViewArray` is zero-copyable to a diff --git a/vortex-array/src/arrays/listview/vtable/mod.rs b/vortex-array/src/arrays/listview/vtable/mod.rs index 45fd1f96cfb..431a25d28f0 100644 --- a/vortex-array/src/arrays/listview/vtable/mod.rs +++ b/vortex-array/src/arrays/listview/vtable/mod.rs @@ -19,6 +19,8 @@ use crate::Precision; use crate::ProstMetadata; use crate::SerializeMetadata; use crate::arrays::ListViewArray; +use crate::arrays::listview::array::NUM_SLOTS; +use crate::arrays::listview::array::SLOT_NAMES; use crate::arrays::listview::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -211,6 +213,29 @@ impl VTable for ListViewVTable { ListViewArray::try_new(elements, offsets, sizes, validity) } + fn nslots(_array: &ListViewArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &ListViewArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &ListViewArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + + fn with_slots(array: &mut ListViewArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "ListViewArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 3 || children.len() == 4, diff --git a/vortex-array/src/arrays/masked/array.rs b/vortex-array/src/arrays/masked/array.rs index 38317caacd7..6372014cc1a 100644 --- a/vortex-array/src/arrays/masked/array.rs +++ b/vortex-array/src/arrays/masked/array.rs @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; @@ -9,9 +10,13 @@ use crate::dtype::DType; use crate::stats::ArrayStats; use crate::validity::Validity; +pub(super) const CHILD_SLOT: usize = 0; +pub(super) const NUM_SLOTS: usize = 1; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["child"]; + #[derive(Clone, Debug)] pub struct MaskedArray { - pub(super) child: ArrayRef, + pub(super) slots: Vec>, pub(super) validity: Validity, pub(super) dtype: DType, pub(super) stats: ArrayStats, @@ -38,7 +43,7 @@ impl MaskedArray { let dtype = child.dtype().as_nullable(); Ok(Self { - child, + slots: vec![Some(child)], validity, dtype, stats: ArrayStats::default(), @@ -46,6 +51,8 @@ impl MaskedArray { } pub fn child(&self) -> &ArrayRef { - &self.child + self.slots[CHILD_SLOT] + .as_ref() + .vortex_expect("MaskedArray child slot") } } diff --git a/vortex-array/src/arrays/masked/compute/filter.rs b/vortex-array/src/arrays/masked/compute/filter.rs index 90f2bb1986c..98318859605 100644 --- a/vortex-array/src/arrays/masked/compute/filter.rs +++ b/vortex-array/src/arrays/masked/compute/filter.rs @@ -18,7 +18,7 @@ impl FilterReduce for MaskedVTable { // Filter the child array // The child is guaranteed to have no nulls, so filtering it is straightforward - let filtered_child = array.child.filter(mask.clone())?; + let filtered_child = array.child().filter(mask.clone())?; // Construct new MaskedArray Ok(Some( diff --git a/vortex-array/src/arrays/masked/compute/mask.rs b/vortex-array/src/arrays/masked/compute/mask.rs index 64867e546f1..ac690ec920d 100644 --- a/vortex-array/src/arrays/masked/compute/mask.rs +++ b/vortex-array/src/arrays/masked/compute/mask.rs @@ -22,9 +22,9 @@ impl MaskReduce for MaskedVTable { .and(Validity::Array(mask.clone()))? .to_array(array.len()); let masked_child = MaskExpr.try_new_array( - array.child.len(), + array.child().len(), EmptyOptions, - [array.child.clone(), combined_mask], + [array.child().clone(), combined_mask], )?; Ok(Some(masked_child)) } diff --git a/vortex-array/src/arrays/masked/compute/slice.rs b/vortex-array/src/arrays/masked/compute/slice.rs index 90a552dd907..f7521bf4796 100644 --- a/vortex-array/src/arrays/masked/compute/slice.rs +++ b/vortex-array/src/arrays/masked/compute/slice.rs @@ -10,21 +10,12 @@ use crate::IntoArray; use crate::arrays::MaskedArray; use crate::arrays::MaskedVTable; use crate::arrays::slice::SliceReduce; -use crate::stats::ArrayStats; impl SliceReduce for MaskedVTable { fn slice(array: &Self::Array, range: Range) -> VortexResult> { - let child = array.child.slice(range.clone())?; + let child = array.child().slice(range.clone())?; let validity = array.validity.slice(range)?; - Ok(Some( - MaskedArray { - child, - validity, - dtype: array.dtype.clone(), - stats: ArrayStats::default(), - } - .into_array(), - )) + Ok(Some(MaskedArray::try_new(child, validity)?.into_array())) } } diff --git a/vortex-array/src/arrays/masked/compute/take.rs b/vortex-array/src/arrays/masked/compute/take.rs index ff9a8c88b9c..c53515e1e40 100644 --- a/vortex-array/src/arrays/masked/compute/take.rs +++ b/vortex-array/src/arrays/masked/compute/take.rs @@ -19,9 +19,9 @@ impl TakeReduce for MaskedVTable { // This is safe because we'll mask out these positions in the validity. let fill_scalar = Scalar::zero_value(indices.dtype()); let filled_take_indices = indices.to_array().fill_null(fill_scalar)?; - array.child.take(filled_take_indices)? + array.child().take(filled_take_indices)? } else { - array.child.take(indices.to_array())? + array.child().take(indices.to_array())? }; // Compute the new validity by taking from array's validity and merging with indices validity diff --git a/vortex-array/src/arrays/masked/execute.rs b/vortex-array/src/arrays/masked/execute.rs index c6c0fc64348..979cab1cdb6 100644 --- a/vortex-array/src/arrays/masked/execute.rs +++ b/vortex-array/src/arrays/masked/execute.rs @@ -139,7 +139,7 @@ fn mask_validity_fixed_size_list(array: FixedSizeListArray, mask: &Mask) -> Fixe fn mask_validity_struct(array: StructArray, mask: &Mask) -> StructArray { let len = array.len(); let new_validity = combine_validity(array.validity(), mask, len); - let fields = array.unmasked_fields().clone(); + let fields = array.unmasked_fields(); let struct_fields = array.struct_fields().clone(); // SAFETY: We're only changing validity, not the data structure unsafe { StructArray::new_unchecked(fields, struct_fields, len, new_validity) } diff --git a/vortex-array/src/arrays/masked/vtable/mod.rs b/vortex-array/src/arrays/masked/vtable/mod.rs index dafd40a50ee..4cecccea916 100644 --- a/vortex-array/src/arrays/masked/vtable/mod.rs +++ b/vortex-array/src/arrays/masked/vtable/mod.rs @@ -20,6 +20,8 @@ use crate::IntoArray; use crate::Precision; use crate::arrays::ConstantArray; use crate::arrays::MaskedArray; +use crate::arrays::masked::array::NUM_SLOTS; +use crate::arrays::masked::array::SLOT_NAMES; use crate::arrays::masked::compute::rules::PARENT_RULES; use crate::arrays::masked::mask_validity_canonical; use crate::buffer::BufferHandle; @@ -59,7 +61,7 @@ impl VTable for MaskedVTable { } fn len(array: &MaskedArray) -> usize { - array.child.len() + array.child().len() } fn dtype(array: &MaskedArray) -> &DType { @@ -71,13 +73,13 @@ impl VTable for MaskedVTable { } fn array_hash(array: &MaskedArray, state: &mut H, precision: Precision) { - array.child.array_hash(state, precision); + array.child().array_hash(state, precision); array.validity.array_hash(state, precision); array.dtype.hash(state); } fn array_eq(array: &MaskedArray, other: &MaskedArray, precision: Precision) -> bool { - array.child.array_eq(&other.child, precision) + array.child().array_eq(other.child(), precision) && array.validity.array_eq(&other.validity, precision) && array.dtype == other.dtype } @@ -100,8 +102,8 @@ impl VTable for MaskedVTable { fn child(array: &Self::Array, idx: usize) -> ArrayRef { match idx { - 0 => array.child.clone(), - 1 => validity_to_child(&array.validity, array.child.len()) + 0 => array.child().clone(), + 1 => validity_to_child(&array.validity, array.child().len()) .vortex_expect("MaskedArray validity child out of bounds"), _ => vortex_panic!("MaskedArray child index {idx} out of bounds"), } @@ -192,6 +194,29 @@ impl VTable for MaskedVTable { PARENT_RULES.evaluate(array, parent, child_idx) } + fn nslots(_array: &MaskedArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &MaskedArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &MaskedArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + + fn with_slots(array: &mut MaskedArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "MaskedArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 1 || children.len() == 2, diff --git a/vortex-array/src/arrays/masked/vtable/operations.rs b/vortex-array/src/arrays/masked/vtable/operations.rs index 65ad7b57597..578c8cbf618 100644 --- a/vortex-array/src/arrays/masked/vtable/operations.rs +++ b/vortex-array/src/arrays/masked/vtable/operations.rs @@ -12,6 +12,6 @@ use crate::vtable::OperationsVTable; impl OperationsVTable for MaskedVTable { fn scalar_at(array: &MaskedArray, index: usize) -> VortexResult { // Invalid indices are handled by the entrypoint function. - Ok(array.child.scalar_at(index)?.into_nullable()) + Ok(array.child().scalar_at(index)?.into_nullable()) } } diff --git a/vortex-array/src/arrays/null/mod.rs b/vortex-array/src/arrays/null/mod.rs index 5b83164333a..518aec42c80 100644 --- a/vortex-array/src/arrays/null/mod.rs +++ b/vortex-array/src/arrays/null/mod.rs @@ -28,6 +28,9 @@ use crate::vtable::OperationsVTable; use crate::vtable::VTable; use crate::vtable::ValidityVTable; +const NUM_SLOTS: usize = 0; +const SLOT_NAMES: [&str; 0] = []; + pub(crate) mod compute; vtable!(Null); @@ -87,6 +90,30 @@ impl VTable for NullVTable { vortex_panic!("NullArray child_name index {idx} out of bounds") } + fn nslots(_array: &NullArray) -> usize { + NUM_SLOTS + } + + fn slot(_array: &NullArray, idx: usize) -> &Option { + let _ = SLOT_NAMES; + vortex_panic!("NullArray slot index {idx} out of bounds") + } + + fn slot_name(_array: &NullArray, idx: usize) -> &str { + vortex_panic!("NullArray slot_name index {idx} out of bounds") + } + + fn with_slots(array: &mut NullArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "NullArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn metadata(_array: &NullArray) -> VortexResult { Ok(EmptyMetadata) } @@ -167,6 +194,7 @@ impl VTable for NullVTable { #[derive(Clone, Debug)] pub struct NullArray { len: usize, + slots: Vec>, stats_set: ArrayStats, } @@ -181,6 +209,7 @@ impl NullArray { pub fn new(len: usize) -> Self { Self { len, + slots: vec![], stats_set: Default::default(), } } diff --git a/vortex-array/src/arrays/primitive/array/mod.rs b/vortex-array/src/arrays/primitive/array/mod.rs index 37c9b475800..60b99d67ab8 100644 --- a/vortex-array/src/arrays/primitive/array/mod.rs +++ b/vortex-array/src/arrays/primitive/array/mod.rs @@ -31,8 +31,12 @@ mod top_value; pub use patch::chunk_range; pub use patch::patch_chunk; +use crate::ArrayRef; use crate::buffer::BufferHandle; +pub(super) const NUM_SLOTS: usize = 0; +pub(super) const SLOT_NAMES: [&str; 0] = []; + /// A primitive array that stores [native types][crate::dtype::NativePType] in a contiguous buffer /// of memory, along with an optional validity child. /// @@ -70,6 +74,7 @@ use crate::buffer::BufferHandle; /// ``` #[derive(Clone, Debug)] pub struct PrimitiveArray { + pub(super) slots: Vec>, pub(super) dtype: DType, pub(super) buffer: BufferHandle, pub(super) validity: Validity, @@ -96,6 +101,7 @@ impl PrimitiveArray { validity: Validity, ) -> Self { Self { + slots: vec![], buffer: handle, dtype: DType::Primitive(ptype, validity.nullability()), validity, @@ -149,6 +155,7 @@ impl PrimitiveArray { .vortex_expect("[Debug Assertion]: Invalid `PrimitiveArray` parameters"); Self { + slots: vec![], dtype: DType::Primitive(T::PTYPE, validity.nullability()), buffer: BufferHandle::new_host(buffer.into_byte_buffer()), validity, @@ -204,6 +211,7 @@ impl PrimitiveArray { pub fn from_buffer_handle(handle: BufferHandle, ptype: PType, validity: Validity) -> Self { let dtype = DType::Primitive(ptype, validity.nullability()); Self { + slots: vec![], buffer: handle, dtype, validity, diff --git a/vortex-array/src/arrays/primitive/vtable/mod.rs b/vortex-array/src/arrays/primitive/vtable/mod.rs index 3418eb1f822..c81b65f0449 100644 --- a/vortex-array/src/arrays/primitive/vtable/mod.rs +++ b/vortex-array/src/arrays/primitive/vtable/mod.rs @@ -14,6 +14,8 @@ use crate::ExecutionCtx; use crate::ExecutionStep; use crate::IntoArray; use crate::arrays::PrimitiveArray; +use crate::arrays::primitive::array::NUM_SLOTS; +use crate::arrays::primitive::array::SLOT_NAMES; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::dtype::PType; @@ -183,6 +185,29 @@ impl VTable for PrimitiveVTable { } } + fn nslots(_array: &PrimitiveArray) -> usize { + NUM_SLOTS + } + + fn slot(_array: &PrimitiveArray, idx: usize) -> &Option { + vortex_panic!("PrimitiveArray has no slots, requested index {idx}") + } + + fn slot_name(_array: &PrimitiveArray, idx: usize) -> &str { + let _ = SLOT_NAMES; + vortex_panic!("PrimitiveArray has no slots, requested index {idx}") + } + + fn with_slots(array: &mut PrimitiveArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.is_empty(), + "PrimitiveArray expects 0 slots, got {}", + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() <= 1, diff --git a/vortex-array/src/arrays/scalar_fn/array.rs b/vortex-array/src/arrays/scalar_fn/array.rs index 1e3ef1d14ba..d8260d051d3 100644 --- a/vortex-array/src/arrays/scalar_fn/array.rs +++ b/vortex-array/src/arrays/scalar_fn/array.rs @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_ensure; @@ -10,12 +11,14 @@ use crate::dtype::DType; use crate::scalar_fn::ScalarFnRef; use crate::stats::ArrayStats; +// ScalarFnArray has a variable number of slots (one per child) + #[derive(Clone, Debug)] pub struct ScalarFnArray { pub(super) scalar_fn: ScalarFnRef, pub(super) dtype: DType, pub(super) len: usize, - pub(super) children: Vec, + pub(super) slots: Vec>, pub(super) stats: ArrayStats, } @@ -30,11 +33,13 @@ impl ScalarFnArray { "ScalarFnArray must have children equal to the array length" ); + let slots = children.into_iter().map(Some).collect(); + Ok(Self { scalar_fn: bound, dtype, len, - children, + slots, stats: Default::default(), }) } @@ -46,7 +51,10 @@ impl ScalarFnArray { } /// Get the children arrays of this scalar function array. - pub fn children(&self) -> &[ArrayRef] { - &self.children + pub fn children(&self) -> Vec { + self.slots + .iter() + .map(|s| s.as_ref().vortex_expect("ScalarFnArray child slot").clone()) + .collect() } } diff --git a/vortex-array/src/arrays/scalar_fn/rules.rs b/vortex-array/src/arrays/scalar_fn/rules.rs index 55af03a7f39..c3d10d89cee 100644 --- a/vortex-array/src/arrays/scalar_fn/rules.rs +++ b/vortex-array/src/arrays/scalar_fn/rules.rs @@ -60,7 +60,7 @@ impl ArrayReduceRule for ScalarFnPackToStructRule { Ok(Some( StructArray::try_new( pack_options.names.clone(), - array.children.clone(), + array.children(), array.len, validity, )? @@ -73,7 +73,7 @@ impl ArrayReduceRule for ScalarFnPackToStructRule { struct ScalarFnConstantRule; impl ArrayReduceRule for ScalarFnConstantRule { fn reduce(&self, array: &ScalarFnArray) -> VortexResult> { - if !array.children.iter().all(|c| c.is::()) { + if !array.children().iter().all(|c| c.is::()) { return Ok(None); } if array.is_empty() { @@ -124,7 +124,7 @@ impl ReduceNode for ScalarFnArray { } fn child_count(&self) -> usize { - self.children.len() + self.children().len() } } @@ -194,14 +194,14 @@ impl ArrayParentReduceRule for ScalarFnUnaryFilterPushDownRule { // If we only have one non-constant child, then it is _always_ cheaper to push down the // filter over the children of the scalar function array. if child - .children + .children() .iter() .filter(|c| !c.is::()) .count() == 1 { let new_children: Vec<_> = child - .children + .children() .iter() .map(|c| match c.as_opt::() { Some(array) => { diff --git a/vortex-array/src/arrays/scalar_fn/slice.rs b/vortex-array/src/arrays/scalar_fn/slice.rs index b2389475b86..ccc4f1b1baa 100644 --- a/vortex-array/src/arrays/scalar_fn/slice.rs +++ b/vortex-array/src/arrays/scalar_fn/slice.rs @@ -24,7 +24,7 @@ impl SliceReduce for ScalarFnVTable { scalar_fn: array.scalar_fn.clone(), dtype: array.dtype.clone(), len: range.len(), - children, + slots: children.into_iter().map(Some).collect(), stats: Default::default(), } .into_array(), diff --git a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs index c1dca2b3168..0e4ac38ec42 100644 --- a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs +++ b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs @@ -76,7 +76,7 @@ impl VTable for ScalarFnVTable { array.len.hash(state); array.dtype.hash(state); array.scalar_fn.hash(state); - for child in &array.children { + for child in array.children() { child.array_hash(state, precision); } } @@ -91,7 +91,7 @@ impl VTable for ScalarFnVTable { if array.scalar_fn != other.scalar_fn { return false; } - for (child, other_child) in array.children.iter().zip(other.children.iter()) { + for (child, other_child) in array.children().iter().zip(other.children().iter()) { if !child.array_eq(other_child, precision) { return false; } @@ -112,11 +112,14 @@ impl VTable for ScalarFnVTable { } fn nchildren(array: &ScalarFnArray) -> usize { - array.children.len() + array.slots.len() } fn child(array: &ScalarFnArray, idx: usize) -> ArrayRef { - array.children[idx].clone() + array.slots[idx] + .as_ref() + .vortex_expect("ScalarFnArray child slot") + .clone() } fn child_name(array: &ScalarFnArray, idx: usize) -> String { @@ -179,25 +182,42 @@ impl VTable for ScalarFnVTable { scalar_fn: metadata.scalar_fn.clone(), dtype: dtype.clone(), len, - children, + slots: children.into_iter().map(Some).collect(), stats: Default::default(), }) } + fn nslots(array: &ScalarFnArray) -> usize { + array.slots.len() + } + + fn slot(array: &ScalarFnArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &ScalarFnArray, _idx: usize) -> &str { + "child" + } + + fn with_slots(array: &mut ScalarFnArray, slots: Vec>) -> VortexResult<()> { + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { vortex_ensure!( - children.len() == array.children.len(), + children.len() == array.slots.len(), "ScalarFnArray expects {} children, got {}", - array.children.len(), + array.slots.len(), children.len() ); - array.children = children; + array.slots = children.into_iter().map(Some).collect(); Ok(()) } fn execute(array: &Self::Array, ctx: &mut ExecutionCtx) -> VortexResult { ctx.log(format_args!("scalar_fn({}): executing", array.scalar_fn)); - let args = VecExecutionArgs::new(array.children.clone(), array.len); + let args = VecExecutionArgs::new(array.children(), array.len); array.scalar_fn.execute(&args, ctx).map(ExecutionStep::Done) } @@ -237,7 +257,7 @@ pub trait ScalarFnArrayExt: scalar_fn::ScalarFnVTable { scalar_fn, dtype, len, - children, + slots: children.into_iter().map(Some).collect(), stats: Default::default(), } .into_array()) diff --git a/vortex-array/src/arrays/scalar_fn/vtable/operations.rs b/vortex-array/src/arrays/scalar_fn/vtable/operations.rs index 628c829a4c3..cc704697009 100644 --- a/vortex-array/src/arrays/scalar_fn/vtable/operations.rs +++ b/vortex-array/src/arrays/scalar_fn/vtable/operations.rs @@ -18,7 +18,7 @@ use crate::vtable::OperationsVTable; impl OperationsVTable for ScalarFnVTable { fn scalar_at(array: &ScalarFnArray, index: usize) -> VortexResult { let inputs: Vec<_> = array - .children + .children() .iter() .map(|child| Ok(ConstantArray::new(child.scalar_at(index)?, 1).into_array())) .collect::>()?; diff --git a/vortex-array/src/arrays/scalar_fn/vtable/validity.rs b/vortex-array/src/arrays/scalar_fn/vtable/validity.rs index 8da32d352ec..be2ba4761fc 100644 --- a/vortex-array/src/arrays/scalar_fn/vtable/validity.rs +++ b/vortex-array/src/arrays/scalar_fn/vtable/validity.rs @@ -52,7 +52,7 @@ fn execute_expr(expr: &Expression, row_count: usize) -> VortexResult { impl ValidityVTable for ScalarFnVTable { fn validity(array: &ScalarFnArray) -> VortexResult { let inputs: Vec<_> = array - .children + .children() .iter() .map(|child| { if let Some(scalar) = child.as_constant() { diff --git a/vortex-array/src/arrays/shared/array.rs b/vortex-array/src/arrays/shared/array.rs index c69ae39395d..bc4fb043b35 100644 --- a/vortex-array/src/arrays/shared/array.rs +++ b/vortex-array/src/arrays/shared/array.rs @@ -7,6 +7,7 @@ use std::sync::OnceLock; use async_lock::Mutex as AsyncMutex; use vortex_error::SharedVortexResult; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::ArrayRef; @@ -15,13 +16,17 @@ use crate::IntoArray; use crate::dtype::DType; use crate::stats::ArrayStats; +pub(super) const SOURCE_SLOT: usize = 0; +pub(super) const NUM_SLOTS: usize = 1; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["source"]; + /// A lazily-executing array wrapper with a one-way transition from source to cached form. /// /// Before materialization, operations delegate to the source array. /// After materialization (via `get_or_compute`), operations delegate to the cached result. #[derive(Debug, Clone)] pub struct SharedArray { - source: ArrayRef, + pub(super) slots: Vec>, cached: Arc>>, async_compute_lock: Arc>, pub(super) dtype: DType, @@ -32,13 +37,20 @@ impl SharedArray { pub fn new(source: ArrayRef) -> Self { Self { dtype: source.dtype().clone(), - source, + slots: vec![Some(source)], cached: Arc::new(OnceLock::new()), async_compute_lock: Arc::new(AsyncMutex::new(())), stats: ArrayStats::default(), } } + /// Returns the source array reference. + pub(super) fn source(&self) -> &ArrayRef { + self.slots[SOURCE_SLOT] + .as_ref() + .vortex_expect("SharedArray source slot") + } + /// Returns the current array reference. /// /// After materialization, returns the cached result. Otherwise, returns the source. @@ -46,7 +58,7 @@ impl SharedArray { pub(super) fn current_array_ref(&self) -> &ArrayRef { match self.cached.get() { Some(Ok(arr)) => arr, - _ => &self.source, + _ => self.source(), } } @@ -59,7 +71,7 @@ impl SharedArray { ) -> VortexResult { let result = self .cached - .get_or_init(|| f(&self.source).map(|c| c.into_array()).map_err(Arc::new)); + .get_or_init(|| f(self.source()).map(|c| c.into_array()).map_err(Arc::new)); result.clone().map_err(Into::into) } @@ -82,7 +94,7 @@ impl SharedArray { return result.clone().map_err(Into::into); } - let computed = f(self.source.clone()) + let computed = f(self.source().clone()) .await .map(|c| c.into_array()) .map_err(Arc::new); @@ -93,7 +105,7 @@ impl SharedArray { pub(super) fn set_source(&mut self, source: ArrayRef) { self.dtype = source.dtype().clone(); - self.source = source; + self.slots[SOURCE_SLOT] = Some(source); self.cached = Arc::new(OnceLock::new()); self.async_compute_lock = Arc::new(AsyncMutex::new(())); } diff --git a/vortex-array/src/arrays/shared/vtable.rs b/vortex-array/src/arrays/shared/vtable.rs index 12106400338..c443de4a9df 100644 --- a/vortex-array/src/arrays/shared/vtable.rs +++ b/vortex-array/src/arrays/shared/vtable.rs @@ -5,6 +5,7 @@ use std::hash::Hash; use vortex_error::VortexExpect; use vortex_error::VortexResult; +use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; @@ -15,6 +16,8 @@ use crate::ExecutionCtx; use crate::ExecutionStep; use crate::Precision; use crate::arrays::SharedArray; +use crate::arrays::shared::array::NUM_SLOTS; +use crate::arrays::shared::array::SLOT_NAMES; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::hash::ArrayEq; @@ -102,6 +105,29 @@ impl VTable for SharedVTable { } } + fn nslots(_array: &SharedArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &SharedArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &SharedArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + + fn with_slots(array: &mut Self::Array, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "SharedArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn metadata(_array: &Self::Array) -> VortexResult { Ok(EmptyMetadata) } @@ -132,7 +158,7 @@ impl VTable for SharedVTable { } fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_error::vortex_ensure!( + vortex_ensure!( children.len() == 1, "SharedArray expects exactly 1 child, got {}", children.len() diff --git a/vortex-array/src/arrays/slice/array.rs b/vortex-array/src/arrays/slice/array.rs index 8a0dbbb642c..cf6db0d9be8 100644 --- a/vortex-array/src/arrays/slice/array.rs +++ b/vortex-array/src/arrays/slice/array.rs @@ -10,9 +10,13 @@ use vortex_error::vortex_panic; use crate::ArrayRef; use crate::stats::ArrayStats; +pub(super) const CHILD_SLOT: usize = 0; +pub(super) const NUM_SLOTS: usize = 1; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["child"]; + #[derive(Clone, Debug)] pub struct SliceArray { - pub(super) child: ArrayRef, + pub(super) slots: Vec>, pub(super) range: Range, pub(super) stats: ArrayStats, } @@ -32,7 +36,7 @@ impl SliceArray { ); } Ok(Self { - child, + slots: vec![Some(child)], range, stats: ArrayStats::default(), }) @@ -49,13 +53,17 @@ impl SliceArray { /// The child array being sliced. pub fn child(&self) -> &ArrayRef { - &self.child + self.slots[CHILD_SLOT] + .as_ref() + .vortex_expect("SliceArray child slot") } /// Consume the slice array and return its components. pub fn into_parts(self) -> SliceArrayParts { SliceArrayParts { - child: self.child, + child: self.slots[CHILD_SLOT] + .clone() + .vortex_expect("SliceArray child slot"), range: self.range, } } diff --git a/vortex-array/src/arrays/slice/vtable.rs b/vortex-array/src/arrays/slice/vtable.rs index a8aaafb1d61..7bbbe5e3464 100644 --- a/vortex-array/src/arrays/slice/vtable.rs +++ b/vortex-array/src/arrays/slice/vtable.rs @@ -21,6 +21,8 @@ use crate::ArrayRef; use crate::Canonical; use crate::DynArray; use crate::Precision; +use crate::arrays::slice::array::NUM_SLOTS; +use crate::arrays::slice::array::SLOT_NAMES; use crate::arrays::slice::array::SliceArray; use crate::arrays::slice::rules::PARENT_RULES; use crate::buffer::BufferHandle; @@ -60,7 +62,7 @@ impl VTable for SliceVTable { } fn dtype(array: &SliceArray) -> &DType { - array.child.dtype() + array.child().dtype() } fn stats(array: &SliceArray) -> StatsSetRef<'_> { @@ -68,13 +70,13 @@ impl VTable for SliceVTable { } fn array_hash(array: &SliceArray, state: &mut H, precision: Precision) { - array.child.array_hash(state, precision); + array.child().array_hash(state, precision); array.range.start.hash(state); array.range.end.hash(state); } fn array_eq(array: &SliceArray, other: &SliceArray, precision: Precision) -> bool { - array.child.array_eq(&other.child, precision) && array.range == other.range + array.child().array_eq(other.child(), precision) && array.range == other.range } fn nbuffers(_array: &Self::Array) -> usize { @@ -95,11 +97,23 @@ impl VTable for SliceVTable { fn child(array: &Self::Array, idx: usize) -> ArrayRef { match idx { - 0 => array.child.clone(), + 0 => array.child().clone(), _ => vortex_panic!("SliceArray child index {idx} out of bounds"), } } + fn nslots(_array: &Self::Array) -> usize { + NUM_SLOTS + } + + fn slot(array: &Self::Array, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &Self::Array, idx: usize) -> &str { + SLOT_NAMES[idx] + } + fn child_name(_array: &Self::Array, idx: usize) -> String { match idx { 0 => "child".to_string(), @@ -135,11 +149,18 @@ impl VTable for SliceVTable { ) -> VortexResult { assert_eq!(len, metadata.0.len()); let child = children.get(0, dtype, metadata.0.end)?; - Ok(SliceArray { - child, - range: metadata.0.clone(), - stats: Default::default(), - }) + SliceArray::try_new(child, metadata.0.clone()) + } + + fn with_slots(array: &mut Self::Array, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "SliceArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) } fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { @@ -148,19 +169,20 @@ impl VTable for SliceVTable { "SliceArray expects exactly 1 child, got {}", children.len() ); - array.child = children + let child = children .into_iter() .next() .vortex_expect("children length already validated"); + array.slots = vec![Some(child)]; Ok(()) } fn execute(array: &Self::Array, ctx: &mut ExecutionCtx) -> VortexResult { // Execute the child to get canonical form, then slice it - let Some(canonical) = array.child.as_opt::() else { + let Some(canonical) = array.child().as_opt::() else { // If the child is not canonical, recurse. return array - .child + .child() .clone() .execute::(ctx)? .slice(array.slice_range().clone()) @@ -184,13 +206,13 @@ impl VTable for SliceVTable { } impl OperationsVTable for SliceVTable { fn scalar_at(array: &SliceArray, index: usize) -> VortexResult { - array.child.scalar_at(array.range.start + index) + array.child().scalar_at(array.range.start + index) } } impl ValidityVTable for SliceVTable { fn validity(array: &SliceArray) -> VortexResult { - array.child.validity()?.slice(array.range.clone()) + array.child().validity()?.slice(array.range.clone()) } } diff --git a/vortex-array/src/arrays/struct_/array.rs b/vortex-array/src/arrays/struct_/array.rs index a351cc84a5d..f77d8066da8 100644 --- a/vortex-array/src/arrays/struct_/array.rs +++ b/vortex-array/src/arrays/struct_/array.rs @@ -21,6 +21,8 @@ use crate::stats::ArrayStats; use crate::validity::Validity; use crate::vtable::ValidityHelper; +// StructArray has a variable number of slots (one per field) + /// A struct array that stores multiple named fields as columns, similar to a database row. /// /// This mirrors the Apache Arrow Struct array encoding and provides a columnar representation @@ -143,7 +145,7 @@ use crate::vtable::ValidityHelper; pub struct StructArray { pub(super) len: usize, pub(super) dtype: DType, - pub(super) fields: Arc<[ArrayRef]>, + pub(super) slots: Vec>, pub(super) validity: Validity, pub(super) stats_set: ArrayStats, } @@ -155,9 +157,12 @@ pub struct StructArrayParts { } impl StructArray { - /// Return the struct fields without the validity of the struct applied - pub fn unmasked_fields(&self) -> &Arc<[ArrayRef]> { - &self.fields + /// Return the struct fields without the validity of the struct applied. + pub fn unmasked_fields(&self) -> Arc<[ArrayRef]> { + self.slots + .iter() + .map(|s| s.as_ref().vortex_expect("StructArray field slot").clone()) + .collect() } /// Return the struct field without the validity of the struct applied @@ -174,7 +179,11 @@ impl StructArray { /// Return the struct field without the validity of the struct applied pub fn unmasked_field_by_name_opt(&self, name: impl AsRef) -> Option<&ArrayRef> { let name = name.as_ref(); - self.struct_fields().find(name).map(|idx| &self.fields[idx]) + self.struct_fields().find(name).map(|idx| { + self.slots[idx] + .as_ref() + .vortex_expect("StructArray field slot") + }) } pub fn names(&self) -> &FieldNames { @@ -278,10 +287,12 @@ impl StructArray { Self::validate(&fields, &dtype, length, &validity) .vortex_expect("[Debug Assertion]: Invalid `StructArray` parameters"); + let slots = fields.iter().map(|f| Some(f.clone())).collect(); + Self { len: length, dtype: DType::Struct(dtype, validity.nullability()), - fields, + slots, validity, stats_set: Default::default(), } @@ -355,9 +366,14 @@ impl StructArray { pub fn into_parts(self) -> StructArrayParts { let struct_fields = self.dtype.into_struct_fields(); + let fields: Arc<[ArrayRef]> = self + .slots + .into_iter() + .map(|s| s.vortex_expect("StructArray field slot")) + .collect(); StructArrayParts { struct_fields, - fields: self.fields, + fields, validity: self.validity, } } @@ -407,7 +423,6 @@ impl StructArray { let mut children = Vec::with_capacity(projection.len()); let mut names = Vec::with_capacity(projection.len()); - let fields = self.unmasked_fields(); for f_name in projection.iter() { let idx = self .names() @@ -416,7 +431,12 @@ impl StructArray { .ok_or_else(|| vortex_err!("Unknown field {f_name}"))?; names.push(self.names()[idx].clone()); - children.push(fields[idx].clone()); + children.push( + self.slots[idx] + .as_ref() + .vortex_expect("StructArray field slot") + .clone(), + ); } StructArray::try_new( @@ -439,17 +459,20 @@ impl StructArray { .iter() .position(|field_name| field_name.as_ref() == name.as_ref())?; - let field = self.fields[position].clone(); - let new_fields: Arc<[ArrayRef]> = self - .fields + let field = self.slots[position] + .as_ref() + .vortex_expect("StructArray field slot") + .clone(); + let new_slots: Vec> = self + .slots .iter() .enumerate() .filter(|(i, _)| *i != position) - .map(|(_, f)| f.clone()) + .map(|(_, s)| s.clone()) .collect(); if let Ok(new_dtype) = struct_dtype.without_field(position) { - self.fields = new_fields; + self.slots = new_slots; self.dtype = DType::Struct(new_dtype, self.dtype.nullability()); return Some(field); } @@ -465,7 +488,12 @@ impl StructArray { let types = struct_dtype.fields().chain(once(array.dtype().clone())); let new_fields = StructFields::new(names.collect(), types.collect()); - let children: Arc<[ArrayRef]> = self.fields.iter().cloned().chain(once(array)).collect(); + let children: Arc<[ArrayRef]> = self + .slots + .iter() + .map(|s| s.as_ref().vortex_expect("StructArray field slot").clone()) + .chain(once(array)) + .collect(); Self::try_new_with_dtype(children, new_fields, self.len, self.validity.clone()) } diff --git a/vortex-array/src/arrays/struct_/compute/mask.rs b/vortex-array/src/arrays/struct_/compute/mask.rs index 16331bd5afc..2ed94a07093 100644 --- a/vortex-array/src/arrays/struct_/compute/mask.rs +++ b/vortex-array/src/arrays/struct_/compute/mask.rs @@ -14,7 +14,7 @@ use crate::vtable::ValidityHelper; impl MaskReduce for StructVTable { fn mask(array: &StructArray, mask: &ArrayRef) -> VortexResult> { StructArray::try_new_with_dtype( - array.unmasked_fields().clone(), + array.unmasked_fields().iter().cloned().collect::>(), array.struct_fields().clone(), array.len(), array diff --git a/vortex-array/src/arrays/struct_/compute/take.rs b/vortex-array/src/arrays/struct_/compute/take.rs index 3dd65512f06..06292471751 100644 --- a/vortex-array/src/arrays/struct_/compute/take.rs +++ b/vortex-array/src/arrays/struct_/compute/take.rs @@ -20,7 +20,7 @@ impl TakeReduce for StructVTable { // an out of bounds element. if array.is_empty() { return StructArray::try_new_with_dtype( - array.unmasked_fields().clone(), + array.unmasked_fields().iter().cloned().collect::>(), array.struct_fields().clone(), indices.len(), Validity::AllInvalid, diff --git a/vortex-array/src/arrays/struct_/tests.rs b/vortex-array/src/arrays/struct_/tests.rs index 7981fd0458c..243c16e7692 100644 --- a/vortex-array/src/arrays/struct_/tests.rs +++ b/vortex-array/src/arrays/struct_/tests.rs @@ -45,13 +45,13 @@ fn test_project() { assert_eq!(struct_b.len(), 5); - let bools = &struct_b.fields[0]; + let bools = &struct_b.unmasked_fields()[0]; assert_arrays_eq!( bools, BoolArray::from_iter([true, true, true, false, false]) ); - let prims = &struct_b.fields[1]; + let prims = &struct_b.unmasked_fields()[1]; assert_arrays_eq!(prims, PrimitiveArray::from_iter([0i64, 1, 2, 3, 4])); } @@ -76,14 +76,14 @@ fn test_remove_column() { assert_arrays_eq!(removed, PrimitiveArray::from_iter([0i64, 1, 2, 3, 4])); assert_eq!(struct_a.names(), &["ys"]); - assert_eq!(struct_a.fields.len(), 1); + assert_eq!(struct_a.unmasked_fields().len(), 1); assert_eq!(struct_a.len(), 5); assert_eq!( - struct_a.fields[0].dtype(), + struct_a.unmasked_fields()[0].dtype(), &DType::Primitive(PType::U64, Nullability::NonNullable) ); assert_arrays_eq!( - struct_a.fields[0], + struct_a.unmasked_fields()[0], PrimitiveArray::from_iter([4u64, 5, 6, 7, 8]) ); diff --git a/vortex-array/src/arrays/struct_/vtable/mod.rs b/vortex-array/src/arrays/struct_/vtable/mod.rs index bbc35b0a67c..7d3fcda1b9f 100644 --- a/vortex-array/src/arrays/struct_/vtable/mod.rs +++ b/vortex-array/src/arrays/struct_/vtable/mod.rs @@ -1,8 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use std::sync::Arc; - use itertools::Itertools; use kernel::PARENT_KERNELS; use vortex_error::VortexExpect; @@ -66,7 +64,7 @@ impl VTable for StructVTable { fn array_hash(array: &StructArray, state: &mut H, precision: Precision) { array.len.hash(state); array.dtype.hash(state); - for field in array.fields.iter() { + for field in array.unmasked_fields().iter() { field.array_hash(state, precision); } array.validity.array_hash(state, precision); @@ -75,11 +73,11 @@ impl VTable for StructVTable { fn array_eq(array: &StructArray, other: &StructArray, precision: Precision) -> bool { array.len == other.len && array.dtype == other.dtype - && array.fields.len() == other.fields.len() + && array.slots.len() == other.slots.len() && array - .fields + .unmasked_fields() .iter() - .zip(other.fields.iter()) + .zip(other.unmasked_fields().iter()) .all(|(a, b)| a.array_eq(b, precision)) && array.validity.array_eq(&other.validity, precision) } @@ -97,7 +95,7 @@ impl VTable for StructVTable { } fn nchildren(array: &StructArray) -> usize { - validity_nchildren(&array.validity) + array.unmasked_fields().len() + validity_nchildren(&array.validity) + array.slots.len() } fn child(array: &StructArray, idx: usize) -> ArrayRef { @@ -106,7 +104,10 @@ impl VTable for StructVTable { validity_to_child(&array.validity, array.len()) .vortex_expect("StructArray validity child out of bounds") } else { - array.unmasked_fields()[idx - vc].clone() + array.slots[idx - vc] + .as_ref() + .vortex_expect("StructArray field slot") + .clone() } } @@ -175,6 +176,23 @@ impl VTable for StructVTable { StructArray::try_new_with_dtype(children, struct_dtype.clone(), len, validity) } + fn nslots(array: &StructArray) -> usize { + array.slots.len() + } + + fn slot(array: &StructArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(array: &StructArray, idx: usize) -> &str { + array.names()[idx].as_ref() + } + + fn with_slots(array: &mut StructArray, slots: Vec>) -> VortexResult<()> { + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { let DType::Struct(struct_dtype, _nullability) = &array.dtype else { vortex_bail!("Expected struct dtype, found {:?}", array.dtype) @@ -194,15 +212,19 @@ impl VTable for StructVTable { ); }; - let fields: Arc<[ArrayRef]> = children.into_iter().skip(non_data_children).collect(); + let slots: Vec> = children + .into_iter() + .skip(non_data_children) + .map(Some) + .collect(); vortex_ensure!( - fields.len() == struct_dtype.nfields(), + slots.len() == struct_dtype.nfields(), "Expected {} field children, found {}", struct_dtype.nfields(), - fields.len() + slots.len() ); - array.fields = fields; + array.slots = slots; array.validity = validity; Ok(()) } diff --git a/vortex-array/src/arrays/varbin/array.rs b/vortex-array/src/arrays/varbin/array.rs index 9c72e80487d..16bcca5fc6a 100644 --- a/vortex-array/src/arrays/varbin/array.rs +++ b/vortex-array/src/arrays/varbin/array.rs @@ -20,11 +20,15 @@ use crate::match_each_integer_ptype; use crate::stats::ArrayStats; use crate::validity::Validity; +pub(super) const OFFSETS_SLOT: usize = 0; +pub(super) const NUM_SLOTS: usize = 1; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["offsets"]; + #[derive(Clone, Debug)] pub struct VarBinArray { pub(super) dtype: DType, pub(super) bytes: BufferHandle, - pub(super) offsets: ArrayRef, + pub(super) slots: Vec>, pub(super) validity: Validity, pub(super) stats_set: ArrayStats, } @@ -157,7 +161,7 @@ impl VarBinArray { Self { dtype, bytes, - offsets, + slots: vec![Some(offsets)], validity, stats_set: Default::default(), } @@ -259,7 +263,9 @@ impl VarBinArray { #[inline] pub fn offsets(&self) -> &ArrayRef { - &self.offsets + self.slots[OFFSETS_SLOT] + .as_ref() + .vortex_expect("VarBinArray offsets slot") } /// Access the value bytes child buffer @@ -371,7 +377,10 @@ impl VarBinArray { /// Consumes self, returning a tuple containing the `DType`, the `bytes` array, /// the `offsets` array, and the `validity`. pub fn into_parts(self) -> (DType, BufferHandle, ArrayRef, Validity) { - (self.dtype, self.bytes, self.offsets, self.validity) + let offsets = self.slots[OFFSETS_SLOT] + .clone() + .vortex_expect("VarBinArray offsets slot"); + (self.dtype, self.bytes, offsets, self.validity) } } diff --git a/vortex-array/src/arrays/varbin/vtable/mod.rs b/vortex-array/src/arrays/varbin/vtable/mod.rs index 3f35cd793c4..378dab66a01 100644 --- a/vortex-array/src/arrays/varbin/vtable/mod.rs +++ b/vortex-array/src/arrays/varbin/vtable/mod.rs @@ -4,6 +4,7 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; +use vortex_error::vortex_ensure; use vortex_error::vortex_err; use vortex_error::vortex_panic; @@ -15,6 +16,8 @@ use crate::IntoArray; use crate::ProstMetadata; use crate::SerializeMetadata; use crate::arrays::VarBinArray; +use crate::arrays::varbin::array::NUM_SLOTS; +use crate::arrays::varbin::array::SLOT_NAMES; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::dtype::Nullability; @@ -179,19 +182,42 @@ impl VTable for VarBinVTable { VarBinArray::try_new(offsets, bytes, dtype.clone(), validity) } + fn nslots(_array: &VarBinArray) -> usize { + NUM_SLOTS + } + + fn slot(array: &VarBinArray, idx: usize) -> &Option { + &array.slots[idx] + } + + fn slot_name(_array: &VarBinArray, idx: usize) -> &str { + SLOT_NAMES[idx] + } + + fn with_slots(array: &mut VarBinArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "VarBinArray expects exactly {} slots, got {}", + NUM_SLOTS, + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { match children.len() { 1 => { let [offsets]: [ArrayRef; 1] = children .try_into() .map_err(|_| vortex_err!("Failed to convert children to array"))?; - array.offsets = offsets; + array.slots = vec![Some(offsets)]; } 2 => { let [offsets, validity]: [ArrayRef; 2] = children .try_into() .map_err(|_| vortex_err!("Failed to convert children to array"))?; - array.offsets = offsets; + array.slots = vec![Some(offsets)]; array.validity = Validity::Array(validity); } _ => vortex_bail!( diff --git a/vortex-array/src/arrays/varbinview/array.rs b/vortex-array/src/arrays/varbinview/array.rs index 0c1276c928f..9523af4cfde 100644 --- a/vortex-array/src/arrays/varbinview/array.rs +++ b/vortex-array/src/arrays/varbinview/array.rs @@ -13,6 +13,7 @@ use vortex_error::vortex_ensure; use vortex_error::vortex_err; use vortex_error::vortex_panic; +use crate::ArrayRef; use crate::arrays::varbinview::BinaryView; use crate::buffer::BufferHandle; use crate::builders::ArrayBuilder; @@ -22,6 +23,9 @@ use crate::dtype::Nullability; use crate::stats::ArrayStats; use crate::validity::Validity; +pub(super) const NUM_SLOTS: usize = 0; +pub(super) const SLOT_NAMES: [&str; 0] = []; + /// A variable-length binary view array that stores strings and binary data efficiently. /// /// This mirrors the Apache Arrow StringView/BinaryView array encoding and provides @@ -83,6 +87,7 @@ use crate::validity::Validity; /// ``` #[derive(Clone, Debug)] pub struct VarBinViewArray { + pub(super) slots: Vec>, pub(super) dtype: DType, pub(super) buffers: Arc<[BufferHandle]>, pub(super) views: BufferHandle, @@ -245,6 +250,7 @@ impl VarBinViewArray { validity: Validity, ) -> Self { Self { + slots: vec![], views, buffers, dtype, diff --git a/vortex-array/src/arrays/varbinview/vtable/mod.rs b/vortex-array/src/arrays/varbinview/vtable/mod.rs index 9df6a68636c..3d111a5810b 100644 --- a/vortex-array/src/arrays/varbinview/vtable/mod.rs +++ b/vortex-array/src/arrays/varbinview/vtable/mod.rs @@ -10,6 +10,7 @@ use vortex_buffer::Buffer; use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; +use vortex_error::vortex_ensure; use vortex_error::vortex_err; use vortex_error::vortex_panic; use vortex_session::VortexSession; @@ -22,6 +23,8 @@ use crate::IntoArray; use crate::Precision; use crate::arrays::VarBinViewArray; use crate::arrays::varbinview::BinaryView; +use crate::arrays::varbinview::array::NUM_SLOTS; +use crate::arrays::varbinview::array::SLOT_NAMES; use crate::arrays::varbinview::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -209,6 +212,29 @@ impl VTable for VarBinViewVTable { VarBinViewArray::try_new(views, Arc::from(data_buffers), dtype.clone(), validity) } + fn nslots(_array: &VarBinViewArray) -> usize { + NUM_SLOTS + } + + fn slot(_array: &VarBinViewArray, idx: usize) -> &Option { + vortex_panic!("VarBinViewArray has no slots, requested index {idx}") + } + + fn slot_name(_array: &VarBinViewArray, idx: usize) -> &str { + let _ = SLOT_NAMES; + vortex_panic!("VarBinViewArray has no slots, requested index {idx}") + } + + fn with_slots(array: &mut VarBinViewArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.is_empty(), + "VarBinViewArray expects 0 slots, got {}", + slots.len() + ); + array.slots = slots; + Ok(()) + } + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { match children.len() { 0 => {} diff --git a/vortex-array/src/arrow/executor/struct_.rs b/vortex-array/src/arrow/executor/struct_.rs index a27f6e10cff..1737d1def11 100644 --- a/vortex-array/src/arrow/executor/struct_.rs +++ b/vortex-array/src/arrow/executor/struct_.rs @@ -78,7 +78,7 @@ pub(super) fn to_arrow_struct( }; return create_from_fields( target_fields.ok_or_else(|| struct_fields.names().clone()), - array.children(), + &array.children(), None, // Pack is never null, len, ctx, diff --git a/vortex-array/src/executor.rs b/vortex-array/src/executor.rs index da05450f8de..b5be703824a 100644 --- a/vortex-array/src/executor.rs +++ b/vortex-array/src/executor.rs @@ -93,7 +93,7 @@ impl dyn DynArray + '_ { }); let mut current = self.optimize()?; - // Stack frames: (parent, child_idx, done_predicate_for_child) + // Stack frames: (parent, slot_idx, done_predicate_for_slot) let mut stack: Vec<(ArrayRef, usize, DonePredicate)> = Vec::new(); for _ in 0..*MAX_ITERATIONS { @@ -107,8 +107,8 @@ impl dyn DynArray + '_ { ctx.log(format_args!("-> {}", current)); return Ok(current); } - Some((parent, child_idx, _)) => { - current = parent.with_child(child_idx, current)?; + Some((parent, slot_idx, _)) => { + current = parent.with_slot(slot_idx, current)?; current = current.optimize()?; continue; } @@ -123,8 +123,8 @@ impl dyn DynArray + '_ { ctx.log(format_args!("-> canonical (unmatched) {}", current)); return Ok(current); } - Some((parent, child_idx, _)) => { - current = parent.with_child(child_idx, current)?; + Some((parent, slot_idx, _)) => { + current = parent.with_slot(slot_idx, current)?; current = current.optimize()?; continue; } @@ -143,12 +143,10 @@ impl dyn DynArray + '_ { // Execute the array itself match current.vtable().execute(¤t, ctx)? { - ExecutionStep::ExecuteChild(i, done) => { - let child = current - .nth_child(i) - .vortex_expect("ExecuteChild index in bounds"); + ExecutionStep::ExecuteSlot(i, done) => { + let child = current.slot(i).vortex_expect("ExecuteSlot index in bounds"); ctx.log(format_args!( - "ExecuteChild({i}): pushing {}, focusing on {}", + "ExecuteSlot({i}): pushing {}, focusing on {}", current, child )); stack.push((current, i, done)); @@ -269,12 +267,14 @@ impl Executable for ArrayRef { } // 2. reduce_parent (child-driven metadata-only rewrites) - for child_idx in 0..array.nchildren() { - let child = array.nth_child(child_idx).vortex_expect("checked length"); - if let Some(reduced_parent) = child.vtable().reduce_parent(&child, &array, child_idx)? { + for slot_idx in 0..array.nslots() { + let Some(child) = array.slot(slot_idx) else { + continue; + }; + if let Some(reduced_parent) = child.vtable().reduce_parent(&child, &array, slot_idx)? { ctx.log(format_args!( - "reduce_parent: child[{}]({}) rewrote {} -> {}", - child_idx, + "reduce_parent: slot[{}]({}) rewrote {} -> {}", + slot_idx, child.encoding_id(), array, reduced_parent @@ -285,15 +285,17 @@ impl Executable for ArrayRef { } // 3. execute_parent (child-driven optimized execution) - for child_idx in 0..array.nchildren() { - let child = array.nth_child(child_idx).vortex_expect("checked length"); + for slot_idx in 0..array.nslots() { + let Some(child) = array.slot(slot_idx) else { + continue; + }; if let Some(executed_parent) = child .vtable() - .execute_parent(&child, &array, child_idx, ctx)? + .execute_parent(&child, &array, slot_idx, ctx)? { ctx.log(format_args!( - "execute_parent: child[{}]({}) rewrote {} -> {}", - child_idx, + "execute_parent: slot[{}]({}) rewrote {} -> {}", + slot_idx, child.encoding_id(), array, executed_parent @@ -312,26 +314,26 @@ impl Executable for ArrayRef { ctx.log(format_args!("-> {}", result.as_ref())); Ok(result) } - ExecutionStep::ExecuteChild(i, _) => { - // For single-step execution, handle ExecuteChild by executing the child, + ExecutionStep::ExecuteSlot(i, _) => { + // For single-step execution, handle ExecuteSlot by executing the slot, // replacing it, and returning the updated array. - let child = array.nth_child(i).vortex_expect("valid child index"); + let child = array.slot(i).vortex_expect("valid slot index"); let executed_child = child.execute::(ctx)?; - array.with_child(i, executed_child) + array.with_slot(i, executed_child) } } } } -/// Try execute_parent on each child of the array. +/// Try execute_parent on each occupied slot of the array. fn try_execute_parent(array: &ArrayRef, ctx: &mut ExecutionCtx) -> VortexResult> { - for child_idx in 0..array.nchildren() { - let child = array - .nth_child(child_idx) - .vortex_expect("checked nchildren"); + for slot_idx in 0..array.nslots() { + let Some(child) = array.slot(slot_idx) else { + continue; + }; if let Some(result) = child .vtable() - .execute_parent(&child, array, child_idx, ctx)? + .execute_parent(&child, array, slot_idx, ctx)? { result.statistics().inherit_from(array.statistics()); return Ok(Some(result)); @@ -349,15 +351,15 @@ pub type DonePredicate = fn(&dyn DynArray) -> bool; /// scheduler what to do next. This enables the scheduler to manage execution iteratively using /// an explicit work stack, run cross-step optimizations, and cache shared sub-expressions. pub enum ExecutionStep { - /// Request that the scheduler execute child at the given index, using the provided - /// [`DonePredicate`] to determine when the child is "done", then replace the child in this + /// Request that the scheduler execute the slot at the given index, using the provided + /// [`DonePredicate`] to determine when the slot is "done", then replace the slot in this /// array and re-enter execution. /// /// Between steps, the scheduler runs reduce/reduce_parent rules to fixpoint, enabling /// cross-step optimization (e.g., pushing scalar functions through newly-decoded children). /// - /// Use [`ExecutionStep::execute_child`] instead of constructing this variant directly. - ExecuteChild(usize, DonePredicate), + /// Use [`ExecutionStep::execute_slot`] instead of constructing this variant directly. + ExecuteSlot(usize, DonePredicate), /// Execution is complete. The result may be in any encoding — not necessarily canonical. /// The scheduler will continue executing the result if it has not yet reached the target form. @@ -365,9 +367,9 @@ pub enum ExecutionStep { } impl ExecutionStep { - /// Request execution of child at `child_idx` until it matches the given [`Matcher`]. - pub fn execute_child(child_idx: usize) -> Self { - ExecutionStep::ExecuteChild(child_idx, M::matches) + /// Request execution of the slot at `slot_idx` until it matches the given [`Matcher`]. + pub fn execute_slot(slot_idx: usize) -> Self { + ExecutionStep::ExecuteSlot(slot_idx, M::matches) } /// Signal that execution is complete with the given result. @@ -379,9 +381,7 @@ impl ExecutionStep { impl fmt::Debug for ExecutionStep { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - ExecutionStep::ExecuteChild(idx, _) => { - f.debug_tuple("ExecuteChild").field(idx).finish() - } + ExecutionStep::ExecuteSlot(idx, _) => f.debug_tuple("ExecuteSlot").field(idx).finish(), ExecutionStep::Done(result) => f.debug_tuple("Done").field(result).finish(), } } diff --git a/vortex-array/src/vtable/dyn_.rs b/vortex-array/src/vtable/dyn_.rs index 64ca5e99c50..6f0e5f1eaed 100644 --- a/vortex-array/src/vtable/dyn_.rs +++ b/vortex-array/src/vtable/dyn_.rs @@ -49,6 +49,9 @@ pub trait DynVTable: 'static + private::Sealed + Send + Sync + Debug { ) -> VortexResult; fn with_children(&self, array: &ArrayRef, children: Vec) -> VortexResult; + /// See [`VTable::with_slots`] + fn with_slots(&self, array: &ArrayRef, slots: Vec>) -> VortexResult; + /// See [`VTable::reduce`] fn reduce(&self, array: &ArrayRef) -> VortexResult>; @@ -101,6 +104,12 @@ impl DynVTable for ArrayVTableAdapter { Ok(array.into_array()) } + fn with_slots(&self, array: &ArrayRef, slots: Vec>) -> VortexResult { + let mut array = array.as_::().clone(); + V::with_slots(&mut array, slots)?; + Ok(array.into_array()) + } + fn reduce(&self, array: &ArrayRef) -> VortexResult> { let Some(reduced) = V::reduce(downcast::(array))? else { return Ok(None); diff --git a/vortex-array/src/vtable/mod.rs b/vortex-array/src/vtable/mod.rs index a038a83639a..532103dde44 100644 --- a/vortex-array/src/vtable/mod.rs +++ b/vortex-array/src/vtable/mod.rs @@ -86,19 +86,40 @@ pub trait VTable: 'static + Sized + Send + Sync + Debug { fn buffer_name(array: &Self::Array, idx: usize) -> Option; /// Returns the number of children in the array. - fn nchildren(array: &Self::Array) -> usize; + /// + /// The default counts non-None slots. + fn nchildren(array: &Self::Array) -> usize { + (0..Self::nslots(array)) + .filter(|i| Self::slot(array, *i).is_some()) + .count() + } /// Returns the child at the given index. /// + /// The default returns the `idx`-th non-None slot. + /// /// # Panics /// Panics if `idx >= nchildren(array)`. - fn child(array: &Self::Array, idx: usize) -> ArrayRef; + fn child(array: &Self::Array, idx: usize) -> ArrayRef { + (0..Self::nslots(array)) + .filter_map(|i| Self::slot(array, i).clone()) + .nth(idx) + .vortex_expect("child index out of bounds") + } /// Returns the name of the child at the given index. /// + /// The default returns the slot name of the `idx`-th non-None slot. + /// /// # Panics /// Panics if `idx >= nchildren(array)`. - fn child_name(array: &Self::Array, idx: usize) -> String; + fn child_name(array: &Self::Array, idx: usize) -> String { + (0..Self::nslots(array)) + .filter(|i| Self::slot(array, *i).is_some()) + .nth(idx) + .map(|slot_idx| Self::slot_name(array, slot_idx).to_string()) + .vortex_expect("child_name index out of bounds") + } /// Exports metadata for an array. /// @@ -177,15 +198,51 @@ pub trait VTable: 'static + Sized + Send + Sync + Debug { children: &dyn ArrayChildren, ) -> VortexResult; + /// Returns the number of slots in the array. + /// + /// Slots provide fixed-position storage for child arrays, enabling direct access + /// by slot index without the overhead of dynamic child lookups. Optional children + /// (like validity) are represented as `None` slots rather than shifting dense indices. + fn nslots(array: &Self::Array) -> usize; + + /// Returns a reference to the slot at the given index. + /// + /// # Panics + /// Panics if `idx >= nslots(array)`. + fn slot(array: &Self::Array, idx: usize) -> &Option; + + /// Returns the name of the slot at the given index. + /// + /// # Panics + /// Panics if `idx >= nslots(array)`. + fn slot_name(array: &Self::Array, idx: usize) -> &str; + + /// Replaces the slots in `array` with `slots`. + fn with_slots(array: &mut Self::Array, slots: Vec>) -> VortexResult<()>; + /// Replaces the children in `array` with `children`. The count must be the same and types /// of children must be expected. - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()>; + /// + /// The default maps children back onto the current slot structure and calls `with_slots`. + fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + let mut child_iter = children.into_iter(); + let slots: Vec> = (0..Self::nslots(array)) + .map(|i| { + Self::slot(array, i).is_some().then(|| { + child_iter + .next() + .vortex_expect("too few children for with_children") + }) + }) + .collect(); + Self::with_slots(array, slots) + } /// Execute this array by returning an [`ExecutionStep`] that tells the scheduler what to /// do next. /// /// Instead of recursively executing children, implementations should return - /// [`ExecutionStep::ExecuteChild(i)`] to request that the scheduler execute a child first, + /// [`ExecutionStep::ExecuteSlot(i)`] to request that the scheduler execute a slot first, /// or [`ExecutionStep::Done(result)`] when the /// encoding can produce a result directly. /// From 05c5032a4aa9c186279d5179d3a104786d2c43d1 Mon Sep 17 00:00:00 2001 From: Joe Isaacs Date: Wed, 11 Mar 2026 14:46:07 +0000 Subject: [PATCH 2/4] fix Signed-off-by: Joe Isaacs --- encodings/alp/src/alp/array.rs | 149 +++++++---------- encodings/alp/src/alp_rd/array.rs | 148 +++++++---------- encodings/bytebool/src/array.rs | 9 +- encodings/datetime-parts/src/array.rs | 8 +- .../src/decimal_byte_parts/mod.rs | 8 +- .../fastlanes/src/bitpacking/array/mod.rs | 35 +++- .../fastlanes/src/bitpacking/vtable/mod.rs | 150 ++++-------------- encodings/fastlanes/src/delta/vtable/mod.rs | 8 +- encodings/fastlanes/src/for/vtable/mod.rs | 8 +- encodings/fastlanes/src/rle/vtable/mod.rs | 8 +- encodings/fsst/src/array.rs | 94 ++++------- encodings/pco/src/array.rs | 65 ++------ encodings/runend/src/array.rs | 8 +- encodings/sequence/src/array.rs | 9 +- encodings/sparse/src/lib.rs | 93 +++++------ encodings/zigzag/src/array.rs | 8 +- encodings/zstd/src/array.rs | 63 ++------ encodings/zstd/src/zstd_buffers.rs | 8 +- vortex-array/src/array/mod.rs | 15 +- vortex-array/src/array/visitor.rs | 15 +- vortex-array/src/arrays/bool/array.rs | 1 - vortex-array/src/arrays/bool/vtable/mod.rs | 9 +- vortex-array/src/arrays/chunked/vtable/mod.rs | 8 +- vortex-array/src/arrays/constant/array.rs | 1 - .../src/arrays/constant/vtable/mod.rs | 10 +- vortex-array/src/arrays/decimal/array.rs | 1 - vortex-array/src/arrays/decimal/vtable/mod.rs | 9 +- vortex-array/src/arrays/dict/vtable/mod.rs | 14 +- .../src/arrays/extension/vtable/mod.rs | 8 +- vortex-array/src/arrays/filter/vtable.rs | 8 +- .../src/arrays/fixed_size_list/array.rs | 9 +- .../src/arrays/fixed_size_list/vtable/mod.rs | 60 +------ vortex-array/src/arrays/list/array.rs | 11 +- vortex-array/src/arrays/list/vtable/mod.rs | 64 +------- vortex-array/src/arrays/listview/array.rs | 16 +- .../src/arrays/listview/vtable/mod.rs | 69 +------- vortex-array/src/arrays/masked/array.rs | 10 +- vortex-array/src/arrays/masked/vtable/mod.rs | 74 ++------- vortex-array/src/arrays/null/mod.rs | 10 +- .../src/arrays/primitive/array/mod.rs | 1 - .../src/arrays/primitive/vtable/mod.rs | 9 +- .../src/arrays/scalar_fn/vtable/mod.rs | 8 +- vortex-array/src/arrays/shared/vtable.rs | 8 +- vortex-array/src/arrays/slice/vtable.rs | 8 +- vortex-array/src/arrays/struct_/array.rs | 25 +-- vortex-array/src/arrays/struct_/vtable/mod.rs | 88 ++-------- vortex-array/src/arrays/varbin/array.rs | 11 +- vortex-array/src/arrays/varbin/vtable/mod.rs | 60 +------ vortex-array/src/arrays/varbinview/array.rs | 1 - .../src/arrays/varbinview/vtable/mod.rs | 9 +- vortex-array/src/executor.rs | 27 ++-- vortex-array/src/vtable/mod.rs | 36 ++--- 52 files changed, 491 insertions(+), 1101 deletions(-) diff --git a/encodings/alp/src/alp/array.rs b/encodings/alp/src/alp/array.rs index b27c8beadcb..d677055fe63 100644 --- a/encodings/alp/src/alp/array.rs +++ b/encodings/alp/src/alp/array.rs @@ -28,14 +28,10 @@ use vortex_array::vtable::ArrayId; use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityChild; use vortex_array::vtable::ValidityVTableFromChild; -use vortex_array::vtable::patches_child; -use vortex_array::vtable::patches_child_name; -use vortex_array::vtable::patches_nchildren; use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; -use vortex_error::vortex_err; use vortex_error::vortex_panic; use vortex_session::VortexSession; @@ -96,12 +92,8 @@ impl VTable for ALPVTable { None } - fn nslots(_array: &ALPArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &ALPArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &ALPArray) -> &[Option] { + &array.slots } fn slot_name(_array: &ALPArray, idx: usize) -> &str { @@ -115,36 +107,26 @@ impl VTable for ALPVTable { NUM_SLOTS, slots.len() ); - array.slots = slots; - Ok(()) - } - fn nchildren(array: &ALPArray) -> usize { - 1 + array.patches().map_or(0, patches_nchildren) - } - - fn child(array: &ALPArray, idx: usize) -> ArrayRef { - match idx { - 0 => array.encoded().clone(), - _ => { - let patches = array - .patches() - .unwrap_or_else(|| vortex_panic!("ALPArray child index {idx} out of bounds")); - patches_child(patches, idx - 1) + // Reconstruct patches from slots + existing metadata + array.patches = match (&slots[PATCH_INDICES_SLOT], &slots[PATCH_VALUES_SLOT]) { + (Some(indices), Some(values)) => { + let old = array + .patches + .as_ref() + .vortex_expect("ALPArray had patch slots but no patches metadata"); + Some(Patches::new( + old.array_len(), + old.offset(), + indices.clone(), + values.clone(), + slots[PATCH_CHUNK_OFFSETS_SLOT].clone(), + )?) } - } - } - - fn child_name(array: &ALPArray, idx: usize) -> String { - match idx { - 0 => "encoded".to_string(), - _ => { - if array.patches().is_none() { - vortex_panic!("ALPArray child_name index {idx} out of bounds"); - } - patches_child_name(idx - 1).to_string() - } - } + _ => None, + }; + array.slots = slots; + Ok(()) } fn metadata(array: &ALPArray) -> VortexResult { @@ -213,53 +195,6 @@ impl VTable for ALPVTable { ) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - // Children: encoded, patches (if present): indices, values, chunk_offsets (optional) - let patches_info = array - .patches - .as_ref() - .map(|p| (p.array_len(), p.offset(), p.chunk_offsets().is_some())); - - let expected_children = match &patches_info { - Some((_, _, has_chunk_offsets)) => 1 + 2 + if *has_chunk_offsets { 1 } else { 0 }, - None => 1, - }; - - vortex_ensure!( - children.len() == expected_children, - "ALPArray expects {} children, got {}", - expected_children, - children.len() - ); - - let mut children_iter = children.into_iter(); - array.slots[ENCODED_SLOT] = Some( - children_iter - .next() - .ok_or_else(|| vortex_err!("Expected encoded child"))?, - ); - - if let Some((array_len, offset, _has_chunk_offsets)) = patches_info { - let indices = children_iter - .next() - .ok_or_else(|| vortex_err!("Expected patch indices child"))?; - let values = children_iter - .next() - .ok_or_else(|| vortex_err!("Expected patch values child"))?; - let chunk_offsets = children_iter.next(); - - array.patches = Some(Patches::new( - array_len, - offset, - indices, - values, - chunk_offsets, - )?); - } - - Ok(()) - } - fn execute(array: &Self::Array, ctx: &mut ExecutionCtx) -> VortexResult { // TODO(joe): take by value Ok(ExecutionStep::Done( @@ -286,8 +221,16 @@ impl VTable for ALPVTable { } pub(super) const ENCODED_SLOT: usize = 0; -pub(super) const NUM_SLOTS: usize = 1; -pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["encoded"]; +pub(super) const PATCH_INDICES_SLOT: usize = 1; +pub(super) const PATCH_VALUES_SLOT: usize = 2; +pub(super) const PATCH_CHUNK_OFFSETS_SLOT: usize = 3; +pub(super) const NUM_SLOTS: usize = 4; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = [ + "encoded", + "patch_indices", + "patch_values", + "patch_chunk_offsets", +]; #[derive(Clone, Debug)] pub struct ALPArray { @@ -460,9 +403,11 @@ impl ALPArray { _ => unreachable!(), }; + let slots = Self::make_slots(&encoded, &patches); + Ok(Self { dtype, - slots: vec![Some(encoded)], + slots, exponents, patches, stats_set: Default::default(), @@ -479,15 +424,34 @@ impl ALPArray { patches: Option, dtype: DType, ) -> Self { + let slots = Self::make_slots(&encoded, &patches); + Self { dtype, - slots: vec![Some(encoded)], + slots, exponents, patches, stats_set: Default::default(), } } + fn make_slots(encoded: &ArrayRef, patches: &Option) -> Vec> { + let (patch_indices, patch_values, patch_chunk_offsets) = match patches { + Some(p) => ( + Some(p.indices().clone()), + Some(p.values().clone()), + p.chunk_offsets().clone(), + ), + None => (None, None, None), + }; + vec![ + Some(encoded.clone()), + patch_indices, + patch_values, + patch_chunk_offsets, + ] + } + pub fn ptype(&self) -> PType { self.dtype.as_ptype() } @@ -510,11 +474,8 @@ impl ALPArray { /// Consumes the array and returns its parts. #[inline] pub fn into_parts(self) -> (ArrayRef, Exponents, Option, DType) { - let encoded = self - .slots - .into_iter() - .next() - .flatten() + let encoded = self.slots[ENCODED_SLOT] + .clone() .vortex_expect("ALPArray encoded slot"); (encoded, self.exponents, self.patches, self.dtype) } diff --git a/encodings/alp/src/alp_rd/array.rs b/encodings/alp/src/alp_rd/array.rs index a4b51a39136..e230c592441 100644 --- a/encodings/alp/src/alp_rd/array.rs +++ b/encodings/alp/src/alp_rd/array.rs @@ -32,9 +32,6 @@ use vortex_array::vtable::ArrayId; use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityChild; use vortex_array::vtable::ValidityVTableFromChild; -use vortex_array::vtable::patches_child; -use vortex_array::vtable::patches_child_name; -use vortex_array::vtable::patches_nchildren; use vortex_buffer::Buffer; use vortex_error::VortexExpect; use vortex_error::VortexResult; @@ -122,36 +119,6 @@ impl VTable for ALPRDVTable { None } - fn nchildren(array: &ALPRDArray) -> usize { - 2 + array.left_parts_patches().map_or(0, patches_nchildren) - } - - fn child(array: &ALPRDArray, idx: usize) -> ArrayRef { - match idx { - 0 => array.left_parts().clone(), - 1 => array.right_parts().clone(), - _ => { - let patches = array - .left_parts_patches() - .unwrap_or_else(|| vortex_panic!("ALPRDArray child index {idx} out of bounds")); - patches_child(patches, idx - 2) - } - } - } - - fn child_name(array: &ALPRDArray, idx: usize) -> String { - match idx { - 0 => "left_parts".to_string(), - 1 => "right_parts".to_string(), - _ => { - if array.left_parts_patches().is_none() { - vortex_panic!("ALPRDArray child_name index {idx} out of bounds"); - } - patches_child_name(idx - 2).to_string() - } - } - } - fn metadata(array: &ALPRDArray) -> VortexResult { let dict = array .left_parts_dictionary() @@ -256,12 +223,8 @@ impl VTable for ALPRDVTable { ) } - fn nslots(_array: &ALPRDArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &ALPRDArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &ALPRDArray) -> &[Option] { + &array.slots } fn slot_name(_array: &ALPRDArray, idx: usize) -> &str { @@ -275,52 +238,26 @@ impl VTable for ALPRDVTable { NUM_SLOTS, slots.len() ); - array.slots = slots; - Ok(()) - } - - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - // Children: left_parts, right_parts, patches (if present): indices, values - let patches_info = array - .left_parts_patches - .as_ref() - .map(|p| (p.array_len(), p.offset())); - - let expected_children = if patches_info.is_some() { 4 } else { 2 }; - - vortex_ensure!( - children.len() == expected_children, - "ALPRDArray expects {} children, got {}", - expected_children, - children.len() - ); - - let mut children_iter = children.into_iter(); - array.slots[LEFT_PARTS_SLOT] = Some( - children_iter - .next() - .ok_or_else(|| vortex_err!("Expected left_parts child"))?, - ); - array.slots[RIGHT_PARTS_SLOT] = Some( - children_iter - .next() - .ok_or_else(|| vortex_err!("Expected right_parts child"))?, - ); - - if let Some((array_len, offset)) = patches_info { - let indices = children_iter - .next() - .ok_or_else(|| vortex_err!("Expected patch indices child"))?; - let values = children_iter - .next() - .ok_or_else(|| vortex_err!("Expected patch values child"))?; - - array.left_parts_patches = Some(Patches::new( - array_len, offset, indices, values, - None, // chunk_offsets not currently supported for ALPRD - )?); - } + // Reconstruct patches from slots + existing metadata + array.left_parts_patches = + match (&slots[LP_PATCH_INDICES_SLOT], &slots[LP_PATCH_VALUES_SLOT]) { + (Some(indices), Some(values)) => { + let old = array + .left_parts_patches + .as_ref() + .vortex_expect("ALPRDArray had patch slots but no patches metadata"); + Some(Patches::new( + old.array_len(), + old.offset(), + indices.clone(), + values.clone(), + slots[LP_PATCH_CHUNK_OFFSETS_SLOT].clone(), + )?) + } + _ => None, + }; + array.slots = slots; Ok(()) } @@ -386,8 +323,17 @@ impl VTable for ALPRDVTable { pub(super) const LEFT_PARTS_SLOT: usize = 0; pub(super) const RIGHT_PARTS_SLOT: usize = 1; -pub(super) const NUM_SLOTS: usize = 2; -pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["left_parts", "right_parts"]; +pub(super) const LP_PATCH_INDICES_SLOT: usize = 2; +pub(super) const LP_PATCH_VALUES_SLOT: usize = 3; +pub(super) const LP_PATCH_CHUNK_OFFSETS_SLOT: usize = 4; +pub(super) const NUM_SLOTS: usize = 5; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = [ + "left_parts", + "right_parts", + "patch_indices", + "patch_values", + "patch_chunk_offsets", +]; #[derive(Clone, Debug)] pub struct ALPRDArray { @@ -461,9 +407,11 @@ impl ALPRDArray { }) .transpose()?; + let slots = Self::make_slots(&left_parts, &right_parts, &left_parts_patches); + Ok(Self { dtype, - slots: vec![Some(left_parts), Some(right_parts)], + slots, left_parts_dictionary, right_bit_width, left_parts_patches, @@ -481,9 +429,11 @@ impl ALPRDArray { right_bit_width: u8, left_parts_patches: Option, ) -> Self { + let slots = Self::make_slots(&left_parts, &right_parts, &left_parts_patches); + Self { dtype, - slots: vec![Some(left_parts), Some(right_parts)], + slots, left_parts_patches, left_parts_dictionary, right_bit_width, @@ -491,6 +441,28 @@ impl ALPRDArray { } } + fn make_slots( + left_parts: &ArrayRef, + right_parts: &ArrayRef, + patches: &Option, + ) -> Vec> { + let (pi, pv, pco) = match patches { + Some(p) => ( + Some(p.indices().clone()), + Some(p.values().clone()), + p.chunk_offsets().clone(), + ), + None => (None, None, None), + }; + vec![ + Some(left_parts.clone()), + Some(right_parts.clone()), + pi, + pv, + pco, + ] + } + /// Returns true if logical type of the array values is f32. /// /// Returns false if the logical type of the array values is f64. diff --git a/encodings/bytebool/src/array.rs b/encodings/bytebool/src/array.rs index 114f3529d55..ef6ce343782 100644 --- a/encodings/bytebool/src/array.rs +++ b/encodings/bytebool/src/array.rs @@ -175,12 +175,8 @@ impl VTable for ByteBoolVTable { Ok(()) } - fn nslots(_array: &ByteBoolArray) -> usize { - NUM_SLOTS - } - - fn slot(_array: &ByteBoolArray, idx: usize) -> &Option { - vortex_panic!("ByteBoolArray has no slots, requested index {idx}") + fn slots(array: &ByteBoolArray) -> &[Option] { + &array.slots } fn slot_name(_array: &ByteBoolArray, idx: usize) -> &str { @@ -224,7 +220,6 @@ impl VTable for ByteBoolVTable { } } -pub(super) const NUM_SLOTS: usize = 0; pub(super) const SLOT_NAMES: [&str; 0] = []; #[derive(Clone, Debug)] diff --git a/encodings/datetime-parts/src/array.rs b/encodings/datetime-parts/src/array.rs index 4b919eb07ee..19ad41b3964 100644 --- a/encodings/datetime-parts/src/array.rs +++ b/encodings/datetime-parts/src/array.rs @@ -207,12 +207,8 @@ impl VTable for DateTimePartsVTable { DateTimePartsArray::try_new(dtype.clone(), days, seconds, subseconds) } - fn nslots(_array: &DateTimePartsArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &DateTimePartsArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &DateTimePartsArray) -> &[Option] { + &array.slots } fn slot_name(_array: &DateTimePartsArray, idx: usize) -> &str { diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs index 1787ab2a690..e66a4d18b28 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs @@ -172,12 +172,8 @@ impl VTable for DecimalBytePartsVTable { DecimalBytePartsArray::try_new(msp, *decimal_dtype) } - fn nslots(_array: &DecimalBytePartsArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &DecimalBytePartsArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &DecimalBytePartsArray) -> &[Option] { + &array.slots } fn slot_name(_array: &DecimalBytePartsArray, idx: usize) -> &str { diff --git a/encodings/fastlanes/src/bitpacking/array/mod.rs b/encodings/fastlanes/src/bitpacking/array/mod.rs index 42461b710ac..83082f74243 100644 --- a/encodings/fastlanes/src/bitpacking/array/mod.rs +++ b/encodings/fastlanes/src/bitpacking/array/mod.rs @@ -11,6 +11,7 @@ use vortex_array::dtype::PType; use vortex_array::patches::Patches; use vortex_array::stats::ArrayStats; use vortex_array::validity::Validity; +use vortex_array::vtable::validity_to_child; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -23,8 +24,17 @@ use crate::bitpack_compress::bitpack_encode; use crate::unpack_iter::BitPacked; use crate::unpack_iter::BitUnpackedChunks; -pub(super) const NUM_SLOTS: usize = 0; -pub(super) const SLOT_NAMES: [&str; 0] = []; +pub(super) const PATCH_INDICES_SLOT: usize = 0; +pub(super) const PATCH_VALUES_SLOT: usize = 1; +pub(super) const PATCH_CHUNK_OFFSETS_SLOT: usize = 2; +pub(super) const VALIDITY_SLOT: usize = 3; +pub(super) const NUM_SLOTS: usize = 4; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = [ + "patch_indices", + "patch_values", + "patch_chunk_offsets", + "validity", +]; pub struct BitPackedArrayParts { pub offset: u16, @@ -80,8 +90,10 @@ impl BitPackedArray { len: usize, offset: u16, ) -> Self { + let slots = Self::make_slots(&patches, &validity, len); + Self { - slots: vec![], + slots, offset, len, dtype, @@ -93,6 +105,23 @@ impl BitPackedArray { } } + fn make_slots( + patches: &Option, + validity: &Validity, + len: usize, + ) -> Vec> { + let (pi, pv, pco) = match patches { + Some(p) => ( + Some(p.indices().clone()), + Some(p.values().clone()), + p.chunk_offsets().clone(), + ), + None => (None, None, None), + }; + let validity_slot = validity_to_child(validity, len); + vec![pi, pv, pco, validity_slot] + } + /// A safe constructor for a `BitPackedArray` from its components: /// /// * `packed` is ByteBuffer holding the compressed data that was packed with FastLanes diff --git a/encodings/fastlanes/src/bitpacking/vtable/mod.rs b/encodings/fastlanes/src/bitpacking/vtable/mod.rs index 1ad996de261..ed614d88479 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/mod.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/mod.rs @@ -27,11 +27,6 @@ use vortex_array::vtable; use vortex_array::vtable::ArrayId; use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityVTableFromValidityHelper; -use vortex_array::vtable::patches_child; -use vortex_array::vtable::patches_child_name; -use vortex_array::vtable::patches_nchildren; -use vortex_array::vtable::validity_nchildren; -use vortex_array::vtable::validity_to_child; use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; @@ -44,7 +39,11 @@ use crate::BitPackedArray; use crate::bitpack_decompress::unpack_array; use crate::bitpack_decompress::unpack_into_primitive_builder; use crate::bitpacking::array::NUM_SLOTS; +use crate::bitpacking::array::PATCH_CHUNK_OFFSETS_SLOT; +use crate::bitpacking::array::PATCH_INDICES_SLOT; +use crate::bitpacking::array::PATCH_VALUES_SLOT; use crate::bitpacking::array::SLOT_NAMES; +use crate::bitpacking::array::VALIDITY_SLOT; use crate::bitpacking::vtable::kernels::PARENT_KERNELS; use crate::bitpacking::vtable::rules::RULES; mod kernels; @@ -130,36 +129,6 @@ impl VTable for BitPackedVTable { } } - fn nchildren(array: &BitPackedArray) -> usize { - array.patches().map_or(0, patches_nchildren) + validity_nchildren(&array.validity) - } - - fn child(array: &BitPackedArray, idx: usize) -> ArrayRef { - let pc = array.patches().map_or(0, patches_nchildren); - if idx < pc { - patches_child( - array - .patches() - .vortex_expect("BitPackedArray child index out of bounds"), - idx, - ) - } else if idx < pc + validity_nchildren(&array.validity) { - validity_to_child(&array.validity, array.len) - .vortex_expect("BitPackedArray child index out of bounds") - } else { - vortex_panic!("BitPackedArray child index {idx} out of bounds") - } - } - - fn child_name(array: &BitPackedArray, idx: usize) -> String { - let pc = array.patches().map_or(0, patches_nchildren); - if idx < pc { - patches_child_name(idx).to_string() - } else { - "validity".to_string() - } - } - fn reduce_parent( array: &Self::Array, parent: &ArrayRef, @@ -168,95 +137,46 @@ impl VTable for BitPackedVTable { RULES.evaluate(array, parent, child_idx) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - // Children: patches (if present): indices, values, chunk_offsets; then validity (if present) - let patches_info = array - .patches() - .map(|p| (p.offset(), p.chunk_offsets().is_some())); - - let mut child_idx = 0; - let patches = if let Some((patch_offset, has_chunk_offsets)) = patches_info { - let patch_indices = children - .get(child_idx) - .ok_or_else(|| vortex_err!("Expected patch_indices child at index {}", child_idx))? - .clone(); - child_idx += 1; - - let patch_values = children - .get(child_idx) - .ok_or_else(|| vortex_err!("Expected patch_values child at index {}", child_idx))? - .clone(); - child_idx += 1; - - let patch_chunk_offsets = if has_chunk_offsets { - let offsets = children - .get(child_idx) - .ok_or_else(|| { - vortex_err!("Expected patch_chunk_offsets child at index {}", child_idx) - })? - .clone(); - child_idx += 1; - Some(offsets) - } else { - None - }; - - Some(Patches::new( - array.len(), - patch_offset, - patch_indices, - patch_values, - patch_chunk_offsets, - )?) - } else { - None - }; - - let validity = if child_idx < children.len() { - Validity::Array(children[child_idx].clone()) - } else { - Validity::from(array.dtype().nullability()) - }; - - let expected_children = child_idx - + if matches!(validity, Validity::Array(_)) { - 1 - } else { - 0 - }; - vortex_ensure!( - children.len() == expected_children, - "Expected {} children, got {}", - expected_children, - children.len() - ); - - array.patches = patches; - array.validity = validity; - - Ok(()) - } - - fn nslots(_array: &BitPackedArray) -> usize { - NUM_SLOTS - } - - fn slot(_array: &BitPackedArray, idx: usize) -> &Option { - let _ = SLOT_NAMES; - vortex_panic!("BitPackedArray has no slots, requested index {idx}") + fn slots(array: &BitPackedArray) -> &[Option] { + &array.slots } fn slot_name(_array: &BitPackedArray, idx: usize) -> &str { - let _ = SLOT_NAMES; - vortex_panic!("BitPackedArray has no slots, requested index {idx}") + SLOT_NAMES[idx] } fn with_slots(array: &mut BitPackedArray, slots: Vec>) -> VortexResult<()> { vortex_ensure!( - slots.is_empty(), - "BitPackedArray expects 0 slots, got {}", + slots.len() == NUM_SLOTS, + "BitPackedArray expects {} slots, got {}", + NUM_SLOTS, slots.len() ); + + // Reconstruct patches from slots + existing metadata + array.patches = match (&slots[PATCH_INDICES_SLOT], &slots[PATCH_VALUES_SLOT]) { + (Some(indices), Some(values)) => { + let old = array + .patches + .as_ref() + .vortex_expect("BitPackedArray had patch slots but no patches metadata"); + Some(Patches::new( + array.len, + old.offset(), + indices.clone(), + values.clone(), + slots[PATCH_CHUNK_OFFSETS_SLOT].clone(), + )?) + } + _ => None, + }; + + // Reconstruct validity from slot + array.validity = match &slots[VALIDITY_SLOT] { + Some(arr) => Validity::Array(arr.clone()), + None => Validity::from(array.dtype.nullability()), + }; + array.slots = slots; Ok(()) } diff --git a/encodings/fastlanes/src/delta/vtable/mod.rs b/encodings/fastlanes/src/delta/vtable/mod.rs index 9ee6b96e5a2..3d90da51569 100644 --- a/encodings/fastlanes/src/delta/vtable/mod.rs +++ b/encodings/fastlanes/src/delta/vtable/mod.rs @@ -131,12 +131,8 @@ impl VTable for DeltaVTable { rules::RULES.evaluate(array, parent, child_idx) } - fn nslots(_array: &DeltaArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &DeltaArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &DeltaArray) -> &[Option] { + &array.slots } fn slot_name(_array: &DeltaArray, idx: usize) -> &str { diff --git a/encodings/fastlanes/src/for/vtable/mod.rs b/encodings/fastlanes/src/for/vtable/mod.rs index 0b1525250a4..6f7886b0716 100644 --- a/encodings/fastlanes/src/for/vtable/mod.rs +++ b/encodings/fastlanes/src/for/vtable/mod.rs @@ -107,12 +107,8 @@ impl VTable for FoRVTable { } } - fn nslots(_array: &FoRArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &FoRArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &FoRArray) -> &[Option] { + &array.slots } fn slot_name(_array: &FoRArray, idx: usize) -> &str { diff --git a/encodings/fastlanes/src/rle/vtable/mod.rs b/encodings/fastlanes/src/rle/vtable/mod.rs index b255fc1e7a1..63e7196c3b0 100644 --- a/encodings/fastlanes/src/rle/vtable/mod.rs +++ b/encodings/fastlanes/src/rle/vtable/mod.rs @@ -152,12 +152,8 @@ impl VTable for RLEVTable { Ok(()) } - fn nslots(array: &RLEArray) -> usize { - array.slots.len() - } - - fn slot(array: &RLEArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &RLEArray) -> &[Option] { + &array.slots } fn slot_name(_array: &RLEArray, idx: usize) -> &str { diff --git a/encodings/fsst/src/array.rs b/encodings/fsst/src/array.rs index 9712bc99ae9..f4dfa2691a4 100644 --- a/encodings/fsst/src/array.rs +++ b/encodings/fsst/src/array.rs @@ -40,7 +40,6 @@ use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityChild; use vortex_array::vtable::ValidityHelper; use vortex_array::vtable::ValidityVTableFromChild; -use vortex_array::vtable::validity_nchildren; use vortex_array::vtable::validity_to_child; use vortex_buffer::Buffer; use vortex_buffer::ByteBuffer; @@ -143,29 +142,6 @@ impl VTable for FSSTVTable { } } - fn nchildren(array: &FSSTArray) -> usize { - 2 + validity_nchildren(array.codes.validity()) - } - - fn child(array: &FSSTArray, idx: usize) -> ArrayRef { - match idx { - 0 => array.uncompressed_lengths().clone(), - 1 => array.codes.offsets().clone(), - 2 => validity_to_child(array.codes.validity(), array.codes.len()) - .unwrap_or_else(|| vortex_panic!("FSSTArray child index {idx} out of bounds")), - _ => vortex_panic!("FSSTArray child index {idx} out of bounds"), - } - } - - fn child_name(_array: &FSSTArray, idx: usize) -> String { - match idx { - 0 => "uncompressed_lengths".to_string(), - 1 => "codes_offsets".to_string(), - 2 => "validity".to_string(), - _ => vortex_panic!("FSSTArray child_name index {idx} out of bounds"), - } - } - fn metadata(array: &FSSTArray) -> VortexResult { Ok(ProstMetadata(FSSTMetadata { uncompressed_lengths_ptype: array.uncompressed_lengths().dtype().as_ptype().into(), @@ -309,12 +285,8 @@ impl VTable for FSSTVTable { ); } - fn nslots(_array: &FSSTArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &FSSTArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &FSSTArray) -> &[Option] { + &array.slots } fn slot_name(_array: &FSSTArray, idx: usize) -> &str { @@ -328,38 +300,23 @@ impl VTable for FSSTVTable { NUM_SLOTS, slots.len() ); - array.slots = slots; - Ok(()) - } - - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 2, - "FSSTArray expects 2 children, got {}", - children.len() - ); - - let mut children_iter = children.into_iter(); - let codes = children_iter - .next() - .ok_or_else(|| vortex_err!("FSSTArray with_children missing codes"))?; - - let codes = codes - .as_opt::() - .ok_or_else(|| { - vortex_err!( - "Expected VarBinArray for codes, got {}", - codes.encoding_id() - ) - })? - .clone(); - let uncompressed_lengths = children_iter - .next() - .ok_or_else(|| vortex_err!("FSSTArray with_children missing uncompressed_lengths"))?; - - array.codes = codes; - array.slots[UNCOMPRESSED_LENGTHS_SLOT] = Some(uncompressed_lengths); + // Reconstruct codes VarBinArray from new offsets + existing bytes + new validity + let codes_offsets = slots[CODES_OFFSETS_SLOT] + .clone() + .vortex_expect("FSSTArray requires codes_offsets slot"); + let codes_validity = match &slots[CODES_VALIDITY_SLOT] { + Some(arr) => Validity::Array(arr.clone()), + None => Validity::from(array.codes.dtype().nullability()), + }; + array.codes = VarBinArray::try_new_from_handle( + codes_offsets, + array.codes.bytes_handle().clone(), + array.codes.dtype().clone(), + codes_validity, + )?; + array.codes_array = array.codes.clone().into_array(); + array.slots = slots; Ok(()) } @@ -386,8 +343,11 @@ impl VTable for FSSTVTable { } pub(crate) const UNCOMPRESSED_LENGTHS_SLOT: usize = 0; -pub(crate) const NUM_SLOTS: usize = 1; -pub(crate) const SLOT_NAMES: [&str; NUM_SLOTS] = ["uncompressed_lengths"]; +pub(crate) const CODES_OFFSETS_SLOT: usize = 1; +pub(crate) const CODES_VALIDITY_SLOT: usize = 2; +pub(crate) const NUM_SLOTS: usize = 3; +pub(crate) const SLOT_NAMES: [&str; NUM_SLOTS] = + ["uncompressed_lengths", "codes_offsets", "codes_validity"]; #[derive(Clone)] pub struct FSSTArray { @@ -487,6 +447,8 @@ impl FSSTArray { }) as Box Compressor + Send>)); let codes_array = codes.clone().into_array(); + let codes_offsets_slot = Some(codes.offsets().clone()); + let codes_validity_slot = validity_to_child(codes.validity(), codes.len()); Self { dtype, @@ -494,7 +456,11 @@ impl FSSTArray { symbol_lengths, codes, codes_array, - slots: vec![Some(uncompressed_lengths)], + slots: vec![ + Some(uncompressed_lengths), + codes_offsets_slot, + codes_validity_slot, + ], stats_set: Default::default(), compressor, } diff --git a/encodings/pco/src/array.rs b/encodings/pco/src/array.rs index bccba3ea53d..45425c0dd33 100644 --- a/encodings/pco/src/array.rs +++ b/encodings/pco/src/array.rs @@ -43,18 +43,15 @@ use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityHelper; use vortex_array::vtable::ValiditySliceHelper; use vortex_array::vtable::ValidityVTableFromValiditySliceHelper; -use vortex_array::vtable::validity_nchildren; use vortex_array::vtable::validity_to_child; use vortex_buffer::BufferMut; use vortex_buffer::ByteBuffer; use vortex_buffer::ByteBufferMut; use vortex_error::VortexError; -use vortex_error::VortexExpect as _; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; use vortex_error::vortex_err; -use vortex_error::vortex_panic; use vortex_session::VortexSession; use crate::PcoChunkInfo; @@ -168,22 +165,6 @@ impl VTable for PcoVTable { } } - fn nchildren(array: &PcoArray) -> usize { - validity_nchildren(&array.unsliced_validity) - } - - fn child(array: &PcoArray, idx: usize) -> ArrayRef { - validity_to_child(&array.unsliced_validity, array.unsliced_n_rows) - .unwrap_or_else(|| vortex_panic!("PcoArray child index {idx} out of bounds")) - } - - fn child_name(_array: &PcoArray, idx: usize) -> String { - match idx { - 0 => "validity".to_string(), - _ => vortex_panic!("PcoArray child_name index {idx} out of bounds"), - } - } - fn metadata(array: &PcoArray) -> VortexResult { Ok(ProstMetadata(array.metadata.clone())) } @@ -246,42 +227,25 @@ impl VTable for PcoVTable { )) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() <= 1, - "PcoArray expects 0 or 1 children, got {}", - children.len() - ); - - if children.is_empty() { - array.unsliced_validity = Validity::from(array.dtype.nullability()); - } else { - array.unsliced_validity = - Validity::Array(children.into_iter().next().vortex_expect("validity child")); - } - - Ok(()) - } - - fn nslots(_array: &PcoArray) -> usize { - NUM_SLOTS - } - - fn slot(_array: &PcoArray, idx: usize) -> &Option { - vortex_panic!("PcoArray has no slots, requested index {idx}") + fn slots(array: &PcoArray) -> &[Option] { + &array.slots } fn slot_name(_array: &PcoArray, idx: usize) -> &str { - let _ = SLOT_NAMES; - vortex_panic!("PcoArray has no slots, requested index {idx}") + SLOT_NAMES[idx] } fn with_slots(array: &mut PcoArray, slots: Vec>) -> VortexResult<()> { vortex_ensure!( - slots.is_empty(), - "PcoArray expects 0 slots, got {}", + slots.len() == NUM_SLOTS, + "PcoArray expects {} slots, got {}", + NUM_SLOTS, slots.len() ); + array.unsliced_validity = match &slots[VALIDITY_SLOT] { + Some(arr) => Validity::Array(arr.clone()), + None => Validity::from(array.dtype.nullability()), + }; array.slots = slots; Ok(()) } @@ -336,8 +300,9 @@ impl PcoVTable { pub const ID: ArrayId = ArrayId::new_ref("vortex.pco"); } -pub(super) const NUM_SLOTS: usize = 0; -pub(super) const SLOT_NAMES: [&str; 0] = []; +pub(super) const VALIDITY_SLOT: usize = 0; +pub(super) const NUM_SLOTS: usize = 1; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["validity"]; #[derive(Clone, Debug)] pub struct PcoArray { @@ -362,6 +327,8 @@ impl PcoArray { len: usize, validity: Validity, ) -> Self { + let validity_slot = validity_to_child(&validity, len); + Self { chunk_metas, pages, @@ -369,7 +336,7 @@ impl PcoArray { dtype, unsliced_validity: validity, unsliced_n_rows: len, - slots: vec![], + slots: vec![validity_slot], stats_set: Default::default(), slice_start: 0, slice_stop: len, diff --git a/encodings/runend/src/array.rs b/encodings/runend/src/array.rs index 09f5ec2368c..c69b236e168 100644 --- a/encodings/runend/src/array.rs +++ b/encodings/runend/src/array.rs @@ -172,12 +172,8 @@ impl VTable for RunEndVTable { ) } - fn nslots(_array: &RunEndArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &RunEndArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &RunEndArray) -> &[Option] { + &array.slots } fn slot_name(_array: &RunEndArray, idx: usize) -> &str { diff --git a/encodings/sequence/src/array.rs b/encodings/sequence/src/array.rs index 5d469706b93..cf7c33c66be 100644 --- a/encodings/sequence/src/array.rs +++ b/encodings/sequence/src/array.rs @@ -72,7 +72,6 @@ pub struct SequenceArrayParts { pub nullability: Nullability, } -pub(super) const NUM_SLOTS: usize = 0; pub(super) const SLOT_NAMES: [&str; 0] = []; #[derive(Clone, Debug)] @@ -386,12 +385,8 @@ impl VTable for SequenceVTable { Ok(()) } - fn nslots(_array: &SequenceArray) -> usize { - NUM_SLOTS - } - - fn slot(_array: &SequenceArray, idx: usize) -> &Option { - vortex_panic!("SequenceArray has no slots, requested index {idx}") + fn slots(array: &SequenceArray) -> &[Option] { + &array.slots } fn slot_name(_array: &SequenceArray, idx: usize) -> &str { diff --git a/encodings/sparse/src/lib.rs b/encodings/sparse/src/lib.rs index 671464f392b..c8668d4a658 100644 --- a/encodings/sparse/src/lib.rs +++ b/encodings/sparse/src/lib.rs @@ -33,9 +33,6 @@ use vortex_array::vtable; use vortex_array::vtable::ArrayId; use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityVTable; -use vortex_array::vtable::patches_child; -use vortex_array::vtable::patches_child_name; -use vortex_array::vtable::patches_nchildren; use vortex_buffer::Buffer; use vortex_buffer::ByteBufferMut; use vortex_error::VortexExpect as _; @@ -127,18 +124,6 @@ impl VTable for SparseVTable { } } - fn nchildren(array: &SparseArray) -> usize { - patches_nchildren(array.patches()) - } - - fn child(array: &SparseArray, idx: usize) -> ArrayRef { - patches_child(array.patches(), idx) - } - - fn child_name(_array: &SparseArray, idx: usize) -> String { - patches_child_name(idx).to_string() - } - fn metadata(array: &SparseArray) -> VortexResult { let patches = array.patches().to_metadata(array.len(), array.dtype())?; @@ -216,49 +201,38 @@ impl VTable for SparseVTable { ) } - fn nslots(_array: &SparseArray) -> usize { - NUM_SLOTS - } - - fn slot(_array: &SparseArray, idx: usize) -> &Option { - vortex_panic!("SparseArray has no slots, requested index {idx}") + fn slots(array: &SparseArray) -> &[Option] { + &array.slots } fn slot_name(_array: &SparseArray, idx: usize) -> &str { - let _ = SLOT_NAMES; - vortex_panic!("SparseArray has no slots, requested index {idx}") + SLOT_NAMES[idx] } fn with_slots(array: &mut SparseArray, slots: Vec>) -> VortexResult<()> { vortex_ensure!( - slots.is_empty(), - "SparseArray expects 0 slots, got {}", + slots.len() == NUM_SLOTS, + "SparseArray expects {} slots, got {}", + NUM_SLOTS, slots.len() ); - array.slots = slots; - Ok(()) - } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure_eq!( - children.len(), - 2, - "SparseArray expects 2 children, got {}", - children.len() - ); - - let mut children_iter = children.into_iter(); - let patch_indices = children_iter.next().vortex_expect("patch_indices child"); - let patch_values = children_iter.next().vortex_expect("patch_values child"); + // Reconstruct patches from slots + existing metadata + let indices = slots[PATCH_INDICES_SLOT] + .clone() + .vortex_expect("SparseArray requires patch_indices slot"); + let values = slots[PATCH_VALUES_SLOT] + .clone() + .vortex_expect("SparseArray requires patch_values slot"); array.patches = Patches::new( array.patches.array_len(), array.patches.offset(), - patch_indices, - patch_values, - array.patches.chunk_offsets().clone(), + indices, + values, + slots[PATCH_CHUNK_OFFSETS_SLOT].clone(), )?; - + array.slots = slots; Ok(()) } @@ -284,8 +258,12 @@ impl VTable for SparseVTable { } } -pub(crate) const NUM_SLOTS: usize = 0; -pub(crate) const SLOT_NAMES: [&str; 0] = []; +pub(crate) const PATCH_INDICES_SLOT: usize = 0; +pub(crate) const PATCH_VALUES_SLOT: usize = 1; +pub(crate) const PATCH_CHUNK_OFFSETS_SLOT: usize = 2; +pub(crate) const NUM_SLOTS: usize = 3; +pub(crate) const SLOT_NAMES: [&str; NUM_SLOTS] = + ["patch_indices", "patch_values", "patch_chunk_offsets"]; #[derive(Clone, Debug)] pub struct SparseArray { @@ -334,10 +312,13 @@ impl SparseArray { } } + // TODO(0ax1): handle chunk offsets + let patches = Patches::new(len, 0, indices, values, None)?; + let slots = Self::make_slots(&patches); + Ok(Self { - slots: vec![], - // TODO(0ax1): handle chunk offsets - patches: Patches::new(len, 0, indices, values, None)?, + slots, + patches, fill_value, stats_set: Default::default(), }) @@ -353,8 +334,10 @@ impl SparseArray { fill_value.dtype(), ); + let slots = Self::make_slots(&patches); + Ok(Self { - slots: vec![], + slots, patches, fill_value, stats_set: Default::default(), @@ -362,14 +345,24 @@ impl SparseArray { } pub(crate) unsafe fn new_unchecked(patches: Patches, fill_value: Scalar) -> Self { + let slots = Self::make_slots(&patches); + Self { - slots: vec![], + slots, patches, fill_value, stats_set: Default::default(), } } + fn make_slots(patches: &Patches) -> Vec> { + vec![ + Some(patches.indices().clone()), + Some(patches.values().clone()), + patches.chunk_offsets().clone(), + ] + } + #[inline] pub fn patches(&self) -> &Patches { &self.patches diff --git a/encodings/zigzag/src/array.rs b/encodings/zigzag/src/array.rs index 18466c89d81..5bb1595d4ec 100644 --- a/encodings/zigzag/src/array.rs +++ b/encodings/zigzag/src/array.rs @@ -139,12 +139,8 @@ impl VTable for ZigZagVTable { ZigZagArray::try_new(encoded) } - fn nslots(_array: &ZigZagArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &ZigZagArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &ZigZagArray) -> &[Option] { + &array.slots } fn slot_name(_array: &ZigZagArray, idx: usize) -> &str { diff --git a/encodings/zstd/src/array.rs b/encodings/zstd/src/array.rs index fd52a6af40a..8efd1206dd3 100644 --- a/encodings/zstd/src/array.rs +++ b/encodings/zstd/src/array.rs @@ -37,7 +37,6 @@ use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityHelper; use vortex_array::vtable::ValiditySliceHelper; use vortex_array::vtable::ValidityVTableFromValiditySliceHelper; -use vortex_array::vtable::validity_nchildren; use vortex_array::vtable::validity_to_child; use vortex_buffer::Alignment; use vortex_buffer::Buffer; @@ -176,22 +175,6 @@ impl VTable for ZstdVTable { } } - fn nchildren(array: &ZstdArray) -> usize { - validity_nchildren(&array.unsliced_validity) - } - - fn child(array: &ZstdArray, idx: usize) -> ArrayRef { - validity_to_child(&array.unsliced_validity, array.unsliced_n_rows) - .unwrap_or_else(|| vortex_panic!("ZstdArray child index {idx} out of bounds")) - } - - fn child_name(_array: &ZstdArray, idx: usize) -> String { - match idx { - 0 => "validity".to_string(), - _ => vortex_panic!("ZstdArray child_name index {idx} out of bounds"), - } - } - fn metadata(array: &ZstdArray) -> VortexResult { Ok(ProstMetadata(array.metadata.clone())) } @@ -256,41 +239,27 @@ impl VTable for ZstdVTable { )) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() <= 1, - "ZstdArray expects at most 1 child (validity), got {}", - children.len() - ); - - array.unsliced_validity = if children.is_empty() { - Validity::from(array.dtype.nullability()) - } else { - Validity::Array(children.into_iter().next().vortex_expect("checked")) - }; - - Ok(()) - } - - fn nslots(_array: &ZstdArray) -> usize { - NUM_SLOTS - } - - fn slot(_array: &ZstdArray, idx: usize) -> &Option { - vortex_panic!("ZstdArray has no slots, requested index {idx}") + fn slots(array: &ZstdArray) -> &[Option] { + &array.slots } fn slot_name(_array: &ZstdArray, idx: usize) -> &str { - let _ = SLOT_NAMES; - vortex_panic!("ZstdArray has no slots, requested index {idx}") + SLOT_NAMES[idx] } fn with_slots(array: &mut ZstdArray, slots: Vec>) -> VortexResult<()> { vortex_ensure!( - slots.is_empty(), - "ZstdArray expects 0 slots, got {}", + slots.len() == NUM_SLOTS, + "ZstdArray expects {} slots, got {}", + NUM_SLOTS, slots.len() ); + + array.unsliced_validity = match &slots[VALIDITY_SLOT] { + Some(arr) => Validity::Array(arr.clone()), + None => Validity::from(array.dtype.nullability()), + }; + array.slots = slots; Ok(()) } @@ -318,8 +287,9 @@ impl ZstdVTable { pub const ID: ArrayId = ArrayId::new_ref("vortex.zstd"); } -pub(super) const NUM_SLOTS: usize = 0; -pub(super) const SLOT_NAMES: [&str; 0] = []; +pub(super) const VALIDITY_SLOT: usize = 0; +pub(super) const NUM_SLOTS: usize = 1; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["validity"]; #[derive(Clone, Debug)] pub struct ZstdArray { @@ -438,6 +408,7 @@ impl ZstdArray { n_rows: usize, validity: Validity, ) -> Self { + let validity_slot = validity_to_child(&validity, n_rows); Self { dictionary, frames, @@ -445,7 +416,7 @@ impl ZstdArray { dtype, unsliced_validity: validity, unsliced_n_rows: n_rows, - slots: vec![], + slots: vec![validity_slot], stats_set: Default::default(), slice_start: 0, slice_stop: n_rows, diff --git a/encodings/zstd/src/zstd_buffers.rs b/encodings/zstd/src/zstd_buffers.rs index fad69be5ca7..fcd99eed25a 100644 --- a/encodings/zstd/src/zstd_buffers.rs +++ b/encodings/zstd/src/zstd_buffers.rs @@ -416,12 +416,8 @@ impl VTable for ZstdBuffersVTable { format!("child_{idx}") } - fn nslots(array: &ZstdBuffersArray) -> usize { - array.slots.len() - } - - fn slot(array: &ZstdBuffersArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &ZstdBuffersArray) -> &[Option] { + &array.slots } fn slot_name(_array: &ZstdBuffersArray, idx: usize) -> &str { diff --git a/vortex-array/src/array/mod.rs b/vortex-array/src/array/mod.rs index fb461b4a712..fbcf0329747 100644 --- a/vortex-array/src/array/mod.rs +++ b/vortex-array/src/array/mod.rs @@ -369,13 +369,14 @@ impl dyn DynArray + '_ { /// Returns a new array with the slot at `slot_idx` replaced by `replacement`. pub fn with_slot(&self, slot_idx: usize, replacement: ArrayRef) -> VortexResult { + let slots = self.slots(); vortex_ensure!( - slot_idx < self.nslots(), + slot_idx < slots.len(), "slot index {} out of bounds for array with {} slots", slot_idx, - self.nslots() + slots.len() ); - let mut slots: Vec> = (0..self.nslots()).map(|i| self.slot(i)).collect(); + let mut slots = slots.to_vec(); slots[slot_idx] = Some(replacement); self.vtable().with_slots(&self.to_array(), slots) } @@ -743,12 +744,8 @@ impl ArrayVisitor for ArrayAdapter { V::nbuffers(&self.0) } - fn nslots(&self) -> usize { - V::nslots(&self.0) - } - - fn slot(&self, idx: usize) -> Option { - V::slot(&self.0, idx).clone() + fn slots(&self) -> &[Option] { + V::slots(&self.0) } fn metadata(&self) -> VortexResult>> { diff --git a/vortex-array/src/array/visitor.rs b/vortex-array/src/array/visitor.rs index 0168bc1cac2..012bb1924bc 100644 --- a/vortex-array/src/array/visitor.rs +++ b/vortex-array/src/array/visitor.rs @@ -26,11 +26,8 @@ pub trait ArrayVisitor { /// Returns the names of the children of the array. fn children_names(&self) -> Vec; - /// Returns the number of slots in the array. - fn nslots(&self) -> usize; - - /// Returns a clone of the slot at the given index, or `None` if the slot is empty. - fn slot(&self, idx: usize) -> Option; + /// Returns the slots of the array as a slice. + fn slots(&self) -> &[Option]; /// Returns the array's children with their names. fn named_children(&self) -> Vec<(String, ArrayRef)>; @@ -80,12 +77,8 @@ impl ArrayVisitor for Arc { self.as_ref().children_names() } - fn nslots(&self) -> usize { - self.as_ref().nslots() - } - - fn slot(&self, idx: usize) -> Option { - self.as_ref().slot(idx) + fn slots(&self) -> &[Option] { + self.as_ref().slots() } fn named_children(&self) -> Vec<(String, ArrayRef)> { diff --git a/vortex-array/src/arrays/bool/array.rs b/vortex-array/src/arrays/bool/array.rs index 60b93af8012..1fd9589ee6c 100644 --- a/vortex-array/src/arrays/bool/array.rs +++ b/vortex-array/src/arrays/bool/array.rs @@ -16,7 +16,6 @@ use crate::dtype::DType; use crate::stats::ArrayStats; use crate::validity::Validity; -pub(super) const NUM_SLOTS: usize = 0; pub(super) const SLOT_NAMES: [&str; 0] = []; /// A boolean array that stores true/false values in a compact bit-packed format. diff --git a/vortex-array/src/arrays/bool/vtable/mod.rs b/vortex-array/src/arrays/bool/vtable/mod.rs index b323b8bc278..8d9c6a3bd61 100644 --- a/vortex-array/src/arrays/bool/vtable/mod.rs +++ b/vortex-array/src/arrays/bool/vtable/mod.rs @@ -17,7 +17,6 @@ use crate::IntoArray; use crate::ProstMetadata; use crate::SerializeMetadata; use crate::arrays::BoolArray; -use crate::arrays::bool::array::NUM_SLOTS; use crate::arrays::bool::array::SLOT_NAMES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -171,12 +170,8 @@ impl VTable for BoolVTable { BoolArray::try_new_from_handle(buffer, metadata.offset as usize, len, validity) } - fn nslots(_array: &BoolArray) -> usize { - NUM_SLOTS - } - - fn slot(_array: &BoolArray, idx: usize) -> &Option { - vortex_panic!("BoolArray has no slots, requested index {idx}") + fn slots(array: &BoolArray) -> &[Option] { + &array.slots } fn slot_name(_array: &BoolArray, idx: usize) -> &str { diff --git a/vortex-array/src/arrays/chunked/vtable/mod.rs b/vortex-array/src/arrays/chunked/vtable/mod.rs index dac27f8eb79..cbd99a38f53 100644 --- a/vortex-array/src/arrays/chunked/vtable/mod.rs +++ b/vortex-array/src/arrays/chunked/vtable/mod.rs @@ -252,12 +252,8 @@ impl VTable for ChunkedVTable { Ok(ExecutionStep::Done(_canonicalize(array, ctx)?.into_array())) } - fn nslots(array: &ChunkedArray) -> usize { - array.slots.len() - } - - fn slot(array: &ChunkedArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &ChunkedArray) -> &[Option] { + &array.slots } fn slot_name(_array: &ChunkedArray, idx: usize) -> &str { diff --git a/vortex-array/src/arrays/constant/array.rs b/vortex-array/src/arrays/constant/array.rs index 336f973f140..b6c29077374 100644 --- a/vortex-array/src/arrays/constant/array.rs +++ b/vortex-array/src/arrays/constant/array.rs @@ -6,7 +6,6 @@ use crate::scalar::Scalar; use crate::stats::ArrayStats; pub(super) const NUM_SLOTS: usize = 0; -pub(super) const SLOT_NAMES: [&str; 0] = []; #[derive(Clone, Debug)] pub struct ConstantArray { diff --git a/vortex-array/src/arrays/constant/vtable/mod.rs b/vortex-array/src/arrays/constant/vtable/mod.rs index 4da4a6df8ec..352c5796281 100644 --- a/vortex-array/src/arrays/constant/vtable/mod.rs +++ b/vortex-array/src/arrays/constant/vtable/mod.rs @@ -18,7 +18,6 @@ use crate::IntoArray; use crate::Precision; use crate::arrays::ConstantArray; use crate::arrays::constant::array::NUM_SLOTS; -use crate::arrays::constant::array::SLOT_NAMES; use crate::arrays::constant::compute::rules::PARENT_RULES; use crate::arrays::constant::vtable::canonical::constant_canonicalize; use crate::buffer::BufferHandle; @@ -121,13 +120,8 @@ impl VTable for ConstantVTable { vortex_panic!("ConstantArray child_name index {idx} out of bounds") } - fn nslots(_array: &ConstantArray) -> usize { - NUM_SLOTS - } - - fn slot(_array: &ConstantArray, idx: usize) -> &Option { - let _ = SLOT_NAMES; - vortex_panic!("ConstantArray slot index {idx} out of bounds") + fn slots(array: &ConstantArray) -> &[Option] { + &array.slots } fn slot_name(_array: &ConstantArray, idx: usize) -> &str { diff --git a/vortex-array/src/arrays/decimal/array.rs b/vortex-array/src/arrays/decimal/array.rs index 68f23d0a28e..79910d0bd80 100644 --- a/vortex-array/src/arrays/decimal/array.rs +++ b/vortex-array/src/arrays/decimal/array.rs @@ -29,7 +29,6 @@ use crate::stats::ArrayStats; use crate::validity::Validity; use crate::vtable::ValidityHelper; -pub(super) const NUM_SLOTS: usize = 0; pub(super) const SLOT_NAMES: [&str; 0] = []; /// A decimal array that stores fixed-precision decimal numbers with configurable scale. diff --git a/vortex-array/src/arrays/decimal/vtable/mod.rs b/vortex-array/src/arrays/decimal/vtable/mod.rs index 85fdf3ed7d5..57586b63137 100644 --- a/vortex-array/src/arrays/decimal/vtable/mod.rs +++ b/vortex-array/src/arrays/decimal/vtable/mod.rs @@ -18,7 +18,6 @@ use crate::IntoArray; use crate::ProstMetadata; use crate::SerializeMetadata; use crate::arrays::DecimalArray; -use crate::arrays::decimal::array::NUM_SLOTS; use crate::arrays::decimal::array::SLOT_NAMES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -189,12 +188,8 @@ impl VTable for DecimalVTable { }) } - fn nslots(_array: &DecimalArray) -> usize { - NUM_SLOTS - } - - fn slot(_array: &DecimalArray, idx: usize) -> &Option { - vortex_panic!("DecimalArray has no slots, requested index {idx}") + fn slots(array: &DecimalArray) -> &[Option] { + &array.slots } fn slot_name(_array: &DecimalArray, idx: usize) -> &str { diff --git a/vortex-array/src/arrays/dict/vtable/mod.rs b/vortex-array/src/arrays/dict/vtable/mod.rs index a949bfc6831..b3b58fe1dbf 100644 --- a/vortex-array/src/arrays/dict/vtable/mod.rs +++ b/vortex-array/src/arrays/dict/vtable/mod.rs @@ -13,8 +13,10 @@ use vortex_session::VortexSession; use super::DictArray; use super::DictMetadata; +use super::array::CODES_SLOT; use super::array::NUM_SLOTS; use super::array::SLOT_NAMES; +use super::array::VALUES_SLOT; use super::take_canonical; use crate::ArrayRef; use crate::Canonical; @@ -114,8 +116,8 @@ impl VTable for DictVTable { fn child_name(_array: &DictArray, idx: usize) -> String { match idx { - 0 => "codes".to_string(), - 1 => "values".to_string(), + 0 => SLOT_NAMES[CODES_SLOT].to_string(), + 1 => SLOT_NAMES[VALUES_SLOT].to_string(), _ => vortex_panic!("DictArray child_name index {idx} out of bounds"), } } @@ -179,12 +181,8 @@ impl VTable for DictVTable { }) } - fn nslots(_array: &DictArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &DictArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &DictArray) -> &[Option] { + &array.slots } fn slot_name(_array: &DictArray, idx: usize) -> &str { diff --git a/vortex-array/src/arrays/extension/vtable/mod.rs b/vortex-array/src/arrays/extension/vtable/mod.rs index 4771bed3796..d748079f3b0 100644 --- a/vortex-array/src/arrays/extension/vtable/mod.rs +++ b/vortex-array/src/arrays/extension/vtable/mod.rs @@ -104,12 +104,8 @@ impl VTable for ExtensionVTable { } } - fn nslots(_array: &ExtensionArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &ExtensionArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &ExtensionArray) -> &[Option] { + &array.slots } fn slot_name(_array: &ExtensionArray, idx: usize) -> &str { diff --git a/vortex-array/src/arrays/filter/vtable.rs b/vortex-array/src/arrays/filter/vtable.rs index 7485a578669..ec8735bbc9c 100644 --- a/vortex-array/src/arrays/filter/vtable.rs +++ b/vortex-array/src/arrays/filter/vtable.rs @@ -110,12 +110,8 @@ impl VTable for FilterVTable { } } - fn nslots(_array: &Self::Array) -> usize { - NUM_SLOTS - } - - fn slot(array: &Self::Array, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &Self::Array) -> &[Option] { + &array.slots } fn slot_name(_array: &Self::Array, idx: usize) -> &str { diff --git a/vortex-array/src/arrays/fixed_size_list/array.rs b/vortex-array/src/arrays/fixed_size_list/array.rs index 1d33758976c..78cff0078b8 100644 --- a/vortex-array/src/arrays/fixed_size_list/array.rs +++ b/vortex-array/src/arrays/fixed_size_list/array.rs @@ -12,10 +12,12 @@ use crate::DynArray; use crate::dtype::DType; use crate::stats::ArrayStats; use crate::validity::Validity; +use crate::vtable::validity_to_child; pub(super) const ELEMENTS_SLOT: usize = 0; -pub(super) const NUM_SLOTS: usize = 1; -pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["elements"]; +pub(super) const VALIDITY_SLOT: usize = 1; +pub(super) const NUM_SLOTS: usize = 2; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["elements", "validity"]; /// The canonical encoding for fixed-size list arrays. /// @@ -158,10 +160,11 @@ impl FixedSizeListArray { .vortex_expect("[Debug Assertion]: Invalid `FixedSizeListArray` parameters"); let nullability = validity.nullability(); + let validity_slot = validity_to_child(&validity, len); Self { dtype: DType::FixedSizeList(Arc::new(elements.dtype().clone()), list_size, nullability), - slots: vec![Some(elements)], + slots: vec![Some(elements), validity_slot], list_size, validity, len, diff --git a/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs b/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs index c22424e5b8c..447271e010d 100644 --- a/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs +++ b/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs @@ -3,7 +3,6 @@ use std::hash::Hash; -use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -19,6 +18,7 @@ use crate::Precision; use crate::arrays::FixedSizeListArray; use crate::arrays::fixed_size_list::array::NUM_SLOTS; use crate::arrays::fixed_size_list::array::SLOT_NAMES; +use crate::arrays::fixed_size_list::array::VALIDITY_SLOT; use crate::arrays::fixed_size_list::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -31,8 +31,6 @@ use crate::vtable; use crate::vtable::ArrayId; use crate::vtable::VTable; use crate::vtable::ValidityVTableFromValidityHelper; -use crate::vtable::validity_nchildren; -use crate::vtable::validity_to_child; mod kernel; mod operations; mod validity; @@ -103,27 +101,6 @@ impl VTable for FixedSizeListVTable { vortex_panic!("FixedSizeListArray buffer_name index {idx} out of bounds") } - fn nchildren(array: &FixedSizeListArray) -> usize { - 1 + validity_nchildren(&array.validity) - } - - fn child(array: &FixedSizeListArray, idx: usize) -> ArrayRef { - match idx { - 0 => array.elements().clone(), - 1 => validity_to_child(&array.validity, array.len()) - .vortex_expect("FixedSizeListArray validity child out of bounds"), - _ => vortex_panic!("FixedSizeListArray child index {idx} out of bounds"), - } - } - - fn child_name(_array: &FixedSizeListArray, idx: usize) -> String { - match idx { - 0 => "elements".to_string(), - 1 => "validity".to_string(), - _ => vortex_panic!("FixedSizeListArray child_name index {idx} out of bounds"), - } - } - fn reduce_parent( array: &Self::Array, parent: &ArrayRef, @@ -198,12 +175,8 @@ impl VTable for FixedSizeListVTable { FixedSizeListArray::try_new(elements, *list_size, validity, len) } - fn nslots(_array: &FixedSizeListArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &FixedSizeListArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &FixedSizeListArray) -> &[Option] { + &array.slots } fn slot_name(_array: &FixedSizeListArray, idx: usize) -> &str { @@ -220,30 +193,11 @@ impl VTable for FixedSizeListVTable { NUM_SLOTS, slots.len() ); - array.slots = slots; - Ok(()) - } - - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 1 || children.len() == 2, - "FixedSizeListArray expects 1 or 2 children, got {}", - children.len() - ); - - let mut iter = children.into_iter(); - let elements = iter - .next() - .vortex_expect("children length already validated"); - let validity = if let Some(validity_array) = iter.next() { - Validity::Array(validity_array) - } else { - Validity::from(array.dtype.nullability()) + array.validity = match &slots[VALIDITY_SLOT] { + Some(arr) => Validity::Array(arr.clone()), + None => Validity::from(array.dtype.nullability()), }; - - let new_array = - FixedSizeListArray::try_new(elements, array.list_size(), validity, array.len())?; - *array = new_array; + array.slots = slots; Ok(()) } diff --git a/vortex-array/src/arrays/list/array.rs b/vortex-array/src/arrays/list/array.rs index 0e224962ea7..a3dbab41b94 100644 --- a/vortex-array/src/arrays/list/array.rs +++ b/vortex-array/src/arrays/list/array.rs @@ -25,11 +25,13 @@ use crate::match_each_native_ptype; use crate::scalar_fn::fns::operators::Operator; use crate::stats::ArrayStats; use crate::validity::Validity; +use crate::vtable::validity_to_child; pub(super) const ELEMENTS_SLOT: usize = 0; pub(super) const OFFSETS_SLOT: usize = 1; -pub(super) const NUM_SLOTS: usize = 2; -pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["elements", "offsets"]; +pub(super) const VALIDITY_SLOT: usize = 2; +pub(super) const NUM_SLOTS: usize = 3; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["elements", "offsets", "validity"]; /// A list array that stores variable-length lists of elements, similar to `Vec>`. /// @@ -149,9 +151,12 @@ impl ListArray { Self::validate(&elements, &offsets, &validity) .vortex_expect("[Debug Assertion]: Invalid `ListViewArray` parameters"); + let len = offsets.len().saturating_sub(1); + let validity_slot = validity_to_child(&validity, len); + Self { dtype: DType::List(Arc::new(elements.dtype().clone()), validity.nullability()), - slots: vec![Some(elements), Some(offsets)], + slots: vec![Some(elements), Some(offsets), validity_slot], validity, stats_set: Default::default(), } diff --git a/vortex-array/src/arrays/list/vtable/mod.rs b/vortex-array/src/arrays/list/vtable/mod.rs index 184c61e7cc9..fab9722ed89 100644 --- a/vortex-array/src/arrays/list/vtable/mod.rs +++ b/vortex-array/src/arrays/list/vtable/mod.rs @@ -3,7 +3,6 @@ use std::hash::Hash; -use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -20,6 +19,7 @@ use crate::ProstMetadata; use crate::arrays::ListArray; use crate::arrays::list::array::NUM_SLOTS; use crate::arrays::list::array::SLOT_NAMES; +use crate::arrays::list::array::VALIDITY_SLOT; use crate::arrays::list::compute::PARENT_KERNELS; use crate::arrays::list::compute::rules::PARENT_RULES; use crate::arrays::listview::list_view_from_list; @@ -38,8 +38,6 @@ use crate::vtable; use crate::vtable::ArrayId; use crate::vtable::VTable; use crate::vtable::ValidityVTableFromValidityHelper; -use crate::vtable::validity_nchildren; -use crate::vtable::validity_to_child; mod operations; mod validity; vtable!(List); @@ -100,29 +98,6 @@ impl VTable for ListVTable { vortex_panic!("ListArray buffer_name index {idx} out of bounds") } - fn nchildren(array: &ListArray) -> usize { - 2 + validity_nchildren(&array.validity) - } - - fn child(array: &ListArray, idx: usize) -> ArrayRef { - match idx { - 0 => array.elements().clone(), - 1 => array.offsets().clone(), - 2 => validity_to_child(&array.validity, array.len()) - .vortex_expect("ListArray validity child out of bounds"), - _ => vortex_panic!("ListArray child index {idx} out of bounds"), - } - } - - fn child_name(_array: &ListArray, idx: usize) -> String { - match idx { - 0 => "elements".to_string(), - 1 => "offsets".to_string(), - 2 => "validity".to_string(), - _ => vortex_panic!("ListArray child_name index {idx} out of bounds"), - } - } - fn reduce_parent( array: &Self::Array, parent: &ArrayRef, @@ -188,12 +163,8 @@ impl VTable for ListVTable { ListArray::try_new(elements, offsets, validity) } - fn nslots(_array: &ListArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &ListArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &ListArray) -> &[Option] { + &array.slots } fn slot_name(_array: &ListArray, idx: usize) -> &str { @@ -207,32 +178,11 @@ impl VTable for ListVTable { NUM_SLOTS, slots.len() ); - array.slots = slots; - Ok(()) - } - - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 2 || children.len() == 3, - "ListArray expects 2 or 3 children, got {}", - children.len() - ); - - let mut iter = children.into_iter(); - let elements = iter - .next() - .vortex_expect("children length already validated"); - let offsets = iter - .next() - .vortex_expect("children length already validated"); - let validity = if let Some(validity_array) = iter.next() { - Validity::Array(validity_array) - } else { - Validity::from(array.dtype.nullability()) + array.validity = match &slots[VALIDITY_SLOT] { + Some(arr) => Validity::Array(arr.clone()), + None => Validity::from(array.dtype.nullability()), }; - - let new_array = ListArray::try_new(elements, offsets, validity)?; - *array = new_array; + array.slots = slots; Ok(()) } diff --git a/vortex-array/src/arrays/listview/array.rs b/vortex-array/src/arrays/listview/array.rs index 3d59ebd9821..28090c9d843 100644 --- a/vortex-array/src/arrays/listview/array.rs +++ b/vortex-array/src/arrays/listview/array.rs @@ -21,12 +21,14 @@ use crate::dtype::IntegerPType; use crate::match_each_integer_ptype; use crate::stats::ArrayStats; use crate::validity::Validity; +use crate::vtable::validity_to_child; pub(super) const ELEMENTS_SLOT: usize = 0; pub(super) const OFFSETS_SLOT: usize = 1; pub(super) const SIZES_SLOT: usize = 2; -pub(super) const NUM_SLOTS: usize = 3; -pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["elements", "offsets", "sizes"]; +pub(super) const VALIDITY_SLOT: usize = 3; +pub(super) const NUM_SLOTS: usize = 4; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["elements", "offsets", "sizes", "validity"]; /// The canonical encoding for variable-length list arrays. /// @@ -162,9 +164,12 @@ impl ListViewArray { ) -> VortexResult { Self::validate(&elements, &offsets, &sizes, &validity)?; + let len = offsets.len(); + let validity_slot = validity_to_child(&validity, len); + Ok(Self { dtype: DType::List(Arc::new(elements.dtype().clone()), validity.nullability()), - slots: vec![Some(elements), Some(offsets), Some(sizes)], + slots: vec![Some(elements), Some(offsets), Some(sizes), validity_slot], validity, is_zero_copy_to_list: false, stats_set: Default::default(), @@ -201,9 +206,12 @@ impl ListViewArray { .vortex_expect("Failed to crate `ListViewArray`"); } + let len = offsets.len(); + let validity_slot = validity_to_child(&validity, len); + Self { dtype: DType::List(Arc::new(elements.dtype().clone()), validity.nullability()), - slots: vec![Some(elements), Some(offsets), Some(sizes)], + slots: vec![Some(elements), Some(offsets), Some(sizes), validity_slot], validity, is_zero_copy_to_list: false, stats_set: Default::default(), diff --git a/vortex-array/src/arrays/listview/vtable/mod.rs b/vortex-array/src/arrays/listview/vtable/mod.rs index 431a25d28f0..af7a19e3413 100644 --- a/vortex-array/src/arrays/listview/vtable/mod.rs +++ b/vortex-array/src/arrays/listview/vtable/mod.rs @@ -3,7 +3,6 @@ use std::hash::Hash; -use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -21,6 +20,7 @@ use crate::SerializeMetadata; use crate::arrays::ListViewArray; use crate::arrays::listview::array::NUM_SLOTS; use crate::arrays::listview::array::SLOT_NAMES; +use crate::arrays::listview::array::VALIDITY_SLOT; use crate::arrays::listview::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -35,8 +35,6 @@ use crate::vtable; use crate::vtable::ArrayId; use crate::vtable::VTable; use crate::vtable::ValidityVTableFromValidityHelper; -use crate::vtable::validity_nchildren; -use crate::vtable::validity_to_child; mod operations; mod validity; vtable!(ListView); @@ -113,31 +111,6 @@ impl VTable for ListViewVTable { vortex_panic!("ListViewArray buffer_name index {idx} out of bounds") } - fn nchildren(array: &ListViewArray) -> usize { - 3 + validity_nchildren(&array.validity) - } - - fn child(array: &ListViewArray, idx: usize) -> ArrayRef { - match idx { - 0 => array.elements().clone(), - 1 => array.offsets().clone(), - 2 => array.sizes().clone(), - 3 => validity_to_child(&array.validity, array.len()) - .vortex_expect("ListViewArray validity child out of bounds"), - _ => vortex_panic!("ListViewArray child index {idx} out of bounds"), - } - } - - fn child_name(_array: &ListViewArray, idx: usize) -> String { - match idx { - 0 => "elements".to_string(), - 1 => "offsets".to_string(), - 2 => "sizes".to_string(), - 3 => "validity".to_string(), - _ => vortex_panic!("ListViewArray child_name index {idx} out of bounds"), - } - } - fn metadata(array: &ListViewArray) -> VortexResult { Ok(ProstMetadata(ListViewMetadata { elements_len: array.elements().len() as u64, @@ -213,12 +186,8 @@ impl VTable for ListViewVTable { ListViewArray::try_new(elements, offsets, sizes, validity) } - fn nslots(_array: &ListViewArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &ListViewArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &ListViewArray) -> &[Option] { + &array.slots } fn slot_name(_array: &ListViewArray, idx: usize) -> &str { @@ -232,35 +201,11 @@ impl VTable for ListViewVTable { NUM_SLOTS, slots.len() ); - array.slots = slots; - Ok(()) - } - - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 3 || children.len() == 4, - "ListViewArray expects 3 or 4 children, got {}", - children.len() - ); - - let mut iter = children.into_iter(); - let elements = iter - .next() - .vortex_expect("children length already validated"); - let offsets = iter - .next() - .vortex_expect("children length already validated"); - let sizes = iter - .next() - .vortex_expect("children length already validated"); - let validity = if let Some(validity_array) = iter.next() { - Validity::Array(validity_array) - } else { - Validity::from(array.dtype.nullability()) + array.validity = match &slots[VALIDITY_SLOT] { + Some(arr) => Validity::Array(arr.clone()), + None => Validity::from(array.dtype.nullability()), }; - - let new_array = ListViewArray::try_new(elements, offsets, sizes, validity)?; - *array = new_array; + array.slots = slots; Ok(()) } diff --git a/vortex-array/src/arrays/masked/array.rs b/vortex-array/src/arrays/masked/array.rs index 6372014cc1a..437be1fc8ce 100644 --- a/vortex-array/src/arrays/masked/array.rs +++ b/vortex-array/src/arrays/masked/array.rs @@ -9,10 +9,12 @@ use crate::ArrayRef; use crate::dtype::DType; use crate::stats::ArrayStats; use crate::validity::Validity; +use crate::vtable::validity_to_child; pub(super) const CHILD_SLOT: usize = 0; -pub(super) const NUM_SLOTS: usize = 1; -pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["child"]; +pub(super) const VALIDITY_SLOT: usize = 1; +pub(super) const NUM_SLOTS: usize = 2; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["child", "validity"]; #[derive(Clone, Debug)] pub struct MaskedArray { @@ -41,9 +43,11 @@ impl MaskedArray { // MaskedArray's nullability is determined solely by its validity, not the child's dtype. // The child can have nullable dtype but must not have any actual null values. let dtype = child.dtype().as_nullable(); + let len = child.len(); + let validity_slot = validity_to_child(&validity, len); Ok(Self { - slots: vec![Some(child)], + slots: vec![Some(child), validity_slot], validity, dtype, stats: ArrayStats::default(), diff --git a/vortex-array/src/arrays/masked/vtable/mod.rs b/vortex-array/src/arrays/masked/vtable/mod.rs index 4cecccea916..18e7b9ad126 100644 --- a/vortex-array/src/arrays/masked/vtable/mod.rs +++ b/vortex-array/src/arrays/masked/vtable/mod.rs @@ -6,7 +6,6 @@ mod validity; use std::hash::Hash; -use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -22,6 +21,7 @@ use crate::arrays::ConstantArray; use crate::arrays::MaskedArray; use crate::arrays::masked::array::NUM_SLOTS; use crate::arrays::masked::array::SLOT_NAMES; +use crate::arrays::masked::array::VALIDITY_SLOT; use crate::arrays::masked::compute::rules::PARENT_RULES; use crate::arrays::masked::mask_validity_canonical; use crate::buffer::BufferHandle; @@ -38,8 +38,6 @@ use crate::vtable; use crate::vtable::ArrayId; use crate::vtable::VTable; use crate::vtable::ValidityVTableFromValidityHelper; -use crate::vtable::validity_nchildren; -use crate::vtable::validity_to_child; vtable!(Masked); #[derive(Debug)] @@ -96,27 +94,6 @@ impl VTable for MaskedVTable { None } - fn nchildren(array: &Self::Array) -> usize { - 1 + validity_nchildren(&array.validity) - } - - fn child(array: &Self::Array, idx: usize) -> ArrayRef { - match idx { - 0 => array.child().clone(), - 1 => validity_to_child(&array.validity, array.child().len()) - .vortex_expect("MaskedArray validity child out of bounds"), - _ => vortex_panic!("MaskedArray child index {idx} out of bounds"), - } - } - - fn child_name(_array: &Self::Array, idx: usize) -> String { - match idx { - 0 => "child".to_string(), - 1 => "validity".to_string(), - _ => vortex_panic!("MaskedArray child_name index {idx} out of bounds"), - } - } - fn metadata(_array: &MaskedArray) -> VortexResult { Ok(EmptyMetadata) } @@ -146,18 +123,19 @@ impl VTable for MaskedVTable { vortex_bail!("Expected 0 buffer, got {}", buffers.len()); } + vortex_ensure!( + children.len() == 1 || children.len() == 2, + "`MaskedArray::build` expects 1 or 2 children, got {}", + children.len() + ); + let child = children.get(0, &dtype.as_nonnullable(), len)?; - let validity = if children.len() == 1 { - Validity::from(dtype.nullability()) - } else if children.len() == 2 { + let validity = if children.len() == 2 { let validity = children.get(1, &Validity::DTYPE, len)?; Validity::Array(validity) } else { - vortex_bail!( - "`MaskedArray::build` expects 1 or 2 children, got {}", - children.len() - ); + Validity::from(dtype.nullability()) }; MaskedArray::try_new(child, validity) @@ -194,12 +172,8 @@ impl VTable for MaskedVTable { PARENT_RULES.evaluate(array, parent, child_idx) } - fn nslots(_array: &MaskedArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &MaskedArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &MaskedArray) -> &[Option] { + &array.slots } fn slot_name(_array: &MaskedArray, idx: usize) -> &str { @@ -213,29 +187,11 @@ impl VTable for MaskedVTable { NUM_SLOTS, slots.len() ); - array.slots = slots; - Ok(()) - } - - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 1 || children.len() == 2, - "MaskedArray expects 1 or 2 children, got {}", - children.len() - ); - - let mut iter = children.into_iter(); - let child = iter - .next() - .vortex_expect("children length already validated"); - let validity = if let Some(validity_array) = iter.next() { - Validity::Array(validity_array) - } else { - Validity::from(array.dtype.nullability()) + array.validity = match &slots[VALIDITY_SLOT] { + Some(arr) => Validity::Array(arr.clone()), + None => Validity::from(array.dtype.nullability()), }; - - let new_array = MaskedArray::try_new(child, validity)?; - *array = new_array; + array.slots = slots; Ok(()) } } diff --git a/vortex-array/src/arrays/null/mod.rs b/vortex-array/src/arrays/null/mod.rs index 518aec42c80..b50416c72df 100644 --- a/vortex-array/src/arrays/null/mod.rs +++ b/vortex-array/src/arrays/null/mod.rs @@ -29,7 +29,6 @@ use crate::vtable::VTable; use crate::vtable::ValidityVTable; const NUM_SLOTS: usize = 0; -const SLOT_NAMES: [&str; 0] = []; pub(crate) mod compute; @@ -90,13 +89,8 @@ impl VTable for NullVTable { vortex_panic!("NullArray child_name index {idx} out of bounds") } - fn nslots(_array: &NullArray) -> usize { - NUM_SLOTS - } - - fn slot(_array: &NullArray, idx: usize) -> &Option { - let _ = SLOT_NAMES; - vortex_panic!("NullArray slot index {idx} out of bounds") + fn slots(array: &NullArray) -> &[Option] { + &array.slots } fn slot_name(_array: &NullArray, idx: usize) -> &str { diff --git a/vortex-array/src/arrays/primitive/array/mod.rs b/vortex-array/src/arrays/primitive/array/mod.rs index 60b99d67ab8..9f5ae983293 100644 --- a/vortex-array/src/arrays/primitive/array/mod.rs +++ b/vortex-array/src/arrays/primitive/array/mod.rs @@ -34,7 +34,6 @@ pub use patch::patch_chunk; use crate::ArrayRef; use crate::buffer::BufferHandle; -pub(super) const NUM_SLOTS: usize = 0; pub(super) const SLOT_NAMES: [&str; 0] = []; /// A primitive array that stores [native types][crate::dtype::NativePType] in a contiguous buffer diff --git a/vortex-array/src/arrays/primitive/vtable/mod.rs b/vortex-array/src/arrays/primitive/vtable/mod.rs index c81b65f0449..c8207737c00 100644 --- a/vortex-array/src/arrays/primitive/vtable/mod.rs +++ b/vortex-array/src/arrays/primitive/vtable/mod.rs @@ -14,7 +14,6 @@ use crate::ExecutionCtx; use crate::ExecutionStep; use crate::IntoArray; use crate::arrays::PrimitiveArray; -use crate::arrays::primitive::array::NUM_SLOTS; use crate::arrays::primitive::array::SLOT_NAMES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -185,12 +184,8 @@ impl VTable for PrimitiveVTable { } } - fn nslots(_array: &PrimitiveArray) -> usize { - NUM_SLOTS - } - - fn slot(_array: &PrimitiveArray, idx: usize) -> &Option { - vortex_panic!("PrimitiveArray has no slots, requested index {idx}") + fn slots(array: &PrimitiveArray) -> &[Option] { + &array.slots } fn slot_name(_array: &PrimitiveArray, idx: usize) -> &str { diff --git a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs index 0e4ac38ec42..e67383ff96a 100644 --- a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs +++ b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs @@ -187,12 +187,8 @@ impl VTable for ScalarFnVTable { }) } - fn nslots(array: &ScalarFnArray) -> usize { - array.slots.len() - } - - fn slot(array: &ScalarFnArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &ScalarFnArray) -> &[Option] { + &array.slots } fn slot_name(_array: &ScalarFnArray, _idx: usize) -> &str { diff --git a/vortex-array/src/arrays/shared/vtable.rs b/vortex-array/src/arrays/shared/vtable.rs index c443de4a9df..9fa8f838fe7 100644 --- a/vortex-array/src/arrays/shared/vtable.rs +++ b/vortex-array/src/arrays/shared/vtable.rs @@ -105,12 +105,8 @@ impl VTable for SharedVTable { } } - fn nslots(_array: &SharedArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &SharedArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &SharedArray) -> &[Option] { + &array.slots } fn slot_name(_array: &SharedArray, idx: usize) -> &str { diff --git a/vortex-array/src/arrays/slice/vtable.rs b/vortex-array/src/arrays/slice/vtable.rs index 7bbbe5e3464..e8eb23c2b97 100644 --- a/vortex-array/src/arrays/slice/vtable.rs +++ b/vortex-array/src/arrays/slice/vtable.rs @@ -102,12 +102,8 @@ impl VTable for SliceVTable { } } - fn nslots(_array: &Self::Array) -> usize { - NUM_SLOTS - } - - fn slot(array: &Self::Array, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &Self::Array) -> &[Option] { + &array.slots } fn slot_name(_array: &Self::Array, idx: usize) -> &str { diff --git a/vortex-array/src/arrays/struct_/array.rs b/vortex-array/src/arrays/struct_/array.rs index f77d8066da8..f9d2200715c 100644 --- a/vortex-array/src/arrays/struct_/array.rs +++ b/vortex-array/src/arrays/struct_/array.rs @@ -20,8 +20,11 @@ use crate::dtype::StructFields; use crate::stats::ArrayStats; use crate::validity::Validity; use crate::vtable::ValidityHelper; +use crate::vtable::validity_to_child; -// StructArray has a variable number of slots (one per field) +// StructArray has a variable number of slots: [validity?, field_0, ..., field_N] +pub(super) const VALIDITY_SLOT: usize = 0; +pub(super) const FIELDS_OFFSET: usize = 1; /// A struct array that stores multiple named fields as columns, similar to a database row. /// @@ -159,7 +162,7 @@ pub struct StructArrayParts { impl StructArray { /// Return the struct fields without the validity of the struct applied. pub fn unmasked_fields(&self) -> Arc<[ArrayRef]> { - self.slots + self.slots[FIELDS_OFFSET..] .iter() .map(|s| s.as_ref().vortex_expect("StructArray field slot").clone()) .collect() @@ -180,7 +183,7 @@ impl StructArray { pub fn unmasked_field_by_name_opt(&self, name: impl AsRef) -> Option<&ArrayRef> { let name = name.as_ref(); self.struct_fields().find(name).map(|idx| { - self.slots[idx] + self.slots[FIELDS_OFFSET + idx] .as_ref() .vortex_expect("StructArray field slot") }) @@ -287,7 +290,10 @@ impl StructArray { Self::validate(&fields, &dtype, length, &validity) .vortex_expect("[Debug Assertion]: Invalid `StructArray` parameters"); - let slots = fields.iter().map(|f| Some(f.clone())).collect(); + let validity_slot = validity_to_child(&validity, length); + let slots = once(validity_slot) + .chain(fields.iter().map(|f| Some(f.clone()))) + .collect(); Self { len: length, @@ -369,6 +375,7 @@ impl StructArray { let fields: Arc<[ArrayRef]> = self .slots .into_iter() + .skip(FIELDS_OFFSET) .map(|s| s.vortex_expect("StructArray field slot")) .collect(); StructArrayParts { @@ -432,7 +439,7 @@ impl StructArray { names.push(self.names()[idx].clone()); children.push( - self.slots[idx] + self.slots[FIELDS_OFFSET + idx] .as_ref() .vortex_expect("StructArray field slot") .clone(), @@ -459,7 +466,8 @@ impl StructArray { .iter() .position(|field_name| field_name.as_ref() == name.as_ref())?; - let field = self.slots[position] + let slot_position = FIELDS_OFFSET + position; + let field = self.slots[slot_position] .as_ref() .vortex_expect("StructArray field slot") .clone(); @@ -467,7 +475,7 @@ impl StructArray { .slots .iter() .enumerate() - .filter(|(i, _)| *i != position) + .filter(|(i, _)| *i != slot_position) .map(|(_, s)| s.clone()) .collect(); @@ -488,8 +496,7 @@ impl StructArray { let types = struct_dtype.fields().chain(once(array.dtype().clone())); let new_fields = StructFields::new(names.collect(), types.collect()); - let children: Arc<[ArrayRef]> = self - .slots + let children: Arc<[ArrayRef]> = self.slots[FIELDS_OFFSET..] .iter() .map(|s| s.as_ref().vortex_expect("StructArray field slot").clone()) .chain(once(array)) diff --git a/vortex-array/src/arrays/struct_/vtable/mod.rs b/vortex-array/src/arrays/struct_/vtable/mod.rs index 7d3fcda1b9f..f73374daa85 100644 --- a/vortex-array/src/arrays/struct_/vtable/mod.rs +++ b/vortex-array/src/arrays/struct_/vtable/mod.rs @@ -6,7 +6,6 @@ use kernel::PARENT_KERNELS; use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; -use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; @@ -16,6 +15,8 @@ use crate::ExecutionCtx; use crate::ExecutionStep; use crate::IntoArray; use crate::arrays::StructArray; +use crate::arrays::struct_::array::FIELDS_OFFSET; +use crate::arrays::struct_::array::VALIDITY_SLOT; use crate::arrays::struct_::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -24,8 +25,6 @@ use crate::validity::Validity; use crate::vtable; use crate::vtable::VTable; use crate::vtable::ValidityVTableFromValidityHelper; -use crate::vtable::validity_nchildren; -use crate::vtable::validity_to_child; mod kernel; mod operations; mod validity; @@ -94,32 +93,6 @@ impl VTable for StructVTable { vortex_panic!("StructArray buffer_name index {idx} out of bounds") } - fn nchildren(array: &StructArray) -> usize { - validity_nchildren(&array.validity) + array.slots.len() - } - - fn child(array: &StructArray, idx: usize) -> ArrayRef { - let vc = validity_nchildren(&array.validity); - if idx < vc { - validity_to_child(&array.validity, array.len()) - .vortex_expect("StructArray validity child out of bounds") - } else { - array.slots[idx - vc] - .as_ref() - .vortex_expect("StructArray field slot") - .clone() - } - } - - fn child_name(array: &StructArray, idx: usize) -> String { - let vc = validity_nchildren(&array.validity); - if idx < vc { - "validity".to_string() - } else { - array.names()[idx - vc].as_ref().to_string() - } - } - fn metadata(_array: &StructArray) -> VortexResult { Ok(EmptyMetadata) } @@ -152,7 +125,6 @@ impl VTable for StructVTable { let (validity, non_data_children) = if children.len() == struct_dtype.nfields() { (Validity::from(*nullability), 0_usize) } else if children.len() == struct_dtype.nfields() + 1 { - // Validity is the first child if it exists. let validity = children.get(0, &Validity::DTYPE, len)?; (Validity::Array(validity), 1_usize) } else { @@ -164,7 +136,7 @@ impl VTable for StructVTable { ); }; - let children: Vec<_> = (0..struct_dtype.nfields()) + let field_children: Vec<_> = (0..struct_dtype.nfields()) .map(|i| { let child_dtype = struct_dtype .field_by_index(i) @@ -173,59 +145,27 @@ impl VTable for StructVTable { }) .try_collect()?; - StructArray::try_new_with_dtype(children, struct_dtype.clone(), len, validity) - } - - fn nslots(array: &StructArray) -> usize { - array.slots.len() + StructArray::try_new_with_dtype(field_children, struct_dtype.clone(), len, validity) } - fn slot(array: &StructArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &StructArray) -> &[Option] { + &array.slots } fn slot_name(array: &StructArray, idx: usize) -> &str { - array.names()[idx].as_ref() + if idx == VALIDITY_SLOT { + "validity" + } else { + array.names()[idx - FIELDS_OFFSET].as_ref() + } } fn with_slots(array: &mut StructArray, slots: Vec>) -> VortexResult<()> { - array.slots = slots; - Ok(()) - } - - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - let DType::Struct(struct_dtype, _nullability) = &array.dtype else { - vortex_bail!("Expected struct dtype, found {:?}", array.dtype) + array.validity = match &slots[VALIDITY_SLOT] { + Some(arr) => Validity::Array(arr.clone()), + None => Validity::from(array.dtype.nullability()), }; - - // First child is validity (if present), followed by fields - let (validity, non_data_children) = if children.len() == struct_dtype.nfields() { - (array.validity.clone(), 0_usize) - } else if children.len() == struct_dtype.nfields() + 1 { - (Validity::Array(children[0].clone()), 1_usize) - } else { - vortex_bail!( - "Expected {} or {} children, found {}", - struct_dtype.nfields(), - struct_dtype.nfields() + 1, - children.len() - ); - }; - - let slots: Vec> = children - .into_iter() - .skip(non_data_children) - .map(Some) - .collect(); - vortex_ensure!( - slots.len() == struct_dtype.nfields(), - "Expected {} field children, found {}", - struct_dtype.nfields(), - slots.len() - ); - array.slots = slots; - array.validity = validity; Ok(()) } diff --git a/vortex-array/src/arrays/varbin/array.rs b/vortex-array/src/arrays/varbin/array.rs index 16bcca5fc6a..6474323bced 100644 --- a/vortex-array/src/arrays/varbin/array.rs +++ b/vortex-array/src/arrays/varbin/array.rs @@ -19,10 +19,12 @@ use crate::dtype::Nullability; use crate::match_each_integer_ptype; use crate::stats::ArrayStats; use crate::validity::Validity; +use crate::vtable::validity_to_child; pub(super) const OFFSETS_SLOT: usize = 0; -pub(super) const NUM_SLOTS: usize = 1; -pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["offsets"]; +pub(super) const VALIDITY_SLOT: usize = 1; +pub(super) const NUM_SLOTS: usize = 2; +pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["offsets", "validity"]; #[derive(Clone, Debug)] pub struct VarBinArray { @@ -158,10 +160,13 @@ impl VarBinArray { Self::validate(&offsets, &bytes, &dtype, &validity) .vortex_expect("[Debug Assertion]: Invalid `VarBinArray` parameters"); + let len = offsets.len().saturating_sub(1); + let validity_slot = validity_to_child(&validity, len); + Self { dtype, bytes, - slots: vec![Some(offsets)], + slots: vec![Some(offsets), validity_slot], validity, stats_set: Default::default(), } diff --git a/vortex-array/src/arrays/varbin/vtable/mod.rs b/vortex-array/src/arrays/varbin/vtable/mod.rs index 378dab66a01..75a31f88868 100644 --- a/vortex-array/src/arrays/varbin/vtable/mod.rs +++ b/vortex-array/src/arrays/varbin/vtable/mod.rs @@ -5,7 +5,6 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; -use vortex_error::vortex_err; use vortex_error::vortex_panic; use crate::ArrayRef; @@ -18,6 +17,7 @@ use crate::SerializeMetadata; use crate::arrays::VarBinArray; use crate::arrays::varbin::array::NUM_SLOTS; use crate::arrays::varbin::array::SLOT_NAMES; +use crate::arrays::varbin::array::VALIDITY_SLOT; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::dtype::Nullability; @@ -28,8 +28,6 @@ use crate::vtable; use crate::vtable::ArrayId; use crate::vtable::VTable; use crate::vtable::ValidityVTableFromValidityHelper; -use crate::vtable::validity_nchildren; -use crate::vtable::validity_to_child; mod canonical; mod kernel; mod operations; @@ -108,27 +106,6 @@ impl VTable for VarBinVTable { } } - fn nchildren(array: &VarBinArray) -> usize { - 1 + validity_nchildren(&array.validity) - } - - fn child(array: &VarBinArray, idx: usize) -> ArrayRef { - match idx { - 0 => array.offsets().clone(), - 1 => validity_to_child(&array.validity, array.len()) - .vortex_expect("VarBinArray validity child out of bounds"), - _ => vortex_panic!("VarBinArray child index {idx} out of bounds"), - } - } - - fn child_name(_array: &VarBinArray, idx: usize) -> String { - match idx { - 0 => "offsets".to_string(), - 1 => "validity".to_string(), - _ => vortex_panic!("VarBinArray child_name index {idx} out of bounds"), - } - } - fn metadata(array: &VarBinArray) -> VortexResult { Ok(ProstMetadata(VarBinMetadata { offsets_ptype: PType::try_from(array.offsets().dtype()) @@ -182,12 +159,8 @@ impl VTable for VarBinVTable { VarBinArray::try_new(offsets, bytes, dtype.clone(), validity) } - fn nslots(_array: &VarBinArray) -> usize { - NUM_SLOTS - } - - fn slot(array: &VarBinArray, idx: usize) -> &Option { - &array.slots[idx] + fn slots(array: &VarBinArray) -> &[Option] { + &array.slots } fn slot_name(_array: &VarBinArray, idx: usize) -> &str { @@ -201,33 +174,14 @@ impl VTable for VarBinVTable { NUM_SLOTS, slots.len() ); + array.validity = match &slots[VALIDITY_SLOT] { + Some(arr) => Validity::Array(arr.clone()), + None => Validity::from(array.dtype.nullability()), + }; array.slots = slots; Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - match children.len() { - 1 => { - let [offsets]: [ArrayRef; 1] = children - .try_into() - .map_err(|_| vortex_err!("Failed to convert children to array"))?; - array.slots = vec![Some(offsets)]; - } - 2 => { - let [offsets, validity]: [ArrayRef; 2] = children - .try_into() - .map_err(|_| vortex_err!("Failed to convert children to array"))?; - array.slots = vec![Some(offsets)]; - array.validity = Validity::Array(validity); - } - _ => vortex_bail!( - "VarBinArray expects 1 or 2 children (offsets, validity?), got {}", - children.len() - ), - } - Ok(()) - } - fn reduce_parent( array: &Self::Array, parent: &ArrayRef, diff --git a/vortex-array/src/arrays/varbinview/array.rs b/vortex-array/src/arrays/varbinview/array.rs index 9523af4cfde..7cefc92b6b4 100644 --- a/vortex-array/src/arrays/varbinview/array.rs +++ b/vortex-array/src/arrays/varbinview/array.rs @@ -23,7 +23,6 @@ use crate::dtype::Nullability; use crate::stats::ArrayStats; use crate::validity::Validity; -pub(super) const NUM_SLOTS: usize = 0; pub(super) const SLOT_NAMES: [&str; 0] = []; /// A variable-length binary view array that stores strings and binary data efficiently. diff --git a/vortex-array/src/arrays/varbinview/vtable/mod.rs b/vortex-array/src/arrays/varbinview/vtable/mod.rs index 3d111a5810b..b4a30f56e34 100644 --- a/vortex-array/src/arrays/varbinview/vtable/mod.rs +++ b/vortex-array/src/arrays/varbinview/vtable/mod.rs @@ -23,7 +23,6 @@ use crate::IntoArray; use crate::Precision; use crate::arrays::VarBinViewArray; use crate::arrays::varbinview::BinaryView; -use crate::arrays::varbinview::array::NUM_SLOTS; use crate::arrays::varbinview::array::SLOT_NAMES; use crate::arrays::varbinview::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; @@ -212,12 +211,8 @@ impl VTable for VarBinViewVTable { VarBinViewArray::try_new(views, Arc::from(data_buffers), dtype.clone(), validity) } - fn nslots(_array: &VarBinViewArray) -> usize { - NUM_SLOTS - } - - fn slot(_array: &VarBinViewArray, idx: usize) -> &Option { - vortex_panic!("VarBinViewArray has no slots, requested index {idx}") + fn slots(array: &VarBinViewArray) -> &[Option] { + &array.slots } fn slot_name(_array: &VarBinViewArray, idx: usize) -> &str { diff --git a/vortex-array/src/executor.rs b/vortex-array/src/executor.rs index b5be703824a..367420a4b2f 100644 --- a/vortex-array/src/executor.rs +++ b/vortex-array/src/executor.rs @@ -144,7 +144,9 @@ impl dyn DynArray + '_ { // Execute the array itself match current.vtable().execute(¤t, ctx)? { ExecutionStep::ExecuteSlot(i, done) => { - let child = current.slot(i).vortex_expect("ExecuteSlot index in bounds"); + let child = current.slots()[i] + .clone() + .vortex_expect("ExecuteSlot index in bounds"); ctx.log(format_args!( "ExecuteSlot({i}): pushing {}, focusing on {}", current, child @@ -267,11 +269,11 @@ impl Executable for ArrayRef { } // 2. reduce_parent (child-driven metadata-only rewrites) - for slot_idx in 0..array.nslots() { - let Some(child) = array.slot(slot_idx) else { + for (slot_idx, slot) in array.slots().iter().enumerate() { + let Some(child) = slot else { continue; }; - if let Some(reduced_parent) = child.vtable().reduce_parent(&child, &array, slot_idx)? { + if let Some(reduced_parent) = child.vtable().reduce_parent(child, &array, slot_idx)? { ctx.log(format_args!( "reduce_parent: slot[{}]({}) rewrote {} -> {}", slot_idx, @@ -285,13 +287,13 @@ impl Executable for ArrayRef { } // 3. execute_parent (child-driven optimized execution) - for slot_idx in 0..array.nslots() { - let Some(child) = array.slot(slot_idx) else { + for (slot_idx, slot) in array.slots().iter().enumerate() { + let Some(child) = slot else { continue; }; if let Some(executed_parent) = child .vtable() - .execute_parent(&child, &array, slot_idx, ctx)? + .execute_parent(child, &array, slot_idx, ctx)? { ctx.log(format_args!( "execute_parent: slot[{}]({}) rewrote {} -> {}", @@ -317,7 +319,7 @@ impl Executable for ArrayRef { ExecutionStep::ExecuteSlot(i, _) => { // For single-step execution, handle ExecuteSlot by executing the slot, // replacing it, and returning the updated array. - let child = array.slot(i).vortex_expect("valid slot index"); + let child = array.slots()[i].clone().vortex_expect("valid slot index"); let executed_child = child.execute::(ctx)?; array.with_slot(i, executed_child) } @@ -327,14 +329,11 @@ impl Executable for ArrayRef { /// Try execute_parent on each occupied slot of the array. fn try_execute_parent(array: &ArrayRef, ctx: &mut ExecutionCtx) -> VortexResult> { - for slot_idx in 0..array.nslots() { - let Some(child) = array.slot(slot_idx) else { + for (slot_idx, slot) in array.slots().iter().enumerate() { + let Some(child) = slot else { continue; }; - if let Some(result) = child - .vtable() - .execute_parent(&child, array, slot_idx, ctx)? - { + if let Some(result) = child.vtable().execute_parent(child, array, slot_idx, ctx)? { result.statistics().inherit_from(array.statistics()); return Ok(Some(result)); } diff --git a/vortex-array/src/vtable/mod.rs b/vortex-array/src/vtable/mod.rs index 532103dde44..7f7171647db 100644 --- a/vortex-array/src/vtable/mod.rs +++ b/vortex-array/src/vtable/mod.rs @@ -89,9 +89,7 @@ pub trait VTable: 'static + Sized + Send + Sync + Debug { /// /// The default counts non-None slots. fn nchildren(array: &Self::Array) -> usize { - (0..Self::nslots(array)) - .filter(|i| Self::slot(array, *i).is_some()) - .count() + Self::slots(array).iter().filter(|s| s.is_some()).count() } /// Returns the child at the given index. @@ -101,8 +99,9 @@ pub trait VTable: 'static + Sized + Send + Sync + Debug { /// # Panics /// Panics if `idx >= nchildren(array)`. fn child(array: &Self::Array, idx: usize) -> ArrayRef { - (0..Self::nslots(array)) - .filter_map(|i| Self::slot(array, i).clone()) + Self::slots(array) + .iter() + .filter_map(|s| s.clone()) .nth(idx) .vortex_expect("child index out of bounds") } @@ -114,10 +113,12 @@ pub trait VTable: 'static + Sized + Send + Sync + Debug { /// # Panics /// Panics if `idx >= nchildren(array)`. fn child_name(array: &Self::Array, idx: usize) -> String { - (0..Self::nslots(array)) - .filter(|i| Self::slot(array, *i).is_some()) + Self::slots(array) + .iter() + .enumerate() + .filter(|(_, s)| s.is_some()) .nth(idx) - .map(|slot_idx| Self::slot_name(array, slot_idx).to_string()) + .map(|(slot_idx, _)| Self::slot_name(array, slot_idx).to_string()) .vortex_expect("child_name index out of bounds") } @@ -198,23 +199,17 @@ pub trait VTable: 'static + Sized + Send + Sync + Debug { children: &dyn ArrayChildren, ) -> VortexResult; - /// Returns the number of slots in the array. + /// Returns the slots of the array as a slice. /// /// Slots provide fixed-position storage for child arrays, enabling direct access /// by slot index without the overhead of dynamic child lookups. Optional children /// (like validity) are represented as `None` slots rather than shifting dense indices. - fn nslots(array: &Self::Array) -> usize; - - /// Returns a reference to the slot at the given index. - /// - /// # Panics - /// Panics if `idx >= nslots(array)`. - fn slot(array: &Self::Array, idx: usize) -> &Option; + fn slots(array: &Self::Array) -> &[Option]; /// Returns the name of the slot at the given index. /// /// # Panics - /// Panics if `idx >= nslots(array)`. + /// Panics if `idx >= slots(array).len()`. fn slot_name(array: &Self::Array, idx: usize) -> &str; /// Replaces the slots in `array` with `slots`. @@ -226,9 +221,10 @@ pub trait VTable: 'static + Sized + Send + Sync + Debug { /// The default maps children back onto the current slot structure and calls `with_slots`. fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { let mut child_iter = children.into_iter(); - let slots: Vec> = (0..Self::nslots(array)) - .map(|i| { - Self::slot(array, i).is_some().then(|| { + let slots: Vec> = Self::slots(array) + .iter() + .map(|slot| { + slot.is_some().then(|| { child_iter .next() .vortex_expect("too few children for with_children") From 206d3c03605c36ae06c85a262b8f038f2d063756 Mon Sep 17 00:00:00 2001 From: Joe Isaacs Date: Wed, 11 Mar 2026 15:01:54 +0000 Subject: [PATCH 3/4] fix Signed-off-by: Joe Isaacs --- encodings/bytebool/src/array.rs | 16 --------- encodings/datetime-parts/src/array.rs | 17 --------- .../src/decimal_byte_parts/mod.rs | 10 ------ encodings/fastlanes/src/delta/vtable/mod.rs | 17 --------- encodings/fastlanes/src/for/vtable/mod.rs | 15 -------- encodings/fastlanes/src/rle/vtable/mod.rs | 12 ------- encodings/runend/src/array.rs | 16 --------- encodings/sequence/src/array.rs | 9 ----- encodings/zigzag/src/array.rs | 10 ------ encodings/zstd/src/zstd_buffers.rs | 5 --- vortex-array/src/array/mod.rs | 25 ------------- vortex-array/src/arrays/bool/vtable/mod.rs | 16 --------- vortex-array/src/arrays/chunked/vtable/mod.rs | 33 ----------------- .../src/arrays/constant/vtable/mod.rs | 9 ----- vortex-array/src/arrays/decimal/vtable/mod.rs | 20 ----------- vortex-array/src/arrays/dict/vtable/mod.rs | 13 ------- .../src/arrays/extension/vtable/mod.rs | 15 -------- vortex-array/src/arrays/filter/vtable.rs | 15 -------- vortex-array/src/arrays/null/mod.rs | 9 ----- .../src/arrays/primitive/vtable/mod.rs | 16 --------- .../src/arrays/scalar_fn/vtable/mod.rs | 11 ------ vortex-array/src/arrays/shared/array.rs | 6 ---- vortex-array/src/arrays/shared/vtable.rs | 15 -------- vortex-array/src/arrays/slice/vtable.rs | 15 -------- .../src/arrays/varbinview/vtable/mod.rs | 17 --------- vortex-array/src/optimizer/mod.rs | 36 +++++++++++-------- vortex-array/src/vtable/dyn_.rs | 8 ----- vortex-array/src/vtable/mod.rs | 19 ---------- vortex-python/src/arrays/py/vtable.rs | 9 ----- 29 files changed, 22 insertions(+), 412 deletions(-) diff --git a/encodings/bytebool/src/array.rs b/encodings/bytebool/src/array.rs index ef6ce343782..0d1c39ada2c 100644 --- a/encodings/bytebool/src/array.rs +++ b/encodings/bytebool/src/array.rs @@ -159,22 +159,6 @@ impl VTable for ByteBoolVTable { Ok(ByteBoolArray::new(buffer, validity)) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() <= 1, - "ByteBoolArray expects at most 1 child (validity), got {}", - children.len() - ); - - array.validity = if children.is_empty() { - Validity::from(array.dtype.nullability()) - } else { - Validity::Array(children.into_iter().next().vortex_expect("checked")) - }; - - Ok(()) - } - fn slots(array: &ByteBoolArray) -> &[Option] { &array.slots } diff --git a/encodings/datetime-parts/src/array.rs b/encodings/datetime-parts/src/array.rs index 19ad41b3964..6467e6884e5 100644 --- a/encodings/datetime-parts/src/array.rs +++ b/encodings/datetime-parts/src/array.rs @@ -229,23 +229,6 @@ impl VTable for DateTimePartsVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 3, - "DateTimePartsArray expects exactly 3 children (days, seconds, subseconds), got {}", - children.len() - ); - - let mut children_iter = children.into_iter(); - array.slots = vec![ - Some(children_iter.next().vortex_expect("days child")), - Some(children_iter.next().vortex_expect("seconds child")), - Some(children_iter.next().vortex_expect("subseconds child")), - ]; - - Ok(()) - } - fn execute(array: &Self::Array, ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionStep::Done( decode_to_temporal(array, ctx)?.into_array(), diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs index e66a4d18b28..147f33a2c1e 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs @@ -194,16 +194,6 @@ impl VTable for DecimalBytePartsVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 1, - "DecimalBytePartsArray expects exactly 1 child (msp), got {}", - children.len() - ); - array.slots = vec![Some(children.into_iter().next().vortex_expect("checked"))]; - Ok(()) - } - fn reduce_parent( array: &Self::Array, parent: &ArrayRef, diff --git a/encodings/fastlanes/src/delta/vtable/mod.rs b/encodings/fastlanes/src/delta/vtable/mod.rs index 3d90da51569..ebff55a10b7 100644 --- a/encodings/fastlanes/src/delta/vtable/mod.rs +++ b/encodings/fastlanes/src/delta/vtable/mod.rs @@ -23,7 +23,6 @@ use vortex_array::vtable; use vortex_array::vtable::ArrayId; use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityVTableFromChildSliceHelper; -use vortex_error::VortexExpect as _; use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_err; @@ -150,22 +149,6 @@ impl VTable for DeltaVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 2, - "Expected 2 children for Delta encoding, got {}", - children.len() - ); - - let mut children_iter = children.into_iter(); - array.slots = vec![ - Some(children_iter.next().vortex_expect("bases child")), - Some(children_iter.next().vortex_expect("deltas child")), - ]; - - Ok(()) - } - fn metadata(array: &DeltaArray) -> VortexResult { Ok(ProstMetadata(DeltaMetadata { deltas_len: array.deltas().len() as u64, diff --git a/encodings/fastlanes/src/for/vtable/mod.rs b/encodings/fastlanes/src/for/vtable/mod.rs index 6f7886b0716..fd4f273fe4a 100644 --- a/encodings/fastlanes/src/for/vtable/mod.rs +++ b/encodings/fastlanes/src/for/vtable/mod.rs @@ -21,7 +21,6 @@ use vortex_array::vtable; use vortex_array::vtable::ArrayId; use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityVTableFromChild; -use vortex_error::VortexExpect as _; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -126,20 +125,6 @@ impl VTable for FoRVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 1, - "Expected 1 child for FoR encoding, got {}", - children.len() - ); - - array.slots = vec![Some( - children.into_iter().next().vortex_expect("encoded child"), - )]; - - Ok(()) - } - fn metadata(array: &FoRArray) -> VortexResult { Ok(array.reference_scalar().clone()) } diff --git a/encodings/fastlanes/src/rle/vtable/mod.rs b/encodings/fastlanes/src/rle/vtable/mod.rs index 63e7196c3b0..bd7aa4d820b 100644 --- a/encodings/fastlanes/src/rle/vtable/mod.rs +++ b/encodings/fastlanes/src/rle/vtable/mod.rs @@ -140,18 +140,6 @@ impl VTable for RLEVTable { RULES.evaluate(array, parent, child_idx) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 3, - "Expected 3 children for RLE encoding, got {}", - children.len() - ); - - array.slots = children.into_iter().map(Some).collect(); - - Ok(()) - } - fn slots(array: &RLEArray) -> &[Option] { &array.slots } diff --git a/encodings/runend/src/array.rs b/encodings/runend/src/array.rs index c69b236e168..97909f2de14 100644 --- a/encodings/runend/src/array.rs +++ b/encodings/runend/src/array.rs @@ -191,22 +191,6 @@ impl VTable for RunEndVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 2, - "RunEndArray expects 2 children, got {}", - children.len() - ); - - let mut children_iter = children.into_iter(); - array.slots = vec![ - Some(children_iter.next().vortex_expect("ends child")), - Some(children_iter.next().vortex_expect("values child")), - ]; - - Ok(()) - } - fn reduce_parent( array: &Self::Array, parent: &ArrayRef, diff --git a/encodings/sequence/src/array.rs b/encodings/sequence/src/array.rs index cf7c33c66be..a939954742a 100644 --- a/encodings/sequence/src/array.rs +++ b/encodings/sequence/src/array.rs @@ -376,15 +376,6 @@ impl VTable for SequenceVTable { ) } - fn with_children(_array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.is_empty(), - "SequenceArray expects 0 children, got {}", - children.len() - ); - Ok(()) - } - fn slots(array: &SequenceArray) -> &[Option] { &array.slots } diff --git a/encodings/zigzag/src/array.rs b/encodings/zigzag/src/array.rs index 5bb1595d4ec..52e412af390 100644 --- a/encodings/zigzag/src/array.rs +++ b/encodings/zigzag/src/array.rs @@ -158,16 +158,6 @@ impl VTable for ZigZagVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 1, - "ZigZagArray expects exactly 1 child (encoded), got {}", - children.len() - ); - array.slots = vec![Some(children.into_iter().next().vortex_expect("checked"))]; - Ok(()) - } - fn execute(array: &Self::Array, ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionStep::Done( zigzag_decode(array.encoded().clone().execute(ctx)?).into_array(), diff --git a/encodings/zstd/src/zstd_buffers.rs b/encodings/zstd/src/zstd_buffers.rs index fcd99eed25a..51d91639de7 100644 --- a/encodings/zstd/src/zstd_buffers.rs +++ b/encodings/zstd/src/zstd_buffers.rs @@ -481,11 +481,6 @@ impl VTable for ZstdBuffersVTable { Ok(array) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - array.slots = children.into_iter().map(Some).collect(); - Ok(()) - } - fn execute(array: &Self::Array, ctx: &mut ExecutionCtx) -> VortexResult { let session = ctx.session(); let inner_array = array.decompress_and_build_inner(session)?; diff --git a/vortex-array/src/array/mod.rs b/vortex-array/src/array/mod.rs index fbcf0329747..a06367bd0a0 100644 --- a/vortex-array/src/array/mod.rs +++ b/vortex-array/src/array/mod.rs @@ -163,8 +163,6 @@ pub trait DynArray: // TODO(ngates): change how this works. It's weird. fn statistics(&self) -> StatsSetRef<'_>; - /// Replaces the children of the array with the given array references. - fn with_children(&self, children: Vec) -> VortexResult; } impl DynArray for Arc { @@ -274,10 +272,6 @@ impl DynArray for Arc { fn statistics(&self) -> StatsSetRef<'_> { self.as_ref().statistics() } - - fn with_children(&self, children: Vec) -> VortexResult { - self.as_ref().with_children(children) - } } /// A reference counted pointer to a dynamic [`DynArray`] trait object. @@ -354,19 +348,6 @@ impl dyn DynArray + '_ { self.is::() } - /// Returns a new array with the child at `child_idx` replaced by `replacement`. - pub fn with_child(&self, child_idx: usize, replacement: ArrayRef) -> VortexResult { - let mut children: Vec = self.children(); - vortex_ensure!( - child_idx < children.len(), - "child index {} out of bounds for array with {} children", - child_idx, - children.len() - ); - children[child_idx] = replacement; - self.with_children(children) - } - /// Returns a new array with the slot at `slot_idx` replaced by `replacement`. pub fn with_slot(&self, slot_idx: usize, replacement: ArrayRef) -> VortexResult { let slots = self.slots(); @@ -668,12 +649,6 @@ impl DynArray for ArrayAdapter { fn statistics(&self) -> StatsSetRef<'_> { V::stats(&self.0) } - - fn with_children(&self, children: Vec) -> VortexResult { - let mut this = self.0.clone(); - V::with_children(&mut this, children)?; - Ok(this.into_array()) - } } impl ArrayHash for ArrayAdapter { diff --git a/vortex-array/src/arrays/bool/vtable/mod.rs b/vortex-array/src/arrays/bool/vtable/mod.rs index 8d9c6a3bd61..5743af7f75a 100644 --- a/vortex-array/src/arrays/bool/vtable/mod.rs +++ b/vortex-array/src/arrays/bool/vtable/mod.rs @@ -189,22 +189,6 @@ impl VTable for BoolVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() <= 1, - "BoolArray can have at most 1 child (validity), got {}", - children.len() - ); - - array.validity = if children.is_empty() { - Validity::from(array.dtype().nullability()) - } else { - Validity::Array(children.into_iter().next().vortex_expect("checked")) - }; - - Ok(()) - } - fn execute(array: &Self::Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionStep::Done(array.clone().into_array())) } diff --git a/vortex-array/src/arrays/chunked/vtable/mod.rs b/vortex-array/src/arrays/chunked/vtable/mod.rs index cbd99a38f53..0589deb37e6 100644 --- a/vortex-array/src/arrays/chunked/vtable/mod.rs +++ b/vortex-array/src/arrays/chunked/vtable/mod.rs @@ -6,7 +6,6 @@ use std::hash::Hash; use itertools::Itertools; use vortex_error::VortexResult; use vortex_error::vortex_bail; -use vortex_error::vortex_ensure; use vortex_error::vortex_err; use vortex_error::vortex_panic; use vortex_session::VortexSession; @@ -203,39 +202,7 @@ impl VTable for ChunkedVTable { }) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - // Children: chunk_offsets, then chunks... - vortex_ensure!( - !children.is_empty(), - "Chunked array needs at least one child" - ); - let nchunks = children.len() - 1; - let chunk_offsets_array = children[0].to_primitive(); - let chunk_offsets_buf = chunk_offsets_array.to_buffer::(); - - vortex_ensure!( - chunk_offsets_buf.len() == nchunks + 1, - "Expected {} chunk offsets, found {}", - nchunks + 1, - chunk_offsets_buf.len() - ); - - let mut slots = Vec::with_capacity(children.len()); - slots.push(Some( - PrimitiveArray::new(chunk_offsets_buf.clone(), Validity::NonNullable).into_array(), - )); - slots.extend(children.into_iter().skip(1).map(Some)); - array.slots = slots; - - let total_len = chunk_offsets_buf - .last() - .ok_or_else(|| vortex_err!("chunk_offsets must not be empty"))?; - array.len = usize::try_from(*total_len) - .map_err(|_| vortex_err!("total length {} exceeds usize range", total_len))?; - - Ok(()) - } fn append_to_builder( array: &ChunkedArray, diff --git a/vortex-array/src/arrays/constant/vtable/mod.rs b/vortex-array/src/arrays/constant/vtable/mod.rs index 352c5796281..d4659dd617f 100644 --- a/vortex-array/src/arrays/constant/vtable/mod.rs +++ b/vortex-array/src/arrays/constant/vtable/mod.rs @@ -181,15 +181,6 @@ impl VTable for ConstantVTable { Ok(ConstantArray::new(metadata.clone(), len)) } - fn with_children(_array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.is_empty(), - "ConstantArray has no children, got {}", - children.len() - ); - Ok(()) - } - fn reduce_parent( array: &Self::Array, parent: &ArrayRef, diff --git a/vortex-array/src/arrays/decimal/vtable/mod.rs b/vortex-array/src/arrays/decimal/vtable/mod.rs index 57586b63137..99074cc3335 100644 --- a/vortex-array/src/arrays/decimal/vtable/mod.rs +++ b/vortex-array/src/arrays/decimal/vtable/mod.rs @@ -207,26 +207,6 @@ impl VTable for DecimalVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() <= 1, - "DecimalArray expects 0 or 1 child (validity), got {}", - children.len() - ); - - if children.is_empty() { - array.validity = Validity::from(array.dtype.nullability()); - } else { - array.validity = Validity::Array( - children - .into_iter() - .next() - .vortex_expect("children length already validated"), - ); - } - Ok(()) - } - fn execute(array: &Self::Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionStep::Done(array.clone().into_array())) } diff --git a/vortex-array/src/arrays/dict/vtable/mod.rs b/vortex-array/src/arrays/dict/vtable/mod.rs index b3b58fe1dbf..30607699fe4 100644 --- a/vortex-array/src/arrays/dict/vtable/mod.rs +++ b/vortex-array/src/arrays/dict/vtable/mod.rs @@ -200,19 +200,6 @@ impl VTable for DictVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 2, - "DictArray expects exactly 2 children (codes, values), got {}", - children.len() - ); - let [codes, values]: [ArrayRef; 2] = children - .try_into() - .map_err(|_| vortex_err!("Failed to convert children to array"))?; - array.slots = vec![Some(codes), Some(values)]; - Ok(()) - } - fn execute(array: &Self::Array, ctx: &mut ExecutionCtx) -> VortexResult { if let Some(canonical) = execute_fast_path(array, ctx)? { return Ok(ExecutionStep::Done(canonical)); diff --git a/vortex-array/src/arrays/extension/vtable/mod.rs b/vortex-array/src/arrays/extension/vtable/mod.rs index d748079f3b0..b21f9a908cf 100644 --- a/vortex-array/src/arrays/extension/vtable/mod.rs +++ b/vortex-array/src/arrays/extension/vtable/mod.rs @@ -8,7 +8,6 @@ mod validity; use std::hash::Hash; use kernel::PARENT_KERNELS; -use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -158,20 +157,6 @@ impl VTable for ExtensionVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 1, - "ExtensionArray expects exactly 1 child (storage), got {}", - children.len() - ); - let storage = children - .into_iter() - .next() - .vortex_expect("children length already validated"); - array.slots = vec![Some(storage)]; - Ok(()) - } - fn execute(array: &Self::Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionStep::Done(array.clone().into_array())) } diff --git a/vortex-array/src/arrays/filter/vtable.rs b/vortex-array/src/arrays/filter/vtable.rs index ec8735bbc9c..b0a5449b7c6 100644 --- a/vortex-array/src/arrays/filter/vtable.rs +++ b/vortex-array/src/arrays/filter/vtable.rs @@ -5,7 +5,6 @@ use std::fmt::Debug; use std::fmt::Formatter; use std::hash::Hasher; -use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -160,20 +159,6 @@ impl VTable for FilterVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 1, - "FilterArray expects exactly 1 child, got {}", - children.len() - ); - let child = children - .into_iter() - .next() - .vortex_expect("children length already validated"); - array.slots = vec![Some(child)]; - Ok(()) - } - fn execute(array: &Self::Array, ctx: &mut ExecutionCtx) -> VortexResult { if let Some(canonical) = execute_filter_fast_paths(array, ctx)? { return Ok(ExecutionStep::Done(canonical)); diff --git a/vortex-array/src/arrays/null/mod.rs b/vortex-array/src/arrays/null/mod.rs index b50416c72df..bc9d08d7cc9 100644 --- a/vortex-array/src/arrays/null/mod.rs +++ b/vortex-array/src/arrays/null/mod.rs @@ -136,15 +136,6 @@ impl VTable for NullVTable { Ok(NullArray::new(len)) } - fn with_children(_array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.is_empty(), - "NullArray has no children, got {}", - children.len() - ); - Ok(()) - } - fn reduce_parent( array: &Self::Array, parent: &ArrayRef, diff --git a/vortex-array/src/arrays/primitive/vtable/mod.rs b/vortex-array/src/arrays/primitive/vtable/mod.rs index c8207737c00..caa334630ba 100644 --- a/vortex-array/src/arrays/primitive/vtable/mod.rs +++ b/vortex-array/src/arrays/primitive/vtable/mod.rs @@ -203,22 +203,6 @@ impl VTable for PrimitiveVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() <= 1, - "PrimitiveArray can have at most 1 child (validity), got {}", - children.len() - ); - - array.validity = if children.is_empty() { - Validity::from(array.dtype().nullability()) - } else { - Validity::Array(children.into_iter().next().vortex_expect("checked")) - }; - - Ok(()) - } - fn execute(array: &Self::Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionStep::Done(array.clone().into_array())) } diff --git a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs index e67383ff96a..c2421e53211 100644 --- a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs +++ b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs @@ -200,17 +200,6 @@ impl VTable for ScalarFnVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == array.slots.len(), - "ScalarFnArray expects {} children, got {}", - array.slots.len(), - children.len() - ); - array.slots = children.into_iter().map(Some).collect(); - Ok(()) - } - fn execute(array: &Self::Array, ctx: &mut ExecutionCtx) -> VortexResult { ctx.log(format_args!("scalar_fn({}): executing", array.scalar_fn)); let args = VecExecutionArgs::new(array.children(), array.len); diff --git a/vortex-array/src/arrays/shared/array.rs b/vortex-array/src/arrays/shared/array.rs index bc4fb043b35..9521ec82c6b 100644 --- a/vortex-array/src/arrays/shared/array.rs +++ b/vortex-array/src/arrays/shared/array.rs @@ -103,10 +103,4 @@ impl SharedArray { result.clone().map_err(Into::into) } - pub(super) fn set_source(&mut self, source: ArrayRef) { - self.dtype = source.dtype().clone(); - self.slots[SOURCE_SLOT] = Some(source); - self.cached = Arc::new(OnceLock::new()); - self.async_compute_lock = Arc::new(AsyncMutex::new(())); - } } diff --git a/vortex-array/src/arrays/shared/vtable.rs b/vortex-array/src/arrays/shared/vtable.rs index 9fa8f838fe7..2b4e9f1df37 100644 --- a/vortex-array/src/arrays/shared/vtable.rs +++ b/vortex-array/src/arrays/shared/vtable.rs @@ -3,7 +3,6 @@ use std::hash::Hash; -use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_panic; @@ -153,20 +152,6 @@ impl VTable for SharedVTable { Ok(SharedArray::new(child)) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 1, - "SharedArray expects exactly 1 child, got {}", - children.len() - ); - let child = children - .into_iter() - .next() - .vortex_expect("children length already validated"); - array.set_source(child); - Ok(()) - } - fn execute(array: &Self::Array, ctx: &mut ExecutionCtx) -> VortexResult { array .get_or_compute(|source| source.clone().execute::(ctx)) diff --git a/vortex-array/src/arrays/slice/vtable.rs b/vortex-array/src/arrays/slice/vtable.rs index e8eb23c2b97..b6079a41c18 100644 --- a/vortex-array/src/arrays/slice/vtable.rs +++ b/vortex-array/src/arrays/slice/vtable.rs @@ -7,7 +7,6 @@ use std::hash::Hash; use std::hash::Hasher; use std::ops::Range; -use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -159,20 +158,6 @@ impl VTable for SliceVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.len() == 1, - "SliceArray expects exactly 1 child, got {}", - children.len() - ); - let child = children - .into_iter() - .next() - .vortex_expect("children length already validated"); - array.slots = vec![Some(child)]; - Ok(()) - } - fn execute(array: &Self::Array, ctx: &mut ExecutionCtx) -> VortexResult { // Execute the child to get canonical form, then slice it let Some(canonical) = array.child().as_opt::() else { diff --git a/vortex-array/src/arrays/varbinview/vtable/mod.rs b/vortex-array/src/arrays/varbinview/vtable/mod.rs index b4a30f56e34..149a2259254 100644 --- a/vortex-array/src/arrays/varbinview/vtable/mod.rs +++ b/vortex-array/src/arrays/varbinview/vtable/mod.rs @@ -230,23 +230,6 @@ impl VTable for VarBinViewVTable { Ok(()) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - match children.len() { - 0 => {} - 1 => { - let [validity]: [ArrayRef; 1] = children - .try_into() - .map_err(|_| vortex_err!("Failed to convert children to array"))?; - array.validity = Validity::Array(validity); - } - _ => vortex_bail!( - "VarBinViewArray expects 0 or 1 children (validity?), got {}", - children.len() - ), - } - Ok(()) - } - fn reduce_parent( array: &Self::Array, parent: &ArrayRef, diff --git a/vortex-array/src/optimizer/mod.rs b/vortex-array/src/optimizer/mod.rs index 774523a6ca7..40b1d38ca88 100644 --- a/vortex-array/src/optimizer/mod.rs +++ b/vortex-array/src/optimizer/mod.rs @@ -45,10 +45,13 @@ fn try_optimize(array: &ArrayRef) -> VortexResult> { continue; } - // Apply parent reduction rules to each child in the context of the current array. - // Its important to take all children here, as `current_array` can change inside the loop. - for (idx, child) in current_array.children().iter().enumerate() { - if let Some(new_array) = child.vtable().reduce_parent(child, ¤t_array, idx)? { + // Apply parent reduction rules to each slot in the context of the current array. + // Its important to take all slots here, as `current_array` can change inside the loop. + for (slot_idx, slot) in current_array.slots().iter().enumerate() { + let Some(child) = slot else { continue }; + if let Some(new_array) = + child.vtable().reduce_parent(child, ¤t_array, slot_idx)? + { // If the parent was replaced, then we attempt to reduce it again. current_array = new_array; any_optimizations = true; @@ -78,19 +81,24 @@ fn try_optimize_recursive(array: &ArrayRef) -> VortexResult> { any_optimizations = true; } - let mut new_children = Vec::with_capacity(current_array.nchildren()); - let mut any_child_optimized = false; - for child in current_array.children() { - if let Some(new_child) = try_optimize_recursive(&child)? { - new_children.push(new_child); - any_child_optimized = true; - } else { - new_children.push(child.clone()); + let mut new_slots = Vec::with_capacity(current_array.slots().len()); + let mut any_slot_optimized = false; + for slot in current_array.slots() { + match slot { + Some(child) => { + if let Some(new_child) = try_optimize_recursive(child)? { + new_slots.push(Some(new_child)); + any_slot_optimized = true; + } else { + new_slots.push(Some(child.clone())); + } + } + None => new_slots.push(None), } } - if any_child_optimized { - current_array = current_array.with_children(new_children)?; + if any_slot_optimized { + current_array = current_array.vtable().with_slots(¤t_array, new_slots)?; any_optimizations = true; } diff --git a/vortex-array/src/vtable/dyn_.rs b/vortex-array/src/vtable/dyn_.rs index 6f0e5f1eaed..63dae63c6ba 100644 --- a/vortex-array/src/vtable/dyn_.rs +++ b/vortex-array/src/vtable/dyn_.rs @@ -47,8 +47,6 @@ pub trait DynVTable: 'static + private::Sealed + Send + Sync + Debug { children: &dyn ArrayChildren, session: &VortexSession, ) -> VortexResult; - fn with_children(&self, array: &ArrayRef, children: Vec) -> VortexResult; - /// See [`VTable::with_slots`] fn with_slots(&self, array: &ArrayRef, slots: Vec>) -> VortexResult; @@ -98,12 +96,6 @@ impl DynVTable for ArrayVTableAdapter { Ok(array.into_array()) } - fn with_children(&self, array: &ArrayRef, children: Vec) -> VortexResult { - let mut array = array.as_::().clone(); - V::with_children(&mut array, children)?; - Ok(array.into_array()) - } - fn with_slots(&self, array: &ArrayRef, slots: Vec>) -> VortexResult { let mut array = array.as_::().clone(); V::with_slots(&mut array, slots)?; diff --git a/vortex-array/src/vtable/mod.rs b/vortex-array/src/vtable/mod.rs index 7f7171647db..1427e76c85f 100644 --- a/vortex-array/src/vtable/mod.rs +++ b/vortex-array/src/vtable/mod.rs @@ -215,25 +215,6 @@ pub trait VTable: 'static + Sized + Send + Sync + Debug { /// Replaces the slots in `array` with `slots`. fn with_slots(array: &mut Self::Array, slots: Vec>) -> VortexResult<()>; - /// Replaces the children in `array` with `children`. The count must be the same and types - /// of children must be expected. - /// - /// The default maps children back onto the current slot structure and calls `with_slots`. - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { - let mut child_iter = children.into_iter(); - let slots: Vec> = Self::slots(array) - .iter() - .map(|slot| { - slot.is_some().then(|| { - child_iter - .next() - .vortex_expect("too few children for with_children") - }) - }) - .collect(); - Self::with_slots(array, slots) - } - /// Execute this array by returning an [`ExecutionStep`] that tells the scheduler what to /// do next. /// diff --git a/vortex-python/src/arrays/py/vtable.rs b/vortex-python/src/arrays/py/vtable.rs index be3b2ad26a3..d1539f81b1d 100644 --- a/vortex-python/src/arrays/py/vtable.rs +++ b/vortex-python/src/arrays/py/vtable.rs @@ -147,15 +147,6 @@ impl VTable for PythonVTable { todo!() } - fn with_children(_array: &mut Self::Array, children: Vec) -> VortexResult<()> { - vortex_ensure!( - children.is_empty(), - "PythonArray has no children, got {}", - children.len() - ); - Ok(()) - } - fn execute(_array: &Self::Array, _ctx: &mut ExecutionCtx) -> VortexResult { todo!() } From bb3d5c1f923719869c49827fc9a54411fc3025f4 Mon Sep 17 00:00:00 2001 From: Joe Isaacs Date: Wed, 11 Mar 2026 15:49:17 +0000 Subject: [PATCH 4/4] fix: add missing slot methods to PythonVTable and regenerate public API lock files CI was failing because the VTable trait now requires `slots`, `slot_name`, and `with_slots` methods, which were missing from PythonVTable. Signed-off-by: Joe Isaacs Co-Authored-By: Claude Opus 4.6 --- encodings/alp/public-api.lock | 28 +- encodings/bytebool/public-api.lock | 8 +- encodings/datetime-parts/public-api.lock | 8 +- encodings/decimal-byte-parts/public-api.lock | 8 +- encodings/fastlanes/public-api.lock | 38 +- encodings/fsst/public-api.lock | 14 +- encodings/pco/public-api.lock | 14 +- encodings/runend/public-api.lock | 8 +- encodings/sequence/public-api.lock | 8 +- encodings/sparse/public-api.lock | 14 +- encodings/zigzag/public-api.lock | 8 +- encodings/zstd/public-api.lock | 14 +- vortex-array/public-api.lock | 602 ++++++------------- vortex-python/src/arrays/py/vtable.rs | 17 + 14 files changed, 225 insertions(+), 564 deletions(-) diff --git a/encodings/alp/public-api.lock b/encodings/alp/public-api.lock index 9a4e80e5672..7d42e519dc1 100644 --- a/encodings/alp/public-api.lock +++ b/encodings/alp/public-api.lock @@ -196,10 +196,6 @@ pub fn vortex_alp::ALPRDVTable::buffer_name(_array: &vortex_alp::ALPRDArray, _id pub fn vortex_alp::ALPRDVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_alp::ALPRDVTable::child(array: &vortex_alp::ALPRDArray, idx: usize) -> vortex_array::array::ArrayRef - -pub fn vortex_alp::ALPRDVTable::child_name(array: &vortex_alp::ALPRDArray, idx: usize) -> alloc::string::String - pub fn vortex_alp::ALPRDVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult pub fn vortex_alp::ALPRDVTable::dtype(array: &vortex_alp::ALPRDArray) -> &vortex_array::dtype::DType @@ -216,21 +212,15 @@ pub fn vortex_alp::ALPRDVTable::metadata(array: &vortex_alp::ALPRDArray) -> vort pub fn vortex_alp::ALPRDVTable::nbuffers(_array: &vortex_alp::ALPRDArray) -> usize -pub fn vortex_alp::ALPRDVTable::nchildren(array: &vortex_alp::ALPRDArray) -> usize - -pub fn vortex_alp::ALPRDVTable::nslots(_array: &vortex_alp::ALPRDArray) -> usize - pub fn vortex_alp::ALPRDVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_alp::ALPRDVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_alp::ALPRDVTable::slot(array: &vortex_alp::ALPRDArray, idx: usize) -> &core::option::Option - pub fn vortex_alp::ALPRDVTable::slot_name(_array: &vortex_alp::ALPRDArray, idx: usize) -> &str -pub fn vortex_alp::ALPRDVTable::stats(array: &vortex_alp::ALPRDArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_alp::ALPRDVTable::slots(array: &vortex_alp::ALPRDArray) -> &[core::option::Option] -pub fn vortex_alp::ALPRDVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_alp::ALPRDVTable::stats(array: &vortex_alp::ALPRDArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_alp::ALPRDVTable::with_slots(array: &mut vortex_alp::ALPRDArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -308,10 +298,6 @@ pub fn vortex_alp::ALPVTable::buffer_name(_array: &vortex_alp::ALPArray, _idx: u pub fn vortex_alp::ALPVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_alp::ALPVTable::child(array: &vortex_alp::ALPArray, idx: usize) -> vortex_array::array::ArrayRef - -pub fn vortex_alp::ALPVTable::child_name(array: &vortex_alp::ALPArray, idx: usize) -> alloc::string::String - pub fn vortex_alp::ALPVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult pub fn vortex_alp::ALPVTable::dtype(array: &vortex_alp::ALPArray) -> &vortex_array::dtype::DType @@ -328,21 +314,15 @@ pub fn vortex_alp::ALPVTable::metadata(array: &vortex_alp::ALPArray) -> vortex_e pub fn vortex_alp::ALPVTable::nbuffers(_array: &vortex_alp::ALPArray) -> usize -pub fn vortex_alp::ALPVTable::nchildren(array: &vortex_alp::ALPArray) -> usize - -pub fn vortex_alp::ALPVTable::nslots(_array: &vortex_alp::ALPArray) -> usize - pub fn vortex_alp::ALPVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_alp::ALPVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_alp::ALPVTable::slot(array: &vortex_alp::ALPArray, idx: usize) -> &core::option::Option - pub fn vortex_alp::ALPVTable::slot_name(_array: &vortex_alp::ALPArray, idx: usize) -> &str -pub fn vortex_alp::ALPVTable::stats(array: &vortex_alp::ALPArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_alp::ALPVTable::slots(array: &vortex_alp::ALPArray) -> &[core::option::Option] -pub fn vortex_alp::ALPVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_alp::ALPVTable::stats(array: &vortex_alp::ALPArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_alp::ALPVTable::with_slots(array: &mut vortex_alp::ALPArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> diff --git a/encodings/bytebool/public-api.lock b/encodings/bytebool/public-api.lock index f02d268471c..5585d87089c 100644 --- a/encodings/bytebool/public-api.lock +++ b/encodings/bytebool/public-api.lock @@ -122,19 +122,15 @@ pub fn vortex_bytebool::ByteBoolVTable::nbuffers(_array: &vortex_bytebool::ByteB pub fn vortex_bytebool::ByteBoolVTable::nchildren(array: &vortex_bytebool::ByteBoolArray) -> usize -pub fn vortex_bytebool::ByteBoolVTable::nslots(_array: &vortex_bytebool::ByteBoolArray) -> usize - pub fn vortex_bytebool::ByteBoolVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_bytebool::ByteBoolVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_bytebool::ByteBoolVTable::slot(_array: &vortex_bytebool::ByteBoolArray, idx: usize) -> &core::option::Option - pub fn vortex_bytebool::ByteBoolVTable::slot_name(_array: &vortex_bytebool::ByteBoolArray, idx: usize) -> &str -pub fn vortex_bytebool::ByteBoolVTable::stats(array: &vortex_bytebool::ByteBoolArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_bytebool::ByteBoolVTable::slots(array: &vortex_bytebool::ByteBoolArray) -> &[core::option::Option] -pub fn vortex_bytebool::ByteBoolVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_bytebool::ByteBoolVTable::stats(array: &vortex_bytebool::ByteBoolArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_bytebool::ByteBoolVTable::with_slots(array: &mut vortex_bytebool::ByteBoolArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> diff --git a/encodings/datetime-parts/public-api.lock b/encodings/datetime-parts/public-api.lock index 2374e4e96e2..6b1baff3883 100644 --- a/encodings/datetime-parts/public-api.lock +++ b/encodings/datetime-parts/public-api.lock @@ -196,19 +196,15 @@ pub fn vortex_datetime_parts::DateTimePartsVTable::nbuffers(_array: &vortex_date pub fn vortex_datetime_parts::DateTimePartsVTable::nchildren(_array: &vortex_datetime_parts::DateTimePartsArray) -> usize -pub fn vortex_datetime_parts::DateTimePartsVTable::nslots(_array: &vortex_datetime_parts::DateTimePartsArray) -> usize - pub fn vortex_datetime_parts::DateTimePartsVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_datetime_parts::DateTimePartsVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_datetime_parts::DateTimePartsVTable::slot(array: &vortex_datetime_parts::DateTimePartsArray, idx: usize) -> &core::option::Option - pub fn vortex_datetime_parts::DateTimePartsVTable::slot_name(_array: &vortex_datetime_parts::DateTimePartsArray, idx: usize) -> &str -pub fn vortex_datetime_parts::DateTimePartsVTable::stats(array: &vortex_datetime_parts::DateTimePartsArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_datetime_parts::DateTimePartsVTable::slots(array: &vortex_datetime_parts::DateTimePartsArray) -> &[core::option::Option] -pub fn vortex_datetime_parts::DateTimePartsVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_datetime_parts::DateTimePartsVTable::stats(array: &vortex_datetime_parts::DateTimePartsArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_datetime_parts::DateTimePartsVTable::with_slots(array: &mut vortex_datetime_parts::DateTimePartsArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> diff --git a/encodings/decimal-byte-parts/public-api.lock b/encodings/decimal-byte-parts/public-api.lock index ac4812e441f..a4bd5f16998 100644 --- a/encodings/decimal-byte-parts/public-api.lock +++ b/encodings/decimal-byte-parts/public-api.lock @@ -126,19 +126,15 @@ pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::nbuffers(_array: &vort pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::nchildren(_array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> usize -pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::nslots(_array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> usize - pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::slot(array: &vortex_decimal_byte_parts::DecimalBytePartsArray, idx: usize) -> &core::option::Option - pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::slot_name(_array: &vortex_decimal_byte_parts::DecimalBytePartsArray, idx: usize) -> &str -pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::stats(array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::slots(array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> &[core::option::Option] -pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::stats(array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_decimal_byte_parts::DecimalBytePartsVTable::with_slots(array: &mut vortex_decimal_byte_parts::DecimalBytePartsArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> diff --git a/encodings/fastlanes/public-api.lock b/encodings/fastlanes/public-api.lock index d7a44b8b886..9f4070a1d89 100644 --- a/encodings/fastlanes/public-api.lock +++ b/encodings/fastlanes/public-api.lock @@ -234,10 +234,6 @@ pub fn vortex_fastlanes::BitPackedVTable::buffer_name(_array: &vortex_fastlanes: pub fn vortex_fastlanes::BitPackedVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_fastlanes::BitPackedVTable::child(array: &vortex_fastlanes::BitPackedArray, idx: usize) -> vortex_array::array::ArrayRef - -pub fn vortex_fastlanes::BitPackedVTable::child_name(array: &vortex_fastlanes::BitPackedArray, idx: usize) -> alloc::string::String - pub fn vortex_fastlanes::BitPackedVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult pub fn vortex_fastlanes::BitPackedVTable::dtype(array: &vortex_fastlanes::BitPackedArray) -> &vortex_array::dtype::DType @@ -254,21 +250,15 @@ pub fn vortex_fastlanes::BitPackedVTable::metadata(array: &vortex_fastlanes::Bit pub fn vortex_fastlanes::BitPackedVTable::nbuffers(_array: &vortex_fastlanes::BitPackedArray) -> usize -pub fn vortex_fastlanes::BitPackedVTable::nchildren(array: &vortex_fastlanes::BitPackedArray) -> usize - -pub fn vortex_fastlanes::BitPackedVTable::nslots(_array: &vortex_fastlanes::BitPackedArray) -> usize - pub fn vortex_fastlanes::BitPackedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::BitPackedVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_fastlanes::BitPackedVTable::slot(_array: &vortex_fastlanes::BitPackedArray, idx: usize) -> &core::option::Option - pub fn vortex_fastlanes::BitPackedVTable::slot_name(_array: &vortex_fastlanes::BitPackedArray, idx: usize) -> &str -pub fn vortex_fastlanes::BitPackedVTable::stats(array: &vortex_fastlanes::BitPackedArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_fastlanes::BitPackedVTable::slots(array: &vortex_fastlanes::BitPackedArray) -> &[core::option::Option] -pub fn vortex_fastlanes::BitPackedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::BitPackedVTable::stats(array: &vortex_fastlanes::BitPackedArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_fastlanes::BitPackedVTable::with_slots(array: &mut vortex_fastlanes::BitPackedArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -392,19 +382,15 @@ pub fn vortex_fastlanes::DeltaVTable::nbuffers(_array: &vortex_fastlanes::DeltaA pub fn vortex_fastlanes::DeltaVTable::nchildren(_array: &vortex_fastlanes::DeltaArray) -> usize -pub fn vortex_fastlanes::DeltaVTable::nslots(_array: &vortex_fastlanes::DeltaArray) -> usize - pub fn vortex_fastlanes::DeltaVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::DeltaVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_fastlanes::DeltaVTable::slot(array: &vortex_fastlanes::DeltaArray, idx: usize) -> &core::option::Option - pub fn vortex_fastlanes::DeltaVTable::slot_name(_array: &vortex_fastlanes::DeltaArray, idx: usize) -> &str -pub fn vortex_fastlanes::DeltaVTable::stats(array: &vortex_fastlanes::DeltaArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_fastlanes::DeltaVTable::slots(array: &vortex_fastlanes::DeltaArray) -> &[core::option::Option] -pub fn vortex_fastlanes::DeltaVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::DeltaVTable::stats(array: &vortex_fastlanes::DeltaArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_fastlanes::DeltaVTable::with_slots(array: &mut vortex_fastlanes::DeltaArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -540,19 +526,15 @@ pub fn vortex_fastlanes::FoRVTable::nbuffers(_array: &vortex_fastlanes::FoRArray pub fn vortex_fastlanes::FoRVTable::nchildren(_array: &vortex_fastlanes::FoRArray) -> usize -pub fn vortex_fastlanes::FoRVTable::nslots(_array: &vortex_fastlanes::FoRArray) -> usize - pub fn vortex_fastlanes::FoRVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::FoRVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_fastlanes::FoRVTable::slot(array: &vortex_fastlanes::FoRArray, idx: usize) -> &core::option::Option - pub fn vortex_fastlanes::FoRVTable::slot_name(_array: &vortex_fastlanes::FoRArray, idx: usize) -> &str -pub fn vortex_fastlanes::FoRVTable::stats(array: &vortex_fastlanes::FoRArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_fastlanes::FoRVTable::slots(array: &vortex_fastlanes::FoRArray) -> &[core::option::Option] -pub fn vortex_fastlanes::FoRVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::FoRVTable::stats(array: &vortex_fastlanes::FoRArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_fastlanes::FoRVTable::with_slots(array: &mut vortex_fastlanes::FoRArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -684,19 +666,15 @@ pub fn vortex_fastlanes::RLEVTable::nbuffers(_array: &vortex_fastlanes::RLEArray pub fn vortex_fastlanes::RLEVTable::nchildren(_array: &vortex_fastlanes::RLEArray) -> usize -pub fn vortex_fastlanes::RLEVTable::nslots(array: &vortex_fastlanes::RLEArray) -> usize - pub fn vortex_fastlanes::RLEVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::RLEVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_fastlanes::RLEVTable::slot(array: &vortex_fastlanes::RLEArray, idx: usize) -> &core::option::Option - pub fn vortex_fastlanes::RLEVTable::slot_name(_array: &vortex_fastlanes::RLEArray, idx: usize) -> &str -pub fn vortex_fastlanes::RLEVTable::stats(array: &vortex_fastlanes::RLEArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_fastlanes::RLEVTable::slots(array: &vortex_fastlanes::RLEArray) -> &[core::option::Option] -pub fn vortex_fastlanes::RLEVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::RLEVTable::stats(array: &vortex_fastlanes::RLEArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_fastlanes::RLEVTable::with_slots(array: &mut vortex_fastlanes::RLEArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> diff --git a/encodings/fsst/public-api.lock b/encodings/fsst/public-api.lock index 8d204b1cc0c..6229ffe7748 100644 --- a/encodings/fsst/public-api.lock +++ b/encodings/fsst/public-api.lock @@ -138,10 +138,6 @@ pub fn vortex_fsst::FSSTVTable::buffer_name(_array: &vortex_fsst::FSSTArray, idx pub fn vortex_fsst::FSSTVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_fsst::FSSTVTable::child(array: &vortex_fsst::FSSTArray, idx: usize) -> vortex_array::array::ArrayRef - -pub fn vortex_fsst::FSSTVTable::child_name(_array: &vortex_fsst::FSSTArray, idx: usize) -> alloc::string::String - pub fn vortex_fsst::FSSTVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult pub fn vortex_fsst::FSSTVTable::dtype(array: &vortex_fsst::FSSTArray) -> &vortex_array::dtype::DType @@ -158,21 +154,15 @@ pub fn vortex_fsst::FSSTVTable::metadata(array: &vortex_fsst::FSSTArray) -> vort pub fn vortex_fsst::FSSTVTable::nbuffers(_array: &vortex_fsst::FSSTArray) -> usize -pub fn vortex_fsst::FSSTVTable::nchildren(array: &vortex_fsst::FSSTArray) -> usize - -pub fn vortex_fsst::FSSTVTable::nslots(_array: &vortex_fsst::FSSTArray) -> usize - pub fn vortex_fsst::FSSTVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fsst::FSSTVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_fsst::FSSTVTable::slot(array: &vortex_fsst::FSSTArray, idx: usize) -> &core::option::Option - pub fn vortex_fsst::FSSTVTable::slot_name(_array: &vortex_fsst::FSSTArray, idx: usize) -> &str -pub fn vortex_fsst::FSSTVTable::stats(array: &vortex_fsst::FSSTArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_fsst::FSSTVTable::slots(array: &vortex_fsst::FSSTArray) -> &[core::option::Option] -pub fn vortex_fsst::FSSTVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fsst::FSSTVTable::stats(array: &vortex_fsst::FSSTArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_fsst::FSSTVTable::with_slots(array: &mut vortex_fsst::FSSTArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> diff --git a/encodings/pco/public-api.lock b/encodings/pco/public-api.lock index 5c091bf4b2e..a8c5ca65f50 100644 --- a/encodings/pco/public-api.lock +++ b/encodings/pco/public-api.lock @@ -152,10 +152,6 @@ pub fn vortex_pco::PcoVTable::buffer_name(array: &vortex_pco::PcoArray, idx: usi pub fn vortex_pco::PcoVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_pco::PcoVTable::child(array: &vortex_pco::PcoArray, idx: usize) -> vortex_array::array::ArrayRef - -pub fn vortex_pco::PcoVTable::child_name(_array: &vortex_pco::PcoArray, idx: usize) -> alloc::string::String - pub fn vortex_pco::PcoVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult pub fn vortex_pco::PcoVTable::dtype(array: &vortex_pco::PcoArray) -> &vortex_array::dtype::DType @@ -170,21 +166,15 @@ pub fn vortex_pco::PcoVTable::metadata(array: &vortex_pco::PcoArray) -> vortex_e pub fn vortex_pco::PcoVTable::nbuffers(array: &vortex_pco::PcoArray) -> usize -pub fn vortex_pco::PcoVTable::nchildren(array: &vortex_pco::PcoArray) -> usize - -pub fn vortex_pco::PcoVTable::nslots(_array: &vortex_pco::PcoArray) -> usize - pub fn vortex_pco::PcoVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_pco::PcoVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_pco::PcoVTable::slot(_array: &vortex_pco::PcoArray, idx: usize) -> &core::option::Option - pub fn vortex_pco::PcoVTable::slot_name(_array: &vortex_pco::PcoArray, idx: usize) -> &str -pub fn vortex_pco::PcoVTable::stats(array: &vortex_pco::PcoArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_pco::PcoVTable::slots(array: &vortex_pco::PcoArray) -> &[core::option::Option] -pub fn vortex_pco::PcoVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_pco::PcoVTable::stats(array: &vortex_pco::PcoArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_pco::PcoVTable::with_slots(array: &mut vortex_pco::PcoArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> diff --git a/encodings/runend/public-api.lock b/encodings/runend/public-api.lock index e49f29b016f..518f56ff8bd 100644 --- a/encodings/runend/public-api.lock +++ b/encodings/runend/public-api.lock @@ -198,19 +198,15 @@ pub fn vortex_runend::RunEndVTable::nbuffers(_array: &vortex_runend::RunEndArray pub fn vortex_runend::RunEndVTable::nchildren(_array: &vortex_runend::RunEndArray) -> usize -pub fn vortex_runend::RunEndVTable::nslots(_array: &vortex_runend::RunEndArray) -> usize - pub fn vortex_runend::RunEndVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_runend::RunEndVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_runend::RunEndVTable::slot(array: &vortex_runend::RunEndArray, idx: usize) -> &core::option::Option - pub fn vortex_runend::RunEndVTable::slot_name(_array: &vortex_runend::RunEndArray, idx: usize) -> &str -pub fn vortex_runend::RunEndVTable::stats(array: &vortex_runend::RunEndArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_runend::RunEndVTable::slots(array: &vortex_runend::RunEndArray) -> &[core::option::Option] -pub fn vortex_runend::RunEndVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_runend::RunEndVTable::stats(array: &vortex_runend::RunEndArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_runend::RunEndVTable::with_slots(array: &mut vortex_runend::RunEndArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> diff --git a/encodings/sequence/public-api.lock b/encodings/sequence/public-api.lock index b7cf896700a..ec490b0983d 100644 --- a/encodings/sequence/public-api.lock +++ b/encodings/sequence/public-api.lock @@ -146,19 +146,15 @@ pub fn vortex_sequence::SequenceVTable::nbuffers(_array: &vortex_sequence::Seque pub fn vortex_sequence::SequenceVTable::nchildren(_array: &vortex_sequence::SequenceArray) -> usize -pub fn vortex_sequence::SequenceVTable::nslots(_array: &vortex_sequence::SequenceArray) -> usize - pub fn vortex_sequence::SequenceVTable::reduce_parent(array: &vortex_sequence::SequenceArray, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_sequence::SequenceVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_sequence::SequenceVTable::slot(_array: &vortex_sequence::SequenceArray, idx: usize) -> &core::option::Option - pub fn vortex_sequence::SequenceVTable::slot_name(_array: &vortex_sequence::SequenceArray, idx: usize) -> &str -pub fn vortex_sequence::SequenceVTable::stats(array: &vortex_sequence::SequenceArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_sequence::SequenceVTable::slots(array: &vortex_sequence::SequenceArray) -> &[core::option::Option] -pub fn vortex_sequence::SequenceVTable::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_sequence::SequenceVTable::stats(array: &vortex_sequence::SequenceArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_sequence::SequenceVTable::with_slots(array: &mut vortex_sequence::SequenceArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> diff --git a/encodings/sparse/public-api.lock b/encodings/sparse/public-api.lock index 1ef5ffdff79..9267312e493 100644 --- a/encodings/sparse/public-api.lock +++ b/encodings/sparse/public-api.lock @@ -122,10 +122,6 @@ pub fn vortex_sparse::SparseVTable::buffer_name(_array: &vortex_sparse::SparseAr pub fn vortex_sparse::SparseVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_sparse::SparseVTable::child(array: &vortex_sparse::SparseArray, idx: usize) -> vortex_array::array::ArrayRef - -pub fn vortex_sparse::SparseVTable::child_name(_array: &vortex_sparse::SparseArray, idx: usize) -> alloc::string::String - pub fn vortex_sparse::SparseVTable::deserialize(bytes: &[u8], dtype: &vortex_array::dtype::DType, _len: usize, buffers: &[vortex_array::buffer::BufferHandle], session: &vortex_session::VortexSession) -> vortex_error::VortexResult pub fn vortex_sparse::SparseVTable::dtype(array: &vortex_sparse::SparseArray) -> &vortex_array::dtype::DType @@ -142,21 +138,15 @@ pub fn vortex_sparse::SparseVTable::metadata(array: &vortex_sparse::SparseArray) pub fn vortex_sparse::SparseVTable::nbuffers(_array: &vortex_sparse::SparseArray) -> usize -pub fn vortex_sparse::SparseVTable::nchildren(array: &vortex_sparse::SparseArray) -> usize - -pub fn vortex_sparse::SparseVTable::nslots(_array: &vortex_sparse::SparseArray) -> usize - pub fn vortex_sparse::SparseVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_sparse::SparseVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_sparse::SparseVTable::slot(_array: &vortex_sparse::SparseArray, idx: usize) -> &core::option::Option - pub fn vortex_sparse::SparseVTable::slot_name(_array: &vortex_sparse::SparseArray, idx: usize) -> &str -pub fn vortex_sparse::SparseVTable::stats(array: &vortex_sparse::SparseArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_sparse::SparseVTable::slots(array: &vortex_sparse::SparseArray) -> &[core::option::Option] -pub fn vortex_sparse::SparseVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_sparse::SparseVTable::stats(array: &vortex_sparse::SparseArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_sparse::SparseVTable::with_slots(array: &mut vortex_sparse::SparseArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> diff --git a/encodings/zigzag/public-api.lock b/encodings/zigzag/public-api.lock index d99e2ecc112..11206247705 100644 --- a/encodings/zigzag/public-api.lock +++ b/encodings/zigzag/public-api.lock @@ -114,19 +114,15 @@ pub fn vortex_zigzag::ZigZagVTable::nbuffers(_array: &vortex_zigzag::ZigZagArray pub fn vortex_zigzag::ZigZagVTable::nchildren(_array: &vortex_zigzag::ZigZagArray) -> usize -pub fn vortex_zigzag::ZigZagVTable::nslots(_array: &vortex_zigzag::ZigZagArray) -> usize - pub fn vortex_zigzag::ZigZagVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_zigzag::ZigZagVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_zigzag::ZigZagVTable::slot(array: &vortex_zigzag::ZigZagArray, idx: usize) -> &core::option::Option - pub fn vortex_zigzag::ZigZagVTable::slot_name(_array: &vortex_zigzag::ZigZagArray, idx: usize) -> &str -pub fn vortex_zigzag::ZigZagVTable::stats(array: &vortex_zigzag::ZigZagArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_zigzag::ZigZagVTable::slots(array: &vortex_zigzag::ZigZagArray) -> &[core::option::Option] -pub fn vortex_zigzag::ZigZagVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_zigzag::ZigZagVTable::stats(array: &vortex_zigzag::ZigZagArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_zigzag::ZigZagVTable::with_slots(array: &mut vortex_zigzag::ZigZagArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> diff --git a/encodings/zstd/public-api.lock b/encodings/zstd/public-api.lock index 0dfd6cbd204..fff85cd7cb2 100644 --- a/encodings/zstd/public-api.lock +++ b/encodings/zstd/public-api.lock @@ -192,10 +192,6 @@ pub fn vortex_zstd::ZstdVTable::buffer_name(array: &vortex_zstd::ZstdArray, idx: pub fn vortex_zstd::ZstdVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_zstd::ZstdVTable::child(array: &vortex_zstd::ZstdArray, idx: usize) -> vortex_array::array::ArrayRef - -pub fn vortex_zstd::ZstdVTable::child_name(_array: &vortex_zstd::ZstdArray, idx: usize) -> alloc::string::String - pub fn vortex_zstd::ZstdVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult pub fn vortex_zstd::ZstdVTable::dtype(array: &vortex_zstd::ZstdArray) -> &vortex_array::dtype::DType @@ -210,21 +206,15 @@ pub fn vortex_zstd::ZstdVTable::metadata(array: &vortex_zstd::ZstdArray) -> vort pub fn vortex_zstd::ZstdVTable::nbuffers(array: &vortex_zstd::ZstdArray) -> usize -pub fn vortex_zstd::ZstdVTable::nchildren(array: &vortex_zstd::ZstdArray) -> usize - -pub fn vortex_zstd::ZstdVTable::nslots(_array: &vortex_zstd::ZstdArray) -> usize - pub fn vortex_zstd::ZstdVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_zstd::ZstdVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_zstd::ZstdVTable::slot(_array: &vortex_zstd::ZstdArray, idx: usize) -> &core::option::Option - pub fn vortex_zstd::ZstdVTable::slot_name(_array: &vortex_zstd::ZstdArray, idx: usize) -> &str -pub fn vortex_zstd::ZstdVTable::stats(array: &vortex_zstd::ZstdArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_zstd::ZstdVTable::slots(array: &vortex_zstd::ZstdArray) -> &[core::option::Option] -pub fn vortex_zstd::ZstdVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_zstd::ZstdVTable::stats(array: &vortex_zstd::ZstdArray) -> vortex_array::stats::array::StatsSetRef<'_> pub fn vortex_zstd::ZstdVTable::with_slots(array: &mut vortex_zstd::ZstdArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> diff --git a/vortex-array/public-api.lock b/vortex-array/public-api.lock index 531cb42f20d..188ce9d14ac 100644 --- a/vortex-array/public-api.lock +++ b/vortex-array/public-api.lock @@ -612,21 +612,17 @@ pub fn vortex_array::arrays::BoolVTable::nbuffers(_array: &vortex_array::arrays: pub fn vortex_array::arrays::BoolVTable::nchildren(array: &vortex_array::arrays::BoolArray) -> usize -pub fn vortex_array::arrays::BoolVTable::nslots(_array: &vortex_array::arrays::BoolArray) -> usize - pub fn vortex_array::arrays::BoolVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::BoolVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::BoolVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::BoolVTable::slot(_array: &vortex_array::arrays::BoolArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::BoolVTable::slot_name(_array: &vortex_array::arrays::BoolArray, idx: usize) -> &str -pub fn vortex_array::arrays::BoolVTable::stats(array: &vortex_array::arrays::BoolArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::BoolVTable::slots(array: &vortex_array::arrays::BoolArray) -> &[core::option::Option] -pub fn vortex_array::arrays::BoolVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::BoolVTable::stats(array: &vortex_array::arrays::BoolArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::BoolVTable::with_slots(array: &mut vortex_array::arrays::BoolArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -796,21 +792,17 @@ pub fn vortex_array::arrays::ChunkedVTable::nbuffers(_array: &vortex_array::arra pub fn vortex_array::arrays::ChunkedVTable::nchildren(array: &vortex_array::arrays::ChunkedArray) -> usize -pub fn vortex_array::arrays::ChunkedVTable::nslots(array: &vortex_array::arrays::ChunkedArray) -> usize - pub fn vortex_array::arrays::ChunkedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ChunkedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ChunkedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ChunkedVTable::slot(array: &vortex_array::arrays::ChunkedArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ChunkedVTable::slot_name(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> &str -pub fn vortex_array::arrays::ChunkedVTable::stats(array: &vortex_array::arrays::ChunkedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ChunkedVTable::slots(array: &vortex_array::arrays::ChunkedArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ChunkedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ChunkedVTable::stats(array: &vortex_array::arrays::ChunkedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ChunkedVTable::with_slots(array: &mut vortex_array::arrays::ChunkedArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -958,21 +950,17 @@ pub fn vortex_array::arrays::ConstantVTable::nbuffers(_array: &vortex_array::arr pub fn vortex_array::arrays::ConstantVTable::nchildren(_array: &vortex_array::arrays::ConstantArray) -> usize -pub fn vortex_array::arrays::ConstantVTable::nslots(_array: &vortex_array::arrays::ConstantArray) -> usize - pub fn vortex_array::arrays::ConstantVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ConstantVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ConstantVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ConstantVTable::slot(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ConstantVTable::slot_name(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> &str -pub fn vortex_array::arrays::ConstantVTable::stats(array: &vortex_array::arrays::ConstantArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ConstantVTable::slots(array: &vortex_array::arrays::ConstantArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ConstantVTable::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ConstantVTable::stats(array: &vortex_array::arrays::ConstantArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ConstantVTable::with_slots(array: &mut vortex_array::arrays::ConstantArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -1252,21 +1240,17 @@ pub fn vortex_array::arrays::DecimalVTable::nbuffers(_array: &vortex_array::arra pub fn vortex_array::arrays::DecimalVTable::nchildren(array: &vortex_array::arrays::DecimalArray) -> usize -pub fn vortex_array::arrays::DecimalVTable::nslots(_array: &vortex_array::arrays::DecimalArray) -> usize - pub fn vortex_array::arrays::DecimalVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::DecimalVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::DecimalVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::DecimalVTable::slot(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::DecimalVTable::slot_name(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> &str -pub fn vortex_array::arrays::DecimalVTable::stats(array: &vortex_array::arrays::DecimalArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::DecimalVTable::slots(array: &vortex_array::arrays::DecimalArray) -> &[core::option::Option] -pub fn vortex_array::arrays::DecimalVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::DecimalVTable::stats(array: &vortex_array::arrays::DecimalArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::DecimalVTable::with_slots(array: &mut vortex_array::arrays::DecimalArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -1380,21 +1364,17 @@ pub fn vortex_array::arrays::dict::DictVTable::nbuffers(_array: &vortex_array::a pub fn vortex_array::arrays::dict::DictVTable::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize -pub fn vortex_array::arrays::dict::DictVTable::nslots(_array: &vortex_array::arrays::dict::DictArray) -> usize - pub fn vortex_array::arrays::dict::DictVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::dict::DictVTable::slot(array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::dict::DictVTable::slot_name(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &str -pub fn vortex_array::arrays::dict::DictVTable::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::dict::DictVTable::slots(array: &vortex_array::arrays::dict::DictArray) -> &[core::option::Option] -pub fn vortex_array::arrays::dict::DictVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::DictVTable::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::dict::DictVTable::with_slots(array: &mut vortex_array::arrays::dict::DictArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -1602,21 +1582,17 @@ pub fn vortex_array::arrays::dict::DictVTable::nbuffers(_array: &vortex_array::a pub fn vortex_array::arrays::dict::DictVTable::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize -pub fn vortex_array::arrays::dict::DictVTable::nslots(_array: &vortex_array::arrays::dict::DictArray) -> usize - pub fn vortex_array::arrays::dict::DictVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::dict::DictVTable::slot(array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::dict::DictVTable::slot_name(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &str -pub fn vortex_array::arrays::dict::DictVTable::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::dict::DictVTable::slots(array: &vortex_array::arrays::dict::DictArray) -> &[core::option::Option] -pub fn vortex_array::arrays::dict::DictVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::DictVTable::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::dict::DictVTable::with_slots(array: &mut vortex_array::arrays::dict::DictArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -1734,11 +1710,13 @@ impl vortex_array::arrays::ExtensionArray pub fn vortex_array::arrays::ExtensionArray::ext_dtype(&self) -> &vortex_array::dtype::extension::ExtDTypeRef +pub fn vortex_array::arrays::ExtensionArray::id(&self) -> vortex_array::dtype::extension::ExtId + pub fn vortex_array::arrays::ExtensionArray::new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self pub unsafe fn vortex_array::arrays::ExtensionArray::new_unchecked(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self -pub fn vortex_array::arrays::ExtensionArray::storage_array(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::ExtensionArray::storage(&self) -> &vortex_array::ArrayRef pub fn vortex_array::arrays::ExtensionArray::try_new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> vortex_error::VortexResult @@ -1890,21 +1868,17 @@ pub fn vortex_array::arrays::ExtensionVTable::nbuffers(_array: &vortex_array::ar pub fn vortex_array::arrays::ExtensionVTable::nchildren(_array: &vortex_array::arrays::ExtensionArray) -> usize -pub fn vortex_array::arrays::ExtensionVTable::nslots(_array: &vortex_array::arrays::ExtensionArray) -> usize - pub fn vortex_array::arrays::ExtensionVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ExtensionVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ExtensionVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ExtensionVTable::slot(array: &vortex_array::arrays::ExtensionArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ExtensionVTable::slot_name(_array: &vortex_array::arrays::ExtensionArray, idx: usize) -> &str -pub fn vortex_array::arrays::ExtensionVTable::stats(array: &vortex_array::arrays::ExtensionArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ExtensionVTable::slots(array: &vortex_array::arrays::ExtensionArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ExtensionVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ExtensionVTable::stats(array: &vortex_array::arrays::ExtensionArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ExtensionVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -2054,21 +2028,17 @@ pub fn vortex_array::arrays::FilterVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::FilterVTable::nchildren(_array: &Self::Array) -> usize -pub fn vortex_array::arrays::FilterVTable::nslots(_array: &Self::Array) -> usize - pub fn vortex_array::arrays::FilterVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FilterVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FilterVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::FilterVTable::slot(array: &Self::Array, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::FilterVTable::slot_name(_array: &Self::Array, idx: usize) -> &str -pub fn vortex_array::arrays::FilterVTable::stats(array: &vortex_array::arrays::FilterArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::FilterVTable::slots(array: &Self::Array) -> &[core::option::Option] -pub fn vortex_array::arrays::FilterVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FilterVTable::stats(array: &vortex_array::arrays::FilterArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::FilterVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -2246,9 +2216,9 @@ pub fn vortex_array::arrays::FixedSizeListVTable::buffer_name(_array: &vortex_ar pub fn vortex_array::arrays::FixedSizeListVTable::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeListVTable::child(array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FixedSizeListVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::FixedSizeListVTable::child_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::FixedSizeListVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::FixedSizeListVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -2266,9 +2236,7 @@ pub fn vortex_array::arrays::FixedSizeListVTable::metadata(_array: &vortex_array pub fn vortex_array::arrays::FixedSizeListVTable::nbuffers(_array: &vortex_array::arrays::FixedSizeListArray) -> usize -pub fn vortex_array::arrays::FixedSizeListVTable::nchildren(array: &vortex_array::arrays::FixedSizeListArray) -> usize - -pub fn vortex_array::arrays::FixedSizeListVTable::nslots(_array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeListVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::FixedSizeListVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -2276,13 +2244,11 @@ pub fn vortex_array::arrays::FixedSizeListVTable::reduce_parent(array: &Self::Ar pub fn vortex_array::arrays::FixedSizeListVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::FixedSizeListVTable::slot(array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::FixedSizeListVTable::slot_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> &str -pub fn vortex_array::arrays::FixedSizeListVTable::stats(array: &vortex_array::arrays::FixedSizeListArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::FixedSizeListVTable::slots(array: &vortex_array::arrays::FixedSizeListArray) -> &[core::option::Option] -pub fn vortex_array::arrays::FixedSizeListVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeListVTable::stats(array: &vortex_array::arrays::FixedSizeListArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::FixedSizeListVTable::with_slots(array: &mut vortex_array::arrays::FixedSizeListArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -2430,9 +2396,9 @@ pub fn vortex_array::arrays::ListVTable::buffer_name(_array: &vortex_array::arra pub fn vortex_array::arrays::ListVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListVTable::child(array: &vortex_array::arrays::ListArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::ListVTable::child_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::ListVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::ListVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -2450,9 +2416,7 @@ pub fn vortex_array::arrays::ListVTable::metadata(array: &vortex_array::arrays:: pub fn vortex_array::arrays::ListVTable::nbuffers(_array: &vortex_array::arrays::ListArray) -> usize -pub fn vortex_array::arrays::ListVTable::nchildren(array: &vortex_array::arrays::ListArray) -> usize - -pub fn vortex_array::arrays::ListVTable::nslots(_array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::ListVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::ListVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -2460,13 +2424,11 @@ pub fn vortex_array::arrays::ListVTable::reduce_parent(array: &Self::Array, pare pub fn vortex_array::arrays::ListVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ListVTable::slot(array: &vortex_array::arrays::ListArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ListVTable::slot_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> &str -pub fn vortex_array::arrays::ListVTable::stats(array: &vortex_array::arrays::ListArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ListVTable::slots(array: &vortex_array::arrays::ListArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ListVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListVTable::stats(array: &vortex_array::arrays::ListArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ListVTable::with_slots(array: &mut vortex_array::arrays::ListArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -2634,9 +2596,9 @@ pub fn vortex_array::arrays::ListViewVTable::buffer_name(_array: &vortex_array:: pub fn vortex_array::arrays::ListViewVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListViewVTable::child(array: &vortex_array::arrays::ListViewArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListViewVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::ListViewVTable::child_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::ListViewVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::ListViewVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -2654,9 +2616,7 @@ pub fn vortex_array::arrays::ListViewVTable::metadata(array: &vortex_array::arra pub fn vortex_array::arrays::ListViewVTable::nbuffers(_array: &vortex_array::arrays::ListViewArray) -> usize -pub fn vortex_array::arrays::ListViewVTable::nchildren(array: &vortex_array::arrays::ListViewArray) -> usize - -pub fn vortex_array::arrays::ListViewVTable::nslots(_array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListViewVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::ListViewVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -2664,13 +2624,11 @@ pub fn vortex_array::arrays::ListViewVTable::reduce_parent(array: &Self::Array, pub fn vortex_array::arrays::ListViewVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ListViewVTable::slot(array: &vortex_array::arrays::ListViewArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ListViewVTable::slot_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> &str -pub fn vortex_array::arrays::ListViewVTable::stats(array: &vortex_array::arrays::ListViewArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ListViewVTable::slots(array: &vortex_array::arrays::ListViewArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ListViewVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListViewVTable::stats(array: &vortex_array::arrays::ListViewArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ListViewVTable::with_slots(array: &mut vortex_array::arrays::ListViewArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -2778,7 +2736,7 @@ pub fn vortex_array::arrays::MaskedVTable::build(dtype: &vortex_array::dtype::DT pub fn vortex_array::arrays::MaskedVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::MaskedVTable::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::MaskedVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::MaskedVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -2798,21 +2756,17 @@ pub fn vortex_array::arrays::MaskedVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::MaskedVTable::nchildren(array: &Self::Array) -> usize -pub fn vortex_array::arrays::MaskedVTable::nslots(_array: &vortex_array::arrays::MaskedArray) -> usize - pub fn vortex_array::arrays::MaskedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::MaskedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::MaskedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::MaskedVTable::slot(array: &vortex_array::arrays::MaskedArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::MaskedVTable::slot_name(_array: &vortex_array::arrays::MaskedArray, idx: usize) -> &str -pub fn vortex_array::arrays::MaskedVTable::stats(array: &vortex_array::arrays::MaskedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::MaskedVTable::slots(array: &vortex_array::arrays::MaskedArray) -> &[core::option::Option] -pub fn vortex_array::arrays::MaskedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::MaskedVTable::stats(array: &vortex_array::arrays::MaskedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::MaskedVTable::with_slots(array: &mut vortex_array::arrays::MaskedArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -2946,21 +2900,17 @@ pub fn vortex_array::arrays::null::NullVTable::nbuffers(_array: &vortex_array::a pub fn vortex_array::arrays::null::NullVTable::nchildren(_array: &vortex_array::arrays::null::NullArray) -> usize -pub fn vortex_array::arrays::null::NullVTable::nslots(_array: &vortex_array::arrays::null::NullArray) -> usize - pub fn vortex_array::arrays::null::NullVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::NullVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::NullVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::null::NullVTable::slot(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::null::NullVTable::slot_name(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> &str -pub fn vortex_array::arrays::null::NullVTable::stats(array: &vortex_array::arrays::null::NullArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::null::NullVTable::slots(array: &vortex_array::arrays::null::NullArray) -> &[core::option::Option] -pub fn vortex_array::arrays::null::NullVTable::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::NullVTable::stats(array: &vortex_array::arrays::null::NullArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::null::NullVTable::with_slots(array: &mut vortex_array::arrays::null::NullArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -3280,21 +3230,17 @@ pub fn vortex_array::arrays::PrimitiveVTable::nbuffers(_array: &vortex_array::ar pub fn vortex_array::arrays::PrimitiveVTable::nchildren(array: &vortex_array::arrays::PrimitiveArray) -> usize -pub fn vortex_array::arrays::PrimitiveVTable::nslots(_array: &vortex_array::arrays::PrimitiveArray) -> usize - pub fn vortex_array::arrays::PrimitiveVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::PrimitiveVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::PrimitiveVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::PrimitiveVTable::slot(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::PrimitiveVTable::slot_name(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> &str -pub fn vortex_array::arrays::PrimitiveVTable::stats(array: &vortex_array::arrays::PrimitiveArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::PrimitiveVTable::slots(array: &vortex_array::arrays::PrimitiveArray) -> &[core::option::Option] -pub fn vortex_array::arrays::PrimitiveVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::PrimitiveVTable::stats(array: &vortex_array::arrays::PrimitiveArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::PrimitiveVTable::with_slots(array: &mut vortex_array::arrays::PrimitiveArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -3466,21 +3412,17 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nbuffers(_array: &vortex pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nchildren(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nslots(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray, _idx: usize) -> &str -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> &[core::option::Option] -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_slots(array: &mut vortex_array::arrays::scalar_fn::ScalarFnArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -3596,21 +3538,17 @@ pub fn vortex_array::arrays::SharedVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::SharedVTable::nchildren(_array: &Self::Array) -> usize -pub fn vortex_array::arrays::SharedVTable::nslots(_array: &vortex_array::arrays::SharedArray) -> usize - pub fn vortex_array::arrays::SharedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::SharedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::SharedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::SharedVTable::slot(array: &vortex_array::arrays::SharedArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::SharedVTable::slot_name(_array: &vortex_array::arrays::SharedArray, idx: usize) -> &str -pub fn vortex_array::arrays::SharedVTable::stats(array: &vortex_array::arrays::SharedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::SharedVTable::slots(array: &vortex_array::arrays::SharedArray) -> &[core::option::Option] -pub fn vortex_array::arrays::SharedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::SharedVTable::stats(array: &vortex_array::arrays::SharedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::SharedVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -3770,21 +3708,17 @@ pub fn vortex_array::arrays::slice::SliceVTable::nbuffers(_array: &Self::Array) pub fn vortex_array::arrays::slice::SliceVTable::nchildren(_array: &Self::Array) -> usize -pub fn vortex_array::arrays::slice::SliceVTable::nslots(_array: &Self::Array) -> usize - pub fn vortex_array::arrays::slice::SliceVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::SliceVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::SliceVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::slice::SliceVTable::slot(array: &Self::Array, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::slice::SliceVTable::slot_name(_array: &Self::Array, idx: usize) -> &str -pub fn vortex_array::arrays::slice::SliceVTable::stats(array: &vortex_array::arrays::slice::SliceArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::slice::SliceVTable::slots(array: &Self::Array) -> &[core::option::Option] -pub fn vortex_array::arrays::slice::SliceVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::SliceVTable::stats(array: &vortex_array::arrays::slice::SliceArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::slice::SliceVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -4026,9 +3960,9 @@ pub fn vortex_array::arrays::StructVTable::buffer_name(_array: &vortex_array::ar pub fn vortex_array::arrays::StructVTable::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::StructVTable::child(array: &vortex_array::arrays::StructArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::StructVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::StructVTable::child_name(array: &vortex_array::arrays::StructArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::StructVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::StructVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -4046,9 +3980,7 @@ pub fn vortex_array::arrays::StructVTable::metadata(_array: &vortex_array::array pub fn vortex_array::arrays::StructVTable::nbuffers(_array: &vortex_array::arrays::StructArray) -> usize -pub fn vortex_array::arrays::StructVTable::nchildren(array: &vortex_array::arrays::StructArray) -> usize - -pub fn vortex_array::arrays::StructVTable::nslots(array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::StructVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::StructVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -4056,13 +3988,11 @@ pub fn vortex_array::arrays::StructVTable::reduce_parent(array: &Self::Array, pa pub fn vortex_array::arrays::StructVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::StructVTable::slot(array: &vortex_array::arrays::StructArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::StructVTable::slot_name(array: &vortex_array::arrays::StructArray, idx: usize) -> &str -pub fn vortex_array::arrays::StructVTable::stats(array: &vortex_array::arrays::StructArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::StructVTable::slots(array: &vortex_array::arrays::StructArray) -> &[core::option::Option] -pub fn vortex_array::arrays::StructVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::StructVTable::stats(array: &vortex_array::arrays::StructArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::StructVTable::with_slots(array: &mut vortex_array::arrays::StructArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -4300,9 +4230,9 @@ pub fn vortex_array::arrays::VarBinVTable::buffer_name(_array: &vortex_array::ar pub fn vortex_array::arrays::VarBinVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinVTable::child(array: &vortex_array::arrays::VarBinArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBinVTable::child_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::VarBinVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::VarBinVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -4320,9 +4250,7 @@ pub fn vortex_array::arrays::VarBinVTable::metadata(array: &vortex_array::arrays pub fn vortex_array::arrays::VarBinVTable::nbuffers(_array: &vortex_array::arrays::VarBinArray) -> usize -pub fn vortex_array::arrays::VarBinVTable::nchildren(array: &vortex_array::arrays::VarBinArray) -> usize - -pub fn vortex_array::arrays::VarBinVTable::nslots(_array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBinVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::VarBinVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -4330,13 +4258,11 @@ pub fn vortex_array::arrays::VarBinVTable::reduce_parent(array: &Self::Array, pa pub fn vortex_array::arrays::VarBinVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::VarBinVTable::slot(array: &vortex_array::arrays::VarBinArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::VarBinVTable::slot_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> &str -pub fn vortex_array::arrays::VarBinVTable::stats(array: &vortex_array::arrays::VarBinArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::VarBinVTable::slots(array: &vortex_array::arrays::VarBinArray) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBinVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinVTable::stats(array: &vortex_array::arrays::VarBinArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::VarBinVTable::with_slots(array: &mut vortex_array::arrays::VarBinArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -4738,21 +4664,17 @@ pub fn vortex_array::arrays::VarBinViewVTable::nbuffers(array: &vortex_array::ar pub fn vortex_array::arrays::VarBinViewVTable::nchildren(array: &vortex_array::arrays::VarBinViewArray) -> usize -pub fn vortex_array::arrays::VarBinViewVTable::nslots(_array: &vortex_array::arrays::VarBinViewArray) -> usize - pub fn vortex_array::arrays::VarBinViewVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinViewVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinViewVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::VarBinViewVTable::slot(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::VarBinViewVTable::slot_name(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> &str -pub fn vortex_array::arrays::VarBinViewVTable::stats(array: &vortex_array::arrays::VarBinViewArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::VarBinViewVTable::slots(array: &vortex_array::arrays::VarBinViewArray) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBinViewVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinViewVTable::stats(array: &vortex_array::arrays::VarBinViewArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::VarBinViewVTable::with_slots(array: &mut vortex_array::arrays::VarBinViewArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -4946,21 +4868,17 @@ pub fn vortex_array::arrays::BoolVTable::nbuffers(_array: &vortex_array::arrays: pub fn vortex_array::arrays::BoolVTable::nchildren(array: &vortex_array::arrays::BoolArray) -> usize -pub fn vortex_array::arrays::BoolVTable::nslots(_array: &vortex_array::arrays::BoolArray) -> usize - pub fn vortex_array::arrays::BoolVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::BoolVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::BoolVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::BoolVTable::slot(_array: &vortex_array::arrays::BoolArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::BoolVTable::slot_name(_array: &vortex_array::arrays::BoolArray, idx: usize) -> &str -pub fn vortex_array::arrays::BoolVTable::stats(array: &vortex_array::arrays::BoolArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::BoolVTable::slots(array: &vortex_array::arrays::BoolArray) -> &[core::option::Option] -pub fn vortex_array::arrays::BoolVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::BoolVTable::stats(array: &vortex_array::arrays::BoolArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::BoolVTable::with_slots(array: &mut vortex_array::arrays::BoolArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -5128,21 +5046,17 @@ pub fn vortex_array::arrays::ChunkedVTable::nbuffers(_array: &vortex_array::arra pub fn vortex_array::arrays::ChunkedVTable::nchildren(array: &vortex_array::arrays::ChunkedArray) -> usize -pub fn vortex_array::arrays::ChunkedVTable::nslots(array: &vortex_array::arrays::ChunkedArray) -> usize - pub fn vortex_array::arrays::ChunkedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ChunkedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ChunkedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ChunkedVTable::slot(array: &vortex_array::arrays::ChunkedArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ChunkedVTable::slot_name(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> &str -pub fn vortex_array::arrays::ChunkedVTable::stats(array: &vortex_array::arrays::ChunkedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ChunkedVTable::slots(array: &vortex_array::arrays::ChunkedArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ChunkedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ChunkedVTable::stats(array: &vortex_array::arrays::ChunkedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ChunkedVTable::with_slots(array: &mut vortex_array::arrays::ChunkedArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -5288,21 +5202,17 @@ pub fn vortex_array::arrays::ConstantVTable::nbuffers(_array: &vortex_array::arr pub fn vortex_array::arrays::ConstantVTable::nchildren(_array: &vortex_array::arrays::ConstantArray) -> usize -pub fn vortex_array::arrays::ConstantVTable::nslots(_array: &vortex_array::arrays::ConstantArray) -> usize - pub fn vortex_array::arrays::ConstantVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ConstantVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ConstantVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ConstantVTable::slot(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ConstantVTable::slot_name(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> &str -pub fn vortex_array::arrays::ConstantVTable::stats(array: &vortex_array::arrays::ConstantArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ConstantVTable::slots(array: &vortex_array::arrays::ConstantArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ConstantVTable::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ConstantVTable::stats(array: &vortex_array::arrays::ConstantArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ConstantVTable::with_slots(array: &mut vortex_array::arrays::ConstantArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -5492,21 +5402,17 @@ pub fn vortex_array::arrays::DecimalVTable::nbuffers(_array: &vortex_array::arra pub fn vortex_array::arrays::DecimalVTable::nchildren(array: &vortex_array::arrays::DecimalArray) -> usize -pub fn vortex_array::arrays::DecimalVTable::nslots(_array: &vortex_array::arrays::DecimalArray) -> usize - pub fn vortex_array::arrays::DecimalVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::DecimalVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::DecimalVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::DecimalVTable::slot(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::DecimalVTable::slot_name(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> &str -pub fn vortex_array::arrays::DecimalVTable::stats(array: &vortex_array::arrays::DecimalArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::DecimalVTable::slots(array: &vortex_array::arrays::DecimalArray) -> &[core::option::Option] -pub fn vortex_array::arrays::DecimalVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::DecimalVTable::stats(array: &vortex_array::arrays::DecimalArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::DecimalVTable::with_slots(array: &mut vortex_array::arrays::DecimalArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -5672,21 +5578,17 @@ pub fn vortex_array::arrays::dict::DictVTable::nbuffers(_array: &vortex_array::a pub fn vortex_array::arrays::dict::DictVTable::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize -pub fn vortex_array::arrays::dict::DictVTable::nslots(_array: &vortex_array::arrays::dict::DictArray) -> usize - pub fn vortex_array::arrays::dict::DictVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::dict::DictVTable::slot(array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::dict::DictVTable::slot_name(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &str -pub fn vortex_array::arrays::dict::DictVTable::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::dict::DictVTable::slots(array: &vortex_array::arrays::dict::DictArray) -> &[core::option::Option] -pub fn vortex_array::arrays::dict::DictVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::DictVTable::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::dict::DictVTable::with_slots(array: &mut vortex_array::arrays::dict::DictArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -5700,11 +5602,13 @@ impl vortex_array::arrays::ExtensionArray pub fn vortex_array::arrays::ExtensionArray::ext_dtype(&self) -> &vortex_array::dtype::extension::ExtDTypeRef +pub fn vortex_array::arrays::ExtensionArray::id(&self) -> vortex_array::dtype::extension::ExtId + pub fn vortex_array::arrays::ExtensionArray::new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self pub unsafe fn vortex_array::arrays::ExtensionArray::new_unchecked(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self -pub fn vortex_array::arrays::ExtensionArray::storage_array(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::ExtensionArray::storage(&self) -> &vortex_array::ArrayRef pub fn vortex_array::arrays::ExtensionArray::try_new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> vortex_error::VortexResult @@ -5856,21 +5760,17 @@ pub fn vortex_array::arrays::ExtensionVTable::nbuffers(_array: &vortex_array::ar pub fn vortex_array::arrays::ExtensionVTable::nchildren(_array: &vortex_array::arrays::ExtensionArray) -> usize -pub fn vortex_array::arrays::ExtensionVTable::nslots(_array: &vortex_array::arrays::ExtensionArray) -> usize - pub fn vortex_array::arrays::ExtensionVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ExtensionVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ExtensionVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ExtensionVTable::slot(array: &vortex_array::arrays::ExtensionArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ExtensionVTable::slot_name(_array: &vortex_array::arrays::ExtensionArray, idx: usize) -> &str -pub fn vortex_array::arrays::ExtensionVTable::stats(array: &vortex_array::arrays::ExtensionArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ExtensionVTable::slots(array: &vortex_array::arrays::ExtensionArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ExtensionVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ExtensionVTable::stats(array: &vortex_array::arrays::ExtensionArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ExtensionVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -5980,21 +5880,17 @@ pub fn vortex_array::arrays::FilterVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::FilterVTable::nchildren(_array: &Self::Array) -> usize -pub fn vortex_array::arrays::FilterVTable::nslots(_array: &Self::Array) -> usize - pub fn vortex_array::arrays::FilterVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FilterVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FilterVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::FilterVTable::slot(array: &Self::Array, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::FilterVTable::slot_name(_array: &Self::Array, idx: usize) -> &str -pub fn vortex_array::arrays::FilterVTable::stats(array: &vortex_array::arrays::FilterArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::FilterVTable::slots(array: &Self::Array) -> &[core::option::Option] -pub fn vortex_array::arrays::FilterVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FilterVTable::stats(array: &vortex_array::arrays::FilterArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::FilterVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -6126,9 +6022,9 @@ pub fn vortex_array::arrays::FixedSizeListVTable::buffer_name(_array: &vortex_ar pub fn vortex_array::arrays::FixedSizeListVTable::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeListVTable::child(array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FixedSizeListVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::FixedSizeListVTable::child_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::FixedSizeListVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::FixedSizeListVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -6146,9 +6042,7 @@ pub fn vortex_array::arrays::FixedSizeListVTable::metadata(_array: &vortex_array pub fn vortex_array::arrays::FixedSizeListVTable::nbuffers(_array: &vortex_array::arrays::FixedSizeListArray) -> usize -pub fn vortex_array::arrays::FixedSizeListVTable::nchildren(array: &vortex_array::arrays::FixedSizeListArray) -> usize - -pub fn vortex_array::arrays::FixedSizeListVTable::nslots(_array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeListVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::FixedSizeListVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -6156,13 +6050,11 @@ pub fn vortex_array::arrays::FixedSizeListVTable::reduce_parent(array: &Self::Ar pub fn vortex_array::arrays::FixedSizeListVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::FixedSizeListVTable::slot(array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::FixedSizeListVTable::slot_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> &str -pub fn vortex_array::arrays::FixedSizeListVTable::stats(array: &vortex_array::arrays::FixedSizeListArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::FixedSizeListVTable::slots(array: &vortex_array::arrays::FixedSizeListArray) -> &[core::option::Option] -pub fn vortex_array::arrays::FixedSizeListVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeListVTable::stats(array: &vortex_array::arrays::FixedSizeListArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::FixedSizeListVTable::with_slots(array: &mut vortex_array::arrays::FixedSizeListArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -6298,9 +6190,9 @@ pub fn vortex_array::arrays::ListVTable::buffer_name(_array: &vortex_array::arra pub fn vortex_array::arrays::ListVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListVTable::child(array: &vortex_array::arrays::ListArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::ListVTable::child_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::ListVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::ListVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -6318,9 +6210,7 @@ pub fn vortex_array::arrays::ListVTable::metadata(array: &vortex_array::arrays:: pub fn vortex_array::arrays::ListVTable::nbuffers(_array: &vortex_array::arrays::ListArray) -> usize -pub fn vortex_array::arrays::ListVTable::nchildren(array: &vortex_array::arrays::ListArray) -> usize - -pub fn vortex_array::arrays::ListVTable::nslots(_array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::ListVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::ListVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -6328,13 +6218,11 @@ pub fn vortex_array::arrays::ListVTable::reduce_parent(array: &Self::Array, pare pub fn vortex_array::arrays::ListVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ListVTable::slot(array: &vortex_array::arrays::ListArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ListVTable::slot_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> &str -pub fn vortex_array::arrays::ListVTable::stats(array: &vortex_array::arrays::ListArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ListVTable::slots(array: &vortex_array::arrays::ListArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ListVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListVTable::stats(array: &vortex_array::arrays::ListArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ListVTable::with_slots(array: &mut vortex_array::arrays::ListArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -6478,9 +6366,9 @@ pub fn vortex_array::arrays::ListViewVTable::buffer_name(_array: &vortex_array:: pub fn vortex_array::arrays::ListViewVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListViewVTable::child(array: &vortex_array::arrays::ListViewArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListViewVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::ListViewVTable::child_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::ListViewVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::ListViewVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -6498,9 +6386,7 @@ pub fn vortex_array::arrays::ListViewVTable::metadata(array: &vortex_array::arra pub fn vortex_array::arrays::ListViewVTable::nbuffers(_array: &vortex_array::arrays::ListViewArray) -> usize -pub fn vortex_array::arrays::ListViewVTable::nchildren(array: &vortex_array::arrays::ListViewArray) -> usize - -pub fn vortex_array::arrays::ListViewVTable::nslots(_array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListViewVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::ListViewVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -6508,13 +6394,11 @@ pub fn vortex_array::arrays::ListViewVTable::reduce_parent(array: &Self::Array, pub fn vortex_array::arrays::ListViewVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ListViewVTable::slot(array: &vortex_array::arrays::ListViewArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ListViewVTable::slot_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> &str -pub fn vortex_array::arrays::ListViewVTable::stats(array: &vortex_array::arrays::ListViewArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ListViewVTable::slots(array: &vortex_array::arrays::ListViewArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ListViewVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListViewVTable::stats(array: &vortex_array::arrays::ListViewArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ListViewVTable::with_slots(array: &mut vortex_array::arrays::ListViewArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -6614,7 +6498,7 @@ pub fn vortex_array::arrays::MaskedVTable::build(dtype: &vortex_array::dtype::DT pub fn vortex_array::arrays::MaskedVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::MaskedVTable::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::MaskedVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::MaskedVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -6634,21 +6518,17 @@ pub fn vortex_array::arrays::MaskedVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::MaskedVTable::nchildren(array: &Self::Array) -> usize -pub fn vortex_array::arrays::MaskedVTable::nslots(_array: &vortex_array::arrays::MaskedArray) -> usize - pub fn vortex_array::arrays::MaskedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::MaskedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::MaskedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::MaskedVTable::slot(array: &vortex_array::arrays::MaskedArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::MaskedVTable::slot_name(_array: &vortex_array::arrays::MaskedArray, idx: usize) -> &str -pub fn vortex_array::arrays::MaskedVTable::stats(array: &vortex_array::arrays::MaskedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::MaskedVTable::slots(array: &vortex_array::arrays::MaskedArray) -> &[core::option::Option] -pub fn vortex_array::arrays::MaskedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::MaskedVTable::stats(array: &vortex_array::arrays::MaskedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::MaskedVTable::with_slots(array: &mut vortex_array::arrays::MaskedArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -6778,21 +6658,17 @@ pub fn vortex_array::arrays::null::NullVTable::nbuffers(_array: &vortex_array::a pub fn vortex_array::arrays::null::NullVTable::nchildren(_array: &vortex_array::arrays::null::NullArray) -> usize -pub fn vortex_array::arrays::null::NullVTable::nslots(_array: &vortex_array::arrays::null::NullArray) -> usize - pub fn vortex_array::arrays::null::NullVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::NullVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::NullVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::null::NullVTable::slot(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::null::NullVTable::slot_name(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> &str -pub fn vortex_array::arrays::null::NullVTable::stats(array: &vortex_array::arrays::null::NullArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::null::NullVTable::slots(array: &vortex_array::arrays::null::NullArray) -> &[core::option::Option] -pub fn vortex_array::arrays::null::NullVTable::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::NullVTable::stats(array: &vortex_array::arrays::null::NullArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::null::NullVTable::with_slots(array: &mut vortex_array::arrays::null::NullArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -7020,21 +6896,17 @@ pub fn vortex_array::arrays::PrimitiveVTable::nbuffers(_array: &vortex_array::ar pub fn vortex_array::arrays::PrimitiveVTable::nchildren(array: &vortex_array::arrays::PrimitiveArray) -> usize -pub fn vortex_array::arrays::PrimitiveVTable::nslots(_array: &vortex_array::arrays::PrimitiveArray) -> usize - pub fn vortex_array::arrays::PrimitiveVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::PrimitiveVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::PrimitiveVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::PrimitiveVTable::slot(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::PrimitiveVTable::slot_name(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> &str -pub fn vortex_array::arrays::PrimitiveVTable::stats(array: &vortex_array::arrays::PrimitiveArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::PrimitiveVTable::slots(array: &vortex_array::arrays::PrimitiveArray) -> &[core::option::Option] -pub fn vortex_array::arrays::PrimitiveVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::PrimitiveVTable::stats(array: &vortex_array::arrays::PrimitiveArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::PrimitiveVTable::with_slots(array: &mut vortex_array::arrays::PrimitiveArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -7152,21 +7024,17 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nbuffers(_array: &vortex pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nchildren(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nslots(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray, _idx: usize) -> &str -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> &[core::option::Option] -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_slots(array: &mut vortex_array::arrays::scalar_fn::ScalarFnArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -7272,21 +7140,17 @@ pub fn vortex_array::arrays::SharedVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::SharedVTable::nchildren(_array: &Self::Array) -> usize -pub fn vortex_array::arrays::SharedVTable::nslots(_array: &vortex_array::arrays::SharedArray) -> usize - pub fn vortex_array::arrays::SharedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::SharedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::SharedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::SharedVTable::slot(array: &vortex_array::arrays::SharedArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::SharedVTable::slot_name(_array: &vortex_array::arrays::SharedArray, idx: usize) -> &str -pub fn vortex_array::arrays::SharedVTable::stats(array: &vortex_array::arrays::SharedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::SharedVTable::slots(array: &vortex_array::arrays::SharedArray) -> &[core::option::Option] -pub fn vortex_array::arrays::SharedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::SharedVTable::stats(array: &vortex_array::arrays::SharedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::SharedVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -7400,21 +7264,17 @@ pub fn vortex_array::arrays::slice::SliceVTable::nbuffers(_array: &Self::Array) pub fn vortex_array::arrays::slice::SliceVTable::nchildren(_array: &Self::Array) -> usize -pub fn vortex_array::arrays::slice::SliceVTable::nslots(_array: &Self::Array) -> usize - pub fn vortex_array::arrays::slice::SliceVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::SliceVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::SliceVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::slice::SliceVTable::slot(array: &Self::Array, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::slice::SliceVTable::slot_name(_array: &Self::Array, idx: usize) -> &str -pub fn vortex_array::arrays::slice::SliceVTable::stats(array: &vortex_array::arrays::slice::SliceArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::slice::SliceVTable::slots(array: &Self::Array) -> &[core::option::Option] -pub fn vortex_array::arrays::slice::SliceVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::SliceVTable::stats(array: &vortex_array::arrays::slice::SliceArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::slice::SliceVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -7570,9 +7430,9 @@ pub fn vortex_array::arrays::StructVTable::buffer_name(_array: &vortex_array::ar pub fn vortex_array::arrays::StructVTable::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::StructVTable::child(array: &vortex_array::arrays::StructArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::StructVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::StructVTable::child_name(array: &vortex_array::arrays::StructArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::StructVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::StructVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -7590,9 +7450,7 @@ pub fn vortex_array::arrays::StructVTable::metadata(_array: &vortex_array::array pub fn vortex_array::arrays::StructVTable::nbuffers(_array: &vortex_array::arrays::StructArray) -> usize -pub fn vortex_array::arrays::StructVTable::nchildren(array: &vortex_array::arrays::StructArray) -> usize - -pub fn vortex_array::arrays::StructVTable::nslots(array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::StructVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::StructVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -7600,13 +7458,11 @@ pub fn vortex_array::arrays::StructVTable::reduce_parent(array: &Self::Array, pa pub fn vortex_array::arrays::StructVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::StructVTable::slot(array: &vortex_array::arrays::StructArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::StructVTable::slot_name(array: &vortex_array::arrays::StructArray, idx: usize) -> &str -pub fn vortex_array::arrays::StructVTable::stats(array: &vortex_array::arrays::StructArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::StructVTable::slots(array: &vortex_array::arrays::StructArray) -> &[core::option::Option] -pub fn vortex_array::arrays::StructVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::StructVTable::stats(array: &vortex_array::arrays::StructArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::StructVTable::with_slots(array: &mut vortex_array::arrays::StructArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -7876,9 +7732,9 @@ pub fn vortex_array::arrays::VarBinVTable::buffer_name(_array: &vortex_array::ar pub fn vortex_array::arrays::VarBinVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinVTable::child(array: &vortex_array::arrays::VarBinArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBinVTable::child_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::VarBinVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::VarBinVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -7896,9 +7752,7 @@ pub fn vortex_array::arrays::VarBinVTable::metadata(array: &vortex_array::arrays pub fn vortex_array::arrays::VarBinVTable::nbuffers(_array: &vortex_array::arrays::VarBinArray) -> usize -pub fn vortex_array::arrays::VarBinVTable::nchildren(array: &vortex_array::arrays::VarBinArray) -> usize - -pub fn vortex_array::arrays::VarBinVTable::nslots(_array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBinVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::VarBinVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -7906,13 +7760,11 @@ pub fn vortex_array::arrays::VarBinVTable::reduce_parent(array: &Self::Array, pa pub fn vortex_array::arrays::VarBinVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::VarBinVTable::slot(array: &vortex_array::arrays::VarBinArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::VarBinVTable::slot_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> &str -pub fn vortex_array::arrays::VarBinVTable::stats(array: &vortex_array::arrays::VarBinArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::VarBinVTable::slots(array: &vortex_array::arrays::VarBinArray) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBinVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinVTable::stats(array: &vortex_array::arrays::VarBinArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::VarBinVTable::with_slots(array: &mut vortex_array::arrays::VarBinArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -8118,21 +7970,17 @@ pub fn vortex_array::arrays::VarBinViewVTable::nbuffers(array: &vortex_array::ar pub fn vortex_array::arrays::VarBinViewVTable::nchildren(array: &vortex_array::arrays::VarBinViewArray) -> usize -pub fn vortex_array::arrays::VarBinViewVTable::nslots(_array: &vortex_array::arrays::VarBinViewArray) -> usize - pub fn vortex_array::arrays::VarBinViewVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinViewVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinViewVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::VarBinViewVTable::slot(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::VarBinViewVTable::slot_name(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> &str -pub fn vortex_array::arrays::VarBinViewVTable::stats(array: &vortex_array::arrays::VarBinViewArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::VarBinViewVTable::slots(array: &vortex_array::arrays::VarBinViewArray) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBinViewVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinViewVTable::stats(array: &vortex_array::arrays::VarBinViewArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::VarBinViewVTable::with_slots(array: &mut vortex_array::arrays::VarBinViewArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -20636,8 +20484,6 @@ pub fn vortex_array::vtable::DynVTable::reduce(&self, array: &vortex_array::Arra pub fn vortex_array::vtable::DynVTable::reduce_parent(&self, array: &vortex_array::ArrayRef, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> -pub fn vortex_array::vtable::DynVTable::with_children(&self, array: &vortex_array::ArrayRef, children: alloc::vec::Vec) -> vortex_error::VortexResult - pub fn vortex_array::vtable::DynVTable::with_slots(&self, array: &vortex_array::ArrayRef, slots: alloc::vec::Vec>) -> vortex_error::VortexResult pub trait vortex_array::vtable::OperationsVTable @@ -20768,21 +20614,17 @@ pub fn vortex_array::vtable::VTable::nbuffers(array: &Self::Array) -> usize pub fn vortex_array::vtable::VTable::nchildren(array: &Self::Array) -> usize -pub fn vortex_array::vtable::VTable::nslots(array: &Self::Array) -> usize - pub fn vortex_array::vtable::VTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::vtable::VTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::vtable::VTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::vtable::VTable::slot(array: &Self::Array, idx: usize) -> &core::option::Option - pub fn vortex_array::vtable::VTable::slot_name(array: &Self::Array, idx: usize) -> &str -pub fn vortex_array::vtable::VTable::stats(array: &Self::Array) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::vtable::VTable::slots(array: &Self::Array) -> &[core::option::Option] -pub fn vortex_array::vtable::VTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::vtable::VTable::stats(array: &Self::Array) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::vtable::VTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -20830,21 +20672,17 @@ pub fn vortex_array::arrays::BoolVTable::nbuffers(_array: &vortex_array::arrays: pub fn vortex_array::arrays::BoolVTable::nchildren(array: &vortex_array::arrays::BoolArray) -> usize -pub fn vortex_array::arrays::BoolVTable::nslots(_array: &vortex_array::arrays::BoolArray) -> usize - pub fn vortex_array::arrays::BoolVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::BoolVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::BoolVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::BoolVTable::slot(_array: &vortex_array::arrays::BoolArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::BoolVTable::slot_name(_array: &vortex_array::arrays::BoolArray, idx: usize) -> &str -pub fn vortex_array::arrays::BoolVTable::stats(array: &vortex_array::arrays::BoolArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::BoolVTable::slots(array: &vortex_array::arrays::BoolArray) -> &[core::option::Option] -pub fn vortex_array::arrays::BoolVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::BoolVTable::stats(array: &vortex_array::arrays::BoolArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::BoolVTable::with_slots(array: &mut vortex_array::arrays::BoolArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -20892,21 +20730,17 @@ pub fn vortex_array::arrays::ChunkedVTable::nbuffers(_array: &vortex_array::arra pub fn vortex_array::arrays::ChunkedVTable::nchildren(array: &vortex_array::arrays::ChunkedArray) -> usize -pub fn vortex_array::arrays::ChunkedVTable::nslots(array: &vortex_array::arrays::ChunkedArray) -> usize - pub fn vortex_array::arrays::ChunkedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ChunkedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ChunkedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ChunkedVTable::slot(array: &vortex_array::arrays::ChunkedArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ChunkedVTable::slot_name(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> &str -pub fn vortex_array::arrays::ChunkedVTable::stats(array: &vortex_array::arrays::ChunkedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ChunkedVTable::slots(array: &vortex_array::arrays::ChunkedArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ChunkedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ChunkedVTable::stats(array: &vortex_array::arrays::ChunkedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ChunkedVTable::with_slots(array: &mut vortex_array::arrays::ChunkedArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -20954,21 +20788,17 @@ pub fn vortex_array::arrays::ConstantVTable::nbuffers(_array: &vortex_array::arr pub fn vortex_array::arrays::ConstantVTable::nchildren(_array: &vortex_array::arrays::ConstantArray) -> usize -pub fn vortex_array::arrays::ConstantVTable::nslots(_array: &vortex_array::arrays::ConstantArray) -> usize - pub fn vortex_array::arrays::ConstantVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ConstantVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ConstantVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ConstantVTable::slot(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ConstantVTable::slot_name(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> &str -pub fn vortex_array::arrays::ConstantVTable::stats(array: &vortex_array::arrays::ConstantArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ConstantVTable::slots(array: &vortex_array::arrays::ConstantArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ConstantVTable::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ConstantVTable::stats(array: &vortex_array::arrays::ConstantArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ConstantVTable::with_slots(array: &mut vortex_array::arrays::ConstantArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21016,21 +20846,17 @@ pub fn vortex_array::arrays::DecimalVTable::nbuffers(_array: &vortex_array::arra pub fn vortex_array::arrays::DecimalVTable::nchildren(array: &vortex_array::arrays::DecimalArray) -> usize -pub fn vortex_array::arrays::DecimalVTable::nslots(_array: &vortex_array::arrays::DecimalArray) -> usize - pub fn vortex_array::arrays::DecimalVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::DecimalVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::DecimalVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::DecimalVTable::slot(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::DecimalVTable::slot_name(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> &str -pub fn vortex_array::arrays::DecimalVTable::stats(array: &vortex_array::arrays::DecimalArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::DecimalVTable::slots(array: &vortex_array::arrays::DecimalArray) -> &[core::option::Option] -pub fn vortex_array::arrays::DecimalVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::DecimalVTable::stats(array: &vortex_array::arrays::DecimalArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::DecimalVTable::with_slots(array: &mut vortex_array::arrays::DecimalArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21078,21 +20904,17 @@ pub fn vortex_array::arrays::ExtensionVTable::nbuffers(_array: &vortex_array::ar pub fn vortex_array::arrays::ExtensionVTable::nchildren(_array: &vortex_array::arrays::ExtensionArray) -> usize -pub fn vortex_array::arrays::ExtensionVTable::nslots(_array: &vortex_array::arrays::ExtensionArray) -> usize - pub fn vortex_array::arrays::ExtensionVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ExtensionVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ExtensionVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ExtensionVTable::slot(array: &vortex_array::arrays::ExtensionArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ExtensionVTable::slot_name(_array: &vortex_array::arrays::ExtensionArray, idx: usize) -> &str -pub fn vortex_array::arrays::ExtensionVTable::stats(array: &vortex_array::arrays::ExtensionArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ExtensionVTable::slots(array: &vortex_array::arrays::ExtensionArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ExtensionVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ExtensionVTable::stats(array: &vortex_array::arrays::ExtensionArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ExtensionVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21140,21 +20962,17 @@ pub fn vortex_array::arrays::FilterVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::FilterVTable::nchildren(_array: &Self::Array) -> usize -pub fn vortex_array::arrays::FilterVTable::nslots(_array: &Self::Array) -> usize - pub fn vortex_array::arrays::FilterVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FilterVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FilterVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::FilterVTable::slot(array: &Self::Array, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::FilterVTable::slot_name(_array: &Self::Array, idx: usize) -> &str -pub fn vortex_array::arrays::FilterVTable::stats(array: &vortex_array::arrays::FilterArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::FilterVTable::slots(array: &Self::Array) -> &[core::option::Option] -pub fn vortex_array::arrays::FilterVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FilterVTable::stats(array: &vortex_array::arrays::FilterArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::FilterVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21180,9 +20998,9 @@ pub fn vortex_array::arrays::FixedSizeListVTable::buffer_name(_array: &vortex_ar pub fn vortex_array::arrays::FixedSizeListVTable::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeListVTable::child(array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FixedSizeListVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::FixedSizeListVTable::child_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::FixedSizeListVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::FixedSizeListVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -21200,9 +21018,7 @@ pub fn vortex_array::arrays::FixedSizeListVTable::metadata(_array: &vortex_array pub fn vortex_array::arrays::FixedSizeListVTable::nbuffers(_array: &vortex_array::arrays::FixedSizeListArray) -> usize -pub fn vortex_array::arrays::FixedSizeListVTable::nchildren(array: &vortex_array::arrays::FixedSizeListArray) -> usize - -pub fn vortex_array::arrays::FixedSizeListVTable::nslots(_array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeListVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::FixedSizeListVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -21210,13 +21026,11 @@ pub fn vortex_array::arrays::FixedSizeListVTable::reduce_parent(array: &Self::Ar pub fn vortex_array::arrays::FixedSizeListVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::FixedSizeListVTable::slot(array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::FixedSizeListVTable::slot_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> &str -pub fn vortex_array::arrays::FixedSizeListVTable::stats(array: &vortex_array::arrays::FixedSizeListArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::FixedSizeListVTable::slots(array: &vortex_array::arrays::FixedSizeListArray) -> &[core::option::Option] -pub fn vortex_array::arrays::FixedSizeListVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeListVTable::stats(array: &vortex_array::arrays::FixedSizeListArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::FixedSizeListVTable::with_slots(array: &mut vortex_array::arrays::FixedSizeListArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21242,9 +21056,9 @@ pub fn vortex_array::arrays::ListVTable::buffer_name(_array: &vortex_array::arra pub fn vortex_array::arrays::ListVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListVTable::child(array: &vortex_array::arrays::ListArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::ListVTable::child_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::ListVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::ListVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -21262,9 +21076,7 @@ pub fn vortex_array::arrays::ListVTable::metadata(array: &vortex_array::arrays:: pub fn vortex_array::arrays::ListVTable::nbuffers(_array: &vortex_array::arrays::ListArray) -> usize -pub fn vortex_array::arrays::ListVTable::nchildren(array: &vortex_array::arrays::ListArray) -> usize - -pub fn vortex_array::arrays::ListVTable::nslots(_array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::ListVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::ListVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -21272,13 +21084,11 @@ pub fn vortex_array::arrays::ListVTable::reduce_parent(array: &Self::Array, pare pub fn vortex_array::arrays::ListVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ListVTable::slot(array: &vortex_array::arrays::ListArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ListVTable::slot_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> &str -pub fn vortex_array::arrays::ListVTable::stats(array: &vortex_array::arrays::ListArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ListVTable::slots(array: &vortex_array::arrays::ListArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ListVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListVTable::stats(array: &vortex_array::arrays::ListArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ListVTable::with_slots(array: &mut vortex_array::arrays::ListArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21304,9 +21114,9 @@ pub fn vortex_array::arrays::ListViewVTable::buffer_name(_array: &vortex_array:: pub fn vortex_array::arrays::ListViewVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListViewVTable::child(array: &vortex_array::arrays::ListViewArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListViewVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::ListViewVTable::child_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::ListViewVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::ListViewVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -21324,9 +21134,7 @@ pub fn vortex_array::arrays::ListViewVTable::metadata(array: &vortex_array::arra pub fn vortex_array::arrays::ListViewVTable::nbuffers(_array: &vortex_array::arrays::ListViewArray) -> usize -pub fn vortex_array::arrays::ListViewVTable::nchildren(array: &vortex_array::arrays::ListViewArray) -> usize - -pub fn vortex_array::arrays::ListViewVTable::nslots(_array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListViewVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::ListViewVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -21334,13 +21142,11 @@ pub fn vortex_array::arrays::ListViewVTable::reduce_parent(array: &Self::Array, pub fn vortex_array::arrays::ListViewVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ListViewVTable::slot(array: &vortex_array::arrays::ListViewArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::ListViewVTable::slot_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> &str -pub fn vortex_array::arrays::ListViewVTable::stats(array: &vortex_array::arrays::ListViewArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ListViewVTable::slots(array: &vortex_array::arrays::ListViewArray) -> &[core::option::Option] -pub fn vortex_array::arrays::ListViewVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListViewVTable::stats(array: &vortex_array::arrays::ListViewArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::ListViewVTable::with_slots(array: &mut vortex_array::arrays::ListViewArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21368,7 +21174,7 @@ pub fn vortex_array::arrays::MaskedVTable::build(dtype: &vortex_array::dtype::DT pub fn vortex_array::arrays::MaskedVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::MaskedVTable::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::MaskedVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::MaskedVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -21388,21 +21194,17 @@ pub fn vortex_array::arrays::MaskedVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::MaskedVTable::nchildren(array: &Self::Array) -> usize -pub fn vortex_array::arrays::MaskedVTable::nslots(_array: &vortex_array::arrays::MaskedArray) -> usize - pub fn vortex_array::arrays::MaskedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::MaskedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::MaskedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::MaskedVTable::slot(array: &vortex_array::arrays::MaskedArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::MaskedVTable::slot_name(_array: &vortex_array::arrays::MaskedArray, idx: usize) -> &str -pub fn vortex_array::arrays::MaskedVTable::stats(array: &vortex_array::arrays::MaskedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::MaskedVTable::slots(array: &vortex_array::arrays::MaskedArray) -> &[core::option::Option] -pub fn vortex_array::arrays::MaskedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::MaskedVTable::stats(array: &vortex_array::arrays::MaskedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::MaskedVTable::with_slots(array: &mut vortex_array::arrays::MaskedArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21450,21 +21252,17 @@ pub fn vortex_array::arrays::PrimitiveVTable::nbuffers(_array: &vortex_array::ar pub fn vortex_array::arrays::PrimitiveVTable::nchildren(array: &vortex_array::arrays::PrimitiveArray) -> usize -pub fn vortex_array::arrays::PrimitiveVTable::nslots(_array: &vortex_array::arrays::PrimitiveArray) -> usize - pub fn vortex_array::arrays::PrimitiveVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::PrimitiveVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::PrimitiveVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::PrimitiveVTable::slot(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::PrimitiveVTable::slot_name(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> &str -pub fn vortex_array::arrays::PrimitiveVTable::stats(array: &vortex_array::arrays::PrimitiveArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::PrimitiveVTable::slots(array: &vortex_array::arrays::PrimitiveArray) -> &[core::option::Option] -pub fn vortex_array::arrays::PrimitiveVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::PrimitiveVTable::stats(array: &vortex_array::arrays::PrimitiveArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::PrimitiveVTable::with_slots(array: &mut vortex_array::arrays::PrimitiveArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21512,21 +21310,17 @@ pub fn vortex_array::arrays::SharedVTable::nbuffers(_array: &Self::Array) -> usi pub fn vortex_array::arrays::SharedVTable::nchildren(_array: &Self::Array) -> usize -pub fn vortex_array::arrays::SharedVTable::nslots(_array: &vortex_array::arrays::SharedArray) -> usize - pub fn vortex_array::arrays::SharedVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::SharedVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::SharedVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::SharedVTable::slot(array: &vortex_array::arrays::SharedArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::SharedVTable::slot_name(_array: &vortex_array::arrays::SharedArray, idx: usize) -> &str -pub fn vortex_array::arrays::SharedVTable::stats(array: &vortex_array::arrays::SharedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::SharedVTable::slots(array: &vortex_array::arrays::SharedArray) -> &[core::option::Option] -pub fn vortex_array::arrays::SharedVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::SharedVTable::stats(array: &vortex_array::arrays::SharedArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::SharedVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21552,9 +21346,9 @@ pub fn vortex_array::arrays::StructVTable::buffer_name(_array: &vortex_array::ar pub fn vortex_array::arrays::StructVTable::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::StructVTable::child(array: &vortex_array::arrays::StructArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::StructVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::StructVTable::child_name(array: &vortex_array::arrays::StructArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::StructVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::StructVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -21572,9 +21366,7 @@ pub fn vortex_array::arrays::StructVTable::metadata(_array: &vortex_array::array pub fn vortex_array::arrays::StructVTable::nbuffers(_array: &vortex_array::arrays::StructArray) -> usize -pub fn vortex_array::arrays::StructVTable::nchildren(array: &vortex_array::arrays::StructArray) -> usize - -pub fn vortex_array::arrays::StructVTable::nslots(array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::StructVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::StructVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -21582,13 +21374,11 @@ pub fn vortex_array::arrays::StructVTable::reduce_parent(array: &Self::Array, pa pub fn vortex_array::arrays::StructVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::StructVTable::slot(array: &vortex_array::arrays::StructArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::StructVTable::slot_name(array: &vortex_array::arrays::StructArray, idx: usize) -> &str -pub fn vortex_array::arrays::StructVTable::stats(array: &vortex_array::arrays::StructArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::StructVTable::slots(array: &vortex_array::arrays::StructArray) -> &[core::option::Option] -pub fn vortex_array::arrays::StructVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::StructVTable::stats(array: &vortex_array::arrays::StructArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::StructVTable::with_slots(array: &mut vortex_array::arrays::StructArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21614,9 +21404,9 @@ pub fn vortex_array::arrays::VarBinVTable::buffer_name(_array: &vortex_array::ar pub fn vortex_array::arrays::VarBinVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinVTable::child(array: &vortex_array::arrays::VarBinArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBinVTable::child_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::VarBinVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::VarBinVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -21634,9 +21424,7 @@ pub fn vortex_array::arrays::VarBinVTable::metadata(array: &vortex_array::arrays pub fn vortex_array::arrays::VarBinVTable::nbuffers(_array: &vortex_array::arrays::VarBinArray) -> usize -pub fn vortex_array::arrays::VarBinVTable::nchildren(array: &vortex_array::arrays::VarBinArray) -> usize - -pub fn vortex_array::arrays::VarBinVTable::nslots(_array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBinVTable::nchildren(array: &Self::Array) -> usize pub fn vortex_array::arrays::VarBinVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> @@ -21644,13 +21432,11 @@ pub fn vortex_array::arrays::VarBinVTable::reduce_parent(array: &Self::Array, pa pub fn vortex_array::arrays::VarBinVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::VarBinVTable::slot(array: &vortex_array::arrays::VarBinArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::VarBinVTable::slot_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> &str -pub fn vortex_array::arrays::VarBinVTable::stats(array: &vortex_array::arrays::VarBinArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::VarBinVTable::slots(array: &vortex_array::arrays::VarBinArray) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBinVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinVTable::stats(array: &vortex_array::arrays::VarBinArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::VarBinVTable::with_slots(array: &mut vortex_array::arrays::VarBinArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21698,21 +21484,17 @@ pub fn vortex_array::arrays::VarBinViewVTable::nbuffers(array: &vortex_array::ar pub fn vortex_array::arrays::VarBinViewVTable::nchildren(array: &vortex_array::arrays::VarBinViewArray) -> usize -pub fn vortex_array::arrays::VarBinViewVTable::nslots(_array: &vortex_array::arrays::VarBinViewArray) -> usize - pub fn vortex_array::arrays::VarBinViewVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinViewVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinViewVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::VarBinViewVTable::slot(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::VarBinViewVTable::slot_name(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> &str -pub fn vortex_array::arrays::VarBinViewVTable::stats(array: &vortex_array::arrays::VarBinViewArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::VarBinViewVTable::slots(array: &vortex_array::arrays::VarBinViewArray) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBinViewVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinViewVTable::stats(array: &vortex_array::arrays::VarBinViewArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::VarBinViewVTable::with_slots(array: &mut vortex_array::arrays::VarBinViewArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21760,21 +21542,17 @@ pub fn vortex_array::arrays::dict::DictVTable::nbuffers(_array: &vortex_array::a pub fn vortex_array::arrays::dict::DictVTable::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize -pub fn vortex_array::arrays::dict::DictVTable::nslots(_array: &vortex_array::arrays::dict::DictArray) -> usize - pub fn vortex_array::arrays::dict::DictVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::DictVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::dict::DictVTable::slot(array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::dict::DictVTable::slot_name(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> &str -pub fn vortex_array::arrays::dict::DictVTable::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::dict::DictVTable::slots(array: &vortex_array::arrays::dict::DictArray) -> &[core::option::Option] -pub fn vortex_array::arrays::dict::DictVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::DictVTable::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::dict::DictVTable::with_slots(array: &mut vortex_array::arrays::dict::DictArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21822,21 +21600,17 @@ pub fn vortex_array::arrays::null::NullVTable::nbuffers(_array: &vortex_array::a pub fn vortex_array::arrays::null::NullVTable::nchildren(_array: &vortex_array::arrays::null::NullArray) -> usize -pub fn vortex_array::arrays::null::NullVTable::nslots(_array: &vortex_array::arrays::null::NullArray) -> usize - pub fn vortex_array::arrays::null::NullVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::NullVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::NullVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::null::NullVTable::slot(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::null::NullVTable::slot_name(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> &str -pub fn vortex_array::arrays::null::NullVTable::stats(array: &vortex_array::arrays::null::NullArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::null::NullVTable::slots(array: &vortex_array::arrays::null::NullArray) -> &[core::option::Option] -pub fn vortex_array::arrays::null::NullVTable::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::NullVTable::stats(array: &vortex_array::arrays::null::NullArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::null::NullVTable::with_slots(array: &mut vortex_array::arrays::null::NullArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21884,21 +21658,17 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nbuffers(_array: &vortex pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nchildren(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nslots(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray, _idx: usize) -> &str -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> &[core::option::Option] -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_slots(array: &mut vortex_array::arrays::scalar_fn::ScalarFnArray, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -21946,21 +21716,17 @@ pub fn vortex_array::arrays::slice::SliceVTable::nbuffers(_array: &Self::Array) pub fn vortex_array::arrays::slice::SliceVTable::nchildren(_array: &Self::Array) -> usize -pub fn vortex_array::arrays::slice::SliceVTable::nslots(_array: &Self::Array) -> usize - pub fn vortex_array::arrays::slice::SliceVTable::reduce(array: &Self::Array) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::SliceVTable::reduce_parent(array: &Self::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::SliceVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::slice::SliceVTable::slot(array: &Self::Array, idx: usize) -> &core::option::Option - pub fn vortex_array::arrays::slice::SliceVTable::slot_name(_array: &Self::Array, idx: usize) -> &str -pub fn vortex_array::arrays::slice::SliceVTable::stats(array: &vortex_array::arrays::slice::SliceArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::slice::SliceVTable::slots(array: &Self::Array) -> &[core::option::Option] -pub fn vortex_array::arrays::slice::SliceVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::SliceVTable::stats(array: &vortex_array::arrays::slice::SliceArray) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::arrays::slice::SliceVTable::with_slots(array: &mut Self::Array, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> @@ -22384,11 +22150,9 @@ pub fn vortex_array::ArrayAdapter::nbuffers(&self) -> usize pub fn vortex_array::ArrayAdapter::nchildren(&self) -> usize -pub fn vortex_array::ArrayAdapter::nslots(&self) -> usize - pub fn vortex_array::ArrayAdapter::nth_child(&self, idx: usize) -> core::option::Option -pub fn vortex_array::ArrayAdapter::slot(&self, idx: usize) -> core::option::Option +pub fn vortex_array::ArrayAdapter::slots(&self) -> &[core::option::Option] impl vortex_array::DynArray for vortex_array::ArrayAdapter @@ -22438,8 +22202,6 @@ pub fn vortex_array::ArrayAdapter::validity_mask(&self) -> vortex_error::Vort pub fn vortex_array::ArrayAdapter::vtable(&self) -> &dyn vortex_array::vtable::DynVTable -pub fn vortex_array::ArrayAdapter::with_children(&self, children: alloc::vec::Vec) -> vortex_error::VortexResult - impl vortex_array::scalar_fn::ReduceNode for vortex_array::ArrayAdapter pub fn vortex_array::ArrayAdapter::as_any(&self) -> &dyn core::any::Any @@ -22680,11 +22442,9 @@ pub fn vortex_array::ArrayVisitor::nbuffers(&self) -> usize pub fn vortex_array::ArrayVisitor::nchildren(&self) -> usize -pub fn vortex_array::ArrayVisitor::nslots(&self) -> usize - pub fn vortex_array::ArrayVisitor::nth_child(&self, idx: usize) -> core::option::Option -pub fn vortex_array::ArrayVisitor::slot(&self, idx: usize) -> core::option::Option +pub fn vortex_array::ArrayVisitor::slots(&self) -> &[core::option::Option] impl vortex_array::ArrayVisitor for alloc::sync::Arc @@ -22712,11 +22472,9 @@ pub fn alloc::sync::Arc::nbuffers(&self) -> usize pub fn alloc::sync::Arc::nchildren(&self) -> usize -pub fn alloc::sync::Arc::nslots(&self) -> usize - pub fn alloc::sync::Arc::nth_child(&self, idx: usize) -> core::option::Option -pub fn alloc::sync::Arc::slot(&self, idx: usize) -> core::option::Option +pub fn alloc::sync::Arc::slots(&self) -> &[core::option::Option] impl vortex_array::ArrayVisitor for vortex_array::ArrayAdapter @@ -22744,11 +22502,9 @@ pub fn vortex_array::ArrayAdapter::nbuffers(&self) -> usize pub fn vortex_array::ArrayAdapter::nchildren(&self) -> usize -pub fn vortex_array::ArrayAdapter::nslots(&self) -> usize - pub fn vortex_array::ArrayAdapter::nth_child(&self, idx: usize) -> core::option::Option -pub fn vortex_array::ArrayAdapter::slot(&self, idx: usize) -> core::option::Option +pub fn vortex_array::ArrayAdapter::slots(&self) -> &[core::option::Option] pub trait vortex_array::ArrayVisitorExt: vortex_array::DynArray @@ -22834,8 +22590,6 @@ pub fn vortex_array::DynArray::validity_mask(&self) -> vortex_error::VortexResul pub fn vortex_array::DynArray::vtable(&self) -> &dyn vortex_array::vtable::DynVTable -pub fn vortex_array::DynArray::with_children(&self, children: alloc::vec::Vec) -> vortex_error::VortexResult - impl vortex_array::DynArray for alloc::sync::Arc pub fn alloc::sync::Arc::all_invalid(&self) -> vortex_error::VortexResult @@ -22884,8 +22638,6 @@ pub fn alloc::sync::Arc::validity_mask(&self) -> vor pub fn alloc::sync::Arc::vtable(&self) -> &dyn vortex_array::vtable::DynVTable -pub fn alloc::sync::Arc::with_children(&self, children: alloc::vec::Vec) -> vortex_error::VortexResult - impl vortex_array::DynArray for vortex_array::ArrayAdapter pub fn vortex_array::ArrayAdapter::all_invalid(&self) -> vortex_error::VortexResult @@ -22934,8 +22686,6 @@ pub fn vortex_array::ArrayAdapter::validity_mask(&self) -> vortex_error::Vort pub fn vortex_array::ArrayAdapter::vtable(&self) -> &dyn vortex_array::vtable::DynVTable -pub fn vortex_array::ArrayAdapter::with_children(&self, children: alloc::vec::Vec) -> vortex_error::VortexResult - pub trait vortex_array::DynArrayEq: vortex_array::hash::private::SealedEq pub fn vortex_array::DynArrayEq::dyn_array_eq(&self, other: &dyn core::any::Any, precision: vortex_array::Precision) -> bool diff --git a/vortex-python/src/arrays/py/vtable.rs b/vortex-python/src/arrays/py/vtable.rs index d1539f81b1d..3e5f13631ea 100644 --- a/vortex-python/src/arrays/py/vtable.rs +++ b/vortex-python/src/arrays/py/vtable.rs @@ -147,6 +147,23 @@ impl VTable for PythonVTable { todo!() } + fn slots(_array: &PythonArray) -> &[Option] { + &[] + } + + fn slot_name(_array: &PythonArray, idx: usize) -> &str { + vortex_panic!("PythonArray has no slots, requested index {idx}") + } + + fn with_slots(_array: &mut PythonArray, slots: Vec>) -> VortexResult<()> { + vortex_ensure!( + slots.is_empty(), + "PythonArray has no slots, got {}", + slots.len() + ); + Ok(()) + } + fn execute(_array: &Self::Array, _ctx: &mut ExecutionCtx) -> VortexResult { todo!() }