From fbd5441a968b476df68839a68940a57211cf2074 Mon Sep 17 00:00:00 2001 From: Nicholas Gates Date: Fri, 3 Apr 2026 20:10:47 -0400 Subject: [PATCH 01/10] Remove with_slots from vtable Signed-off-by: Nicholas Gates --- encodings/alp/src/alp/array.rs | 44 +++---- encodings/alp/src/alp_rd/array.rs | 56 ++++---- encodings/bytebool/src/array.rs | 44 ++++--- encodings/datetime-parts/src/array.rs | 31 +++-- .../src/decimal_byte_parts/mod.rs | 31 +++-- .../fastlanes/src/bitpacking/vtable/mod.rs | 40 +++--- encodings/fastlanes/src/delta/vtable/mod.rs | 37 +++--- encodings/fastlanes/src/for/vtable/mod.rs | 37 +++--- encodings/fastlanes/src/rle/vtable/mod.rs | 37 +++--- encodings/fsst/src/array.rs | 55 ++++---- encodings/parquet-variant/src/vtable.rs | 38 +++--- encodings/pco/src/array.rs | 41 +++--- encodings/runend/src/array.rs | 37 +++--- encodings/sequence/src/array.rs | 32 +++-- encodings/sparse/src/lib.rs | 53 ++++---- encodings/zigzag/src/array.rs | 37 +++--- encodings/zstd/src/array.rs | 43 +++--- encodings/zstd/src/zstd_buffers.rs | 19 +-- vortex-array/src/array/erased.rs | 10 +- vortex-array/src/array/mod.rs | 64 +++++---- vortex-array/src/array/typed.rs | 35 ++++- vortex-array/src/array/view.rs | 13 +- vortex-array/src/array/vtable/dyn_.rs | 31 ++--- vortex-array/src/array/vtable/mod.rs | 35 +++-- vortex-array/src/arrays/bool/vtable/mod.rs | 26 ++-- vortex-array/src/arrays/chunked/array.rs | 50 +++---- vortex-array/src/arrays/chunked/tests.rs | 32 ----- vortex-array/src/arrays/chunked/vtable/mod.rs | 53 ++------ vortex-array/src/arrays/constant/array.rs | 7 +- .../src/arrays/constant/vtable/mod.rs | 29 ++-- vortex-array/src/arrays/decimal/vtable/mod.rs | 26 ++-- vortex-array/src/arrays/dict/execute.rs | 1 + vortex-array/src/arrays/dict/vtable/mod.rs | 22 ++-- .../src/arrays/extension/vtable/mod.rs | 22 ++-- vortex-array/src/arrays/filter/array.rs | 92 +++++++++---- vortex-array/src/arrays/filter/execute/mod.rs | 2 + vortex-array/src/arrays/filter/mod.rs | 1 + vortex-array/src/arrays/filter/rules.rs | 1 + vortex-array/src/arrays/filter/vtable.rs | 40 +++--- .../src/arrays/fixed_size_list/vtable/mod.rs | 28 ++-- vortex-array/src/arrays/list/vtable/mod.rs | 26 ++-- .../src/arrays/listview/vtable/mod.rs | 26 ++-- vortex-array/src/arrays/masked/array.rs | 120 ++++++++++------- .../src/arrays/masked/compute/filter.rs | 1 + .../src/arrays/masked/compute/mask.rs | 1 + .../src/arrays/masked/compute/slice.rs | 1 + .../src/arrays/masked/compute/take.rs | 1 + vortex-array/src/arrays/masked/execute.rs | 1 + vortex-array/src/arrays/masked/mod.rs | 1 + vortex-array/src/arrays/masked/vtable/mod.rs | 46 +++---- .../src/arrays/masked/vtable/operations.rs | 1 + .../src/arrays/masked/vtable/validity.rs | 3 +- vortex-array/src/arrays/null/mod.rs | 39 +++--- vortex-array/src/arrays/patched/vtable/mod.rs | 22 ++-- .../src/arrays/primitive/vtable/mod.rs | 27 ++-- .../src/arrays/scalar_fn/vtable/mod.rs | 16 +-- vortex-array/src/arrays/shared/array.rs | 124 +++++++++--------- vortex-array/src/arrays/shared/mod.rs | 1 + vortex-array/src/arrays/shared/tests.rs | 1 + vortex-array/src/arrays/shared/vtable.rs | 38 +++--- vortex-array/src/arrays/slice/array.rs | 91 ++++++++----- vortex-array/src/arrays/slice/mod.rs | 1 + vortex-array/src/arrays/slice/slice_.rs | 1 + vortex-array/src/arrays/slice/vtable.rs | 40 +++--- vortex-array/src/arrays/struct_/vtable/mod.rs | 20 +-- vortex-array/src/arrays/varbin/vtable/mod.rs | 26 ++-- .../src/arrays/varbinview/vtable/mod.rs | 26 ++-- vortex-array/src/arrays/variant/mod.rs | 71 +++++----- vortex-array/src/arrays/variant/vtable/mod.rs | 69 ++++------ .../src/arrays/variant/vtable/operations.rs | 1 + .../src/arrays/variant/vtable/validity.rs | 1 + vortex-array/src/canonical.rs | 1 + .../src/dynamic_dispatch/plan_builder.rs | 1 + vortex-cuda/src/kernel/arrays/shared.rs | 1 + vortex-cuda/src/kernel/encodings/for_.rs | 1 + vortex-cuda/src/kernel/filter/mod.rs | 5 +- vortex-cuda/src/kernel/slice/mod.rs | 6 +- vortex-python/src/arrays/py/vtable.rs | 29 ++-- 78 files changed, 1120 insertions(+), 1099 deletions(-) diff --git a/encodings/alp/src/alp/array.rs b/encodings/alp/src/alp/array.rs index feff33c6269..488e0b95abe 100644 --- a/encodings/alp/src/alp/array.rs +++ b/encodings/alp/src/alp/array.rs @@ -54,17 +54,31 @@ impl VTable for ALP { Self::ID } - fn validate(&self, data: &ALPData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &ALPData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { data.validate_against_outer(dtype, len) } - fn array_hash(array: &ALPData, state: &mut H, precision: Precision) { + fn array_hash( + array: ArrayView<'_, Self>, + state: &mut H, + precision: Precision, + ) { array.encoded().array_hash(state, precision); array.exponents.hash(state); array.patches().array_hash(state, precision); } - fn array_eq(array: &ALPData, other: &ALPData, precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool { array.encoded().array_eq(other.encoded(), precision) && array.exponents == other.exponents && array.patches().array_eq(&other.patches(), precision) @@ -138,32 +152,18 @@ impl VTable for ALP { ) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "ALPArray expects {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - - // If patch slots are being cleared, clear the metadata too - if slots[PATCH_INDICES_SLOT].is_none() || slots[PATCH_VALUES_SLOT].is_none() { - array.patch_offset = None; - array.patch_offset_within_chunk = None; - }; - - array.slots = slots; - Ok(()) - } - fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { let array = require_child!(array, array.encoded(), ENCODED_SLOT => Primitive); require_patches!( diff --git a/encodings/alp/src/alp_rd/array.rs b/encodings/alp/src/alp_rd/array.rs index b16470372bc..850f7ca82df 100644 --- a/encodings/alp/src/alp_rd/array.rs +++ b/encodings/alp/src/alp_rd/array.rs @@ -72,11 +72,21 @@ impl VTable for ALPRD { Self::ID } - fn validate(&self, data: &ALPRDData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &ALPRDData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { data.validate_against_outer(dtype, len) } - fn array_hash(array: &ALPRDData, state: &mut H, precision: Precision) { + fn array_hash( + array: ArrayView<'_, Self>, + state: &mut H, + precision: Precision, + ) { array.left_parts().array_hash(state, precision); array.left_parts_dictionary.array_hash(state, precision); array.right_parts().array_hash(state, precision); @@ -84,7 +94,11 @@ impl VTable for ALPRD { array.left_parts_patches.array_hash(state, precision); } - fn array_eq(array: &ALPRDData, other: &ALPRDData, precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool { array.left_parts().array_eq(other.left_parts(), precision) && array .left_parts_dictionary @@ -201,44 +215,18 @@ impl VTable for ALPRD { ) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "ALPRDArray expects {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - - // 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(()) - } - fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { let array = require_child!(array, array.left_parts(), 0 => Primitive); let array = require_child!(array, array.right_parts(), 1 => Primitive); diff --git a/encodings/bytebool/src/array.rs b/encodings/bytebool/src/array.rs index 44a10177999..4f2c38fc549 100644 --- a/encodings/bytebool/src/array.rs +++ b/encodings/bytebool/src/array.rs @@ -50,19 +50,36 @@ impl VTable for ByteBool { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { let validity = data.validity(); ByteBoolData::validate(data.buffer(), &validity, dtype, len) } - fn array_hash(array: &ByteBoolData, state: &mut H, precision: Precision) { + fn array_hash( + array: ArrayView<'_, Self>, + state: &mut H, + precision: Precision, + ) { array.buffer.array_hash(state, precision); - array.validity().array_hash(state, precision); + array.data().validity().array_hash(state, precision); } - fn array_eq(array: &ByteBoolData, other: &ByteBoolData, precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool { array.buffer.array_eq(&other.buffer, precision) - && array.validity().array_eq(&other.validity(), precision) + && array + .data() + .validity() + .array_eq(&other.data().validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -119,25 +136,18 @@ impl VTable for ByteBool { Ok(ByteBoolData::new(buffer, validity)) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "ByteBoolArray expects {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } - fn reduce_parent( array: ArrayView<'_, Self>, parent: &ArrayRef, diff --git a/encodings/datetime-parts/src/array.rs b/encodings/datetime-parts/src/array.rs index f59cec3dd11..dcec81bb6bd 100644 --- a/encodings/datetime-parts/src/array.rs +++ b/encodings/datetime-parts/src/array.rs @@ -79,12 +79,18 @@ impl VTable for DateTimeParts { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { DateTimePartsData::validate(dtype, data.days(), data.seconds(), data.subseconds(), len) } fn array_hash( - array: &DateTimePartsData, + array: ArrayView<'_, Self>, state: &mut H, precision: Precision, ) { @@ -94,8 +100,8 @@ impl VTable for DateTimeParts { } fn array_eq( - array: &DateTimePartsData, - other: &DateTimePartsData, + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, precision: Precision, ) -> bool { array.days().array_eq(other.days(), precision) @@ -162,25 +168,18 @@ impl VTable for DateTimeParts { DateTimePartsData::try_new(dtype.clone(), days, seconds, subseconds) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "DateTimePartsArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } - fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::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 6623e554f36..0091378c6a8 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs @@ -63,7 +63,13 @@ impl VTable for DecimalByteParts { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { let Some(decimal_dtype) = dtype.as_decimal_opt() else { vortex_bail!("expected decimal dtype, got {}", dtype) }; @@ -71,7 +77,7 @@ impl VTable for DecimalByteParts { } fn array_hash( - array: &DecimalBytePartsData, + array: ArrayView<'_, Self>, state: &mut H, precision: Precision, ) { @@ -79,8 +85,8 @@ impl VTable for DecimalByteParts { } fn array_eq( - array: &DecimalBytePartsData, - other: &DecimalBytePartsData, + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, precision: Precision, ) -> bool { array.msp().array_eq(other.msp(), precision) @@ -134,25 +140,18 @@ impl VTable for DecimalByteParts { DecimalBytePartsData::try_new(msp, *decimal_dtype) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "DecimalBytePartsArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } - fn reduce_parent( array: ArrayView<'_, Self>, parent: &ArrayRef, diff --git a/encodings/fastlanes/src/bitpacking/vtable/mod.rs b/encodings/fastlanes/src/bitpacking/vtable/mod.rs index 29741c89623..7281cb95e8b 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/mod.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/mod.rs @@ -77,12 +77,18 @@ impl VTable for BitPacked { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { data.validate_against_outer(dtype, len) } fn array_hash( - array: &BitPackedData, + array: ArrayView<'_, Self>, state: &mut H, precision: Precision, ) { @@ -121,7 +127,11 @@ impl VTable for BitPacked { array.patch_offset_within_chunk.hash(state); } - fn array_eq(array: &BitPackedData, other: &BitPackedData, precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool { array.offset == other.offset && array.bit_width == other.bit_width && array.packed.array_eq(&other.packed, precision) @@ -175,32 +185,18 @@ impl VTable for BitPacked { RULES.evaluate(array, parent, child_idx) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "BitPackedArray expects {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - - // If patch slots are being cleared, clear the metadata too - if slots[PATCH_INDICES_SLOT].is_none() || slots[PATCH_VALUES_SLOT].is_none() { - array.patch_offset = None; - array.patch_offset_within_chunk = None; - } - - array.slots = slots; - Ok(()) - } - fn serialize(array: ArrayView<'_, Self>) -> VortexResult>> { Ok(Some( BitPackedMetadata { diff --git a/encodings/fastlanes/src/delta/vtable/mod.rs b/encodings/fastlanes/src/delta/vtable/mod.rs index 746221a5b1e..bc4d1d103ba 100644 --- a/encodings/fastlanes/src/delta/vtable/mod.rs +++ b/encodings/fastlanes/src/delta/vtable/mod.rs @@ -61,17 +61,31 @@ impl VTable for Delta { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { data.validate(dtype, len) } - fn array_hash(array: &DeltaData, state: &mut H, precision: Precision) { + fn array_hash( + array: ArrayView<'_, Self>, + state: &mut H, + precision: Precision, + ) { array.offset().hash(state); array.bases().array_hash(state, precision); array.deltas().array_hash(state, precision); } - fn array_eq(array: &DeltaData, other: &DeltaData, precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool { array.offset() == other.offset() && array.bases().array_eq(other.bases(), precision) && array.deltas().array_eq(other.deltas(), precision) @@ -97,25 +111,18 @@ impl VTable for Delta { rules::RULES.evaluate(array, parent, child_idx) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "DeltaArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } - fn serialize(array: ArrayView<'_, Self>) -> VortexResult>> { Ok(Some( DeltaMetadata { diff --git a/encodings/fastlanes/src/for/vtable/mod.rs b/encodings/fastlanes/src/for/vtable/mod.rs index 157645c410f..7732ef5266b 100644 --- a/encodings/fastlanes/src/for/vtable/mod.rs +++ b/encodings/fastlanes/src/for/vtable/mod.rs @@ -55,16 +55,30 @@ impl VTable for FoR { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { data.validate(dtype, len) } - fn array_hash(array: &FoRData, state: &mut H, precision: Precision) { + fn array_hash( + array: ArrayView<'_, Self>, + state: &mut H, + precision: Precision, + ) { array.encoded().array_hash(state, precision); array.reference_scalar().hash(state); } - fn array_eq(array: &FoRData, other: &FoRData, precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool { array.encoded().array_eq(other.encoded(), precision) && array.reference_scalar() == other.reference_scalar() } @@ -81,25 +95,18 @@ impl VTable for FoR { None } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "FoRArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } - fn serialize(array: ArrayView<'_, Self>) -> VortexResult>> { // Note that we **only** serialize the optional scalar value (not including the dtype). Ok(Some(ScalarValue::to_proto_bytes( diff --git a/encodings/fastlanes/src/rle/vtable/mod.rs b/encodings/fastlanes/src/rle/vtable/mod.rs index 776fa1b84ad..551226682cb 100644 --- a/encodings/fastlanes/src/rle/vtable/mod.rs +++ b/encodings/fastlanes/src/rle/vtable/mod.rs @@ -65,18 +65,32 @@ impl VTable for RLE { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { data.validate_against_outer(dtype, len) } - fn array_hash(array: &RLEData, state: &mut H, precision: Precision) { + fn array_hash( + array: ArrayView<'_, Self>, + state: &mut H, + precision: Precision, + ) { array.values().array_hash(state, precision); array.indices().array_hash(state, precision); array.values_idx_offsets().array_hash(state, precision); array.offset().hash(state); } - fn array_eq(array: &RLEData, other: &RLEData, precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool { array.values().array_eq(other.values(), precision) && array.indices().array_eq(other.indices(), precision) && array @@ -105,25 +119,18 @@ impl VTable for RLE { RULES.evaluate(array, parent, child_idx) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { crate::rle::array::SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, 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(()) - } - fn serialize(array: ArrayView<'_, Self>) -> VortexResult>> { Ok(Some( RLEMetadata { diff --git a/encodings/fsst/src/array.rs b/encodings/fsst/src/array.rs index 417ea7b420e..d6b36a470ed 100644 --- a/encodings/fsst/src/array.rs +++ b/encodings/fsst/src/array.rs @@ -79,11 +79,21 @@ impl VTable for FSST { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { data.validate(dtype, len) } - fn array_hash(array: &FSSTData, state: &mut H, precision: Precision) { + fn array_hash( + array: ArrayView<'_, Self>, + state: &mut H, + precision: Precision, + ) { array.symbols.array_hash(state, precision); array.symbol_lengths.array_hash(state, precision); array @@ -94,7 +104,11 @@ impl VTable for FSST { array.uncompressed_lengths().array_hash(state, precision); } - fn array_eq(array: &FSSTData, other: &FSSTData, precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool { array.symbols.array_eq(&other.symbols, precision) && array .symbol_lengths @@ -228,43 +242,18 @@ impl VTable for FSST { ); } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "FSSTArray expects {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - - // Rebuild the codes VarBinArray from the slots - let codes_offsets = slots[CODES_OFFSETS_SLOT] - .clone() - .vortex_expect("FSSTArray requires codes_offsets slot"); - let codes_validity = match &slots[CODES_VALIDITY_SLOT] { - Some(v) => Validity::Array(v.clone()), - None => Validity::from(array.codes.dtype().nullability()), - }; - let codes = VarBinArray::try_new( - codes_offsets, - array.codes.bytes().clone(), - array.codes.dtype().clone(), - codes_validity, - )?; - array.codes = codes; - array.codes_array = array.codes.clone().into_array(); - array.slots = slots; - - Ok(()) - } - fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { canonicalize_fsst(array.as_view(), ctx).map(ExecutionResult::done) } diff --git a/encodings/parquet-variant/src/vtable.rs b/encodings/parquet-variant/src/vtable.rs index 370a5cfbda0..1499b4653e2 100644 --- a/encodings/parquet-variant/src/vtable.rs +++ b/encodings/parquet-variant/src/vtable.rs @@ -67,12 +67,18 @@ impl VTable for ParquetVariant { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { data.validate(dtype, len) } - fn array_hash(array: &ParquetVariantData, state: &mut H, precision: Precision) { - array.validity().array_hash(state, precision); + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { + array.data().validity().array_hash(state, precision); array.metadata_array().array_hash(state, precision); // Hash discriminators so that (value=Some, typed_value=None) and // (value=None, typed_value=Some) produce different hashes. @@ -87,11 +93,14 @@ impl VTable for ParquetVariant { } fn array_eq( - array: &ParquetVariantData, - other: &ParquetVariantData, + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, precision: Precision, ) -> bool { - if !array.validity().array_eq(&other.validity(), precision) + if !array + .data() + .validity() + .array_eq(&other.data().validity(), precision) || !array .metadata_array() .array_eq(other.metadata_array(), precision) @@ -126,8 +135,12 @@ impl VTable for ParquetVariant { None } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { @@ -216,17 +229,6 @@ impl VTable for ParquetVariant { ParquetVariantData::try_new(validity, variant_metadata, value, typed_value) } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "ParquetVariantArray expects {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } - fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done( VariantArray::new(array.as_ref().clone().into_array()).into_array(), diff --git a/encodings/pco/src/array.rs b/encodings/pco/src/array.rs index f1e352542d3..811de5fbe27 100644 --- a/encodings/pco/src/array.rs +++ b/encodings/pco/src/array.rs @@ -90,11 +90,21 @@ impl VTable for Pco { Self::ID } - fn validate(&self, data: &PcoData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &PcoData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { data.validate(dtype, len) } - fn array_hash(array: &PcoData, state: &mut H, precision: Precision) { + fn array_hash( + array: ArrayView<'_, Self>, + state: &mut H, + precision: Precision, + ) { array.unsliced_validity.array_hash(state, precision); array.unsliced_n_rows.hash(state); array.slice_start.hash(state); @@ -108,7 +118,11 @@ impl VTable for Pco { } } - fn array_eq(array: &PcoData, other: &PcoData, precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool { if !array .unsliced_validity .array_eq(&other.unsliced_validity, precision) @@ -204,29 +218,18 @@ impl VTable for Pco { )) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - 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.unsliced_validity.nullability()), - }; - array.slots = slots; - Ok(()) - } - fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array.decompress(ctx)?.into_array())) } diff --git a/encodings/runend/src/array.rs b/encodings/runend/src/array.rs index a9fe74e7d36..5c48fe47fa2 100644 --- a/encodings/runend/src/array.rs +++ b/encodings/runend/src/array.rs @@ -66,7 +66,13 @@ impl VTable for RunEnd { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { RunEndData::validate(data.ends(), data.values(), data.offset, len)?; vortex_ensure!( data.values().dtype() == dtype, @@ -77,13 +83,21 @@ impl VTable for RunEnd { Ok(()) } - fn array_hash(array: &RunEndData, state: &mut H, precision: Precision) { + fn array_hash( + array: ArrayView<'_, Self>, + state: &mut H, + precision: Precision, + ) { array.ends().array_hash(state, precision); array.values().array_hash(state, precision); array.offset.hash(state); } - fn array_eq(array: &RunEndData, other: &RunEndData, precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool { array.ends().array_eq(other.ends(), precision) && array.values().array_eq(other.values(), precision) && array.offset == other.offset @@ -137,25 +151,18 @@ impl VTable for RunEnd { ) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "RunEndArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } - fn reduce_parent( array: ArrayView<'_, Self>, parent: &ArrayRef, diff --git a/encodings/sequence/src/array.rs b/encodings/sequence/src/array.rs index a3d50a420e1..a7b40a1942b 100644 --- a/encodings/sequence/src/array.rs +++ b/encodings/sequence/src/array.rs @@ -215,12 +215,18 @@ impl VTable for Sequence { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { SequenceData::validate(data.base, data.multiplier, dtype, len) } fn array_hash( - array: &SequenceData, + array: ArrayView<'_, Self>, state: &mut H, _precision: Precision, ) { @@ -228,7 +234,11 @@ impl VTable for Sequence { array.multiplier.hash(state); } - fn array_eq(array: &SequenceData, other: &SequenceData, _precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + _precision: Precision, + ) -> bool { array.base == other.base && array.multiplier == other.multiplier } @@ -304,24 +314,18 @@ impl VTable for Sequence { SequenceData::try_new(base, multiplier, ptype, dtype.nullability(), len) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.is_empty(), - "SequenceArray expects 0 slots, got {}", - slots.len() - ); - array.slots = slots; - Ok(()) - } - fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { sequence_decompress(&array).map(ExecutionResult::done) } diff --git a/encodings/sparse/src/lib.rs b/encodings/sparse/src/lib.rs index fc9613a369d..d79bc4931ae 100644 --- a/encodings/sparse/src/lib.rs +++ b/encodings/sparse/src/lib.rs @@ -74,16 +74,30 @@ impl VTable for Sparse { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { SparseData::validate(data.patches(), data.fill_scalar(), dtype, len) } - fn array_hash(array: &SparseData, state: &mut H, precision: Precision) { + fn array_hash( + array: ArrayView<'_, Self>, + state: &mut H, + precision: Precision, + ) { array.patches.array_hash(state, precision); array.fill_value.hash(state); } - fn array_eq(array: &SparseData, other: &SparseData, precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool { array.patches.array_eq(&other.patches, precision) && array.fill_value == other.fill_value } @@ -164,41 +178,18 @@ impl VTable for Sparse { ) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "SparseArray expects {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - - // 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(), - indices, - values, - slots[PATCH_CHUNK_OFFSETS_SLOT].clone(), - )?; - array.slots = slots; - Ok(()) - } - fn reduce_parent( array: ArrayView<'_, Self>, parent: &ArrayRef, diff --git a/encodings/zigzag/src/array.rs b/encodings/zigzag/src/array.rs index 896afd67fb3..3a78f962090 100644 --- a/encodings/zigzag/src/array.rs +++ b/encodings/zigzag/src/array.rs @@ -48,7 +48,13 @@ impl VTable for ZigZag { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { let expected_dtype = ZigZagData::dtype_from_encoded_dtype(data.encoded().dtype())?; vortex_ensure!( dtype == &expected_dtype, @@ -62,11 +68,19 @@ impl VTable for ZigZag { Ok(()) } - fn array_hash(array: &ZigZagData, state: &mut H, precision: Precision) { + fn array_hash( + array: ArrayView<'_, Self>, + state: &mut H, + precision: Precision, + ) { array.encoded().array_hash(state, precision); } - fn array_eq(array: &ZigZagData, other: &ZigZagData, precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool { array.encoded().array_eq(other.encoded(), precision) } @@ -112,25 +126,18 @@ impl VTable for ZigZag { ZigZagData::try_new(encoded) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "ZigZagArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } - fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done( zigzag_decode(array.encoded().clone().execute(ctx)?).into_array(), diff --git a/encodings/zstd/src/array.rs b/encodings/zstd/src/array.rs index 48e25ec1512..d5ba18a3495 100644 --- a/encodings/zstd/src/array.rs +++ b/encodings/zstd/src/array.rs @@ -91,11 +91,21 @@ impl VTable for Zstd { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { data.validate(dtype, len) } - fn array_hash(array: &ZstdData, state: &mut H, precision: Precision) { + fn array_hash( + array: ArrayView<'_, Self>, + state: &mut H, + precision: Precision, + ) { match &array.dictionary { Some(dict) => { true.hash(state); @@ -114,7 +124,11 @@ impl VTable for Zstd { array.slice_stop.hash(state); } - fn array_eq(array: &ZstdData, other: &ZstdData, precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool { if !match (&array.dictionary, &other.dictionary) { (Some(d1), Some(d2)) => d1.array_eq(d2, precision), (None, None) => true, @@ -217,31 +231,18 @@ impl VTable for Zstd { )) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - 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.unsliced_validity.nullability()), - }; - - array.slots = slots; - Ok(()) - } - fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { Zstd::decompress(&array, ctx)? .execute::(ctx) diff --git a/encodings/zstd/src/zstd_buffers.rs b/encodings/zstd/src/zstd_buffers.rs index 1e74a69a9a0..408e3ec871f 100644 --- a/encodings/zstd/src/zstd_buffers.rs +++ b/encodings/zstd/src/zstd_buffers.rs @@ -358,7 +358,7 @@ impl VTable for ZstdBuffers { } fn array_hash( - array: &ZstdBuffersData, + array: ArrayView<'_, Self>, state: &mut H, precision: Precision, ) { @@ -374,7 +374,11 @@ impl VTable for ZstdBuffers { } } - fn array_eq(array: &ZstdBuffersData, other: &ZstdBuffersData, precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool { array.inner_encoding_id == other.inner_encoding_id && array.inner_metadata == other.inner_metadata && array.compressed_buffers.len() == other.compressed_buffers.len() @@ -406,19 +410,18 @@ impl VTable for ZstdBuffers { Some(format!("compressed_{idx}")) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { format!("child_{idx}") } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - array.slots = slots; - Ok(()) - } - fn serialize(array: ArrayView<'_, Self>) -> VortexResult>> { Ok(Some( ZstdBuffersMetadata { diff --git a/vortex-array/src/array/erased.rs b/vortex-array/src/array/erased.rs index bdb67697c3a..f34dda91e03 100644 --- a/vortex-array/src/array/erased.rs +++ b/vortex-array/src/array/erased.rs @@ -107,13 +107,13 @@ impl Debug for ArrayRef { impl ArrayHash for ArrayRef { fn array_hash(&self, state: &mut H, precision: crate::Precision) { - self.0.dyn_array_hash(state as &mut dyn Hasher, precision); + self.0.dyn_array_hash(self, state as &mut dyn Hasher, precision); } } impl ArrayEq for ArrayRef { fn array_eq(&self, other: &Self, precision: crate::Precision) -> bool { - self.0.dyn_array_eq(other.0.as_any(), precision) + self.0.dyn_array_eq(self, other, precision) } } @@ -350,7 +350,7 @@ impl ArrayRef { /// Returns a reference to the typed `ArrayInner` if this array matches the given vtable type. pub fn as_typed(&self) -> Option> { let inner = self.0.as_any().downcast_ref::>()?; - Some(unsafe { ArrayView::new_unchecked(self, &inner.data) }) + Some(unsafe { ArrayView::new_unchecked(self, &inner.data, &inner.slots) }) } /// Returns the constant scalar if this is a constant array. @@ -516,7 +516,7 @@ impl Matcher for V { } fn try_match<'a>(array: &'a ArrayRef) -> Option> { - let data = &array.0.as_any().downcast_ref::>()?.data; - Some(unsafe { ArrayView::new_unchecked(array, data) }) + let inner = array.0.as_any().downcast_ref::>()?; + Some(unsafe { ArrayView::new_unchecked(array, &inner.data, &inner.slots) }) } } diff --git a/vortex-array/src/array/mod.rs b/vortex-array/src/array/mod.rs index 0dbf065e6a1..9534255aebf 100644 --- a/vortex-array/src/array/mod.rs +++ b/vortex-array/src/array/mod.rs @@ -126,10 +126,10 @@ pub(crate) trait DynArray: 'static + private::Sealed + Send + Sync + Debug { fn metadata_fmt(&self, this: &ArrayRef, f: &mut Formatter<'_>) -> std::fmt::Result; /// Hashes the array contents including len, dtype, and encoding id. - fn dyn_array_hash(&self, state: &mut dyn Hasher, precision: crate::Precision); + fn dyn_array_hash(&self, this: &ArrayRef, state: &mut dyn Hasher, precision: crate::Precision); /// Compares two arrays of the same concrete type for equality. - fn dyn_array_eq(&self, other: &dyn Any, precision: crate::Precision) -> bool; + fn dyn_array_eq(&self, this: &ArrayRef, other: &ArrayRef, precision: crate::Precision) -> bool; } /// Trait for converting a type into a Vortex [`ArrayRef`]. @@ -175,7 +175,7 @@ impl DynArray for ArrayInner { } fn scalar_at(&self, this: &ArrayRef, index: usize) -> VortexResult { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; >::scalar_at( view, index, @@ -185,7 +185,7 @@ impl DynArray for ArrayInner { fn validity(&self, this: &ArrayRef) -> VortexResult { if self.dtype.is_nullable() { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; let validity = >::validity(view)?; if let Validity::Array(array) = &validity { vortex_ensure!(array.len() == self.len, "Validity array length mismatch"); @@ -216,7 +216,7 @@ impl DynArray for ArrayInner { } let len = builder.len(); - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; V::append_to_builder(view, builder, ctx)?; assert_eq!( @@ -233,99 +233,105 @@ impl DynArray for ArrayInner { } fn children(&self, this: &ArrayRef) -> Vec { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; (0..V::nchildren(view)).map(|i| V::child(view, i)).collect() } fn nchildren(&self, this: &ArrayRef) -> usize { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; V::nchildren(view) } fn nth_child(&self, this: &ArrayRef, idx: usize) -> Option { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; (idx < V::nchildren(view)).then(|| V::child(view, idx)) } fn children_names(&self, this: &ArrayRef) -> Vec { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; (0..V::nchildren(view)) .map(|i| V::child_name(view, i)) .collect() } fn named_children(&self, this: &ArrayRef) -> Vec<(String, ArrayRef)> { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; (0..V::nchildren(view)) .map(|i| (V::child_name(view, i), V::child(view, i))) .collect() } - fn slots(&self, this: &ArrayRef) -> Vec> { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; - V::slots(view).to_vec() + fn slots(&self, _this: &ArrayRef) -> Vec> { + self.slots.clone() } fn slot_name(&self, this: &ArrayRef, idx: usize) -> String { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; V::slot_name(view, idx) } fn buffers(&self, this: &ArrayRef) -> Vec { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; (0..V::nbuffers(view)) .map(|i| V::buffer(view, i).to_host_sync()) .collect() } fn buffer_handles(&self, this: &ArrayRef) -> Vec { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; (0..V::nbuffers(view)).map(|i| V::buffer(view, i)).collect() } fn buffer_names(&self, this: &ArrayRef) -> Vec { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; (0..V::nbuffers(view)) .filter_map(|i| V::buffer_name(view, i)) .collect() } fn named_buffers(&self, this: &ArrayRef) -> Vec<(String, BufferHandle)> { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; (0..V::nbuffers(view)) .filter_map(|i| V::buffer_name(view, i).map(|name| (name, V::buffer(view, i)))) .collect() } fn nbuffers(&self, this: &ArrayRef) -> usize { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; V::nbuffers(view) } fn metadata(&self, this: &ArrayRef) -> VortexResult>> { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; V::serialize(view) } fn metadata_fmt(&self, this: &ArrayRef, f: &mut Formatter<'_>) -> std::fmt::Result { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; V::fmt_metadata(view, f) } - fn dyn_array_hash(&self, state: &mut dyn Hasher, precision: crate::Precision) { + fn dyn_array_hash(&self, this: &ArrayRef, state: &mut dyn Hasher, precision: crate::Precision) { let mut wrapper = HasherWrapper(state); self.len.hash(&mut wrapper); self.dtype.hash(&mut wrapper); self.vtable.id().hash(&mut wrapper); - V::array_hash(&self.data, &mut wrapper, precision); + let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + V::array_hash(view, &mut wrapper, precision); } - fn dyn_array_eq(&self, other: &dyn Any, precision: crate::Precision) -> bool { - other.downcast_ref::().is_some_and(|other| { - self.len == other.len - && self.dtype == other.dtype - && self.vtable.id() == other.vtable.id() - && V::array_eq(&self.data, &other.data, precision) + fn dyn_array_eq(&self, this: &ArrayRef, other: &ArrayRef, precision: crate::Precision) -> bool { + other.inner().as_any().downcast_ref::().is_some_and(|other_inner| { + self.len == other.len() + && self.dtype == *other.dtype() + && self.vtable.id() == other.encoding_id() + && { + let this = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let other = unsafe { + ArrayView::new_unchecked(other, &other_inner.data, &other_inner.slots) + }; + V::array_eq(this, other, precision) + } }) } } diff --git a/vortex-array/src/array/typed.rs b/vortex-array/src/array/typed.rs index 93e764e7d3a..dfb3dfdca08 100644 --- a/vortex-array/src/array/typed.rs +++ b/vortex-array/src/array/typed.rs @@ -31,6 +31,7 @@ pub struct ArrayParts { pub dtype: DType, pub len: usize, pub data: V::ArrayData, + pub slots: Vec>, } impl ArrayParts { @@ -40,8 +41,15 @@ impl ArrayParts { dtype, len, data, + slots: Vec::new(), } } + + pub fn with_slots(mut self, slots: Vec>) -> Self { + self.slots = slots; + self + } + } // ============================================================================= // ArrayInner — the concrete type stored inside Arc @@ -58,20 +66,25 @@ pub(crate) struct ArrayInner { pub(crate) dtype: DType, pub(crate) len: usize, pub(crate) data: V::ArrayData, + pub(crate) slots: Vec>, pub(crate) stats: ArrayStats, } impl ArrayInner { /// Create a new inner array from explicit construction parameters. #[doc(hidden)] - pub fn try_new(new: ArrayParts) -> VortexResult { - new.vtable.validate(&new.data, &new.dtype, new.len)?; + pub fn try_new(mut new: ArrayParts) -> VortexResult { + if new.slots.is_empty() { + new.slots = V::infer_slots(&new.data); + } + new.vtable.validate(&new.data, &new.dtype, new.len, &new.slots)?; Ok(unsafe { Self::from_data_unchecked( new.vtable, new.dtype, new.len, new.data, + new.slots, ArrayStats::default(), ) }) @@ -86,6 +99,7 @@ impl ArrayInner { dtype: DType, len: usize, data: V::ArrayData, + slots: Vec>, stats: ArrayStats, ) -> Self { Self { @@ -93,6 +107,7 @@ impl ArrayInner { dtype, len, data, + slots, stats, } } @@ -118,6 +133,7 @@ impl Clone for ArrayInner { dtype: self.dtype.clone(), len: self.len, data: self.data.clone(), + slots: self.slots.clone(), stats: self.stats.clone(), } } @@ -130,6 +146,7 @@ impl Debug for ArrayInner { .field("dtype", &self.dtype) .field("len", &self.len) .field("inner", &self.data) + .field("slots", &self.slots) .finish() } } @@ -179,12 +196,18 @@ impl Array { /// Caller must ensure the provided parts are logically consistent. #[doc(hidden)] pub unsafe fn from_parts_unchecked(new: ArrayParts) -> Self { + let slots = if new.slots.is_empty() { + V::infer_slots(&new.data) + } else { + new.slots + }; let inner = ArrayRef::from_inner(Arc::new(unsafe { ArrayInner::::from_data_unchecked( new.vtable, new.dtype, new.len, new.data, + slots, ArrayStats::default(), ) })); @@ -256,6 +279,7 @@ impl Array { dtype: inner.dtype.clone(), len: inner.len, data: inner.data.clone(), + slots: inner.slots.clone(), } } @@ -269,6 +293,11 @@ impl Array { self.downcast_inner().data.clone() } + /// Returns the array slots. + pub fn slots(&self) -> &[Option] { + &self.downcast_inner().slots + } + /// Returns the internal [`ArrayRef`]. #[inline(always)] pub fn as_array(&self) -> &ArrayRef { @@ -279,7 +308,7 @@ impl Array { pub fn as_view(&self) -> ArrayView<'_, V> { let inner = self.downcast_inner(); // SAFETY: `inner.data` is the `V::ArrayData` stored inside `self.inner`. - unsafe { ArrayView::new_unchecked(&self.inner, &inner.data) } + unsafe { ArrayView::new_unchecked(&self.inner, &inner.data, &inner.slots) } } /// Downcast the inner `ArrayRef` to `&ArrayInner`. diff --git a/vortex-array/src/array/view.rs b/vortex-array/src/array/view.rs index 7a2027591d9..ccb39a47ed6 100644 --- a/vortex-array/src/array/view.rs +++ b/vortex-array/src/array/view.rs @@ -19,6 +19,7 @@ use crate::validity::Validity; pub struct ArrayView<'a, V: VTable> { array: &'a ArrayRef, data: &'a V::ArrayData, + slots: &'a [Option], } impl Copy for ArrayView<'_, V> {} @@ -32,9 +33,13 @@ impl Clone for ArrayView<'_, V> { impl<'a, V: VTable> ArrayView<'a, V> { /// # Safety /// Caller must ensure `data` is the `V::ArrayData` stored inside `array`. - pub(crate) unsafe fn new_unchecked(array: &'a ArrayRef, data: &'a V::ArrayData) -> Self { + pub(crate) unsafe fn new_unchecked( + array: &'a ArrayRef, + data: &'a V::ArrayData, + slots: &'a [Option], + ) -> Self { debug_assert!(array.is::()); - Self { array, data } + Self { array, data, slots } } pub fn array(&self) -> &'a ArrayRef { @@ -45,6 +50,10 @@ impl<'a, V: VTable> ArrayView<'a, V> { self.data } + pub fn slots(&self) -> &'a [Option] { + self.slots + } + pub fn dtype(&self) -> &DType { self.array.dtype() } diff --git a/vortex-array/src/array/vtable/dyn_.rs b/vortex-array/src/array/vtable/dyn_.rs index 681267403e2..3118b862fd2 100644 --- a/vortex-array/src/array/vtable/dyn_.rs +++ b/vortex-array/src/array/vtable/dyn_.rs @@ -22,6 +22,7 @@ use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::executor::ExecutionCtx; use crate::serde::ArrayChildren; + /// Reference-counted DynVTable pub type DynVTableRef = Arc; @@ -41,7 +42,8 @@ pub trait DynVTable: 'static + Send + Sync + Debug { children: &dyn ArrayChildren, session: &VortexSession, ) -> VortexResult; - /// See [`VTable::with_slots`] + + /// Rebuilds the array with the provided outer slots. fn with_slots(&self, array: ArrayRef, slots: Vec>) -> VortexResult; /// See [`VTable::reduce`] @@ -84,29 +86,22 @@ impl DynVTable for V { session: &VortexSession, ) -> VortexResult { let inner = self.deserialize(dtype, len, metadata, buffers, children, session)?; - Ok( - Array::::try_from_parts(ArrayParts::new(self.clone(), dtype.clone(), len, inner))? - .into_array(), - ) + Ok(Array::::try_from_parts(ArrayParts::new(self.clone(), dtype.clone(), len, inner))? + .into_array()) } fn with_slots(&self, array: ArrayRef, slots: Vec>) -> VortexResult { let typed = array .as_opt::() .vortex_expect("Failed to downcast array"); - let mut data = typed.data().clone(); - V::with_slots(&mut data, slots)?; + let data = typed.data().clone(); let stats = array.statistics().to_owned(); - Ok(unsafe { - Array::::from_parts_unchecked(ArrayParts::new( - self.clone(), - array.dtype().clone(), - array.len(), - data, - )) - .with_stats_set(stats) - .into_array() - }) + Ok(Array::::try_from_parts( + ArrayParts::new(self.clone(), array.dtype().clone(), array.len(), data) + .with_slots(slots), + )? + .with_stats_set(stats) + .into_array()) } fn reduce(&self, array: &ArrayRef) -> VortexResult> { @@ -155,7 +150,6 @@ impl DynVTable for V { } fn execute(&self, array: ArrayRef, ctx: &mut ExecutionCtx) -> VortexResult { - // Capture metadata before the move for post-validation and stats inheritance. let len = array.len(); let dtype = array.dtype().clone(); let stats = array.statistics().to_owned(); @@ -179,7 +173,6 @@ impl DynVTable for V { ); } - // TODO(ngates): do we want to do this on every execution? We used to in to_canonical. result.array().statistics().set_iter(stats.into_iter()); } diff --git a/vortex-array/src/array/vtable/mod.rs b/vortex-array/src/array/vtable/mod.rs index 305cbef6ca2..0853b64f16d 100644 --- a/vortex-array/src/array/vtable/mod.rs +++ b/vortex-array/src/array/vtable/mod.rs @@ -61,13 +61,29 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { fn id(&self) -> ArrayId; /// Validates that externally supplied logical metadata matches the array data. - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()>; + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()>; + + /// Temporary migration hook for encodings that still store slot state inside `ArrayData`. + fn infer_slots(data: &Self::ArrayData) -> Vec> { + _ = data; + Vec::new() + } /// Hashes the array contents. - fn array_hash(array: &Self::ArrayData, state: &mut H, precision: Precision); + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision); /// Compares two arrays of the same type for equality. - fn array_eq(array: &Self::ArrayData, other: &Self::ArrayData, precision: Precision) -> bool; + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + precision: Precision, + ) -> bool; /// Returns the number of buffers in the array. fn nbuffers(array: ArrayView<'_, Self>) -> usize; @@ -170,9 +186,10 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { /// moved out of an `ArrayData` into the concrete `Array` type during deserialization /// without copying. /// - /// TODO: once no encodings rely on side-effects in [`Self::with_slots`], replace the - /// `slots`/`with_slots` pair with a single `slots_mut` returning `&mut [Option]`. - fn slots<'a>(array: ArrayView<'a, Self>) -> &'a [Option]; + /// TODO: once no encodings rely on `infer_slots`, replace it with direct outer storage only. + fn slots<'a>(array: ArrayView<'a, Self>) -> &'a [Option] { + array.slots() + } /// Returns the name of the slot at the given index. /// @@ -180,12 +197,6 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { /// Panics if `idx >= slots(array).len()`. fn slot_name(array: ArrayView<'_, Self>, idx: usize) -> String; - /// Replaces the slots in `array` with the given `slots` vec. - /// - /// Some encodings use this to perform side-effects (e.g. cache invalidation) when - /// slots change. Once those are removed, this will be replaced by `slots_mut`. - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()>; - /// Execute this array by returning an [`ExecutionResult`]. /// /// Instead of recursively executing children, implementations should return diff --git a/vortex-array/src/arrays/bool/vtable/mod.rs b/vortex-array/src/arrays/bool/vtable/mod.rs index c2a5c25ca8c..37cada50511 100644 --- a/vortex-array/src/arrays/bool/vtable/mod.rs +++ b/vortex-array/src/arrays/bool/vtable/mod.rs @@ -56,16 +56,16 @@ impl VTable for Bool { Self::ID } - fn array_hash(array: &BoolData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.to_bit_buffer().array_hash(state, precision); - array.validity().array_hash(state, precision); + array.data().validity().array_hash(state, precision); } - fn array_eq(array: &BoolData, other: &BoolData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array .to_bit_buffer() .array_eq(&other.to_bit_buffer(), precision) - && array.validity().array_eq(&other.validity(), precision) + && array.data().validity().array_eq(&other.data().validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -100,7 +100,7 @@ impl VTable for Bool { write!(f, "BoolMetadata {{ offset: {} }}", array.offset) } - fn validate(&self, data: &BoolData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate(&self, data: &BoolData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { vortex_ensure!( data.len() == len, "BoolArray length {} does not match outer length {}", @@ -148,24 +148,18 @@ impl VTable for Bool { BoolData::try_new_from_handle(buffer, metadata.offset as usize, len, validity) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "BoolArray expects {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) diff --git a/vortex-array/src/arrays/chunked/array.rs b/vortex-array/src/arrays/chunked/array.rs index 33b471e1852..719cd19a2f9 100644 --- a/vortex-array/src/arrays/chunked/array.rs +++ b/vortex-array/src/arrays/chunked/array.rs @@ -34,7 +34,6 @@ pub(super) const CHUNKS_OFFSET: usize = 1; #[derive(Clone, Debug)] pub struct ChunkedData { - pub(super) empty_dtype: Option, pub(super) chunk_offsets: PrimitiveData, pub(super) chunks: Vec, pub(super) slots: Vec>, @@ -106,7 +105,6 @@ impl ChunkedData { let slots = Self::make_slots(&chunk_offsets, &chunks); Self { - empty_dtype: chunks.is_empty().then_some(dtype), chunk_offsets, chunks, slots, @@ -135,15 +133,6 @@ impl ChunkedData { .vortex_expect("chunk offset must fit in usize") } - /// Returns the [`DType`] of this array. - pub fn dtype(&self) -> &DType { - self.chunks - .first() - .map(|chunk| chunk.dtype()) - .or(self.empty_dtype.as_ref()) - .vortex_expect("ChunkedArray dtype must come from chunks or the empty dtype") - } - /// Returns `true` if this array is empty. pub fn is_empty(&self) -> bool { self.len() == 0 @@ -201,21 +190,26 @@ impl ChunkedData { self.chunks.iter().filter(|c| !c.is_empty()) } - pub fn array_iterator(&self) -> impl ArrayIterator + '_ { + pub fn array_iterator(&self, dtype: &DType) -> impl ArrayIterator + '_ { ArrayIteratorAdapter::new( - self.dtype().clone(), + dtype.clone(), self.chunks.iter().map(|c| Ok(c.clone())), ) } - pub fn array_stream(&self) -> impl ArrayStream + '_ { + pub fn array_stream(&self, dtype: &DType) -> impl ArrayStream + '_ { ArrayStreamAdapter::new( - self.dtype().clone(), + dtype.clone(), stream::iter(self.chunks.iter().map(|c| Ok(c.clone()))), ) } - pub fn rechunk(&self, target_bytesize: u64, target_rowsize: usize) -> VortexResult { + pub fn rechunk( + &self, + dtype: &DType, + target_bytesize: u64, + target_rowsize: usize, + ) -> VortexResult { let mut new_chunks = Vec::new(); let mut chunks_to_combine = Vec::new(); let mut new_chunk_n_bytes = 0; @@ -230,9 +224,9 @@ impl ChunkedData { { new_chunks.push( // SAFETY: chunks_to_combine contains valid chunks of the same dtype as self. - // All chunks are guaranteed to be valid arrays matching self.dtype(). + // All chunks are guaranteed to be valid arrays matching `dtype`. unsafe { - Array::::new_unchecked(chunks_to_combine, self.dtype().clone()) + Array::::new_unchecked(chunks_to_combine, dtype.clone()) } .into_array() .to_canonical()? @@ -255,32 +249,31 @@ impl ChunkedData { if !chunks_to_combine.is_empty() { new_chunks.push( - // SAFETY: chunks_to_combine contains valid chunks of the same dtype as self. - // All chunks are guaranteed to be valid arrays matching self.dtype(). - unsafe { Array::::new_unchecked(chunks_to_combine, self.dtype().clone()) } + // SAFETY: chunks_to_combine contains valid chunks of the same dtype as `dtype`. + unsafe { Array::::new_unchecked(chunks_to_combine, dtype.clone()) } .into_array() .to_canonical()? .into_array(), ); } - // SAFETY: new_chunks contains valid arrays of the same dtype as self. - // All chunks were either taken from self or created from self's chunks. - unsafe { Ok(Self::new_unchecked(new_chunks, self.dtype().clone())) } + // SAFETY: new_chunks contains valid arrays of the same dtype as `dtype`. + unsafe { Ok(Self::new_unchecked(new_chunks, dtype.clone())) } } } impl Array { /// Constructs a new `ChunkedArray`. pub fn try_new(chunks: Vec, dtype: DType) -> VortexResult { - let data = ChunkedData::try_new(chunks, dtype)?; - let dtype = data.dtype().clone(); + let data = ChunkedData::try_new(chunks, dtype.clone())?; let len = data.len(); Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Chunked, dtype, len, data)) }) } pub fn rechunk(&self, target_bytesize: u64, target_rowsize: usize) -> VortexResult { - let data = self.data().rechunk(target_bytesize, target_rowsize)?; + let data = self + .data() + .rechunk(self.dtype(), target_bytesize, target_rowsize)?; Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new( Chunked, @@ -297,8 +290,7 @@ impl Array { /// /// See [`ChunkedData::new_unchecked`]. pub unsafe fn new_unchecked(chunks: Vec, dtype: DType) -> Self { - let data = unsafe { ChunkedData::new_unchecked(chunks, dtype) }; - let dtype = data.dtype().clone(); + let data = unsafe { ChunkedData::new_unchecked(chunks, dtype.clone()) }; let len = data.len(); unsafe { Array::from_parts_unchecked(ArrayParts::new(Chunked, dtype, len, data)) } } diff --git a/vortex-array/src/arrays/chunked/tests.rs b/vortex-array/src/arrays/chunked/tests.rs index f1266a5373d..9a056846976 100644 --- a/vortex-array/src/arrays/chunked/tests.rs +++ b/vortex-array/src/arrays/chunked/tests.rs @@ -199,35 +199,3 @@ pub fn pack_nested_lists() { } #[test] -fn with_slots_updates_nchunks_len_and_offsets() { - let orig = chunked_array(); - let slots = vec![ - Some(buffer![0u64, 4, 9].into_array()), - Some(buffer![10u64, 11, 12, 13].into_array()), - Some(buffer![14u64, 15, 16, 17, 18].into_array()), - ]; - let expected_nchunks = slots.len() - 1; - let expected_len = orig.len(); - let dtype = orig.dtype().clone(); - - let mut data = orig.into_data(); - ::with_slots(&mut data, slots).unwrap(); - let array = - ChunkedArray::try_from_parts(ArrayParts::new(Chunked, dtype, expected_len, data)).unwrap(); - - assert_eq!(array.nchunks(), expected_nchunks); - assert_eq!(array.len(), expected_len); - assert_eq!(array.chunk_offsets(), buffer![0u64, 4, 9]); - assert_arrays_eq!( - array.chunk(0).clone(), - PrimitiveArray::from_iter([10u64, 11, 12, 13]) - ); - assert_arrays_eq!( - array.chunk(1).clone(), - PrimitiveArray::from_iter([14u64, 15, 16, 17, 18]) - ); - assert_arrays_eq!( - array, - PrimitiveArray::from_iter([10u64, 11, 12, 13, 14, 15, 16, 17, 18]) - ); -} diff --git a/vortex-array/src/arrays/chunked/vtable/mod.rs b/vortex-array/src/arrays/chunked/vtable/mod.rs index 6349bfa97ec..ee3da130687 100644 --- a/vortex-array/src/arrays/chunked/vtable/mod.rs +++ b/vortex-array/src/arrays/chunked/vtable/mod.rs @@ -60,7 +60,7 @@ impl VTable for Chunked { Self::ID } - fn array_hash(array: &ChunkedData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { PrimitiveArray::new( array.chunk_offsets.to_buffer::(), Validity::NonNullable, @@ -72,7 +72,7 @@ impl VTable for Chunked { } } - fn array_eq(array: &ChunkedData, other: &ChunkedData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { PrimitiveArray::new( array.chunk_offsets.to_buffer::(), Validity::NonNullable, @@ -108,19 +108,16 @@ impl VTable for Chunked { Ok(Some(vec![])) } - fn validate(&self, data: &ChunkedData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate(&self, data: &ChunkedData, dtype: &DType, len: usize, _slots: &[Option]) -> VortexResult<()> { vortex_ensure!( data.len() == len, "ChunkedArray length {} does not match outer length {}", data.len(), len ); - vortex_ensure!( - data.dtype() == dtype, - "ChunkedArray dtype {} does not match outer dtype {}", - data.dtype(), - dtype - ); + for chunk in &data.chunks { + vortex_ensure!(chunk.dtype() == dtype, "ChunkedArray chunk dtype {} does not match outer dtype {}", chunk.dtype(), dtype); + } Ok(()) } @@ -175,15 +172,18 @@ impl VTable for Chunked { let slots = ChunkedData::make_slots(&chunk_offsets, &chunks); // Construct directly using the struct fields to avoid recomputing chunk_offsets Ok(ChunkedData { - empty_dtype: chunks.is_empty().then_some(dtype.clone()), chunk_offsets, chunks, slots, }) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { @@ -193,37 +193,6 @@ impl VTable for Chunked { } } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - // Slots: chunk_offsets, then chunks... - vortex_ensure!(!slots.is_empty(), "Chunked array needs at least one slot"); - - let nchunks = slots.len() - CHUNKS_OFFSET; - let chunk_offsets_ref = slots[CHUNK_OFFSETS_SLOT] - .as_ref() - .ok_or_else(|| vortex_err!("chunk_offsets slot must not be None"))?; - let chunk_offsets_buf = chunk_offsets_ref.to_primitive().to_buffer::(); - - vortex_ensure!( - chunk_offsets_buf.len() == nchunks + 1, - "Expected {} chunk offsets, found {}", - nchunks + 1, - chunk_offsets_buf.len() - ); - - let chunks: Vec = slots[CHUNKS_OFFSET..] - .iter() - .map(|s| { - s.clone() - .ok_or_else(|| vortex_err!("chunk slot must not be None")) - }) - .try_collect()?; - array.chunk_offsets = PrimitiveData::new(chunk_offsets_buf, Validity::NonNullable); - array.empty_dtype = chunks.is_empty().then_some(array.dtype().clone()); - array.chunks = chunks; - array.slots = slots; - - Ok(()) - } fn append_to_builder( array: ArrayView<'_, Self>, diff --git a/vortex-array/src/arrays/constant/array.rs b/vortex-array/src/arrays/constant/array.rs index 3841a9d2b02..5038f70657d 100644 --- a/vortex-array/src/arrays/constant/array.rs +++ b/vortex-array/src/arrays/constant/array.rs @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; use crate::arrays::Constant; @@ -12,7 +11,6 @@ pub(super) const NUM_SLOTS: usize = 0; #[derive(Clone, Debug)] pub struct ConstantData { pub(super) scalar: Scalar, - pub(super) slots: Vec>, } impl ConstantData { @@ -21,10 +19,7 @@ impl ConstantData { S: Into, { let scalar = scalar.into(); - Self { - scalar, - slots: vec![], - } + Self { scalar } } /// Returns the [`Scalar`] value of this constant array. diff --git a/vortex-array/src/arrays/constant/vtable/mod.rs b/vortex-array/src/arrays/constant/vtable/mod.rs index 55869cbd220..cf2a30f96bb 100644 --- a/vortex-array/src/arrays/constant/vtable/mod.rs +++ b/vortex-array/src/arrays/constant/vtable/mod.rs @@ -63,7 +63,13 @@ impl VTable for Constant { Self::ID } - fn validate(&self, data: &ConstantData, dtype: &DType, _len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &ConstantData, + dtype: &DType, + _len: usize, + _slots: &[Option], + ) -> VortexResult<()> { vortex_ensure!( data.scalar.dtype() == dtype, "ConstantArray scalar dtype does not match outer dtype" @@ -72,14 +78,18 @@ impl VTable for Constant { } fn array_hash( - array: &ConstantData, + array: ArrayView<'_, Self>, state: &mut H, _precision: Precision, ) { array.scalar.hash(state); } - fn array_eq(array: &ConstantData, other: &ConstantData, _precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + _precision: Precision, + ) -> bool { array.scalar == other.scalar } @@ -103,23 +113,10 @@ impl VTable for Constant { } } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { vortex_panic!("ConstantArray slot_name index {idx} out of bounds") } - fn with_slots(_array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "ConstantArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - Ok(()) - } fn serialize(_array: ArrayView<'_, Self>) -> VortexResult>> { // HACK: Because the scalar is stored in the buffers, we do not need to serialize the diff --git a/vortex-array/src/arrays/decimal/vtable/mod.rs b/vortex-array/src/arrays/decimal/vtable/mod.rs index dc7a46c779d..fff877eabaa 100644 --- a/vortex-array/src/arrays/decimal/vtable/mod.rs +++ b/vortex-array/src/arrays/decimal/vtable/mod.rs @@ -57,16 +57,16 @@ impl VTable for Decimal { Self::ID } - fn array_hash(array: &DecimalData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.values.array_hash(state, precision); std::mem::discriminant(&array.values_type).hash(state); - array.validity().array_hash(state, precision); + array.data().validity().array_hash(state, precision); } - fn array_eq(array: &DecimalData, other: &DecimalData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.values.array_eq(&other.values, precision) && array.values_type == other.values_type - && array.validity().array_eq(&other.validity(), precision) + && array.data().validity().array_eq(&other.data().validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -96,7 +96,7 @@ impl VTable for Decimal { )) } - fn validate(&self, data: &DecimalData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate(&self, data: &DecimalData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { vortex_ensure!( data.len() == len, "DecimalArray length {} does not match outer length {}", @@ -155,24 +155,18 @@ impl VTable for Decimal { }) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "DecimalArray expects {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) diff --git a/vortex-array/src/arrays/dict/execute.rs b/vortex-array/src/arrays/dict/execute.rs index da2f549c62c..74bd911315a 100644 --- a/vortex-array/src/arrays/dict/execute.rs +++ b/vortex-array/src/arrays/dict/execute.rs @@ -27,6 +27,7 @@ use crate::arrays::StructArray; use crate::arrays::VarBinView; use crate::arrays::VarBinViewArray; use crate::arrays::VariantArray; +use crate::arrays::variant::VariantArrayExt; use crate::arrays::dict::TakeExecute; use crate::arrays::dict::TakeReduce; diff --git a/vortex-array/src/arrays/dict/vtable/mod.rs b/vortex-array/src/arrays/dict/vtable/mod.rs index 25be2053332..d4d687b5cfc 100644 --- a/vortex-array/src/arrays/dict/vtable/mod.rs +++ b/vortex-array/src/arrays/dict/vtable/mod.rs @@ -63,7 +63,7 @@ impl VTable for Dict { Self::ID } - fn validate(&self, data: &DictData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate(&self, data: &DictData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { vortex_ensure!(data.codes().len() == len, "DictArray codes length mismatch"); vortex_ensure!( data.dtype() == *dtype, @@ -72,12 +72,12 @@ impl VTable for Dict { Ok(()) } - fn array_hash(array: &DictData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.codes().array_hash(state, precision); array.values().array_hash(state, precision); } - fn array_eq(array: &DictData, other: &DictData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.codes().array_eq(other.codes(), precision) && array.values().array_eq(other.values(), precision) } @@ -145,24 +145,18 @@ impl VTable for Dict { }) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "DictArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { if array.is_empty() { diff --git a/vortex-array/src/arrays/extension/vtable/mod.rs b/vortex-array/src/arrays/extension/vtable/mod.rs index 3ef3bc05617..873efa53ea9 100644 --- a/vortex-array/src/arrays/extension/vtable/mod.rs +++ b/vortex-array/src/arrays/extension/vtable/mod.rs @@ -45,14 +45,14 @@ impl VTable for Extension { } fn array_hash( - array: &ExtensionData, + array: ArrayView<'_, Self>, state: &mut H, precision: Precision, ) { array.storage_array().array_hash(state, precision); } - fn array_eq(array: &ExtensionData, other: &ExtensionData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array .storage_array() .array_eq(other.storage_array(), precision) @@ -70,8 +70,12 @@ impl VTable for Extension { None } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { @@ -82,7 +86,7 @@ impl VTable for Extension { Ok(Some(vec![])) } - fn validate(&self, data: &ExtensionData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate(&self, data: &ExtensionData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { vortex_ensure!( data.len() == len, "ExtensionArray length {} does not match outer length {}", @@ -127,16 +131,6 @@ impl VTable for Extension { Ok(ExtensionData::new(ext_dtype.clone(), storage)) } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "ExtensionArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) diff --git a/vortex-array/src/arrays/filter/array.rs b/vortex-array/src/arrays/filter/array.rs index 7a0677d5d92..2ab9974800a 100644 --- a/vortex-array/src/arrays/filter/array.rs +++ b/vortex-array/src/arrays/filter/array.rs @@ -9,6 +9,7 @@ use vortex_mask::Mask; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::arrays::Filter; use crate::dtype::DType; @@ -24,17 +25,64 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["child"]; /// The resulting array contains only the elements where the mask is true. #[derive(Clone, Debug)] pub struct FilterData { - pub(super) slots: Vec>, - /// The boolean mask selecting which elements to keep. pub(super) mask: Mask, } pub struct FilterDataParts { - pub child: ArrayRef, pub mask: Mask, } +pub trait FilterArrayExt { + fn filter_data(&self) -> &FilterData; + fn filter_dtype(&self) -> &DType; + fn filter_len(&self) -> usize; + + fn child(&self) -> &ArrayRef { + self.as_slots()[CHILD_SLOT] + .as_ref() + .expect("validated filter child slot") + } + + fn as_slots(&self) -> &[Option]; +} + +impl FilterArrayExt for Array { + fn filter_data(&self) -> &FilterData { + self.data() + } + + fn filter_dtype(&self) -> &DType { + self.dtype() + } + + fn filter_len(&self) -> usize { + self.len() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl FilterArrayExt for ArrayView<'_, Filter> { + fn filter_data(&self) -> &FilterData { + self.data() + } + + fn filter_dtype(&self) -> &DType { + self.dtype() + } + + fn filter_len(&self) -> usize { + self.len() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + impl FilterData { pub fn new(array: ArrayRef, mask: Mask) -> Self { Self::try_new(array, mask).vortex_expect("FilterArray construction failed") @@ -49,10 +97,7 @@ impl FilterData { mask.len() ); - Ok(Self { - slots: vec![Some(array)], - mask, - }) + Ok(Self { mask }) } /// Returns the length of this array (number of elements after filtering). @@ -60,33 +105,18 @@ impl FilterData { self.mask.true_count() } - /// Returns the [`DType`] of this array. - pub fn dtype(&self) -> &DType { - self.child().dtype() - } - /// Returns `true` if this array is empty. pub fn is_empty(&self) -> bool { self.len() == 0 } - /// The child array being filtered. - pub fn child(&self) -> &ArrayRef { - self.slots[CHILD_SLOT] - .as_ref() - .vortex_expect("FilterArray child slot") - } - /// The mask used to filter the child array. pub fn filter_mask(&self) -> &Mask { &self.mask } - pub fn into_parts(mut self) -> FilterDataParts { + pub fn into_parts(self) -> FilterDataParts { FilterDataParts { - child: self.slots[CHILD_SLOT] - .take() - .vortex_expect("FilterArray child slot"), mask: self.mask, } } @@ -97,15 +127,23 @@ impl Array { pub fn new(array: ArrayRef, mask: Mask) -> Self { let dtype = array.dtype().clone(); let len = mask.true_count(); - let data = FilterData::new(array, mask); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Filter, dtype, len, data)) } + let data = FilterData::new(array.clone(), mask); + unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Filter, dtype, len, data).with_slots(vec![Some(array)]), + ) + } } /// Constructs a new `FilterArray`. pub fn try_new(array: ArrayRef, mask: Mask) -> VortexResult { let dtype = array.dtype().clone(); let len = mask.true_count(); - let data = FilterData::try_new(array, mask)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Filter, dtype, len, data)) }) + let data = FilterData::try_new(array.clone(), mask)?; + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Filter, dtype, len, data).with_slots(vec![Some(array)]), + ) + }) } } diff --git a/vortex-array/src/arrays/filter/execute/mod.rs b/vortex-array/src/arrays/filter/execute/mod.rs index a27a56906b7..adffac80d8a 100644 --- a/vortex-array/src/arrays/filter/execute/mod.rs +++ b/vortex-array/src/arrays/filter/execute/mod.rs @@ -22,6 +22,8 @@ use crate::arrays::ExtensionArray; use crate::arrays::Filter; use crate::arrays::NullArray; use crate::arrays::VariantArray; +use crate::arrays::filter::FilterArrayExt; +use crate::arrays::variant::VariantArrayExt; use crate::scalar::Scalar; use crate::validity::Validity; diff --git a/vortex-array/src/arrays/filter/mod.rs b/vortex-array/src/arrays/filter/mod.rs index 7491899230e..103c2a73b1a 100644 --- a/vortex-array/src/arrays/filter/mod.rs +++ b/vortex-array/src/arrays/filter/mod.rs @@ -4,6 +4,7 @@ mod array; pub use array::FilterData; pub use array::FilterDataParts; +pub use array::FilterArrayExt; pub use vtable::FilterArray; mod execute; diff --git a/vortex-array/src/arrays/filter/rules.rs b/vortex-array/src/arrays/filter/rules.rs index 0095d47b422..9d970d66e63 100644 --- a/vortex-array/src/arrays/filter/rules.rs +++ b/vortex-array/src/arrays/filter/rules.rs @@ -11,6 +11,7 @@ use crate::array::ArrayView; use crate::arrays::Filter; use crate::arrays::Struct; use crate::arrays::StructArray; +use crate::arrays::filter::FilterArrayExt; use crate::arrays::struct_::StructDataParts; use crate::optimizer::rules::ArrayParentReduceRule; use crate::optimizer::rules::ArrayReduceRule; diff --git a/vortex-array/src/arrays/filter/vtable.rs b/vortex-array/src/arrays/filter/vtable.rs index fb7bdbf9d0b..6aeae157b0b 100644 --- a/vortex-array/src/arrays/filter/vtable.rs +++ b/vortex-array/src/arrays/filter/vtable.rs @@ -3,6 +3,7 @@ use std::hash::Hasher; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -21,9 +22,10 @@ use crate::array::ArrayView; use crate::array::OperationsVTable; use crate::array::VTable; use crate::array::ValidityVTable; +use crate::arrays::filter::array::CHILD_SLOT; use crate::arrays::filter::array::FilterData; -use crate::arrays::filter::array::NUM_SLOTS; use crate::arrays::filter::array::SLOT_NAMES; +use crate::arrays::filter::FilterArrayExt; use crate::arrays::filter::execute::execute_filter; use crate::arrays::filter::execute::execute_filter_fast_paths; use crate::arrays::filter::rules::PARENT_RULES; @@ -55,11 +57,19 @@ impl VTable for Filter { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { + vortex_ensure!(slots[CHILD_SLOT].is_some(), "FilterArray child slot must be present"); + let child = slots[CHILD_SLOT].as_ref().vortex_expect("validated child slot"); vortex_ensure!( - data.child().dtype() == dtype, + child.dtype() == dtype, "FilterArray dtype {} does not match outer dtype {}", - data.child().dtype(), + child.dtype(), dtype ); vortex_ensure!( @@ -69,20 +79,20 @@ impl VTable for Filter { len ); vortex_ensure!( - data.child().len() == data.mask.len(), + child.len() == data.mask.len(), "FilterArray child length {} does not match mask length {}", - data.child().len(), + child.len(), data.mask.len() ); Ok(()) } - fn array_hash(array: &FilterData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.child().array_hash(state, precision); array.mask.array_hash(state, precision); } - fn array_eq(array: &FilterData, other: &FilterData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.child().array_eq(other.child(), precision) && array.mask.array_eq(&other.mask, precision) } @@ -99,10 +109,6 @@ impl VTable for Filter { None } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -125,16 +131,6 @@ impl VTable for Filter { vortex_bail!("Filter array is not serializable") } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "FilterArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { if let Some(canonical) = execute_filter_fast_paths(array.as_view(), ctx)? { 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 ab3e468c187..962de8cf3f4 100644 --- a/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs +++ b/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs @@ -52,23 +52,23 @@ impl VTable for FixedSizeList { } fn array_hash( - array: &FixedSizeListData, + array: ArrayView<'_, Self>, state: &mut H, precision: Precision, ) { array.elements().array_hash(state, precision); array.list_size().hash(state); - array.validity().array_hash(state, precision); + array.data().validity().array_hash(state, precision); } fn array_eq( - array: &FixedSizeListData, - other: &FixedSizeListData, + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, precision: Precision, ) -> bool { array.elements().array_eq(other.elements(), precision) && array.list_size() == other.list_size() - && array.validity().array_eq(&other.validity(), precision) + && array.data().validity().array_eq(&other.data().validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -104,7 +104,7 @@ impl VTable for FixedSizeList { Ok(Some(vec![])) } - fn validate(&self, data: &FixedSizeListData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate(&self, data: &FixedSizeListData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { vortex_ensure!( data.len() == len, "FixedSizeListArray length {} does not match outer length {}", @@ -168,24 +168,18 @@ impl VTable for FixedSizeList { FixedSizeListData::try_new(elements, *list_size, validity, len) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "FixedSizeListArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) diff --git a/vortex-array/src/arrays/list/vtable/mod.rs b/vortex-array/src/arrays/list/vtable/mod.rs index dd999ee3419..cbe99cb6935 100644 --- a/vortex-array/src/arrays/list/vtable/mod.rs +++ b/vortex-array/src/arrays/list/vtable/mod.rs @@ -54,16 +54,16 @@ impl VTable for List { Self::ID } - fn array_hash(array: &ListData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.elements().array_hash(state, precision); array.offsets().array_hash(state, precision); - array.validity().array_hash(state, precision); + array.data().validity().array_hash(state, precision); } - fn array_eq(array: &ListData, other: &ListData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.elements().array_eq(other.elements(), precision) && array.offsets().array_eq(other.offsets(), precision) - && array.validity().array_eq(&other.validity(), precision) + && array.data().validity().array_eq(&other.data().validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -96,7 +96,7 @@ impl VTable for List { )) } - fn validate(&self, data: &ListData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate(&self, data: &ListData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { vortex_ensure!( data.len() == len, "ListArray length {} does not match outer length {}", @@ -153,24 +153,18 @@ impl VTable for List { ListData::try_new(elements, offsets, validity) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "ListArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done( diff --git a/vortex-array/src/arrays/listview/vtable/mod.rs b/vortex-array/src/arrays/listview/vtable/mod.rs index 9dae3483a16..de5bb16e3a2 100644 --- a/vortex-array/src/arrays/listview/vtable/mod.rs +++ b/vortex-array/src/arrays/listview/vtable/mod.rs @@ -60,18 +60,18 @@ impl VTable for ListView { Self::ID } - fn array_hash(array: &ListViewData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.elements().array_hash(state, precision); array.offsets().array_hash(state, precision); array.sizes().array_hash(state, precision); - array.validity().array_hash(state, precision); + array.data().validity().array_hash(state, precision); } - fn array_eq(array: &ListViewData, other: &ListViewData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.elements().array_eq(other.elements(), precision) && array.offsets().array_eq(other.offsets(), precision) && array.sizes().array_eq(other.sizes(), precision) - && array.validity().array_eq(&other.validity(), precision) + && array.data().validity().array_eq(&other.data().validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -97,7 +97,7 @@ impl VTable for ListView { )) } - fn validate(&self, data: &ListViewData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate(&self, data: &ListViewData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { vortex_ensure!( data.len() == len, "ListViewArray length {} does not match outer length {}", @@ -172,24 +172,18 @@ impl VTable for ListView { ListViewData::try_new(elements, offsets, sizes, validity) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "ListViewArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) diff --git a/vortex-array/src/arrays/masked/array.rs b/vortex-array/src/arrays/masked/array.rs index 9e011140930..58dc693e3d7 100644 --- a/vortex-array/src/arrays/masked/array.rs +++ b/vortex-array/src/arrays/masked/array.rs @@ -1,18 +1,16 @@ // 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; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::child_to_validity; +use crate::array::ArrayView; use crate::array::validity_to_child; use crate::arrays::Masked; use crate::dtype::DType; -use crate::dtype::Nullability; use crate::validity::Validity; /// The underlying child array being masked. @@ -23,8 +21,71 @@ pub(super) const NUM_SLOTS: usize = 2; pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["child", "validity"]; #[derive(Clone, Debug)] -pub struct MaskedData { - pub(super) slots: Vec>, +pub struct MaskedData; + +pub trait MaskedArrayExt { + fn masked_data(&self) -> &MaskedData; + fn masked_dtype(&self) -> &DType; + fn masked_len(&self) -> usize; + + fn child(&self) -> &ArrayRef { + self.as_slots()[CHILD_SLOT] + .as_ref() + .expect("validated masked child slot") + } + + fn validity_child(&self) -> Option<&ArrayRef> { + self.as_slots()[VALIDITY_SLOT].as_ref() + } + + fn masked_validity(&self) -> Validity { + match self.validity_child() { + Some(validity) => Validity::Array(validity.clone()), + None => Validity::AllValid, + } + } + + fn masked_validity_mask(&self) -> vortex_mask::Mask { + self.masked_validity().to_mask(self.masked_len()) + } + + fn as_slots(&self) -> &[Option]; +} + +impl MaskedArrayExt for Array { + fn masked_data(&self) -> &MaskedData { + self.data() + } + + fn masked_dtype(&self) -> &DType { + self.dtype() + } + + fn masked_len(&self) -> usize { + self.len() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl MaskedArrayExt for ArrayView<'_, Masked> { + fn masked_data(&self) -> &MaskedData { + self.data() + } + + fn masked_dtype(&self) -> &DType { + self.dtype() + } + + fn masked_len(&self) -> usize { + self.len() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } } impl MaskedData { @@ -45,44 +106,7 @@ impl MaskedData { // 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 len = child.len(); - let validity_slot = validity_to_child(&validity, len); - - Ok(Self { - slots: vec![Some(child), validity_slot], - }) - } - - /// Returns the dtype of the array. - pub fn dtype(&self) -> DType { - self.child().dtype().as_nullable() - } - - /// Returns the length of the array. - pub fn len(&self) -> usize { - self.child().len() - } - - /// Returns `true` if the array is empty. - pub fn is_empty(&self) -> bool { - self.len() == 0 - } - - /// Returns the validity of the array. - #[allow(clippy::same_name_method)] - pub fn validity(&self) -> Validity { - child_to_validity(&self.slots[VALIDITY_SLOT], Nullability::Nullable) - } - - /// Returns the validity as a [`Mask`](vortex_mask::Mask). - pub fn validity_mask(&self) -> vortex_mask::Mask { - self.validity().to_mask(self.len()) - } - - pub fn child(&self) -> &ArrayRef { - self.slots[CHILD_SLOT] - .as_ref() - .vortex_expect("MaskedArray child slot") + Ok(Self) } } @@ -91,7 +115,13 @@ impl Array { pub fn try_new(child: ArrayRef, validity: Validity) -> VortexResult { let dtype = child.dtype().as_nullable(); let len = child.len(); - let data = MaskedData::try_new(child, validity)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Masked, dtype, len, data)) }) + let validity_slot = validity_to_child(&validity, len); + let data = MaskedData::try_new(child.clone(), validity)?; + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Masked, dtype, len, data) + .with_slots(vec![Some(child), validity_slot]), + ) + }) } } diff --git a/vortex-array/src/arrays/masked/compute/filter.rs b/vortex-array/src/arrays/masked/compute/filter.rs index 9d33ac6767d..98aefdc425b 100644 --- a/vortex-array/src/arrays/masked/compute/filter.rs +++ b/vortex-array/src/arrays/masked/compute/filter.rs @@ -9,6 +9,7 @@ use crate::IntoArray; use crate::array::ArrayView; use crate::arrays::Masked; use crate::arrays::MaskedArray; +use crate::arrays::masked::MaskedArrayExt; use crate::arrays::filter::FilterReduce; impl FilterReduce for Masked { diff --git a/vortex-array/src/arrays/masked/compute/mask.rs b/vortex-array/src/arrays/masked/compute/mask.rs index f822e909432..6168cbba629 100644 --- a/vortex-array/src/arrays/masked/compute/mask.rs +++ b/vortex-array/src/arrays/masked/compute/mask.rs @@ -6,6 +6,7 @@ use vortex_error::VortexResult; use crate::ArrayRef; use crate::array::ArrayView; use crate::arrays::Masked; +use crate::arrays::masked::MaskedArrayExt; use crate::arrays::scalar_fn::ScalarFnArrayExt; use crate::scalar_fn::EmptyOptions; use crate::scalar_fn::fns::mask::Mask as MaskExpr; diff --git a/vortex-array/src/arrays/masked/compute/slice.rs b/vortex-array/src/arrays/masked/compute/slice.rs index d6c9ee3c033..fe295bd6826 100644 --- a/vortex-array/src/arrays/masked/compute/slice.rs +++ b/vortex-array/src/arrays/masked/compute/slice.rs @@ -10,6 +10,7 @@ use crate::IntoArray; use crate::array::ArrayView; use crate::arrays::Masked; use crate::arrays::MaskedArray; +use crate::arrays::masked::MaskedArrayExt; use crate::arrays::slice::SliceReduce; impl SliceReduce for Masked { diff --git a/vortex-array/src/arrays/masked/compute/take.rs b/vortex-array/src/arrays/masked/compute/take.rs index c1107c76467..e415bb2a49e 100644 --- a/vortex-array/src/arrays/masked/compute/take.rs +++ b/vortex-array/src/arrays/masked/compute/take.rs @@ -8,6 +8,7 @@ use crate::IntoArray; use crate::array::ArrayView; use crate::arrays::Masked; use crate::arrays::MaskedArray; +use crate::arrays::masked::MaskedArrayExt; use crate::arrays::dict::TakeReduce; use crate::builtins::ArrayBuiltins; use crate::scalar::Scalar; diff --git a/vortex-array/src/arrays/masked/execute.rs b/vortex-array/src/arrays/masked/execute.rs index b4f8266aabc..1b9491003e5 100644 --- a/vortex-array/src/arrays/masked/execute.rs +++ b/vortex-array/src/arrays/masked/execute.rs @@ -21,6 +21,7 @@ use crate::arrays::PrimitiveArray; use crate::arrays::StructArray; use crate::arrays::VarBinViewArray; use crate::arrays::VariantArray; +use crate::arrays::variant::VariantArrayExt; use crate::dtype::Nullability; use crate::executor::ExecutionCtx; use crate::match_each_decimal_value_type; diff --git a/vortex-array/src/arrays/masked/mod.rs b/vortex-array/src/arrays/masked/mod.rs index 3343468e593..0a0d717857b 100644 --- a/vortex-array/src/arrays/masked/mod.rs +++ b/vortex-array/src/arrays/masked/mod.rs @@ -3,6 +3,7 @@ mod array; pub use array::MaskedData; +pub use array::MaskedArrayExt; pub use vtable::MaskedArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/masked/vtable/mod.rs b/vortex-array/src/arrays/masked/vtable/mod.rs index 4a79d53b78b..de928eacc6e 100644 --- a/vortex-array/src/arrays/masked/vtable/mod.rs +++ b/vortex-array/src/arrays/masked/vtable/mod.rs @@ -4,6 +4,7 @@ mod canonical; mod operations; mod validity; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -19,9 +20,10 @@ use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; use crate::arrays::ConstantArray; +use crate::arrays::masked::array::CHILD_SLOT; use crate::arrays::masked::MaskedData; -use crate::arrays::masked::array::NUM_SLOTS; use crate::arrays::masked::array::SLOT_NAMES; +use crate::arrays::masked::MaskedArrayExt; use crate::arrays::masked::compute::rules::PARENT_RULES; use crate::arrays::masked::mask_validity_canonical; use crate::buffer::BufferHandle; @@ -53,26 +55,36 @@ impl VTable for Masked { Self::ID } - fn validate(&self, data: &MaskedData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &MaskedData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { + vortex_ensure!(slots[CHILD_SLOT].is_some(), "MaskedArray child slot must be present"); + let child = slots[CHILD_SLOT].as_ref().vortex_expect("validated child slot"); vortex_ensure!( - data.child().len() == len, + child.len() == len, "MaskedArray child length mismatch" ); vortex_ensure!( - data.dtype() == *dtype, + child.dtype().as_nullable() == *dtype, "MaskedArray dtype does not match child and validity" ); Ok(()) } - fn array_hash(array: &MaskedData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.child().array_hash(state, precision); - array.validity().array_hash(state, precision); + array.masked_validity().array_hash(state, precision); } - fn array_eq(array: &MaskedData, other: &MaskedData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.child().array_eq(other.child(), precision) - && array.validity().array_eq(&other.validity(), precision) + && array + .masked_validity() + .array_eq(&other.masked_validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -130,7 +142,7 @@ impl VTable for Masked { } fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { - let validity_mask = array.validity_mask()?; + let validity_mask = array.masked_validity_mask(); // Fast path: all masked means result is all nulls. if validity_mask.all_false() { @@ -159,25 +171,9 @@ impl VTable for Masked { ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) } - - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "MaskedArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } } #[cfg(test)] diff --git a/vortex-array/src/arrays/masked/vtable/operations.rs b/vortex-array/src/arrays/masked/vtable/operations.rs index e90b65f5315..eb3132cf957 100644 --- a/vortex-array/src/arrays/masked/vtable/operations.rs +++ b/vortex-array/src/arrays/masked/vtable/operations.rs @@ -7,6 +7,7 @@ use crate::ExecutionCtx; use crate::array::ArrayView; use crate::array::OperationsVTable; use crate::arrays::Masked; +use crate::arrays::masked::MaskedArrayExt; use crate::scalar::Scalar; impl OperationsVTable for Masked { diff --git a/vortex-array/src/arrays/masked/vtable/validity.rs b/vortex-array/src/arrays/masked/vtable/validity.rs index 6386d23dbb5..b1370171714 100644 --- a/vortex-array/src/arrays/masked/vtable/validity.rs +++ b/vortex-array/src/arrays/masked/vtable/validity.rs @@ -6,10 +6,11 @@ use vortex_error::VortexResult; use crate::array::ArrayView; use crate::array::ValidityVTable; use crate::arrays::masked::vtable::Masked; +use crate::arrays::masked::MaskedArrayExt; use crate::validity::Validity; impl ValidityVTable for Masked { fn validity(array: ArrayView<'_, Masked>) -> VortexResult { - Ok(array.data().validity()) + Ok(array.masked_validity()) } } diff --git a/vortex-array/src/arrays/null/mod.rs b/vortex-array/src/arrays/null/mod.rs index 183a2008654..327e5848bab 100644 --- a/vortex-array/src/arrays/null/mod.rs +++ b/vortex-array/src/arrays/null/mod.rs @@ -41,16 +41,30 @@ impl VTable for Null { Self::ID } - fn validate(&self, _data: &NullData, dtype: &DType, _len: usize) -> VortexResult<()> { + fn validate( + &self, + _data: &NullData, + dtype: &DType, + _len: usize, + _slots: &[Option], + ) -> VortexResult<()> { vortex_ensure!(*dtype == DType::Null, "NullArray dtype must be DType::Null"); Ok(()) } - fn array_hash(_array: &NullData, _state: &mut H, _precision: Precision) { + fn array_hash( + _array: ArrayView<'_, Self>, + _state: &mut H, + _precision: Precision, + ) { // len and dtype are hashed by ArrayInner; NullData has no additional fields. } - fn array_eq(_array: &NullData, _other: &NullData, _precision: Precision) -> bool { + fn array_eq( + _array: ArrayView<'_, Self>, + _other: ArrayView<'_, Self>, + _precision: Precision, + ) -> bool { // len and dtype are compared by ArrayInner; NullData has no additional fields. true } @@ -67,23 +81,10 @@ impl VTable for Null { None } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { vortex_panic!("NullArray slot_name index {idx} out of bounds") } - fn with_slots(_array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "NullArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - Ok(()) - } fn serialize(_array: ArrayView<'_, Self>) -> VortexResult>> { Ok(Some(vec![])) @@ -148,9 +149,7 @@ impl VTable for Null { /// # } /// ``` #[derive(Clone, Debug)] -pub struct NullData { - slots: Vec>, -} +pub struct NullData; #[derive(Clone, Debug)] pub struct Null; @@ -175,7 +174,7 @@ impl Default for NullData { impl NullData { pub fn new() -> Self { - Self { slots: vec![] } + Self } } impl OperationsVTable for Null { diff --git a/vortex-array/src/arrays/patched/vtable/mod.rs b/vortex-array/src/arrays/patched/vtable/mod.rs index 0e592452e27..7207e1734d9 100644 --- a/vortex-array/src/arrays/patched/vtable/mod.rs +++ b/vortex-array/src/arrays/patched/vtable/mod.rs @@ -84,7 +84,7 @@ impl VTable for Patched { ArrayId::new_ref("vortex.patched") } - fn array_hash(array: &PatchedArray, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.offset.hash(state); array.n_lanes.hash(state); array.base_array().array_hash(state, precision); @@ -93,7 +93,7 @@ impl VTable for Patched { array.patch_values().array_hash(state, precision); } - fn array_eq(array: &PatchedArray, other: &PatchedArray, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.offset == other.offset && array.n_lanes == other.n_lanes && array.base_array().array_eq(other.base_array(), precision) @@ -112,7 +112,7 @@ impl VTable for Patched { 0 } - fn validate(&self, data: &PatchedArray, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate(&self, data: &PatchedArray, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { vortex_ensure!( data.base_array().dtype() == dtype, "PatchedArray base dtype {} does not match outer dtype {}", @@ -256,24 +256,18 @@ impl VTable for Patched { Ok(()) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "PatchedArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { let inner = array diff --git a/vortex-array/src/arrays/primitive/vtable/mod.rs b/vortex-array/src/arrays/primitive/vtable/mod.rs index ab29d6305f5..e16ec285d0a 100644 --- a/vortex-array/src/arrays/primitive/vtable/mod.rs +++ b/vortex-array/src/arrays/primitive/vtable/mod.rs @@ -49,14 +49,14 @@ impl VTable for Primitive { Self::ID } - fn array_hash(array: &PrimitiveData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.buffer.array_hash(state, precision); - array.validity().array_hash(state, precision); + array.data().validity().array_hash(state, precision); } - fn array_eq(array: &PrimitiveData, other: &PrimitiveData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.buffer.array_eq(&other.buffer, precision) - && array.validity().array_eq(&other.validity(), precision) + && array.data().validity().array_eq(&other.data().validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -81,7 +81,7 @@ impl VTable for Primitive { Ok(Some(vec![])) } - fn validate(&self, data: &PrimitiveData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate(&self, data: &PrimitiveData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { vortex_ensure!( data.len() == len, "PrimitiveArray length {} does not match outer length {}", @@ -162,25 +162,18 @@ impl VTable for Primitive { } } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "PrimitiveArray expects {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - - array.slots = slots; - Ok(()) - } fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) diff --git a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs index c74a53d7730..b160ba970bc 100644 --- a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs +++ b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs @@ -62,7 +62,7 @@ impl VTable for ScalarFnVTable { self.scalar_fn.id() } - fn validate(&self, data: &ScalarFnData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate(&self, data: &ScalarFnData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { vortex_ensure!( data.scalar_fn == self.scalar_fn, "ScalarFnArray data scalar_fn does not match vtable" @@ -83,14 +83,14 @@ impl VTable for ScalarFnVTable { Ok(()) } - fn array_hash(array: &ScalarFnData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.scalar_fn().hash(state); for child in array.iter_children() { child.array_hash(state, precision); } } - fn array_eq(array: &ScalarFnData, other: &ScalarFnData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { if array.scalar_fn() != other.scalar_fn() { return false; } @@ -132,8 +132,12 @@ impl VTable for ScalarFnVTable { vortex_bail!("Deserialization of ScalarFnVTable metadata is not supported"); } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(array: ArrayView<'_, Self>, idx: usize) -> String { @@ -145,10 +149,6 @@ impl VTable for ScalarFnVTable { .to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - array.slots = slots; - Ok(()) - } fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { ctx.log(format_args!("scalar_fn({}): executing", array.scalar_fn())); diff --git a/vortex-array/src/arrays/shared/array.rs b/vortex-array/src/arrays/shared/array.rs index cf4df660520..05529759480 100644 --- a/vortex-array/src/arrays/shared/array.rs +++ b/vortex-array/src/arrays/shared/array.rs @@ -7,7 +7,6 @@ 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,6 +14,7 @@ use crate::Canonical; use crate::IntoArray; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::arrays::Shared; use crate::dtype::DType; @@ -29,67 +29,51 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["source"]; /// After materialization (via `get_or_compute`), operations delegate to the cached result. #[derive(Debug, Clone)] pub struct SharedData { - pub(super) slots: Vec>, cached: Arc>>, async_compute_lock: Arc>, } -impl SharedData { - pub fn new(source: ArrayRef) -> Self { - Self { - slots: vec![Some(source)], - cached: Arc::new(OnceLock::new()), - async_compute_lock: Arc::new(AsyncMutex::new(())), - } - } +#[allow(async_fn_in_trait)] +pub trait SharedArrayExt { + fn shared_data(&self) -> &SharedData; + fn shared_dtype(&self) -> &DType; + fn shared_len(&self) -> usize; - /// Returns the source array reference. - pub(super) fn source(&self) -> &ArrayRef { - self.slots[SOURCE_SLOT] + fn source(&self) -> &ArrayRef { + self.as_slots()[SOURCE_SLOT] .as_ref() - .vortex_expect("SharedArray source slot") + .expect("validated shared source slot") } - /// Returns the current array reference. - /// - /// After materialization, returns the cached result. Otherwise, returns the source. - /// If materialization failed, falls back to the source. - pub(super) fn current_array_ref(&self) -> &ArrayRef { - match self.cached.get() { + fn current_array_ref(&self) -> &ArrayRef { + match self.shared_data().cached.get() { Some(Ok(arr)) => arr, _ => self.source(), } } - /// Compute and cache the result. The computation runs exactly once via `OnceLock`. - /// - /// If the computation fails, the error is cached and returned on all subsequent calls. - pub fn get_or_compute( + fn get_or_compute( &self, f: impl FnOnce(&ArrayRef) -> VortexResult, ) -> VortexResult { - let result = self - .cached - .get_or_init(|| f(self.source()).map(|c| c.into_array()).map_err(Arc::new)); + let result = self.shared_data().cached.get_or_init(|| { + f(self.source()).map(|c| c.into_array()).map_err(Arc::new) + }); result.clone().map_err(Into::into) } - /// Async version of `get_or_compute`. - pub async fn get_or_compute_async(&self, f: F) -> VortexResult + async fn get_or_compute_async(&self, f: F) -> VortexResult where F: FnOnce(ArrayRef) -> Fut, Fut: Future>, { - // Fast path: already computed. - if let Some(result) = self.cached.get() { + if let Some(result) = self.shared_data().cached.get() { return result.clone().map_err(Into::into); } - // Serialize async computation to prevent redundant work. - let _guard = self.async_compute_lock.lock().await; + let _guard = self.shared_data().async_compute_lock.lock().await; - // Double-check after acquiring the lock. - if let Some(result) = self.cached.get() { + if let Some(result) = self.shared_data().cached.get() { return result.clone().map_err(Into::into); } @@ -98,23 +82,55 @@ impl SharedData { .map(|c| c.into_array()) .map_err(Arc::new); - let result = self.cached.get_or_init(|| computed); + let result = self.shared_data().cached.get_or_init(|| computed); result.clone().map_err(Into::into) } - /// Returns the length of this array. - pub fn len(&self) -> usize { - self.current_array_ref().len() + fn as_slots(&self) -> &[Option]; +} + +impl SharedArrayExt for Array { + fn shared_data(&self) -> &SharedData { + self.data() + } + + fn shared_dtype(&self) -> &DType { + self.dtype() + } + + fn shared_len(&self) -> usize { + self.len() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl SharedArrayExt for ArrayView<'_, Shared> { + fn shared_data(&self) -> &SharedData { + self.data() + } + + fn shared_dtype(&self) -> &DType { + self.dtype() } - /// Returns the [`DType`] of this array. - pub fn dtype(&self) -> &DType { - self.current_array_ref().dtype() + fn shared_len(&self) -> usize { + self.len() } - /// Returns `true` if this array is empty. - pub fn is_empty(&self) -> bool { - self.len() == 0 + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl SharedData { + pub fn new() -> Self { + Self { + cached: Arc::new(OnceLock::new()), + async_compute_lock: Arc::new(AsyncMutex::new(())), + } } } @@ -124,20 +140,10 @@ impl Array { let dtype = source.dtype().clone(); let len = source.len(); unsafe { - Array::from_parts_unchecked(ArrayParts::new( - Shared, - dtype, - len, - SharedData::new(source), - )) + Array::from_parts_unchecked( + ArrayParts::new(Shared, dtype, len, SharedData::new()) + .with_slots(vec![Some(source)]), + ) } } } - -impl SharedData { - pub(super) fn set_source(&mut self, source: Option) { - self.slots = vec![source]; - self.cached = Arc::new(OnceLock::new()); - self.async_compute_lock = Arc::new(AsyncMutex::new(())); - } -} diff --git a/vortex-array/src/arrays/shared/mod.rs b/vortex-array/src/arrays/shared/mod.rs index 34108bcd619..03aab52b02f 100644 --- a/vortex-array/src/arrays/shared/mod.rs +++ b/vortex-array/src/arrays/shared/mod.rs @@ -5,6 +5,7 @@ mod array; mod vtable; pub use array::SharedData; +pub use array::SharedArrayExt; pub use vtable::Shared; pub use vtable::SharedArray; diff --git a/vortex-array/src/arrays/shared/tests.rs b/vortex-array/src/arrays/shared/tests.rs index b828aa8191a..359a0919965 100644 --- a/vortex-array/src/arrays/shared/tests.rs +++ b/vortex-array/src/arrays/shared/tests.rs @@ -10,6 +10,7 @@ use crate::ExecutionCtx; use crate::IntoArray; use crate::arrays::PrimitiveArray; use crate::arrays::SharedArray; +use crate::arrays::shared::SharedArrayExt; use crate::hash::ArrayEq; use crate::hash::Precision as HashPrecision; use crate::session::ArraySession; diff --git a/vortex-array/src/arrays/shared/vtable.rs b/vortex-array/src/arrays/shared/vtable.rs index abd4723ca5d..1aace564851 100644 --- a/vortex-array/src/arrays/shared/vtable.rs +++ b/vortex-array/src/arrays/shared/vtable.rs @@ -18,6 +18,7 @@ use crate::array::OperationsVTable; use crate::array::VTable; use crate::array::ValidityVTable; use crate::arrays::shared::SharedData; +use crate::arrays::shared::SharedArrayExt; use crate::arrays::shared::array::SLOT_NAMES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -47,18 +48,27 @@ impl VTable for Shared { Self::ID } - fn validate(&self, data: &SharedData, dtype: &DType, len: usize) -> VortexResult<()> { - vortex_error::vortex_ensure!(data.source().dtype() == dtype, "SharedArray dtype mismatch"); - vortex_error::vortex_ensure!(data.source().len() == len, "SharedArray len mismatch"); + fn validate( + &self, + _data: &SharedData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { + let source = slots[0] + .as_ref() + .vortex_expect("SharedArray source slot must be present"); + vortex_error::vortex_ensure!(source.dtype() == dtype, "SharedArray dtype mismatch"); + vortex_error::vortex_ensure!(source.len() == len, "SharedArray len mismatch"); Ok(()) } - fn array_hash(array: &SharedData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { let current = array.current_array_ref(); current.array_hash(state, precision); } - fn array_eq(array: &SharedData, other: &SharedData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { let current = array.current_array_ref(); let other_current = other.current_array_ref(); current.array_eq(other_current, precision) @@ -76,28 +86,10 @@ impl VTable for Shared { None } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_error::vortex_ensure!( - slots.len() == 1, - "SharedArray expects exactly 1 slot, got {}", - slots.len() - ); - let slot = slots - .into_iter() - .next() - .vortex_expect("slots length already validated"); - array.set_source(slot); - Ok(()) - } - fn serialize(_array: ArrayView<'_, Self>) -> VortexResult>> { vortex_error::vortex_bail!("Shared array is not serializable") } diff --git a/vortex-array/src/arrays/slice/array.rs b/vortex-array/src/arrays/slice/array.rs index 2d438c3fe9c..56a75ac5167 100644 --- a/vortex-array/src/arrays/slice/array.rs +++ b/vortex-array/src/arrays/slice/array.rs @@ -10,8 +10,8 @@ use vortex_error::vortex_panic; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::arrays::Slice; -use crate::dtype::DType; /// The underlying child array being sliced. pub(super) const CHILD_SLOT: usize = 0; @@ -20,17 +20,56 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["child"]; #[derive(Clone, Debug)] pub struct SliceData { - pub(super) slots: Vec>, pub(super) range: Range, } pub struct SliceDataParts { - pub child: ArrayRef, pub range: Range, } +pub trait SliceArrayExt { + fn slice_data(&self) -> &SliceData; + fn slice_len(&self) -> usize; + + fn child(&self) -> &ArrayRef { + self.as_slots()[CHILD_SLOT] + .as_ref() + .expect("validated slice child slot") + } + + fn as_slots(&self) -> &[Option]; +} + +impl SliceArrayExt for Array { + fn slice_data(&self) -> &SliceData { + self.data() + } + + fn slice_len(&self) -> usize { + self.len() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl SliceArrayExt for ArrayView<'_, Slice> { + fn slice_data(&self) -> &SliceData { + self.data() + } + + fn slice_len(&self) -> usize { + self.len() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + impl SliceData { - fn try_new(child: ArrayRef, range: Range) -> VortexResult { + fn try_new(child: &ArrayRef, range: Range) -> VortexResult { if range.end > child.len() { vortex_panic!( "SliceArray range out of bounds: range {:?} exceeds child array length {}", @@ -38,14 +77,11 @@ impl SliceData { child.len() ); } - Ok(Self { - slots: vec![Some(child)], - range, - }) + Ok(Self { range }) } pub fn new(child: ArrayRef, range: Range) -> Self { - Self::try_new(child, range).vortex_expect("failed") + Self::try_new(&child, range).vortex_expect("failed") } /// Returns the length of this array. @@ -53,11 +89,6 @@ impl SliceData { self.range.len() } - /// Returns the [`DType`] of this array. - pub fn dtype(&self) -> &DType { - self.child().dtype() - } - /// Returns `true` if this array is empty. pub fn is_empty(&self) -> bool { self.len() == 0 @@ -68,20 +99,8 @@ impl SliceData { &self.range } - /// The child array being sliced. - pub fn child(&self) -> &ArrayRef { - self.slots[CHILD_SLOT] - .as_ref() - .vortex_expect("SliceArray child slot") - } - - pub fn into_parts(mut self) -> SliceDataParts { - SliceDataParts { - child: self.slots[CHILD_SLOT] - .take() - .vortex_expect("SliceArray child slot"), - range: self.range, - } + pub fn into_parts(self) -> SliceDataParts { + SliceDataParts { range: self.range } } } @@ -90,15 +109,23 @@ impl Array { pub fn try_new(child: ArrayRef, range: Range) -> VortexResult { let len = range.len(); let dtype = child.dtype().clone(); - let data = SliceData::try_new(child, range)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Slice, dtype, len, data)) }) + let data = SliceData::try_new(&child, range)?; + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Slice, dtype, len, data).with_slots(vec![Some(child)]), + ) + }) } /// Constructs a new `SliceArray`. pub fn new(child: ArrayRef, range: Range) -> Self { let len = range.len(); let dtype = child.dtype().clone(); - let data = SliceData::new(child, range); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Slice, dtype, len, data)) } + let data = SliceData::new(child.clone(), range); + unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Slice, dtype, len, data).with_slots(vec![Some(child)]), + ) + } } } diff --git a/vortex-array/src/arrays/slice/mod.rs b/vortex-array/src/arrays/slice/mod.rs index f701a274a14..4f4397e37f7 100644 --- a/vortex-array/src/arrays/slice/mod.rs +++ b/vortex-array/src/arrays/slice/mod.rs @@ -17,6 +17,7 @@ use std::ops::Range; pub use array::SliceData; pub use array::SliceDataParts; +pub use array::SliceArrayExt; use vortex_error::VortexResult; pub use vtable::*; diff --git a/vortex-array/src/arrays/slice/slice_.rs b/vortex-array/src/arrays/slice/slice_.rs index 23011952ff0..0f5fba2d80b 100644 --- a/vortex-array/src/arrays/slice/slice_.rs +++ b/vortex-array/src/arrays/slice/slice_.rs @@ -10,6 +10,7 @@ use crate::IntoArray; use crate::array::ArrayView; use crate::arrays::Slice; use crate::arrays::SliceArray; +use crate::arrays::slice::SliceArrayExt; use crate::arrays::slice::SliceReduce; impl SliceReduce for Slice { diff --git a/vortex-array/src/arrays/slice/vtable.rs b/vortex-array/src/arrays/slice/vtable.rs index 562fcd4c117..e23e9eaded5 100644 --- a/vortex-array/src/arrays/slice/vtable.rs +++ b/vortex-array/src/arrays/slice/vtable.rs @@ -7,6 +7,7 @@ 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; @@ -26,9 +27,10 @@ use crate::array::ArrayView; use crate::array::OperationsVTable; use crate::array::VTable; use crate::array::ValidityVTable; -use crate::arrays::slice::array::NUM_SLOTS; +use crate::arrays::slice::array::CHILD_SLOT; use crate::arrays::slice::array::SLOT_NAMES; use crate::arrays::slice::array::SliceData; +use crate::arrays::slice::SliceArrayExt; use crate::arrays::slice::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -57,11 +59,19 @@ impl VTable for Slice { Slice::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { + vortex_ensure!(slots[CHILD_SLOT].is_some(), "SliceArray child slot must be present"); + let child = slots[CHILD_SLOT].as_ref().vortex_expect("validated child slot"); vortex_ensure!( - data.child().dtype() == dtype, + child.dtype() == dtype, "SliceArray dtype {} does not match outer dtype {}", - data.child().dtype(), + child.dtype(), dtype ); vortex_ensure!( @@ -71,21 +81,21 @@ impl VTable for Slice { len ); vortex_ensure!( - data.range.end <= data.child().len(), + data.range.end <= child.len(), "SliceArray range {:?} exceeds child length {}", data.range, - data.child().len() + child.len() ); Ok(()) } - fn array_hash(array: &SliceData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.child().array_hash(state, precision); array.range.start.hash(state); array.range.end.hash(state); } - fn array_eq(array: &SliceData, other: &SliceData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.child().array_eq(other.child(), precision) && array.range == other.range } @@ -101,10 +111,6 @@ impl VTable for Slice { None } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -127,16 +133,6 @@ impl VTable for Slice { vortex_bail!("Slice array is not serializable") } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "SliceArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { // Execute the child to get canonical form, then slice it diff --git a/vortex-array/src/arrays/struct_/vtable/mod.rs b/vortex-array/src/arrays/struct_/vtable/mod.rs index 3d32534cd3f..af6d0d4f78e 100644 --- a/vortex-array/src/arrays/struct_/vtable/mod.rs +++ b/vortex-array/src/arrays/struct_/vtable/mod.rs @@ -45,27 +45,27 @@ impl VTable for Struct { Self::ID } - fn array_hash(array: &StructData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { for field in array.iter_unmasked_fields() { field.array_hash(state, precision); } - array.validity().array_hash(state, precision); + array.data().validity().array_hash(state, precision); } - fn array_eq(array: &StructData, other: &StructData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.slots.len() == other.slots.len() && array .iter_unmasked_fields() .zip(other.iter_unmasked_fields()) .all(|(a, b)| a.array_eq(b, precision)) - && array.validity().array_eq(&other.validity(), precision) + && array.data().validity().array_eq(&other.data().validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } - fn validate(&self, data: &StructData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate(&self, data: &StructData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { match dtype { DType::Struct(..) => {} _ => vortex_bail!("Expected struct dtype, found {:?}", dtype), @@ -146,8 +146,12 @@ impl VTable for Struct { StructData::try_new_with_dtype(field_children, struct_dtype.clone(), len, validity) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(array: ArrayView<'_, Self>, idx: usize) -> String { @@ -158,10 +162,6 @@ impl VTable for Struct { } } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - array.slots = slots; - Ok(()) - } fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) diff --git a/vortex-array/src/arrays/varbin/vtable/mod.rs b/vortex-array/src/arrays/varbin/vtable/mod.rs index 0b6813ddc99..681b4979b80 100644 --- a/vortex-array/src/arrays/varbin/vtable/mod.rs +++ b/vortex-array/src/arrays/varbin/vtable/mod.rs @@ -58,23 +58,23 @@ impl VTable for VarBin { Self::ID } - fn array_hash(array: &VarBinData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.bytes().array_hash(state, precision); array.offsets().array_hash(state, precision); - array.validity().array_hash(state, precision); + array.data().validity().array_hash(state, precision); } - fn array_eq(array: &VarBinData, other: &VarBinData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.bytes().array_eq(other.bytes(), precision) && array.offsets().array_eq(other.offsets(), precision) - && array.validity().array_eq(&other.validity(), precision) + && array.data().validity().array_eq(&other.data().validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 1 } - fn validate(&self, data: &VarBinData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate(&self, data: &VarBinData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { vortex_ensure!( data.len() == len, "VarBinArray length {} does not match outer length {}", @@ -148,24 +148,18 @@ impl VTable for VarBin { VarBinData::try_new(offsets, bytes, dtype.clone(), validity) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "VarBinArray expects exactly {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } fn reduce_parent( array: ArrayView<'_, Self>, diff --git a/vortex-array/src/arrays/varbinview/vtable/mod.rs b/vortex-array/src/arrays/varbinview/vtable/mod.rs index 7c2b674aa9e..bcab2ab7f36 100644 --- a/vortex-array/src/arrays/varbinview/vtable/mod.rs +++ b/vortex-array/src/arrays/varbinview/vtable/mod.rs @@ -56,7 +56,7 @@ impl VTable for VarBinView { } fn array_hash( - array: &VarBinViewData, + array: ArrayView<'_, Self>, state: &mut H, precision: Precision, ) { @@ -64,10 +64,10 @@ impl VTable for VarBinView { buffer.array_hash(state, precision); } array.views.array_hash(state, precision); - array.validity().array_hash(state, precision); + array.data().validity().array_hash(state, precision); } - fn array_eq(array: &VarBinViewData, other: &VarBinViewData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.buffers.len() == other.buffers.len() && array .buffers @@ -75,14 +75,14 @@ impl VTable for VarBinView { .zip(other.buffers.iter()) .all(|(a, b)| a.array_eq(b, precision)) && array.views.array_eq(&other.views, precision) - && array.validity().array_eq(&other.validity(), precision) + && array.data().validity().array_eq(&other.data().validity(), precision) } fn nbuffers(array: ArrayView<'_, Self>) -> usize { array.data_buffers().len() + 1 } - fn validate(&self, data: &VarBinViewData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate(&self, data: &VarBinViewData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { vortex_ensure!( data.len() == len, "VarBinViewArray length {} does not match outer length {}", @@ -184,24 +184,18 @@ impl VTable for VarBinView { VarBinViewData::try_new(views, Arc::from(data_buffers), dtype.clone(), validity) } + fn infer_slots(data: &Self::ArrayData) -> Vec> { + data.slots.clone() + } + fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + array.slots() } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "VarBinViewArray expects {} slots, got {}", - NUM_SLOTS, - slots.len() - ); - array.slots = slots; - Ok(()) - } fn reduce_parent( array: ArrayView<'_, Self>, diff --git a/vortex-array/src/arrays/variant/mod.rs b/vortex-array/src/arrays/variant/mod.rs index 02a89fae953..f74730084c7 100644 --- a/vortex-array/src/arrays/variant/mod.rs +++ b/vortex-array/src/arrays/variant/mod.rs @@ -3,13 +3,12 @@ mod vtable; -use vortex_error::VortexExpect; - pub use self::vtable::Variant; pub use self::vtable::VariantArray; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::dtype::DType; pub(super) const NUM_SLOTS: usize = 1; @@ -24,38 +23,53 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["child"]; /// always `DType::Variant(child.dtype().nullability())`. The child's validity /// determines which rows are null. #[derive(Clone, Debug)] -pub struct VariantData { - pub(super) slots: Vec>, +pub struct VariantData; + +pub trait VariantArrayExt { + fn variant_data(&self) -> &VariantData; + fn variant_dtype(&self) -> &DType; + fn variant_len(&self) -> usize; + + fn child(&self) -> &ArrayRef { + self.as_slots()[0].as_ref().expect("validated variant child slot") + } + + fn as_slots(&self) -> &[Option]; } -impl VariantData { - /// Creates a new VariantArray. Nullability comes from the child's dtype. - pub fn new(child: ArrayRef) -> Self { - Self { - slots: vec![Some(child)], - } +impl VariantArrayExt for Array { + fn variant_data(&self) -> &VariantData { + self.data() } - /// Returns the length of this array. - pub fn len(&self) -> usize { - self.child().len() + fn variant_dtype(&self) -> &DType { + self.dtype() + } + + fn variant_len(&self) -> usize { + self.len() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl VariantArrayExt for ArrayView<'_, Variant> { + fn variant_data(&self) -> &VariantData { + self.data() } - /// Returns the [`DType`] of this array. - pub fn dtype(&self) -> DType { - DType::Variant(self.child().dtype().nullability()) + fn variant_dtype(&self) -> &DType { + self.dtype() } - /// Returns `true` if this array is empty. - pub fn is_empty(&self) -> bool { - self.len() == 0 + fn variant_len(&self) -> usize { + self.len() } - /// Returns a reference to the underlying child array. - pub fn child(&self) -> &ArrayRef { - self.slots[0] - .as_ref() - .vortex_expect("VariantArray child slot") + fn as_slots(&self) -> &[Option] { + self.slots() } } @@ -66,12 +80,9 @@ impl Array { let len = child.len(); let stats = child.statistics().to_owned(); unsafe { - Array::from_parts_unchecked(ArrayParts::new( - Variant, - dtype, - len, - VariantData::new(child), - )) + Array::from_parts_unchecked( + ArrayParts::new(Variant, dtype, len, VariantData).with_slots(vec![Some(child)]), + ) } .with_stats_set(stats) } diff --git a/vortex-array/src/arrays/variant/vtable/mod.rs b/vortex-array/src/arrays/variant/vtable/mod.rs index 49981a6f955..27baad0e11d 100644 --- a/vortex-array/src/arrays/variant/vtable/mod.rs +++ b/vortex-array/src/arrays/variant/vtable/mod.rs @@ -6,6 +6,7 @@ mod validity; use std::hash::Hasher; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_panic; @@ -22,6 +23,7 @@ use crate::array::ArrayView; use crate::array::VTable; use crate::arrays::variant::NUM_SLOTS; use crate::arrays::variant::SLOT_NAMES; +use crate::arrays::variant::VariantArrayExt; use crate::arrays::variant::VariantData; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -48,31 +50,44 @@ impl VTable for Variant { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { + vortex_ensure!( + slots[0].is_some(), + "VariantArray child slot must be present" + ); + let child = slots[0] + .as_ref() + .vortex_expect("validated child slot presence"); vortex_ensure!( matches!(dtype, DType::Variant(_)), "Expected Variant DType, got {dtype}" ); vortex_ensure!( - data.child().dtype() == dtype, + child.dtype() == dtype, "VariantArray child dtype {} does not match outer dtype {}", - data.child().dtype(), + child.dtype(), dtype ); vortex_ensure!( - data.len() == len, + child.len() == len, "VariantArray length {} does not match outer length {}", - data.len(), + child.len(), len ); Ok(()) } - fn array_hash(array: &VariantData, state: &mut H, precision: Precision) { + fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.child().array_hash(state, precision); } - fn array_eq(array: &VariantData, other: &VariantData, precision: Precision) -> bool { + fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.child().array_eq(other.child(), precision) } @@ -114,12 +129,8 @@ impl VTable for Variant { children.len() ); // The child carries the nullability for the whole VariantArray. - let child = children.get(0, dtype, len)?; - Ok(VariantData::new(child)) - } - - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + children.get(0, dtype, len)?; + Ok(VariantData) } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { @@ -129,20 +140,6 @@ impl VTable for Variant { } } - fn with_slots(array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == NUM_SLOTS, - "VariantArray expects exactly {} slot, got {}", - NUM_SLOTS, - slots.len() - ); - vortex_ensure!( - slots[0].is_some(), - "VariantArray child slot must be present" - ); - array.slots = slots; - Ok(()) - } fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) @@ -151,22 +148,4 @@ impl VTable for Variant { #[cfg(test)] mod tests { - use super::*; - use crate::IntoArray; - use crate::arrays::ConstantArray; - use crate::dtype::DType; - use crate::dtype::Nullability; - use crate::scalar::Scalar; - - #[test] - fn with_slots_rejects_missing_child() { - let child = - ConstantArray::new(Scalar::null(DType::Variant(Nullability::Nullable)), 3).into_array(); - let array = VariantArray::new(child); - let mut data = array.into_data(); - - let err = ::with_slots(&mut data, vec![None]).unwrap_err(); - - assert!(err.to_string().contains("child slot must be present")); - } } diff --git a/vortex-array/src/arrays/variant/vtable/operations.rs b/vortex-array/src/arrays/variant/vtable/operations.rs index 0e0495b7a91..fb6fc0eb499 100644 --- a/vortex-array/src/arrays/variant/vtable/operations.rs +++ b/vortex-array/src/arrays/variant/vtable/operations.rs @@ -7,6 +7,7 @@ use crate::ExecutionCtx; use crate::array::ArrayView; use crate::array::OperationsVTable; use crate::arrays::Variant; +use crate::arrays::variant::VariantArrayExt; use crate::scalar::Scalar; impl OperationsVTable for Variant { diff --git a/vortex-array/src/arrays/variant/vtable/validity.rs b/vortex-array/src/arrays/variant/vtable/validity.rs index 93fc2b786c6..42237c81977 100644 --- a/vortex-array/src/arrays/variant/vtable/validity.rs +++ b/vortex-array/src/arrays/variant/vtable/validity.rs @@ -6,6 +6,7 @@ use vortex_error::VortexResult; use crate::array::ArrayView; use crate::array::ValidityVTable; use crate::arrays::Variant; +use crate::arrays::variant::VariantArrayExt; use crate::validity::Validity; impl ValidityVTable for Variant { diff --git a/vortex-array/src/canonical.rs b/vortex-array/src/canonical.rs index d48b5d532a2..13768e77eaa 100644 --- a/vortex-array/src/canonical.rs +++ b/vortex-array/src/canonical.rs @@ -37,6 +37,7 @@ use crate::arrays::VarBinView; use crate::arrays::VarBinViewArray; use crate::arrays::Variant; use crate::arrays::VariantArray; +use crate::arrays::variant::VariantArrayExt; use crate::arrays::bool::BoolDataParts; use crate::arrays::decimal::DecimalDataParts; use crate::arrays::listview::ListViewDataParts; diff --git a/vortex-cuda/src/dynamic_dispatch/plan_builder.rs b/vortex-cuda/src/dynamic_dispatch/plan_builder.rs index 19e19119eb0..f4362e6e412 100644 --- a/vortex-cuda/src/dynamic_dispatch/plan_builder.rs +++ b/vortex-cuda/src/dynamic_dispatch/plan_builder.rs @@ -12,6 +12,7 @@ use vortex::array::ArrayRef; use vortex::array::arrays::Dict; use vortex::array::arrays::Primitive; use vortex::array::arrays::Slice; +use vortex::array::arrays::slice::SliceArrayExt; use vortex::array::buffer::BufferHandle; use vortex::dtype::PType; use vortex::encodings::alp::ALP; diff --git a/vortex-cuda/src/kernel/arrays/shared.rs b/vortex-cuda/src/kernel/arrays/shared.rs index 0be3a7b82fd..7af8a294aa2 100644 --- a/vortex-cuda/src/kernel/arrays/shared.rs +++ b/vortex-cuda/src/kernel/arrays/shared.rs @@ -6,6 +6,7 @@ use tracing::instrument; use vortex::array::ArrayRef; use vortex::array::Canonical; use vortex::array::arrays::Shared; +use vortex::array::arrays::shared::SharedArrayExt; use vortex::error::VortexExpect; use vortex::error::VortexResult; diff --git a/vortex-cuda/src/kernel/encodings/for_.rs b/vortex-cuda/src/kernel/encodings/for_.rs index 7fe9d89d64c..761a5e56f94 100644 --- a/vortex-cuda/src/kernel/encodings/for_.rs +++ b/vortex-cuda/src/kernel/encodings/for_.rs @@ -13,6 +13,7 @@ use vortex::array::IntoArray; use vortex::array::arrays::PrimitiveArray; use vortex::array::arrays::Slice; use vortex::array::arrays::primitive::PrimitiveDataParts; +use vortex::array::arrays::slice::SliceArrayExt; use vortex::array::match_each_integer_ptype; use vortex::array::match_each_native_simd_ptype; use vortex::dtype::NativePType; diff --git a/vortex-cuda/src/kernel/filter/mod.rs b/vortex-cuda/src/kernel/filter/mod.rs index 4cf8efbc203..4cdd5620598 100644 --- a/vortex-cuda/src/kernel/filter/mod.rs +++ b/vortex-cuda/src/kernel/filter/mod.rs @@ -19,7 +19,7 @@ use tracing::instrument; use vortex::array::ArrayRef; use vortex::array::Canonical; use vortex::array::arrays::Filter; -use vortex::array::arrays::filter::FilterDataParts; +use vortex::array::arrays::filter::FilterArrayExt; use vortex::array::buffer::BufferHandle; use vortex::array::match_each_decimal_value_type; use vortex::array::match_each_native_simd_ptype; @@ -53,7 +53,8 @@ impl CudaExecute for FilterExecutor { .try_into::() .map_err(|_| vortex_err!("Expected FilterArray"))?; - let FilterDataParts { child, mask } = filter_array.into_data().into_parts(); + let child = filter_array.child().clone(); + let mask = filter_array.data().filter_mask().clone(); // Early return for trivial cases. match mask { diff --git a/vortex-cuda/src/kernel/slice/mod.rs b/vortex-cuda/src/kernel/slice/mod.rs index 5326780b5f9..4efbaafed0b 100644 --- a/vortex-cuda/src/kernel/slice/mod.rs +++ b/vortex-cuda/src/kernel/slice/mod.rs @@ -7,7 +7,7 @@ use vortex::array::ArrayRef; use vortex::array::Canonical; use vortex::array::IntoArray; use vortex::array::arrays::Slice; -use vortex::array::arrays::slice::SliceDataParts; +use vortex::array::arrays::slice::SliceArrayExt; use vortex::error::VortexResult; use vortex::error::vortex_err; @@ -33,8 +33,8 @@ impl CudaExecute for SliceExecutor { ) })?; - let SliceDataParts { child, range } = slice_array.into_data().into_parts(); - let child = child.execute_cuda(ctx).await?; + let range = slice_array.data().slice_range().clone(); + let child = slice_array.child().clone().execute_cuda(ctx).await?; match child { Canonical::Null(null_array) => null_array.into_array().slice(range)?.to_canonical(), diff --git a/vortex-python/src/arrays/py/vtable.rs b/vortex-python/src/arrays/py/vtable.rs index dbbc767f253..e84ec1e3fb7 100644 --- a/vortex-python/src/arrays/py/vtable.rs +++ b/vortex-python/src/arrays/py/vtable.rs @@ -45,18 +45,32 @@ impl VTable for PythonVTable { self.id.clone() } - fn validate(&self, data: &PythonArray, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &PythonArray, + dtype: &DType, + len: usize, + _slots: &[Option], + ) -> VortexResult<()> { vortex_ensure!(data.vtable.id == self.id, "PythonArray vtable id mismatch"); vortex_ensure!(&data.dtype == dtype, "PythonArray dtype mismatch"); vortex_ensure!(data.len == len, "PythonArray len mismatch"); Ok(()) } - fn array_hash(array: &PythonArray, state: &mut H, _precision: Precision) { + fn array_hash( + array: ArrayView<'_, Self>, + state: &mut H, + _precision: Precision, + ) { Arc::as_ptr(&array.object).hash(state); } - fn array_eq(array: &PythonArray, other: &PythonArray, _precision: Precision) -> bool { + fn array_eq( + array: ArrayView<'_, Self>, + other: ArrayView<'_, Self>, + _precision: Precision, + ) -> bool { Arc::ptr_eq(&array.object, &other.object) } @@ -109,15 +123,6 @@ impl VTable for PythonVTable { vortex_panic!("PythonArray has no slots") } - fn with_slots(_array: &mut Self::ArrayData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.is_empty(), - "PythonArray has no slots, got {}", - slots.len() - ); - Ok(()) - } - fn execute(_array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { todo!() } From 19dd907b6e01d5b2b6083671009ac91404cf03fc Mon Sep 17 00:00:00 2001 From: Nicholas Gates Date: Sat, 4 Apr 2026 08:18:59 -0400 Subject: [PATCH 02/10] Engine Signed-off-by: Nicholas Gates --- encodings/alp/public-api.lock | 144 +- encodings/alp/src/alp/array.rs | 183 +- encodings/alp/src/alp/compute/between.rs | 1 + encodings/alp/src/alp/compute/cast.rs | 1 + encodings/alp/src/alp/compute/compare.rs | 1 + encodings/alp/src/alp/compute/filter.rs | 1 + encodings/alp/src/alp/compute/mask.rs | 1 + encodings/alp/src/alp/compute/nan_count.rs | 1 + encodings/alp/src/alp/compute/slice.rs | 1 + encodings/alp/src/alp/compute/take.rs | 1 + encodings/alp/src/alp/decompress.rs | 5 +- encodings/alp/src/alp/ops.rs | 1 + encodings/alp/src/alp_rd/array.rs | 169 +- encodings/alp/src/alp_rd/compute/cast.rs | 1 + encodings/alp/src/alp_rd/compute/filter.rs | 1 + encodings/alp/src/alp_rd/compute/mask.rs | 1 + encodings/alp/src/alp_rd/compute/take.rs | 1 + encodings/alp/src/alp_rd/ops.rs | 1 + encodings/alp/src/alp_rd/slice.rs | 1 + encodings/bytebool/public-api.lock | 50 +- encodings/bytebool/src/array.rs | 112 +- encodings/datetime-parts/public-api.lock | 52 +- encodings/datetime-parts/src/array.rs | 109 +- encodings/datetime-parts/src/canonical.rs | 1 + encodings/datetime-parts/src/compute/cast.rs | 1 + .../datetime-parts/src/compute/compare.rs | 1 + .../datetime-parts/src/compute/filter.rs | 1 + .../datetime-parts/src/compute/is_constant.rs | 1 + encodings/datetime-parts/src/compute/mask.rs | 1 + encodings/datetime-parts/src/compute/rules.rs | 1 + encodings/datetime-parts/src/compute/slice.rs | 1 + encodings/datetime-parts/src/compute/take.rs | 1 + encodings/datetime-parts/src/ops.rs | 1 + encodings/decimal-byte-parts/public-api.lock | 36 +- .../src/decimal_byte_parts/compute/cast.rs | 1 + .../src/decimal_byte_parts/compute/compare.rs | 1 + .../src/decimal_byte_parts/compute/filter.rs | 1 + .../decimal_byte_parts/compute/is_constant.rs | 1 + .../src/decimal_byte_parts/compute/mask.rs | 1 + .../src/decimal_byte_parts/compute/take.rs | 1 + .../src/decimal_byte_parts/mod.rs | 80 +- .../src/decimal_byte_parts/rules.rs | 1 + .../src/decimal_byte_parts/slice.rs | 1 + encodings/fastlanes/public-api.lock | 168 +- .../src/bitpacking/array/bitpack_compress.rs | 10 +- .../fastlanes/src/bitpacking/array/mod.rs | 156 +- .../fastlanes/src/bitpacking/compute/cast.rs | 3 +- .../src/bitpacking/compute/filter.rs | 4 +- .../fastlanes/src/bitpacking/compute/slice.rs | 3 +- .../fastlanes/src/bitpacking/compute/take.rs | 2 +- .../fastlanes/src/bitpacking/vtable/mod.rs | 77 +- .../src/bitpacking/vtable/operations.rs | 13 +- .../src/bitpacking/vtable/validity.rs | 3 +- .../src/delta/array/delta_decompress.rs | 1 + encodings/fastlanes/src/delta/array/mod.rs | 93 +- encodings/fastlanes/src/delta/compute/cast.rs | 1 + encodings/fastlanes/src/delta/vtable/mod.rs | 29 +- encodings/fastlanes/src/delta/vtable/slice.rs | 8 +- .../fastlanes/src/delta/vtable/validity.rs | 1 + .../fastlanes/src/for/array/for_compress.rs | 7 +- .../fastlanes/src/for/array/for_decompress.rs | 1 + encodings/fastlanes/src/for/array/mod.rs | 81 +- encodings/fastlanes/src/for/compute/cast.rs | 1 + .../fastlanes/src/for/compute/compare.rs | 1 + .../fastlanes/src/for/compute/is_constant.rs | 1 + .../fastlanes/src/for/compute/is_sorted.rs | 1 + encodings/fastlanes/src/for/compute/mod.rs | 1 + encodings/fastlanes/src/for/mod.rs | 1 + encodings/fastlanes/src/for/vtable/mod.rs | 20 +- .../fastlanes/src/for/vtable/operations.rs | 1 + encodings/fastlanes/src/for/vtable/rules.rs | 1 + encodings/fastlanes/src/for/vtable/slice.rs | 1 + .../fastlanes/src/for/vtable/validity.rs | 6 +- encodings/fastlanes/src/rle/array/mod.rs | 85 +- .../fastlanes/src/rle/array/rle_decompress.rs | 1 + encodings/fastlanes/src/rle/compute/cast.rs | 1 + encodings/fastlanes/src/rle/kernel.rs | 1 + encodings/fastlanes/src/rle/mod.rs | 1 + encodings/fastlanes/src/rle/vtable/mod.rs | 57 +- .../fastlanes/src/rle/vtable/operations.rs | 1 + .../fastlanes/src/rle/vtable/validity.rs | 1 + encodings/fsst/public-api.lock | 42 +- encodings/fsst/src/array.rs | 138 +- encodings/fsst/src/canonical.rs | 6 +- encodings/fsst/src/compute/cast.rs | 1 + encodings/fsst/src/compute/compare.rs | 1 + encodings/fsst/src/compute/filter.rs | 1 + encodings/fsst/src/compute/mod.rs | 1 + encodings/fsst/src/slice.rs | 1 + encodings/parquet-variant/src/array.rs | 104 +- encodings/parquet-variant/src/kernel.rs | 1 + encodings/parquet-variant/src/lib.rs | 1 + encodings/parquet-variant/src/operations.rs | 1 + encodings/parquet-variant/src/validity.rs | 3 +- encodings/parquet-variant/src/vtable.rs | 57 +- encodings/pco/public-api.lock | 10 +- encodings/pco/src/array.rs | 21 +- encodings/runend/public-api.lock | 70 +- encodings/runend/src/array.rs | 192 +- encodings/runend/src/compress.rs | 2 +- encodings/runend/src/compute/cast.rs | 1 + encodings/runend/src/compute/compare.rs | 1 + encodings/runend/src/compute/fill_null.rs | 1 + encodings/runend/src/compute/filter.rs | 3 +- encodings/runend/src/compute/is_constant.rs | 1 + encodings/runend/src/compute/is_sorted.rs | 1 + encodings/runend/src/compute/min_max.rs | 1 + encodings/runend/src/compute/take.rs | 6 +- encodings/runend/src/compute/take_from.rs | 1 + encodings/runend/src/kernel.rs | 1 + encodings/runend/src/ops.rs | 1 + encodings/runend/src/rules.rs | 1 + encodings/sequence/public-api.lock | 10 +- encodings/sequence/src/array.rs | 16 +- encodings/sparse/public-api.lock | 10 +- encodings/sparse/src/canonical.rs | 3 +- encodings/sparse/src/lib.rs | 65 +- encodings/zigzag/public-api.lock | 44 +- encodings/zigzag/src/array.rs | 94 +- encodings/zigzag/src/compute/cast.rs | 1 + encodings/zigzag/src/compute/mod.rs | 1 + encodings/zigzag/src/slice.rs | 1 + encodings/zstd/public-api.lock | 10 +- encodings/zstd/src/array.rs | 20 +- encodings/zstd/src/zstd_buffers.rs | 100 +- vortex-array/public-api.lock | 3486 +++++++++++------ vortex-array/src/array/erased.rs | 29 +- vortex-array/src/array/mod.rs | 38 +- vortex-array/src/array/typed.rs | 14 +- vortex-array/src/array/view.rs | 13 +- vortex-array/src/array/vtable/dyn_.rs | 40 +- vortex-array/src/array/vtable/mod.rs | 10 +- vortex-array/src/array/vtable/validity.rs | 4 +- vortex-array/src/arrays/bool/array.rs | 165 +- vortex-array/src/arrays/bool/vtable/mod.rs | 35 +- .../src/arrays/bool/vtable/validity.rs | 3 +- vortex-array/src/arrays/chunked/array.rs | 391 +- vortex-array/src/arrays/chunked/mod.rs | 1 + .../src/arrays/chunked/paired_chunks.rs | 24 +- vortex-array/src/arrays/chunked/tests.rs | 31 +- vortex-array/src/arrays/chunked/vtable/mod.rs | 151 +- .../src/arrays/constant/vtable/mod.rs | 11 +- vortex-array/src/arrays/decimal/array.rs | 167 +- vortex-array/src/arrays/decimal/mod.rs | 1 + vortex-array/src/arrays/decimal/vtable/mod.rs | 27 +- .../src/arrays/decimal/vtable/validity.rs | 3 +- vortex-array/src/arrays/dict/array.rs | 278 +- vortex-array/src/arrays/dict/vtable/mod.rs | 45 +- vortex-array/src/arrays/extension/array.rs | 69 +- vortex-array/src/arrays/extension/mod.rs | 1 + .../src/arrays/extension/vtable/mod.rs | 30 +- .../src/arrays/extension/vtable/validity.rs | 7 +- vortex-array/src/arrays/filter/rules.rs | 2 +- vortex-array/src/arrays/filter/vtable.rs | 2 +- .../src/arrays/fixed_size_list/array.rs | 232 +- .../arrays/fixed_size_list/compute/take.rs | 3 +- .../src/arrays/fixed_size_list/mod.rs | 2 + .../src/arrays/fixed_size_list/vtable/mod.rs | 40 +- .../arrays/fixed_size_list/vtable/validity.rs | 3 +- vortex-array/src/arrays/list/array.rs | 249 +- vortex-array/src/arrays/list/compute/take.rs | 5 +- vortex-array/src/arrays/list/mod.rs | 1 + vortex-array/src/arrays/list/vtable/mod.rs | 33 +- .../src/arrays/list/vtable/validity.rs | 2 +- vortex-array/src/arrays/listview/array.rs | 340 +- .../src/arrays/listview/conversion.rs | 6 +- vortex-array/src/arrays/listview/mod.rs | 1 + .../src/arrays/listview/vtable/mod.rs | 38 +- .../src/arrays/listview/vtable/validity.rs | 3 +- vortex-array/src/arrays/masked/vtable/mod.rs | 10 +- vortex-array/src/arrays/null/mod.rs | 13 +- vortex-array/src/arrays/patched/array.rs | 347 +- .../src/arrays/patched/compute/compare.rs | 8 +- .../src/arrays/patched/compute/filter.rs | 11 +- .../src/arrays/patched/compute/take.rs | 7 +- vortex-array/src/arrays/patched/vtable/mod.rs | 76 +- .../src/arrays/patched/vtable/operations.rs | 7 +- .../src/arrays/patched/vtable/slice.rs | 31 +- .../src/arrays/primitive/array/cast.rs | 7 +- .../src/arrays/primitive/array/mod.rs | 140 +- .../src/arrays/primitive/compute/cast.rs | 1 + vortex-array/src/arrays/primitive/mod.rs | 1 + .../src/arrays/primitive/vtable/mod.rs | 29 +- .../src/arrays/primitive/vtable/validity.rs | 3 +- vortex-array/src/arrays/scalar_fn/array.rs | 100 +- .../src/arrays/scalar_fn/vtable/mod.rs | 27 +- vortex-array/src/arrays/shared/vtable.rs | 2 +- vortex-array/src/arrays/slice/vtable.rs | 2 +- vortex-array/src/arrays/struct_/array.rs | 455 ++- vortex-array/src/arrays/struct_/mod.rs | 1 + vortex-array/src/arrays/struct_/tests.rs | 3 +- vortex-array/src/arrays/struct_/vtable/mod.rs | 90 +- .../src/arrays/struct_/vtable/validity.rs | 2 +- vortex-array/src/arrays/varbin/array.rs | 429 +- .../src/arrays/varbin/compute/filter.rs | 2 +- .../src/arrays/varbin/compute/take.rs | 2 +- vortex-array/src/arrays/varbin/mod.rs | 2 + .../src/arrays/varbin/vtable/canonical.rs | 10 +- vortex-array/src/arrays/varbin/vtable/mod.rs | 22 +- .../src/arrays/varbin/vtable/validity.rs | 2 +- vortex-array/src/arrays/varbinview/array.rs | 164 +- .../src/arrays/varbinview/compute/zip.rs | 5 +- vortex-array/src/arrays/varbinview/mod.rs | 1 + .../src/arrays/varbinview/vtable/mod.rs | 35 +- .../src/arrays/varbinview/vtable/validity.rs | 3 +- vortex-array/src/arrays/variant/vtable/mod.rs | 9 +- vortex-array/src/arrow/executor/dictionary.rs | 7 +- vortex-array/src/arrow/executor/list.rs | 2 +- vortex-array/src/arrow/executor/list_view.rs | 2 +- vortex-array/src/arrow/executor/struct_.rs | 8 +- vortex-array/src/canonical.rs | 39 +- vortex-btrblocks/src/schemes/float.rs | 13 +- vortex-btrblocks/src/schemes/integer.rs | 11 +- vortex-btrblocks/src/schemes/rle.rs | 1 + vortex-btrblocks/src/schemes/string.rs | 1 + vortex-compressor/src/compressor.rs | 2 +- vortex-cuda/src/arrow/canonical.rs | 10 +- vortex-cuda/src/arrow/varbinview.rs | 2 +- vortex-cuda/src/canonical.rs | 10 +- .../src/dynamic_dispatch/plan_builder.rs | 9 +- vortex-cuda/src/executor.rs | 2 +- vortex-cuda/src/kernel/arrays/dict.rs | 12 +- vortex-cuda/src/kernel/encodings/alp.rs | 1 + .../src/kernel/encodings/date_time_parts.rs | 1 + .../kernel/encodings/decimal_byte_parts.rs | 4 +- vortex-cuda/src/kernel/encodings/for_.rs | 1 + vortex-cuda/src/kernel/encodings/runend.rs | 5 +- vortex-cuda/src/kernel/encodings/zigzag.rs | 1 + vortex-cuda/src/kernel/filter/primitive.rs | 2 +- vortex-cuda/src/kernel/filter/varbinview.rs | 2 +- vortex-duckdb/src/exporter/fixed_size_list.rs | 5 +- vortex-duckdb/src/exporter/list.rs | 2 +- vortex-duckdb/src/exporter/list_view.rs | 2 +- vortex-duckdb/src/exporter/run_end.rs | 5 +- vortex-duckdb/src/exporter/struct_.rs | 2 +- vortex-duckdb/src/exporter/varbinview.rs | 2 +- vortex-python/src/arrays/builtins/chunked.rs | 6 +- vortex-python/src/arrays/builtins/struct_.rs | 14 +- vortex-python/src/arrays/py/vtable.rs | 3 +- vortex-tensor/src/scalar_fns/inner_product.rs | 4 +- vortex-tensor/src/scalar_fns/l2_norm.rs | 2 +- 241 files changed, 6954 insertions(+), 4200 deletions(-) diff --git a/encodings/alp/public-api.lock b/encodings/alp/public-api.lock index e8907fac04e..ddd44dcfe97 100644 --- a/encodings/alp/public-api.lock +++ b/encodings/alp/public-api.lock @@ -32,15 +32,15 @@ pub type vortex_alp::ALP::OperationsVTable = vortex_alp::ALP pub type vortex_alp::ALP::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_alp::ALP::array_eq(array: &vortex_alp::ALPData, other: &vortex_alp::ALPData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_alp::ALP::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_alp::ALP::array_hash(array: &vortex_alp::ALPData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_alp::ALP::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_alp::ALP::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_alp::ALP::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, _idx: usize) -> core::option::Option -pub fn vortex_alp::ALP::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_alp::ALP::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_alp::ALP::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -58,9 +58,7 @@ pub fn vortex_alp::ALP::slot_name(_array: vortex_array::array::view::ArrayView<' pub fn vortex_alp::ALP::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_alp::ALP::validate(&self, data: &vortex_alp::ALPData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_alp::ALP::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_alp::ALP::validate(&self, data: &vortex_alp::ALPData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_alp::ALP @@ -68,7 +66,7 @@ pub fn vortex_alp::ALP::scalar_at(array: vortex_array::array::view::ArrayView<'_ impl vortex_array::array::vtable::validity::ValidityChild for vortex_alp::ALP -pub fn vortex_alp::ALP::validity_child(array: &vortex_alp::ALPData) -> &vortex_array::array::erased::ArrayRef +pub fn vortex_alp::ALP::validity_child(array: vortex_array::array::view::ArrayView<'_, vortex_alp::ALP>) -> vortex_array::array::erased::ArrayRef impl vortex_array::arrays::dict::take::TakeExecute for vortex_alp::ALP @@ -106,14 +104,8 @@ pub struct vortex_alp::ALPData impl vortex_alp::ALPData -pub fn vortex_alp::ALPData::encoded(&self) -> &vortex_array::array::erased::ArrayRef - pub fn vortex_alp::ALPData::exponents(&self) -> vortex_alp::Exponents -pub fn vortex_alp::ALPData::into_parts(self) -> (vortex_array::array::erased::ArrayRef, vortex_alp::Exponents, core::option::Option) - -pub fn vortex_alp::ALPData::patches(&self) -> core::option::Option - impl vortex_alp::ALPData pub fn vortex_alp::ALPData::new(encoded: vortex_array::array::erased::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option) -> Self @@ -174,15 +166,15 @@ pub type vortex_alp::ALPRD::OperationsVTable = vortex_alp::ALPRD pub type vortex_alp::ALPRD::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_alp::ALPRD::array_eq(array: &vortex_alp::ALPRDData, other: &vortex_alp::ALPRDData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_alp::ALPRD::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_alp::ALPRD::array_hash(array: &vortex_alp::ALPRDData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_alp::ALPRD::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_alp::ALPRD::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_alp::ALPRD::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, _idx: usize) -> core::option::Option -pub fn vortex_alp::ALPRD::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_alp::ALPRD::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_alp::ALPRD::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -200,9 +192,7 @@ pub fn vortex_alp::ALPRD::slot_name(_array: vortex_array::array::view::ArrayView pub fn vortex_alp::ALPRD::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_alp::ALPRD::validate(&self, data: &vortex_alp::ALPRDData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_alp::ALPRD::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_alp::ALPRD::validate(&self, data: &vortex_alp::ALPRDData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_alp::ALPRD @@ -210,7 +200,7 @@ pub fn vortex_alp::ALPRD::scalar_at(array: vortex_array::array::view::ArrayView< impl vortex_array::array::vtable::validity::ValidityChild for vortex_alp::ALPRD -pub fn vortex_alp::ALPRD::validity_child(array: &vortex_alp::ALPRDData) -> &vortex_array::array::erased::ArrayRef +pub fn vortex_alp::ALPRD::validity_child(array: vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>) -> vortex_array::array::erased::ArrayRef impl vortex_array::arrays::dict::take::TakeExecute for vortex_alp::ALPRD @@ -236,20 +226,14 @@ pub struct vortex_alp::ALPRDData impl vortex_alp::ALPRDData -pub fn vortex_alp::ALPRDData::into_parts(self) -> vortex_alp::ALPRDDataParts - -pub fn vortex_alp::ALPRDData::left_parts(&self) -> &vortex_array::array::erased::ArrayRef +pub fn vortex_alp::ALPRDData::into_parts(self, left_parts: vortex_array::array::erased::ArrayRef, right_parts: vortex_array::array::erased::ArrayRef) -> vortex_alp::ALPRDDataParts pub fn vortex_alp::ALPRDData::left_parts_dictionary(&self) -> &vortex_buffer::buffer::Buffer pub fn vortex_alp::ALPRDData::left_parts_patches(&self) -> core::option::Option -pub fn vortex_alp::ALPRDData::replace_left_parts_patches(&mut self, patches: core::option::Option) - pub fn vortex_alp::ALPRDData::right_bit_width(&self) -> u8 -pub fn vortex_alp::ALPRDData::right_parts(&self) -> &vortex_array::array::erased::ArrayRef - pub fn vortex_alp::ALPRDData::try_new(dtype: vortex_array::dtype::DType, left_parts: vortex_array::array::erased::ArrayRef, left_parts_dictionary: vortex_buffer::buffer::Buffer, right_parts: vortex_array::array::erased::ArrayRef, right_bit_width: u8, left_parts_patches: core::option::Option) -> vortex_error::VortexResult impl core::clone::Clone for vortex_alp::ALPRDData @@ -346,6 +330,56 @@ pub fn vortex_alp::RDEncoder::from_parts(right_bit_width: u8, codes: alloc::vec: pub fn vortex_alp::RDEncoder::new(sample: &[T]) -> Self where T: vortex_alp::ALPRDFloat + vortex_array::dtype::ptype::NativePType, ::UINT: vortex_array::dtype::ptype::NativePType +pub trait vortex_alp::ALPArrayExt + +pub fn vortex_alp::ALPArrayExt::alp_data(&self) -> &vortex_alp::ALPData + +pub fn vortex_alp::ALPArrayExt::alp_len(&self) -> usize + +pub fn vortex_alp::ALPArrayExt::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_alp::ALPArrayExt::encoded(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_alp::ALPArrayExt::exponents(&self) -> vortex_alp::Exponents + +pub fn vortex_alp::ALPArrayExt::patches(&self) -> core::option::Option + +impl vortex_alp::ALPArrayExt for vortex_array::array::typed::Array + +pub fn vortex_array::array::typed::Array::alp_data(&self) -> &vortex_alp::ALPData + +pub fn vortex_array::array::typed::Array::alp_len(&self) -> usize + +pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::typed::Array::encoded(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::typed::Array::exponents(&self) -> vortex_alp::Exponents + +pub fn vortex_array::array::typed::Array::patches(&self) -> core::option::Option + +impl vortex_alp::ALPArrayExt for vortex_array::array::view::ArrayView<'_, vortex_alp::ALP> + +pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALP>::alp_data(&self) -> &vortex_alp::ALPData + +pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALP>::alp_len(&self) -> usize + +pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALP>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALP>::encoded(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALP>::exponents(&self) -> vortex_alp::Exponents + +pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALP>::patches(&self) -> core::option::Option + +pub trait vortex_alp::ALPArrayOwnedExt + +pub fn vortex_alp::ALPArrayOwnedExt::into_parts(self) -> (vortex_array::array::erased::ArrayRef, vortex_alp::Exponents, core::option::Option) + +impl vortex_alp::ALPArrayOwnedExt for vortex_array::array::typed::Array + +pub fn vortex_array::array::typed::Array::into_parts(self) -> (vortex_array::array::erased::ArrayRef, vortex_alp::Exponents, core::option::Option) + pub trait vortex_alp::ALPFloat: vortex_alp::alp::private::Sealed + num_traits::float::Float + core::fmt::Display + vortex_array::dtype::ptype::NativePType pub type vortex_alp::ALPFloat::ALPInt: num_traits::int::PrimInt + core::fmt::Display + num_traits::cast::ToPrimitive + core::marker::Copy + vortex_array::dtype::ptype::NativePType + core::convert::Into @@ -478,6 +512,62 @@ pub fn f64::find_best_exponents(values: &[Self]) -> vortex_alp::Exponents pub fn f64::from_int(n: Self::ALPInt) -> Self +pub trait vortex_alp::ALPRDArrayExt + +pub fn vortex_alp::ALPRDArrayExt::alprd_data(&self) -> &vortex_alp::ALPRDData + +pub fn vortex_alp::ALPRDArrayExt::alprd_slots(&self) -> &[core::option::Option] + +pub fn vortex_alp::ALPRDArrayExt::left_parts(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_alp::ALPRDArrayExt::left_parts_dictionary(&self) -> &vortex_buffer::buffer::Buffer + +pub fn vortex_alp::ALPRDArrayExt::left_parts_patches(&self) -> core::option::Option + +pub fn vortex_alp::ALPRDArrayExt::right_bit_width(&self) -> u8 + +pub fn vortex_alp::ALPRDArrayExt::right_parts(&self) -> &vortex_array::array::erased::ArrayRef + +impl vortex_alp::ALPRDArrayExt for vortex_array::array::typed::Array + +pub fn vortex_array::array::typed::Array::alprd_data(&self) -> &vortex_alp::ALPRDData + +pub fn vortex_array::array::typed::Array::alprd_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::typed::Array::left_parts(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::typed::Array::left_parts_dictionary(&self) -> &vortex_buffer::buffer::Buffer + +pub fn vortex_array::array::typed::Array::left_parts_patches(&self) -> core::option::Option + +pub fn vortex_array::array::typed::Array::right_bit_width(&self) -> u8 + +pub fn vortex_array::array::typed::Array::right_parts(&self) -> &vortex_array::array::erased::ArrayRef + +impl vortex_alp::ALPRDArrayExt for vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD> + +pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>::alprd_data(&self) -> &vortex_alp::ALPRDData + +pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>::alprd_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>::left_parts(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>::left_parts_dictionary(&self) -> &vortex_buffer::buffer::Buffer + +pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>::left_parts_patches(&self) -> core::option::Option + +pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>::right_bit_width(&self) -> u8 + +pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>::right_parts(&self) -> &vortex_array::array::erased::ArrayRef + +pub trait vortex_alp::ALPRDArrayOwnedExt + +pub fn vortex_alp::ALPRDArrayOwnedExt::into_data_parts(self) -> vortex_alp::ALPRDDataParts + +impl vortex_alp::ALPRDArrayOwnedExt for vortex_array::array::typed::Array + +pub fn vortex_array::array::typed::Array::into_data_parts(self) -> vortex_alp::ALPRDDataParts + pub trait vortex_alp::ALPRDFloat: vortex_alp::alp_rd::private::Sealed + num_traits::float::Float + core::marker::Copy + vortex_array::dtype::ptype::NativePType pub type vortex_alp::ALPRDFloat::UINT: vortex_array::dtype::ptype::NativePType + num_traits::int::PrimInt + num_traits::identities::One + core::marker::Copy diff --git a/encodings/alp/src/alp/array.rs b/encodings/alp/src/alp/array.rs index 488e0b95abe..c82ff88565f 100644 --- a/encodings/alp/src/alp/array.rs +++ b/encodings/alp/src/alp/array.rs @@ -61,7 +61,19 @@ impl VTable for ALP { len: usize, slots: &[Option], ) -> VortexResult<()> { - data.validate_against_outer(dtype, len) + data.validate_against_outer( + dtype, + len, + slots[ENCODED_SLOT] + .as_ref() + .vortex_expect("ALPArray encoded slot"), + patches_from_slots( + slots, + data.patch_offset, + data.patch_offset_within_chunk, + len, + ), + ) } fn array_hash( @@ -119,7 +131,7 @@ impl VTable for ALP { _buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = ALPMetadata::decode(metadata)?; let encoded_ptype = match &dtype { DType::Primitive(PType::F32, n) => DType::Primitive(PType::I32, *n), @@ -142,18 +154,16 @@ impl VTable for ALP { }) .transpose()?; - ALPData::try_new( + let slots = ALPData::make_slots(&encoded, &patches); + let data = ALPData::try_new( encoded, Exponents { e: u8::try_from(metadata.exp_e)?, f: u8::try_from(metadata.exp_f)?, }, patches, - ) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + )?; + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { @@ -215,7 +225,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = [ #[derive(Clone, Debug)] pub struct ALPData { - pub(super) slots: Vec>, patch_offset: Option, patch_offset_within_chunk: Option, exponents: Exponents, @@ -302,15 +311,20 @@ impl ALPData { } } - fn validate_against_outer(&self, dtype: &DType, len: usize) -> VortexResult<()> { - let patches = self.patches(); - let logical_dtype = Self::logical_dtype(self.encoded())?; - Self::validate_components(self.encoded(), self.exponents, patches.as_ref())?; + fn validate_against_outer( + &self, + dtype: &DType, + len: usize, + encoded: &ArrayRef, + patches: Option, + ) -> VortexResult<()> { + let logical_dtype = Self::logical_dtype(encoded)?; + Self::validate_components(encoded, self.exponents, patches.as_ref())?; vortex_ensure!( - self.encoded().len() == len, + encoded.len() == len, "ALP encoded len {} != outer len {len}", - self.encoded().len(), + encoded.len(), ); vortex_ensure!( &logical_dtype == dtype, @@ -408,15 +422,13 @@ impl ALPData { patches: Option, ) -> VortexResult { Self::validate_components(&encoded, exponents, patches.as_ref())?; - - let slots = Self::make_slots(&encoded, &patches); let (patch_offset, patch_offset_within_chunk) = match &patches { Some(p) => (Some(p.offset()), p.offset_within_chunk()), None => (None, None), }; + drop((encoded, patches)); Ok(Self { - slots, patch_offset, patch_offset_within_chunk, exponents, @@ -432,14 +444,13 @@ impl ALPData { exponents: Exponents, patches: Option, ) -> Self { - let slots = Self::make_slots(&encoded, &patches); let (patch_offset, patch_offset_within_chunk) = match &patches { Some(p) => (Some(p.offset()), p.offset_within_chunk()), None => (None, None), }; + drop((encoded, patches)); Self { - slots, patch_offset, patch_offset_within_chunk, exponents, @@ -452,13 +463,14 @@ impl ALP { pub fn new(encoded: ArrayRef, exponents: Exponents, patches: Option) -> ALPArray { let dtype = ALPData::logical_dtype(&encoded).vortex_expect("ALP encoded dtype"); let len = encoded.len(); + let slots = ALPData::make_slots(&encoded, &patches); unsafe { Array::from_parts_unchecked(ArrayParts::new( ALP, dtype, len, ALPData::new(encoded, exponents, patches), - )) + ).with_slots(slots)) } } @@ -469,8 +481,11 @@ impl ALP { ) -> VortexResult { let dtype = ALPData::logical_dtype(&encoded)?; let len = encoded.len(); + let slots = ALPData::make_slots(&encoded, &patches); let data = ALPData::try_new(encoded, exponents, patches)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(ALP, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(ALP, dtype, len, data).with_slots(slots)) + }) } /// # Safety @@ -482,8 +497,11 @@ impl ALP { ) -> ALPArray { let dtype = ALPData::logical_dtype(&encoded).vortex_expect("ALP encoded dtype"); let len = encoded.len(); + let slots = ALPData::make_slots(&encoded, &patches); let data = unsafe { ALPData::new_unchecked(encoded, exponents, patches) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(ALP, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(ALP, dtype, len, data).with_slots(slots)) + } } } @@ -505,55 +523,106 @@ impl ALPData { ] } - pub fn encoded(&self) -> &ArrayRef { - self.slots[ENCODED_SLOT] + #[inline] + pub fn exponents(&self) -> Exponents { + self.exponents + } +} + +pub trait ALPArrayExt { + fn alp_data(&self) -> &ALPData; + fn as_slots(&self) -> &[Option]; + fn alp_len(&self) -> usize; + + fn encoded(&self) -> &ArrayRef { + self.as_slots()[ENCODED_SLOT] .as_ref() .vortex_expect("ALPArray encoded slot") } - #[inline] - pub fn exponents(&self) -> Exponents { - self.exponents + fn exponents(&self) -> Exponents { + self.alp_data().exponents } - pub fn patches(&self) -> Option { - match ( - &self.slots[PATCH_INDICES_SLOT], - &self.slots[PATCH_VALUES_SLOT], - ) { - (Some(indices), Some(values)) => { - let patch_offset = self - .patch_offset - .vortex_expect("has patch slots but no patch_offset"); - Some(unsafe { - Patches::new_unchecked( - self.encoded().len(), - patch_offset, - indices.clone(), - values.clone(), - self.slots[PATCH_CHUNK_OFFSETS_SLOT].clone(), - self.patch_offset_within_chunk, - ) - }) - } - _ => None, + fn patches(&self) -> Option { + patches_from_slots( + self.as_slots(), + self.alp_data().patch_offset, + self.alp_data().patch_offset_within_chunk, + self.alp_len(), + ) + } +} + +fn patches_from_slots( + slots: &[Option], + patch_offset: Option, + patch_offset_within_chunk: Option, + len: usize, +) -> Option { + match (&slots[PATCH_INDICES_SLOT], &slots[PATCH_VALUES_SLOT]) { + (Some(indices), Some(values)) => { + let patch_offset = patch_offset.vortex_expect("has patch slots but no patch_offset"); + Some(unsafe { + Patches::new_unchecked( + len, + patch_offset, + indices.clone(), + values.clone(), + slots[PATCH_CHUNK_OFFSETS_SLOT].clone(), + patch_offset_within_chunk, + ) + }) } + _ => None, + } +} + +impl ALPArrayExt for Array { + fn alp_data(&self) -> &ALPData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } + + fn alp_len(&self) -> usize { + self.len() } +} + +impl ALPArrayExt for ArrayView<'_, ALP> { + fn alp_data(&self) -> &ALPData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } + + fn alp_len(&self) -> usize { + self.len() + } +} + +pub trait ALPArrayOwnedExt { + fn into_parts(self) -> (ArrayRef, Exponents, Option); +} - /// Consumes the array and returns its parts. +impl ALPArrayOwnedExt for Array { #[inline] - pub fn into_parts(mut self) -> (ArrayRef, Exponents, Option) { + fn into_parts(self) -> (ArrayRef, Exponents, Option) { let patches = self.patches(); - let encoded = self.slots[ENCODED_SLOT] - .take() - .vortex_expect("ALPArray encoded slot"); - (encoded, self.exponents, patches) + let exponents = self.exponents(); + let encoded = self.encoded().clone(); + (encoded, exponents, patches) } } impl ValidityChild for ALP { - fn validity_child(array: &ALPData) -> &ArrayRef { - array.encoded() + fn validity_child(array: ArrayView<'_, ALP>) -> ArrayRef { + array.encoded().clone() } } diff --git a/encodings/alp/src/alp/compute/between.rs b/encodings/alp/src/alp/compute/between.rs index efaaf747768..907816560cd 100644 --- a/encodings/alp/src/alp/compute/between.rs +++ b/encodings/alp/src/alp/compute/between.rs @@ -18,6 +18,7 @@ use vortex_array::scalar_fn::fns::between::StrictComparison; use vortex_error::VortexResult; use crate::ALP; +use crate::ALPArrayExt; use crate::ALPFloat; use crate::match_each_alp_float_ptype; diff --git a/encodings/alp/src/alp/compute/cast.rs b/encodings/alp/src/alp/compute/cast.rs index bd8a8b38381..6f4b5b29027 100644 --- a/encodings/alp/src/alp/compute/cast.rs +++ b/encodings/alp/src/alp/compute/cast.rs @@ -11,6 +11,7 @@ use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_error::VortexResult; use crate::alp::ALP; +use crate::ALPArrayExt; impl CastReduce for ALP { fn cast(array: ArrayView<'_, Self>, dtype: &DType) -> VortexResult> { diff --git a/encodings/alp/src/alp/compute/compare.rs b/encodings/alp/src/alp/compute/compare.rs index 867a14db79a..6d557344d30 100644 --- a/encodings/alp/src/alp/compute/compare.rs +++ b/encodings/alp/src/alp/compute/compare.rs @@ -18,6 +18,7 @@ use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_err; +use crate::ALPArrayExt; use crate::ALP; use crate::ALPFloat; use crate::match_each_alp_float_ptype; diff --git a/encodings/alp/src/alp/compute/filter.rs b/encodings/alp/src/alp/compute/filter.rs index 3daa6d53d7b..51cc206e2bb 100644 --- a/encodings/alp/src/alp/compute/filter.rs +++ b/encodings/alp/src/alp/compute/filter.rs @@ -10,6 +10,7 @@ use vortex_error::VortexResult; use vortex_mask::Mask; use crate::ALP; +use crate::ALPArrayExt; impl FilterKernel for ALP { fn filter( diff --git a/encodings/alp/src/alp/compute/mask.rs b/encodings/alp/src/alp/compute/mask.rs index 9325fa56042..ffe081d2847 100644 --- a/encodings/alp/src/alp/compute/mask.rs +++ b/encodings/alp/src/alp/compute/mask.rs @@ -12,6 +12,7 @@ use vortex_array::validity::Validity; use vortex_error::VortexResult; use crate::ALP; +use crate::ALPArrayExt; impl MaskReduce for ALP { fn mask(array: ArrayView<'_, Self>, mask: &ArrayRef) -> VortexResult> { diff --git a/encodings/alp/src/alp/compute/nan_count.rs b/encodings/alp/src/alp/compute/nan_count.rs index ace09429c30..b76dd6e7a97 100644 --- a/encodings/alp/src/alp/compute/nan_count.rs +++ b/encodings/alp/src/alp/compute/nan_count.rs @@ -11,6 +11,7 @@ use vortex_array::scalar::Scalar; use vortex_error::VortexResult; use crate::ALP; +use crate::ALPArrayExt; /// ALP-specific NaN count kernel. /// diff --git a/encodings/alp/src/alp/compute/slice.rs b/encodings/alp/src/alp/compute/slice.rs index 9ebf0926d1e..3959b624083 100644 --- a/encodings/alp/src/alp/compute/slice.rs +++ b/encodings/alp/src/alp/compute/slice.rs @@ -11,6 +11,7 @@ use vortex_array::arrays::slice::SliceKernel; use vortex_error::VortexResult; use crate::ALP; +use crate::ALPArrayExt; impl SliceKernel for ALP { fn slice( diff --git a/encodings/alp/src/alp/compute/take.rs b/encodings/alp/src/alp/compute/take.rs index 77d161737c3..22dcdeaf6a7 100644 --- a/encodings/alp/src/alp/compute/take.rs +++ b/encodings/alp/src/alp/compute/take.rs @@ -9,6 +9,7 @@ use vortex_array::arrays::dict::TakeExecute; use vortex_error::VortexResult; use crate::ALP; +use crate::ALPArrayExt; impl TakeExecute for ALP { fn take( diff --git a/encodings/alp/src/alp/decompress.rs b/encodings/alp/src/alp/decompress.rs index ea52e362efe..6bc5b469d42 100644 --- a/encodings/alp/src/alp/decompress.rs +++ b/encodings/alp/src/alp/decompress.rs @@ -15,6 +15,7 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::ALPArray; +use crate::ALPArrayOwnedExt; use crate::ALPFloat; use crate::Exponents; use crate::match_each_alp_float_ptype; @@ -29,7 +30,7 @@ pub fn decompress_into_array( ctx: &mut ExecutionCtx, ) -> VortexResult { let dtype = array.dtype().clone(); - let (encoded, exponents, patches) = array.into_data().into_parts(); + let (encoded, exponents, patches) = ALPArrayOwnedExt::into_parts(array); if let Some(ref patches) = patches && let Some(chunk_offsets) = patches.chunk_offsets() { @@ -62,7 +63,7 @@ pub fn decompress_into_array( /// A `PrimitiveArray` containing the decompressed floating-point values with all patches applied. pub fn execute_decompress(array: ALPArray, ctx: &mut ExecutionCtx) -> VortexResult { let dtype = array.dtype().clone(); - let (encoded, exponents, patches) = array.into_data().into_parts(); + let (encoded, exponents, patches) = ALPArrayOwnedExt::into_parts(array); if let Some(ref patches) = patches && let Some(chunk_offsets) = patches.chunk_offsets() { diff --git a/encodings/alp/src/alp/ops.rs b/encodings/alp/src/alp/ops.rs index 25cf19a3e55..47cce5b45f6 100644 --- a/encodings/alp/src/alp/ops.rs +++ b/encodings/alp/src/alp/ops.rs @@ -9,6 +9,7 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::ALP; +use crate::ALPArrayExt; use crate::ALPFloat; use crate::match_each_alp_float_ptype; diff --git a/encodings/alp/src/alp_rd/array.rs b/encodings/alp/src/alp_rd/array.rs index 850f7ca82df..5bd3c9cdd2e 100644 --- a/encodings/alp/src/alp_rd/array.rs +++ b/encodings/alp/src/alp_rd/array.rs @@ -79,7 +79,7 @@ impl VTable for ALPRD { len: usize, slots: &[Option], ) -> VortexResult<()> { - data.validate_against_outer(dtype, len) + data.validate_against_outer(dtype, len, slots) } fn array_hash( @@ -152,7 +152,7 @@ impl VTable for ALPRD { _buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = ALPRDMetadata::decode(metadata)?; if children.len() < 2 { vortex_bail!( @@ -200,7 +200,8 @@ impl VTable for ALPRD { }) .transpose()?; - ALPRDData::try_new( + let slots = ALPRDData::make_slots(&left_parts, &right_parts, &left_parts_patches); + let data = ALPRDData::try_new( dtype.clone(), left_parts, left_parts_dictionary, @@ -212,11 +213,8 @@ impl VTable for ALPRD { ) })?, left_parts_patches, - ) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + )?; + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { @@ -245,7 +243,7 @@ impl VTable for ALPRD { right_parts, left_parts_dictionary, left_parts_patches, - } = array.into_data().into_parts(); + } = ALPRDArrayOwnedExt::into_data_parts(array); let ptype = dtype.as_ptype(); let left_parts = left_parts @@ -329,7 +327,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = [ #[derive(Clone, Debug)] pub struct ALPRDData { - slots: Vec>, left_parts_patches: Option, left_parts_dictionary: Buffer, right_bit_width: u8, @@ -359,6 +356,7 @@ impl ALPRD { ) -> VortexResult { let len = left_parts.len(); let logical_dtype = dtype.clone(); + let slots = ALPRDData::make_slots(&left_parts, &right_parts, &left_parts_patches); let data = ALPRDData::try_new( dtype, left_parts, @@ -367,11 +365,11 @@ impl ALPRD { right_bit_width, left_parts_patches, )?; - Ok( - unsafe { - Array::from_parts_unchecked(ArrayParts::new(ALPRD, logical_dtype, len, data)) - }, - ) + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(ALPRD, logical_dtype, len, data).with_slots(slots), + ) + }) } /// # Safety @@ -386,6 +384,7 @@ impl ALPRD { ) -> ALPRDArray { let len = left_parts.len(); let logical_dtype = dtype.clone(); + let slots = ALPRDData::make_slots(&left_parts, &right_parts, &left_parts_patches); let data = unsafe { ALPRDData::new_unchecked( dtype, @@ -396,7 +395,11 @@ impl ALPRD { left_parts_patches, ) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(ALPRD, logical_dtype, len, data)) } + unsafe { + Array::from_parts_unchecked( + ArrayParts::new(ALPRD, logical_dtype, len, data).with_slots(slots), + ) + } } } @@ -473,12 +476,17 @@ impl ALPRDData { Ok(()) } - fn validate_against_outer(&self, dtype: &DType, len: usize) -> VortexResult<()> { + fn validate_against_outer( + &self, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { Self::validate_parts( dtype, len, - self.left_parts(), - self.right_parts(), + left_parts_from_slots(slots), + right_parts_from_slots(slots), self.left_parts_patches.as_ref(), ) } @@ -516,10 +524,7 @@ impl ALPRDData { left_parts_patches.as_ref(), )?; - let slots = Self::make_slots(&left_parts, &right_parts, &left_parts_patches); - Ok(Self { - slots, left_parts_patches, left_parts_dictionary, right_bit_width, @@ -536,10 +541,9 @@ impl ALPRDData { right_bit_width: u8, left_parts_patches: Option, ) -> Self { - let slots = Self::make_slots(&left_parts, &right_parts, &left_parts_patches); - + drop(left_parts); + drop(right_parts); Self { - slots, left_parts_patches, left_parts_dictionary, right_bit_width, @@ -569,13 +573,7 @@ impl ALPRDData { } /// Return all the owned parts of the array - pub fn into_parts(mut self) -> ALPRDDataParts { - let left_parts = self.slots[LEFT_PARTS_SLOT] - .take() - .vortex_expect("ALPRDArray left_parts slot"); - let right_parts = self.slots[RIGHT_PARTS_SLOT] - .take() - .vortex_expect("ALPRDArray right_parts slot"); + pub fn into_parts(self, left_parts: ArrayRef, right_parts: ArrayRef) -> ALPRDDataParts { ALPRDDataParts { left_parts, left_parts_patches: self.left_parts_patches, @@ -584,23 +582,6 @@ impl ALPRDData { } } - /// The leftmost (most significant) bits of the floating point values stored in the array. - /// - /// 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.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.slots[RIGHT_PARTS_SLOT] - .as_ref() - .vortex_expect("ALPRDArray right_parts slot") - } - #[inline] pub fn right_bit_width(&self) -> u8 { self.right_bit_width @@ -616,27 +597,85 @@ impl ALPRDData { pub fn left_parts_dictionary(&self) -> &Buffer { &self.left_parts_dictionary } +} - pub fn replace_left_parts_patches(&mut self, patches: Option) { - // Update both the patches and the corresponding slots to keep them in sync. - let (pi, pv, pco) = match &patches { - Some(p) => ( - Some(p.indices().clone()), - Some(p.values().clone()), - p.chunk_offsets().clone(), - ), - None => (None, None, None), - }; - self.slots[LP_PATCH_INDICES_SLOT] = pi; - self.slots[LP_PATCH_VALUES_SLOT] = pv; - self.slots[LP_PATCH_CHUNK_OFFSETS_SLOT] = pco; - self.left_parts_patches = patches; +fn left_parts_from_slots(slots: &[Option]) -> &ArrayRef { + slots[LEFT_PARTS_SLOT] + .as_ref() + .vortex_expect("ALPRDArray left_parts slot") +} + +fn right_parts_from_slots(slots: &[Option]) -> &ArrayRef { + slots[RIGHT_PARTS_SLOT] + .as_ref() + .vortex_expect("ALPRDArray right_parts slot") +} + +pub trait ALPRDArrayExt { + fn alprd_data(&self) -> &ALPRDData; + fn alprd_slots(&self) -> &[Option]; + + fn left_parts(&self) -> &ArrayRef { + left_parts_from_slots(self.alprd_slots()) + } + + fn right_parts(&self) -> &ArrayRef { + right_parts_from_slots(self.alprd_slots()) + } + + fn right_bit_width(&self) -> u8 { + self.alprd_data().right_bit_width() + } + + fn left_parts_patches(&self) -> Option { + self.alprd_data().left_parts_patches() + } + + fn left_parts_dictionary(&self) -> &Buffer { + self.alprd_data().left_parts_dictionary() + } +} + +impl ALPRDArrayExt for Array { + fn alprd_data(&self) -> &ALPRDData { + self.data() + } + + fn alprd_slots(&self) -> &[Option] { + self.slots() + } +} + +impl ALPRDArrayExt for ArrayView<'_, ALPRD> { + fn alprd_data(&self) -> &ALPRDData { + self.data() + } + + fn alprd_slots(&self) -> &[Option] { + self.slots() + } +} + +pub trait ALPRDArrayOwnedExt { + fn into_data_parts(self) -> ALPRDDataParts; +} + +impl ALPRDArrayOwnedExt for Array { + fn into_data_parts(self) -> ALPRDDataParts { + let mut parts = self.into_parts(); + let left_parts = parts.slots[LEFT_PARTS_SLOT] + .take() + .vortex_expect("ALPRDArray left_parts slot"); + let right_parts = parts.slots[RIGHT_PARTS_SLOT] + .take() + .vortex_expect("ALPRDArray right_parts slot"); + parts.data.into_parts(left_parts, right_parts) } } impl ValidityChild for ALPRD { - fn validity_child(array: &ALPRDData) -> &ArrayRef { - array.left_parts() + fn validity_child(array: ArrayView<'_, ALPRD>) -> ArrayRef { + array.left_parts().clone() } } diff --git a/encodings/alp/src/alp_rd/compute/cast.rs b/encodings/alp/src/alp_rd/compute/cast.rs index 2919a22294a..01eab5d126f 100644 --- a/encodings/alp/src/alp_rd/compute/cast.rs +++ b/encodings/alp/src/alp_rd/compute/cast.rs @@ -9,6 +9,7 @@ use vortex_array::dtype::DType; use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_error::VortexResult; +use crate::ALPRDArrayExt; use crate::alp_rd::ALPRD; impl CastReduce for ALPRD { diff --git a/encodings/alp/src/alp_rd/compute/filter.rs b/encodings/alp/src/alp_rd/compute/filter.rs index b6bf409d90c..fe7df4a5b7e 100644 --- a/encodings/alp/src/alp_rd/compute/filter.rs +++ b/encodings/alp/src/alp_rd/compute/filter.rs @@ -10,6 +10,7 @@ use vortex_error::VortexResult; use vortex_mask::Mask; use crate::ALPRD; +use crate::ALPRDArrayExt; impl FilterKernel for ALPRD { fn filter( diff --git a/encodings/alp/src/alp_rd/compute/mask.rs b/encodings/alp/src/alp_rd/compute/mask.rs index 066760c1165..a7c420847f6 100644 --- a/encodings/alp/src/alp_rd/compute/mask.rs +++ b/encodings/alp/src/alp_rd/compute/mask.rs @@ -11,6 +11,7 @@ use vortex_array::scalar_fn::fns::mask::MaskReduce; use vortex_error::VortexResult; use crate::ALPRD; +use crate::ALPRDArrayExt; impl MaskReduce for ALPRD { fn mask(array: ArrayView<'_, Self>, mask: &ArrayRef) -> VortexResult> { diff --git a/encodings/alp/src/alp_rd/compute/take.rs b/encodings/alp/src/alp_rd/compute/take.rs index 16e73487d0e..cad39cbc1ff 100644 --- a/encodings/alp/src/alp_rd/compute/take.rs +++ b/encodings/alp/src/alp_rd/compute/take.rs @@ -11,6 +11,7 @@ use vortex_array::scalar::Scalar; use vortex_error::VortexResult; use crate::ALPRD; +use crate::ALPRDArrayExt; impl TakeExecute for ALPRD { fn take( diff --git a/encodings/alp/src/alp_rd/ops.rs b/encodings/alp/src/alp_rd/ops.rs index 6f77fdbd843..0d5f811a590 100644 --- a/encodings/alp/src/alp_rd/ops.rs +++ b/encodings/alp/src/alp_rd/ops.rs @@ -10,6 +10,7 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::ALPRD; +use crate::ALPRDArrayExt; impl OperationsVTable for ALPRD { fn scalar_at( diff --git a/encodings/alp/src/alp_rd/slice.rs b/encodings/alp/src/alp_rd/slice.rs index 8f716a0070b..c36e138ff84 100644 --- a/encodings/alp/src/alp_rd/slice.rs +++ b/encodings/alp/src/alp_rd/slice.rs @@ -10,6 +10,7 @@ use vortex_array::IntoArray; use vortex_array::arrays::slice::SliceKernel; use vortex_error::VortexResult; +use crate::ALPRDArrayExt; use crate::alp_rd::ALPRD; impl SliceKernel for ALPRD { diff --git a/encodings/bytebool/public-api.lock b/encodings/bytebool/public-api.lock index f626040d55d..535634aef7b 100644 --- a/encodings/bytebool/public-api.lock +++ b/encodings/bytebool/public-api.lock @@ -28,15 +28,15 @@ pub type vortex_bytebool::ByteBool::OperationsVTable = vortex_bytebool::ByteBool pub type vortex_bytebool::ByteBool::ValidityVTable = vortex_bytebool::ByteBool -pub fn vortex_bytebool::ByteBool::array_eq(array: &vortex_bytebool::ByteBoolData, other: &vortex_bytebool::ByteBoolData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_bytebool::ByteBool::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_bytebool::ByteBool::array_hash(array: &vortex_bytebool::ByteBoolData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_bytebool::ByteBool::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_bytebool::ByteBool::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_bytebool::ByteBool::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option -pub fn vortex_bytebool::ByteBool::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_bytebool::ByteBool::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_bytebool::ByteBool::execute(array: vortex_array::array::typed::Array, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -54,9 +54,7 @@ pub fn vortex_bytebool::ByteBool::slot_name(_array: vortex_array::array::view::A pub fn vortex_bytebool::ByteBool::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_bytebool::ByteBool::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_bytebool::ByteBool::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_bytebool::ByteBool::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_bytebool::ByteBool @@ -100,10 +98,6 @@ pub fn vortex_bytebool::ByteBoolData::new(buffer: vortex_array::buffer::BufferHa pub fn vortex_bytebool::ByteBoolData::validate(buffer: &vortex_array::buffer::BufferHandle, validity: &vortex_array::validity::Validity, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> -pub fn vortex_bytebool::ByteBoolData::validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_bytebool::ByteBoolData::validity_mask(&self) -> vortex_mask::Mask - impl core::clone::Clone for vortex_bytebool::ByteBoolData pub fn vortex_bytebool::ByteBoolData::clone(&self) -> vortex_bytebool::ByteBoolData @@ -120,4 +114,40 @@ impl core::fmt::Debug for vortex_bytebool::ByteBoolData pub fn vortex_bytebool::ByteBoolData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub trait vortex_bytebool::ByteBoolArrayExt + +pub fn vortex_bytebool::ByteBoolArrayExt::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_bytebool::ByteBoolArrayExt::byte_bool_data(&self) -> &vortex_bytebool::ByteBoolData + +pub fn vortex_bytebool::ByteBoolArrayExt::len(&self) -> usize + +pub fn vortex_bytebool::ByteBoolArrayExt::validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_bytebool::ByteBoolArrayExt::validity_mask(&self) -> vortex_mask::Mask + +impl vortex_bytebool::ByteBoolArrayExt for vortex_array::array::typed::Array + +pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::typed::Array::byte_bool_data(&self) -> &vortex_bytebool::ByteBoolData + +pub fn vortex_array::array::typed::Array::len(&self) -> usize + +pub fn vortex_array::array::typed::Array::validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::array::typed::Array::validity_mask(&self) -> vortex_mask::Mask + +impl vortex_bytebool::ByteBoolArrayExt for vortex_array::array::view::ArrayView<'_, vortex_bytebool::ByteBool> + +pub fn vortex_array::array::view::ArrayView<'_, vortex_bytebool::ByteBool>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::view::ArrayView<'_, vortex_bytebool::ByteBool>::byte_bool_data(&self) -> &vortex_bytebool::ByteBoolData + +pub fn vortex_array::array::view::ArrayView<'_, vortex_bytebool::ByteBool>::len(&self) -> usize + +pub fn vortex_array::array::view::ArrayView<'_, vortex_bytebool::ByteBool>::validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::array::view::ArrayView<'_, vortex_bytebool::ByteBool>::validity_mask(&self) -> vortex_mask::Mask + pub type vortex_bytebool::ByteBoolArray = vortex_array::array::typed::Array diff --git a/encodings/bytebool/src/array.rs b/encodings/bytebool/src/array.rs index 4f2c38fc549..351cecddcdc 100644 --- a/encodings/bytebool/src/array.rs +++ b/encodings/bytebool/src/array.rs @@ -17,7 +17,6 @@ use vortex_array::Precision; use vortex_array::arrays::BoolArray; use vortex_array::buffer::BufferHandle; use vortex_array::dtype::DType; -use vortex_array::dtype::Nullability; use vortex_array::scalar::Scalar; use vortex_array::serde::ArrayChildren; use vortex_array::validity::Validity; @@ -57,7 +56,7 @@ impl VTable for ByteBool { len: usize, slots: &[Option], ) -> VortexResult<()> { - let validity = data.validity(); + let validity = child_to_validity(&slots[VALIDITY_SLOT], dtype.nullability()); ByteBoolData::validate(data.buffer(), &validity, dtype, len) } @@ -67,7 +66,7 @@ impl VTable for ByteBool { precision: Precision, ) { array.buffer.array_hash(state, precision); - array.data().validity().array_hash(state, precision); + ByteBoolArrayExt::validity(&array).array_hash(state, precision); } fn array_eq( @@ -76,10 +75,8 @@ impl VTable for ByteBool { precision: Precision, ) -> bool { array.buffer.array_eq(&other.buffer, precision) - && array - .data() - .validity() - .array_eq(&other.data().validity(), precision) + && ByteBoolArrayExt::validity(&array) + .array_eq(&ByteBoolArrayExt::validity(&other), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -112,7 +109,7 @@ impl VTable for ByteBool { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { if !metadata.is_empty() { vortex_bail!( "ByteBoolArray expects empty metadata, got {} bytes", @@ -133,11 +130,9 @@ impl VTable for ByteBool { } let buffer = buffers[0].clone(); - Ok(ByteBoolData::new(buffer, validity)) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + let data = ByteBoolData::new(buffer, validity.clone()); + let slots = ByteBoolData::make_slots(&validity, len); + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { @@ -182,8 +177,57 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["validity"]; #[derive(Clone, Debug)] pub struct ByteBoolData { buffer: BufferHandle, - nullability: Nullability, - pub(super) slots: Vec>, +} + +pub trait ByteBoolArrayExt { + fn byte_bool_data(&self) -> &ByteBoolData; + fn as_slots(&self) -> &[Option]; + fn len(&self) -> usize; + fn dtype(&self) -> &DType; + + fn validity(&self) -> Validity { + child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.dtype().nullability()) + } + + fn validity_mask(&self) -> Mask { + self.validity().to_mask(self.len()) + } +} + +impl ByteBoolArrayExt for Array { + fn byte_bool_data(&self) -> &ByteBoolData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } + + fn len(&self) -> usize { + Array::len(self) + } + + fn dtype(&self) -> &DType { + Array::dtype(self) + } +} + +impl ByteBoolArrayExt for ArrayView<'_, ByteBool> { + fn byte_bool_data(&self) -> &ByteBoolData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } + + fn len(&self) -> usize { + ArrayView::len(self) + } + + fn dtype(&self) -> &DType { + ArrayView::dtype(self) + } } #[derive(Clone, Debug)] @@ -194,25 +238,36 @@ impl ByteBool { pub fn new(buffer: BufferHandle, validity: Validity) -> ByteBoolArray { let dtype = DType::Bool(validity.nullability()); + let slots = ByteBoolData::make_slots(&validity, buffer.len()); let data = ByteBoolData::new(buffer, validity); let len = data.len(); - unsafe { Array::from_parts_unchecked(ArrayParts::new(ByteBool, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(ByteBool, dtype, len, data).with_slots(slots)) + } } /// Construct a [`ByteBoolArray`] from a `Vec` and validity. pub fn from_vec>(data: Vec, validity: V) -> ByteBoolArray { - let data = ByteBoolData::from_vec(data, validity); - let dtype = DType::Bool(data.nullability); + let validity = validity.into(); + let data = ByteBoolData::from_vec(data, validity.clone()); + let dtype = DType::Bool(validity.nullability()); let len = data.len(); - unsafe { Array::from_parts_unchecked(ArrayParts::new(ByteBool, dtype, len, data)) } + let slots = ByteBoolData::make_slots(&validity, len); + unsafe { + Array::from_parts_unchecked(ArrayParts::new(ByteBool, dtype, len, data).with_slots(slots)) + } } /// Construct a [`ByteBoolArray`] from optional bools. pub fn from_option_vec(data: Vec>) -> ByteBoolArray { + let validity = Validity::from_iter(data.iter().map(|v| v.is_some())); let data = ByteBoolData::from(data); - let dtype = DType::Bool(data.nullability); + let dtype = DType::Bool(validity.nullability()); let len = data.len(); - unsafe { Array::from_parts_unchecked(ArrayParts::new(ByteBool, dtype, len, data)) } + let slots = ByteBoolData::make_slots(&validity, len); + unsafe { + Array::from_parts_unchecked(ArrayParts::new(ByteBool, dtype, len, data).with_slots(slots)) + } } } @@ -243,10 +298,6 @@ impl ByteBoolData { vec![validity_to_child(validity, len)] } - pub fn validity(&self) -> Validity { - child_to_validity(&self.slots[VALIDITY_SLOT], self.nullability) - } - pub fn new(buffer: BufferHandle, validity: Validity) -> Self { let length = buffer.len(); if let Some(vlen) = validity.maybe_len() @@ -258,11 +309,8 @@ impl ByteBoolData { vlen ); } - let slots = Self::make_slots(&validity, length); Self { buffer, - nullability: validity.nullability(), - slots, } } @@ -276,11 +324,6 @@ impl ByteBoolData { self.buffer.len() == 0 } - /// Returns the validity mask for this array. - pub fn validity_mask(&self) -> Mask { - self.validity().to_mask(self.len()) - } - // TODO(ngates): deprecate construction from vec pub fn from_vec>(data: Vec, validity: V) -> Self { let validity = validity.into(); @@ -299,9 +342,10 @@ impl ByteBoolData { } } + impl ValidityVTable for ByteBool { fn validity(array: ArrayView<'_, ByteBool>) -> VortexResult { - Ok(array.data().validity()) + Ok(ByteBoolArrayExt::validity(&array)) } } diff --git a/encodings/datetime-parts/public-api.lock b/encodings/datetime-parts/public-api.lock index a06b945b65d..99bb5a4a6a0 100644 --- a/encodings/datetime-parts/public-api.lock +++ b/encodings/datetime-parts/public-api.lock @@ -26,15 +26,15 @@ pub type vortex_datetime_parts::DateTimeParts::OperationsVTable = vortex_datetim pub type vortex_datetime_parts::DateTimeParts::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_datetime_parts::DateTimeParts::array_eq(array: &vortex_datetime_parts::DateTimePartsData, other: &vortex_datetime_parts::DateTimePartsData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_datetime_parts::DateTimeParts::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_datetime_parts::DateTimeParts::array_hash(array: &vortex_datetime_parts::DateTimePartsData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_datetime_parts::DateTimeParts::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_datetime_parts::DateTimeParts::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_datetime_parts::DateTimeParts::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option -pub fn vortex_datetime_parts::DateTimeParts::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_datetime_parts::DateTimeParts::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_datetime_parts::DateTimeParts::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -52,9 +52,7 @@ pub fn vortex_datetime_parts::DateTimeParts::slot_name(_array: vortex_array::arr pub fn vortex_datetime_parts::DateTimeParts::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_datetime_parts::DateTimeParts::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_datetime_parts::DateTimeParts::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_datetime_parts::DateTimeParts::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_datetime_parts::DateTimeParts @@ -62,7 +60,7 @@ pub fn vortex_datetime_parts::DateTimeParts::scalar_at(array: vortex_array::arra impl vortex_array::array::vtable::validity::ValidityChild for vortex_datetime_parts::DateTimeParts -pub fn vortex_datetime_parts::DateTimeParts::validity_child(array: &vortex_datetime_parts::DateTimePartsData) -> &vortex_array::array::erased::ArrayRef +pub fn vortex_datetime_parts::DateTimeParts::validity_child(array: vortex_array::array::view::ArrayView<'_, vortex_datetime_parts::DateTimeParts>) -> vortex_array::array::erased::ArrayRef impl vortex_array::arrays::dict::take::TakeExecute for vortex_datetime_parts::DateTimeParts @@ -92,16 +90,6 @@ pub struct vortex_datetime_parts::DateTimePartsData impl vortex_datetime_parts::DateTimePartsData -pub fn vortex_datetime_parts::DateTimePartsData::days(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_datetime_parts::DateTimePartsData::is_empty(&self) -> bool - -pub fn vortex_datetime_parts::DateTimePartsData::len(&self) -> usize - -pub fn vortex_datetime_parts::DateTimePartsData::seconds(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_datetime_parts::DateTimePartsData::subseconds(&self) -> &vortex_array::array::erased::ArrayRef - pub fn vortex_datetime_parts::DateTimePartsData::validate(dtype: &vortex_array::dtype::DType, days: &vortex_array::array::erased::ArrayRef, seconds: &vortex_array::array::erased::ArrayRef, subseconds: &vortex_array::array::erased::ArrayRef, len: usize) -> vortex_error::VortexResult<()> impl core::clone::Clone for vortex_datetime_parts::DateTimePartsData @@ -174,6 +162,36 @@ pub vortex_datetime_parts::TemporalParts::seconds: vortex_array::array::erased:: pub vortex_datetime_parts::TemporalParts::subseconds: vortex_array::array::erased::ArrayRef +pub trait vortex_datetime_parts::DateTimePartsArrayExt + +pub fn vortex_datetime_parts::DateTimePartsArrayExt::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_datetime_parts::DateTimePartsArrayExt::days(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_datetime_parts::DateTimePartsArrayExt::seconds(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_datetime_parts::DateTimePartsArrayExt::subseconds(&self) -> &vortex_array::array::erased::ArrayRef + +impl vortex_datetime_parts::DateTimePartsArrayExt for vortex_array::array::typed::Array + +pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::typed::Array::days(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::typed::Array::seconds(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::typed::Array::subseconds(&self) -> &vortex_array::array::erased::ArrayRef + +impl vortex_datetime_parts::DateTimePartsArrayExt for vortex_array::array::view::ArrayView<'_, vortex_datetime_parts::DateTimeParts> + +pub fn vortex_array::array::view::ArrayView<'_, vortex_datetime_parts::DateTimeParts>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::view::ArrayView<'_, vortex_datetime_parts::DateTimeParts>::days(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::view::ArrayView<'_, vortex_datetime_parts::DateTimeParts>::seconds(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::view::ArrayView<'_, vortex_datetime_parts::DateTimeParts>::subseconds(&self) -> &vortex_array::array::erased::ArrayRef + pub fn vortex_datetime_parts::initialize(session: &vortex_session::VortexSession) pub fn vortex_datetime_parts::split_temporal(array: vortex_array::arrays::datetime::TemporalArray) -> vortex_error::VortexResult diff --git a/encodings/datetime-parts/src/array.rs b/encodings/datetime-parts/src/array.rs index dcec81bb6bd..2c8d2539f48 100644 --- a/encodings/datetime-parts/src/array.rs +++ b/encodings/datetime-parts/src/array.rs @@ -86,7 +86,16 @@ impl VTable for DateTimeParts { len: usize, slots: &[Option], ) -> VortexResult<()> { - DateTimePartsData::validate(dtype, data.days(), data.seconds(), data.subseconds(), len) + let days = slots[DAYS_SLOT] + .as_ref() + .vortex_expect("DateTimePartsArray days slot"); + let seconds = slots[SECONDS_SLOT] + .as_ref() + .vortex_expect("DateTimePartsArray seconds slot"); + let subseconds = slots[SUBSECONDS_SLOT] + .as_ref() + .vortex_expect("DateTimePartsArray subseconds slot"); + DateTimePartsData::validate(dtype, days, seconds, subseconds, len) } fn array_hash( @@ -140,7 +149,7 @@ impl VTable for DateTimeParts { _buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = DateTimePartsMetadata::decode(metadata)?; if children.len() != 3 { vortex_bail!( @@ -165,11 +174,13 @@ impl VTable for DateTimeParts { len, )?; - DateTimePartsData::try_new(dtype.clone(), days, seconds, subseconds) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + let slots = vec![ + Some(days.clone()), + Some(seconds.clone()), + Some(subseconds.clone()), + ]; + let data = DateTimePartsData::try_new(dtype.clone(), days, seconds, subseconds)?; + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { @@ -215,7 +226,40 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["days", "seconds", "subseconds #[derive(Clone, Debug)] pub struct DateTimePartsData { - pub(super) slots: Vec>, +} + +pub trait DateTimePartsArrayExt { + fn as_slots(&self) -> &[Option]; + + fn days(&self) -> &ArrayRef { + self.as_slots()[DAYS_SLOT] + .as_ref() + .vortex_expect("DateTimePartsArray days slot") + } + + fn seconds(&self) -> &ArrayRef { + self.as_slots()[SECONDS_SLOT] + .as_ref() + .vortex_expect("DateTimePartsArray seconds slot") + } + + fn subseconds(&self) -> &ArrayRef { + self.as_slots()[SUBSECONDS_SLOT] + .as_ref() + .vortex_expect("DateTimePartsArray subseconds slot") + } +} + +impl DateTimePartsArrayExt for Array { + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl DateTimePartsArrayExt for ArrayView<'_, DateTimeParts> { + fn as_slots(&self) -> &[Option] { + self.slots() + } } #[derive(Clone, Debug)] @@ -231,11 +275,18 @@ impl DateTimeParts { seconds: ArrayRef, subseconds: ArrayRef, ) -> VortexResult { + let len = days.len(); + let slots = vec![ + Some(days.clone()), + Some(seconds.clone()), + Some(subseconds.clone()), + ]; let data = DateTimePartsData::try_new(dtype.clone(), days, seconds, subseconds)?; - let len = data.len(); Ok( unsafe { - Array::from_parts_unchecked(ArrayParts::new(DateTimeParts, dtype, len, data)) + Array::from_parts_unchecked( + ArrayParts::new(DateTimeParts, dtype, len, data).with_slots(slots), + ) }, ) } @@ -243,8 +294,8 @@ impl DateTimeParts { /// Construct a [`DateTimePartsArray`] from a [`TemporalArray`]. pub fn try_from_temporal(temporal: TemporalArray) -> VortexResult { let dtype = temporal.dtype().clone(); + let len = temporal.temporal_values().len(); let data = DateTimePartsData::try_from(temporal)?; - let len = data.len(); Ok( unsafe { Array::from_parts_unchecked(ArrayParts::new(DateTimeParts, dtype, len, data)) @@ -296,42 +347,12 @@ impl DateTimePartsData { subseconds: ArrayRef, ) -> VortexResult { Self::validate(&dtype, &days, &seconds, &subseconds, days.len())?; - Ok(Self { - slots: vec![Some(days), Some(seconds), Some(subseconds)], - }) - } - - /// Returns the number of elements in the array. - pub fn len(&self) -> usize { - self.days().len() - } - - /// Returns `true` if the array contains no elements. - pub fn is_empty(&self) -> bool { - self.days().len() == 0 - } - - pub fn days(&self) -> &ArrayRef { - self.slots[DAYS_SLOT] - .as_ref() - .vortex_expect("DateTimePartsArray days slot") - } - - pub fn seconds(&self) -> &ArrayRef { - self.slots[SECONDS_SLOT] - .as_ref() - .vortex_expect("DateTimePartsArray seconds slot") - } - - pub fn subseconds(&self) -> &ArrayRef { - self.slots[SUBSECONDS_SLOT] - .as_ref() - .vortex_expect("DateTimePartsArray subseconds slot") + Ok(Self {}) } } impl ValidityChild for DateTimeParts { - fn validity_child(array: &DateTimePartsData) -> &ArrayRef { - array.days() + fn validity_child(array: ArrayView<'_, DateTimeParts>) -> ArrayRef { + array.days().clone() } } diff --git a/encodings/datetime-parts/src/canonical.rs b/encodings/datetime-parts/src/canonical.rs index c5b969278c2..f1d1aaf6914 100644 --- a/encodings/datetime-parts/src/canonical.rs +++ b/encodings/datetime-parts/src/canonical.rs @@ -19,6 +19,7 @@ use vortex_error::VortexResult; use vortex_error::vortex_panic; use crate::DateTimePartsArray; +use crate::array::DateTimePartsArrayExt; /// Decode an [Array] into a [TemporalArray]. /// diff --git a/encodings/datetime-parts/src/compute/cast.rs b/encodings/datetime-parts/src/compute/cast.rs index ca846bbd424..0e56d594dcb 100644 --- a/encodings/datetime-parts/src/compute/cast.rs +++ b/encodings/datetime-parts/src/compute/cast.rs @@ -10,6 +10,7 @@ use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_error::VortexResult; use crate::DateTimeParts; +use crate::array::DateTimePartsArrayExt; impl CastReduce for DateTimeParts { fn cast(array: ArrayView<'_, Self>, dtype: &DType) -> VortexResult> { if !array.dtype().eq_ignore_nullability(dtype) { diff --git a/encodings/datetime-parts/src/compute/compare.rs b/encodings/datetime-parts/src/compute/compare.rs index 76250bd320e..bd50a7a5d0f 100644 --- a/encodings/datetime-parts/src/compute/compare.rs +++ b/encodings/datetime-parts/src/compute/compare.rs @@ -17,6 +17,7 @@ use vortex_array::scalar_fn::fns::operators::Operator; use vortex_error::VortexResult; use crate::array::DateTimeParts; +use crate::array::DateTimePartsArrayExt; use crate::timestamp; impl CompareKernel for DateTimeParts { diff --git a/encodings/datetime-parts/src/compute/filter.rs b/encodings/datetime-parts/src/compute/filter.rs index da825d8a95e..d717d3d3500 100644 --- a/encodings/datetime-parts/src/compute/filter.rs +++ b/encodings/datetime-parts/src/compute/filter.rs @@ -9,6 +9,7 @@ use vortex_error::VortexResult; use vortex_mask::Mask; use crate::DateTimeParts; +use crate::array::DateTimePartsArrayExt; impl FilterReduce for DateTimeParts { fn filter(array: ArrayView<'_, Self>, mask: &Mask) -> VortexResult> { Ok(Some( diff --git a/encodings/datetime-parts/src/compute/is_constant.rs b/encodings/datetime-parts/src/compute/is_constant.rs index 5c38c3469a1..94e6806e785 100644 --- a/encodings/datetime-parts/src/compute/is_constant.rs +++ b/encodings/datetime-parts/src/compute/is_constant.rs @@ -11,6 +11,7 @@ use vortex_array::scalar::Scalar; use vortex_error::VortexResult; use crate::DateTimeParts; +use crate::array::DateTimePartsArrayExt; /// DateTimeParts-specific is_constant kernel. /// diff --git a/encodings/datetime-parts/src/compute/mask.rs b/encodings/datetime-parts/src/compute/mask.rs index 290707ef8ef..de737105ffe 100644 --- a/encodings/datetime-parts/src/compute/mask.rs +++ b/encodings/datetime-parts/src/compute/mask.rs @@ -9,6 +9,7 @@ use vortex_array::scalar_fn::fns::mask::MaskReduce; use vortex_error::VortexResult; use crate::DateTimeParts; +use crate::array::DateTimePartsArrayExt; impl MaskReduce for DateTimeParts { fn mask(array: ArrayView<'_, Self>, mask: &ArrayRef) -> VortexResult> { diff --git a/encodings/datetime-parts/src/compute/rules.rs b/encodings/datetime-parts/src/compute/rules.rs index 92c1f877c08..e2c9cbaa774 100644 --- a/encodings/datetime-parts/src/compute/rules.rs +++ b/encodings/datetime-parts/src/compute/rules.rs @@ -363,3 +363,4 @@ mod tests { assert_eq!(optimized.as_bool_typed().true_count().unwrap(), 1); } } +use crate::array::DateTimePartsArrayExt; diff --git a/encodings/datetime-parts/src/compute/slice.rs b/encodings/datetime-parts/src/compute/slice.rs index 5bad980d8dc..46819a41562 100644 --- a/encodings/datetime-parts/src/compute/slice.rs +++ b/encodings/datetime-parts/src/compute/slice.rs @@ -10,6 +10,7 @@ use vortex_array::arrays::slice::SliceReduce; use vortex_error::VortexResult; use crate::DateTimeParts; +use crate::array::DateTimePartsArrayExt; impl SliceReduce for DateTimeParts { fn slice(array: ArrayView<'_, Self>, range: Range) -> VortexResult> { diff --git a/encodings/datetime-parts/src/compute/take.rs b/encodings/datetime-parts/src/compute/take.rs index 4cd214663c1..cd15c466b2a 100644 --- a/encodings/datetime-parts/src/compute/take.rs +++ b/encodings/datetime-parts/src/compute/take.rs @@ -16,6 +16,7 @@ use vortex_error::VortexResult; use vortex_error::vortex_panic; use crate::DateTimeParts; +use crate::array::DateTimePartsArrayExt; fn take_datetime_parts( array: ArrayView, indices: &ArrayRef, diff --git a/encodings/datetime-parts/src/ops.rs b/encodings/datetime-parts/src/ops.rs index c0acf4d6a32..2c224b078d5 100644 --- a/encodings/datetime-parts/src/ops.rs +++ b/encodings/datetime-parts/src/ops.rs @@ -12,6 +12,7 @@ use vortex_error::VortexResult; use vortex_error::vortex_panic; use crate::DateTimeParts; +use crate::array::DateTimePartsArrayExt; use crate::timestamp; use crate::timestamp::TimestampParts; diff --git a/encodings/decimal-byte-parts/public-api.lock b/encodings/decimal-byte-parts/public-api.lock index 268967616c6..5dd5101f0b7 100644 --- a/encodings/decimal-byte-parts/public-api.lock +++ b/encodings/decimal-byte-parts/public-api.lock @@ -24,15 +24,15 @@ pub type vortex_decimal_byte_parts::DecimalByteParts::OperationsVTable = vortex_ pub type vortex_decimal_byte_parts::DecimalByteParts::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_decimal_byte_parts::DecimalByteParts::array_eq(array: &vortex_decimal_byte_parts::DecimalBytePartsData, other: &vortex_decimal_byte_parts::DecimalBytePartsData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_decimal_byte_parts::DecimalByteParts::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_decimal_byte_parts::DecimalByteParts::array_hash(array: &vortex_decimal_byte_parts::DecimalBytePartsData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_decimal_byte_parts::DecimalByteParts::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_decimal_byte_parts::DecimalByteParts::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_decimal_byte_parts::DecimalByteParts::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option -pub fn vortex_decimal_byte_parts::DecimalByteParts::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_decimal_byte_parts::DecimalByteParts::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_decimal_byte_parts::DecimalByteParts::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -50,9 +50,7 @@ pub fn vortex_decimal_byte_parts::DecimalByteParts::slot_name(_array: vortex_arr pub fn vortex_decimal_byte_parts::DecimalByteParts::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_decimal_byte_parts::DecimalByteParts::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_decimal_byte_parts::DecimalByteParts::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_decimal_byte_parts::DecimalByteParts::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_decimal_byte_parts::DecimalByteParts @@ -60,7 +58,7 @@ pub fn vortex_decimal_byte_parts::DecimalByteParts::scalar_at(array: vortex_arra impl vortex_array::array::vtable::validity::ValidityChild for vortex_decimal_byte_parts::DecimalByteParts -pub fn vortex_decimal_byte_parts::DecimalByteParts::validity_child(array: &vortex_decimal_byte_parts::DecimalBytePartsData) -> &vortex_array::array::erased::ArrayRef +pub fn vortex_decimal_byte_parts::DecimalByteParts::validity_child(array: vortex_array::array::view::ArrayView<'_, vortex_decimal_byte_parts::DecimalByteParts>) -> vortex_array::array::erased::ArrayRef impl vortex_array::arrays::dict::take::TakeExecute for vortex_decimal_byte_parts::DecimalByteParts @@ -90,12 +88,6 @@ pub struct vortex_decimal_byte_parts::DecimalBytePartsData impl vortex_decimal_byte_parts::DecimalBytePartsData -pub fn vortex_decimal_byte_parts::DecimalBytePartsData::into_parts(self) -> vortex_decimal_byte_parts::DecimalBytePartsDataParts - -pub fn vortex_decimal_byte_parts::DecimalBytePartsData::is_empty(&self) -> bool - -pub fn vortex_decimal_byte_parts::DecimalBytePartsData::len(&self) -> usize - pub fn vortex_decimal_byte_parts::DecimalBytePartsData::validate(msp: &vortex_array::array::erased::ArrayRef, decimal_dtype: vortex_array::dtype::decimal::DecimalDType, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> impl core::clone::Clone for vortex_decimal_byte_parts::DecimalBytePartsData @@ -136,6 +128,24 @@ pub fn vortex_decimal_byte_parts::DecimalBytesPartsMetadata::clear(&mut self) pub fn vortex_decimal_byte_parts::DecimalBytesPartsMetadata::encoded_len(&self) -> usize +pub trait vortex_decimal_byte_parts::DecimalBytePartsArrayExt + +pub fn vortex_decimal_byte_parts::DecimalBytePartsArrayExt::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_decimal_byte_parts::DecimalBytePartsArrayExt::msp(&self) -> &vortex_array::array::erased::ArrayRef + +impl vortex_decimal_byte_parts::DecimalBytePartsArrayExt for vortex_array::array::typed::Array + +pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::typed::Array::msp(&self) -> &vortex_array::array::erased::ArrayRef + +impl vortex_decimal_byte_parts::DecimalBytePartsArrayExt for vortex_array::array::view::ArrayView<'_, vortex_decimal_byte_parts::DecimalByteParts> + +pub fn vortex_array::array::view::ArrayView<'_, vortex_decimal_byte_parts::DecimalByteParts>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::view::ArrayView<'_, vortex_decimal_byte_parts::DecimalByteParts>::msp(&self) -> &vortex_array::array::erased::ArrayRef + pub fn vortex_decimal_byte_parts::initialize(session: &vortex_session::VortexSession) pub type vortex_decimal_byte_parts::DecimalBytePartsArray = vortex_array::array::typed::Array diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/cast.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/cast.rs index d78c6e2a96d..e554bbfae71 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/cast.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/cast.rs @@ -11,6 +11,7 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::DecimalByteParts; +use crate::decimal_byte_parts::DecimalBytePartsArrayExt; impl CastReduce for DecimalByteParts { fn cast(array: ArrayView<'_, Self>, dtype: &DType) -> VortexResult> { // DecimalBytePartsArray can only have Decimal dtype, so we only handle decimal-to-decimal casts 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 b0afad10cfa..43f06b6e695 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 @@ -25,6 +25,7 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::DecimalByteParts; +use crate::decimal_byte_parts::DecimalBytePartsArrayExt; use crate::decimal_byte_parts::compute::compare::Sign::Positive; impl CompareKernel for DecimalByteParts { 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 49435845476..c82171b0e13 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 @@ -10,6 +10,7 @@ use vortex_error::VortexResult; use vortex_mask::Mask; use crate::DecimalByteParts; +use crate::decimal_byte_parts::DecimalBytePartsArrayExt; impl FilterReduce for DecimalByteParts { fn filter(array: ArrayView<'_, Self>, mask: &Mask) -> VortexResult> { DecimalByteParts::try_new( 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 bca11eda747..4d271eb80b3 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 @@ -11,6 +11,7 @@ use vortex_array::scalar::Scalar; use vortex_error::VortexResult; use crate::DecimalByteParts; +use crate::decimal_byte_parts::DecimalBytePartsArrayExt; /// DecimalByteParts-specific is_constant kernel. /// 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 4c1b1a36c64..a41ae8e21c6 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 @@ -12,6 +12,7 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::DecimalByteParts; +use crate::decimal_byte_parts::DecimalBytePartsArrayExt; impl MaskReduce for DecimalByteParts { fn mask(array: ArrayView<'_, Self>, mask: &ArrayRef) -> VortexResult> { 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 3c7f7ecfabf..807b660ec73 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 @@ -10,6 +10,7 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::DecimalByteParts; +use crate::decimal_byte_parts::DecimalBytePartsArrayExt; impl TakeExecute for DecimalByteParts { fn take( 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 0091378c6a8..ea7d730dcf1 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs @@ -73,7 +73,10 @@ impl VTable for DecimalByteParts { let Some(decimal_dtype) = dtype.as_decimal_opt() else { vortex_bail!("expected decimal dtype, got {}", dtype) }; - DecimalBytePartsData::validate(data.msp(), *decimal_dtype, dtype, len) + let msp = slots[MSP_SLOT] + .as_ref() + .vortex_expect("DecimalBytePartsArray msp slot"); + DecimalBytePartsData::validate(msp, *decimal_dtype, dtype, len) } fn array_hash( @@ -122,7 +125,7 @@ impl VTable for DecimalByteParts { _buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = DecimalBytesPartsMetadata::decode(metadata)?; let Some(decimal_dtype) = dtype.as_decimal_opt() else { vortex_bail!("decoding decimal but given non decimal dtype {}", dtype) @@ -137,11 +140,9 @@ impl VTable for DecimalByteParts { "lower_part_count > 0 not currently supported" ); - DecimalBytePartsData::try_new(msp, *decimal_dtype) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + let slots = vec![Some(msp.clone())]; + let data = DecimalBytePartsData::try_new(msp, *decimal_dtype)?; + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { @@ -186,7 +187,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["msp"]; /// e.g. for a decimal i128 \[ 127..64 | 64..0 \] msp = 127..64 and lower_part\[0\] = 64..0 #[derive(Clone, Debug)] pub struct DecimalBytePartsData { - 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. @@ -197,6 +197,28 @@ pub struct DecimalBytePartsDataParts { pub msp: ArrayRef, } +pub trait DecimalBytePartsArrayExt { + fn as_slots(&self) -> &[Option]; + + fn msp(&self) -> &ArrayRef { + self.as_slots()[MSP_SLOT] + .as_ref() + .vortex_expect("DecimalBytePartsArray msp slot") + } +} + +impl DecimalBytePartsArrayExt for Array { + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl DecimalBytePartsArrayExt for ArrayView<'_, DecimalByteParts> { + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + impl DecimalBytePartsData { pub fn validate( msp: &ArrayRef, @@ -220,34 +242,7 @@ impl DecimalBytePartsData { pub(crate) fn try_new(msp: ArrayRef, decimal_dtype: DecimalDType) -> VortexResult { let dtype = DType::Decimal(decimal_dtype, msp.dtype().nullability()); Self::validate(&msp, decimal_dtype, &dtype, msp.len())?; - Ok(Self { - slots: vec![Some(msp)], - _lower_parts: Vec::new(), - }) - } - - /// Returns the number of elements in the array. - pub fn len(&self) -> usize { - self.msp().len() - } - - /// Returns `true` if the array contains no elements. - pub fn is_empty(&self) -> bool { - self.msp().len() == 0 - } - - pub(crate) fn msp(&self) -> &ArrayRef { - self.slots[MSP_SLOT] - .as_ref() - .vortex_expect("DecimalBytePartsArray msp slot") - } - - pub fn into_parts(mut self) -> DecimalBytePartsDataParts { - DecimalBytePartsDataParts { - msp: self.slots[MSP_SLOT] - .take() - .vortex_expect("DecimalBytePartsArray msp slot"), - } + Ok(Self { _lower_parts: Vec::new() }) } } @@ -262,11 +257,14 @@ impl DecimalByteParts { msp: ArrayRef, decimal_dtype: DecimalDType, ) -> VortexResult { + let len = msp.len(); + let dtype = DType::Decimal(decimal_dtype, msp.dtype().nullability()); + let slots = vec![Some(msp.clone())]; let data = DecimalBytePartsData::try_new(msp, decimal_dtype)?; - let dtype = DType::Decimal(decimal_dtype, data.msp().dtype().nullability()); - let len = data.len(); Ok(unsafe { - Array::from_parts_unchecked(ArrayParts::new(DecimalByteParts, dtype, len, data)) + Array::from_parts_unchecked( + ArrayParts::new(DecimalByteParts, dtype, len, data).with_slots(slots), + ) }) } } @@ -319,9 +317,9 @@ impl OperationsVTable for DecimalByteParts { } impl ValidityChild for DecimalByteParts { - fn validity_child(array: &DecimalBytePartsData) -> &ArrayRef { + fn validity_child(array: ArrayView<'_, DecimalByteParts>) -> ArrayRef { // validity stored in 0th child - array.msp() + array.msp().clone() } } 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 0eeaeed5716..7fafa0d5289 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/rules.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/rules.rs @@ -15,6 +15,7 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::DecimalByteParts; +use crate::decimal_byte_parts::DecimalBytePartsArrayExt; pub(super) const PARENT_RULES: ParentRuleSet = ParentRuleSet::new(&[ ParentRuleSet::lift(&DecimalBytePartsFilterPushDownRule), diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/slice.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/slice.rs index 89275570a53..a9c022d2051 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/slice.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/slice.rs @@ -11,6 +11,7 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::DecimalByteParts; +use crate::decimal_byte_parts::DecimalBytePartsArrayExt; impl SliceReduce for DecimalByteParts { fn slice(array: ArrayView<'_, Self>, range: Range) -> VortexResult> { diff --git a/encodings/fastlanes/public-api.lock b/encodings/fastlanes/public-api.lock index 98354d33f0b..488abace4bd 100644 --- a/encodings/fastlanes/public-api.lock +++ b/encodings/fastlanes/public-api.lock @@ -146,15 +146,15 @@ pub type vortex_fastlanes::BitPacked::ValidityVTable = vortex_fastlanes::BitPack pub fn vortex_fastlanes::BitPacked::append_to_builder(array: vortex_array::array::view::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_fastlanes::BitPacked::array_eq(array: &vortex_fastlanes::BitPackedData, other: &vortex_fastlanes::BitPackedData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fastlanes::BitPacked::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fastlanes::BitPacked::array_hash(array: &vortex_fastlanes::BitPackedData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fastlanes::BitPacked::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_fastlanes::BitPacked::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_fastlanes::BitPacked::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option -pub fn vortex_fastlanes::BitPacked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_fastlanes::BitPacked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_fastlanes::BitPacked::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -172,9 +172,7 @@ pub fn vortex_fastlanes::BitPacked::slot_name(_array: vortex_array::array::view: pub fn vortex_fastlanes::BitPacked::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_fastlanes::BitPacked::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_fastlanes::BitPacked::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::BitPacked::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_fastlanes::BitPacked @@ -218,28 +216,12 @@ pub fn vortex_fastlanes::BitPackedData::packed(&self) -> &vortex_array::buffer:: pub fn vortex_fastlanes::BitPackedData::packed_slice(&self) -> &[T] -pub fn vortex_fastlanes::BitPackedData::patch_chunk_offsets(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> - -pub fn vortex_fastlanes::BitPackedData::patch_indices(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> - -pub fn vortex_fastlanes::BitPackedData::patch_values(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> - -pub fn vortex_fastlanes::BitPackedData::patches(&self, len: usize) -> core::option::Option - pub fn vortex_fastlanes::BitPackedData::ptype(&self, dtype: &vortex_array::dtype::DType) -> vortex_array::dtype::ptype::PType -pub fn vortex_fastlanes::BitPackedData::replace_patches(&mut self, patches: core::option::Option) - pub fn vortex_fastlanes::BitPackedData::try_new(packed: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::ptype::PType, validity: vortex_array::validity::Validity, patches: core::option::Option, bit_width: u8, length: usize, offset: u16) -> vortex_error::VortexResult pub fn vortex_fastlanes::BitPackedData::unpacked_chunks(&self, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult> -pub fn vortex_fastlanes::BitPackedData::validity(&self, nullability: vortex_array::dtype::nullability::Nullability) -> vortex_array::validity::Validity - -pub fn vortex_fastlanes::BitPackedData::validity_child(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> - -pub fn vortex_fastlanes::BitPackedData::validity_mask(&self, len: usize, nullability: vortex_array::dtype::nullability::Nullability) -> vortex_mask::Mask - impl core::clone::Clone for vortex_fastlanes::BitPackedData pub fn vortex_fastlanes::BitPackedData::clone(&self) -> vortex_fastlanes::BitPackedData @@ -288,15 +270,15 @@ pub type vortex_fastlanes::Delta::OperationsVTable = vortex_fastlanes::Delta pub type vortex_fastlanes::Delta::ValidityVTable = vortex_fastlanes::Delta -pub fn vortex_fastlanes::Delta::array_eq(array: &vortex_fastlanes::DeltaData, other: &vortex_fastlanes::DeltaData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fastlanes::Delta::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fastlanes::Delta::array_hash(array: &vortex_fastlanes::DeltaData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fastlanes::Delta::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_fastlanes::Delta::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_fastlanes::Delta::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, _idx: usize) -> core::option::Option -pub fn vortex_fastlanes::Delta::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_fastlanes::Delta::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_fastlanes::Delta::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -312,9 +294,7 @@ pub fn vortex_fastlanes::Delta::slot_name(_array: vortex_array::array::view::Arr pub fn vortex_fastlanes::Delta::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_fastlanes::Delta::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_fastlanes::Delta::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::Delta::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_fastlanes::Delta @@ -336,12 +316,6 @@ pub struct vortex_fastlanes::DeltaData impl vortex_fastlanes::DeltaData -pub fn vortex_fastlanes::DeltaData::bases(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_fastlanes::DeltaData::deltas(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_fastlanes::DeltaData::offset(&self) -> usize - pub fn vortex_fastlanes::DeltaData::try_new(bases: vortex_array::array::erased::ArrayRef, deltas: vortex_array::array::erased::ArrayRef, offset: usize, len: usize) -> vortex_error::VortexResult impl core::clone::Clone for vortex_fastlanes::DeltaData @@ -378,15 +352,15 @@ pub type vortex_fastlanes::FoR::OperationsVTable = vortex_fastlanes::FoR pub type vortex_fastlanes::FoR::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_fastlanes::FoR::array_eq(array: &vortex_fastlanes::FoRData, other: &vortex_fastlanes::FoRData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fastlanes::FoR::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fastlanes::FoR::array_hash(array: &vortex_fastlanes::FoRData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fastlanes::FoR::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_fastlanes::FoR::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_fastlanes::FoR::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, _idx: usize) -> core::option::Option -pub fn vortex_fastlanes::FoR::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_fastlanes::FoR::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_fastlanes::FoR::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -404,9 +378,7 @@ pub fn vortex_fastlanes::FoR::slot_name(_array: vortex_array::array::view::Array pub fn vortex_fastlanes::FoR::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_fastlanes::FoR::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_fastlanes::FoR::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::FoR::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_fastlanes::FoR @@ -414,7 +386,7 @@ pub fn vortex_fastlanes::FoR::scalar_at(array: vortex_array::array::view::ArrayV impl vortex_array::array::vtable::validity::ValidityChild for vortex_fastlanes::FoR -pub fn vortex_fastlanes::FoR::validity_child(array: &vortex_fastlanes::FoRData) -> &vortex_array::array::erased::ArrayRef +pub fn vortex_fastlanes::FoR::validity_child(array: vortex_array::array::view::ArrayView<'_, vortex_fastlanes::FoR>) -> vortex_array::array::erased::ArrayRef impl vortex_array::arrays::dict::take::TakeExecute for vortex_fastlanes::FoR @@ -440,21 +412,11 @@ pub struct vortex_fastlanes::FoRData impl vortex_fastlanes::FoRData -pub fn vortex_fastlanes::FoRData::dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_fastlanes::FoRData::encoded(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_fastlanes::FoRData::is_empty(&self) -> bool - -pub fn vortex_fastlanes::FoRData::len(&self) -> usize - -pub fn vortex_fastlanes::FoRData::ptype(&self) -> vortex_array::dtype::ptype::PType - -pub fn vortex_fastlanes::FoRData::reference_scalar(&self) -> &vortex_array::scalar::Scalar +pub fn vortex_fastlanes::FoRData::encode(array: vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_error::VortexResult impl vortex_fastlanes::FoRData -pub fn vortex_fastlanes::FoRData::encode(array: vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_error::VortexResult +pub fn vortex_fastlanes::FoRData::ptype(&self) -> vortex_array::dtype::ptype::PType impl core::clone::Clone for vortex_fastlanes::FoRData @@ -492,15 +454,15 @@ pub type vortex_fastlanes::RLE::OperationsVTable = vortex_fastlanes::RLE pub type vortex_fastlanes::RLE::ValidityVTable = vortex_fastlanes::RLE -pub fn vortex_fastlanes::RLE::array_eq(array: &vortex_fastlanes::RLEData, other: &vortex_fastlanes::RLEData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fastlanes::RLE::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fastlanes::RLE::array_hash(array: &vortex_fastlanes::RLEData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fastlanes::RLE::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_fastlanes::RLE::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_fastlanes::RLE::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, _idx: usize) -> core::option::Option -pub fn vortex_fastlanes::RLE::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_fastlanes::RLE::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_fastlanes::RLE::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -518,9 +480,7 @@ pub fn vortex_fastlanes::RLE::slot_name(_array: vortex_array::array::view::Array pub fn vortex_fastlanes::RLE::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_fastlanes::RLE::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_fastlanes::RLE::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::RLE::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_fastlanes::RLE @@ -546,18 +506,12 @@ pub fn vortex_fastlanes::RLEData::encode(array: &vortex_array::arrays::primitive impl vortex_fastlanes::RLEData -pub fn vortex_fastlanes::RLEData::indices(&self) -> &vortex_array::array::erased::ArrayRef - pub unsafe fn vortex_fastlanes::RLEData::new_unchecked(values: vortex_array::array::erased::ArrayRef, indices: vortex_array::array::erased::ArrayRef, values_idx_offsets: vortex_array::array::erased::ArrayRef, offset: usize) -> Self pub fn vortex_fastlanes::RLEData::offset(&self) -> usize pub fn vortex_fastlanes::RLEData::try_new(values: vortex_array::array::erased::ArrayRef, indices: vortex_array::array::erased::ArrayRef, values_idx_offsets: vortex_array::array::erased::ArrayRef, offset: usize, length: usize) -> vortex_error::VortexResult -pub fn vortex_fastlanes::RLEData::values(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_fastlanes::RLEData::values_idx_offsets(&self) -> &vortex_array::array::erased::ArrayRef - impl core::clone::Clone for vortex_fastlanes::RLEData pub fn vortex_fastlanes::RLEData::clone(&self) -> vortex_fastlanes::RLEData @@ -568,6 +522,8 @@ pub fn vortex_fastlanes::RLEData::fmt(&self, f: &mut core::fmt::Formatter<'_>) - pub trait vortex_fastlanes::BitPackedArrayExt +pub fn vortex_fastlanes::BitPackedArrayExt::as_slots(&self) -> &[core::option::Option] + pub fn vortex_fastlanes::BitPackedArrayExt::bit_width(&self) -> u8 pub fn vortex_fastlanes::BitPackedArrayExt::bitpacked_data(&self) -> &vortex_fastlanes::BitPackedData @@ -600,6 +556,8 @@ pub fn vortex_fastlanes::BitPackedArrayExt::validity_mask(&self) -> vortex_mask: impl vortex_fastlanes::BitPackedArrayExt for vortex_array::array::typed::Array +pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] + pub fn vortex_array::array::typed::Array::bit_width(&self) -> u8 pub fn vortex_array::array::typed::Array::bitpacked_data(&self) -> &vortex_fastlanes::BitPackedData @@ -632,6 +590,8 @@ pub fn vortex_array::array::typed::Array::validity_ impl vortex_fastlanes::BitPackedArrayExt for vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked> +pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::as_slots(&self) -> &[core::option::Option] + pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::bit_width(&self) -> u8 pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::bitpacked_data(&self) -> &vortex_fastlanes::BitPackedData @@ -662,6 +622,84 @@ pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::va pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::validity_mask(&self) -> vortex_mask::Mask +pub trait vortex_fastlanes::FoRArrayExt + +pub fn vortex_fastlanes::FoRArrayExt::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_fastlanes::FoRArrayExt::encoded(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_fastlanes::FoRArrayExt::for_data(&self) -> &vortex_fastlanes::FoRData + +pub fn vortex_fastlanes::FoRArrayExt::reference_scalar(&self) -> &vortex_array::scalar::Scalar + +impl vortex_fastlanes::FoRArrayExt for vortex_array::array::typed::Array + +pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::typed::Array::encoded(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::typed::Array::for_data(&self) -> &vortex_fastlanes::FoRData + +pub fn vortex_array::array::typed::Array::reference_scalar(&self) -> &vortex_array::scalar::Scalar + +impl vortex_fastlanes::FoRArrayExt for vortex_array::array::view::ArrayView<'_, vortex_fastlanes::FoR> + +pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::FoR>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::FoR>::encoded(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::FoR>::for_data(&self) -> &vortex_fastlanes::FoRData + +pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::FoR>::reference_scalar(&self) -> &vortex_array::scalar::Scalar + +pub trait vortex_fastlanes::RLEArrayExt + +pub fn vortex_fastlanes::RLEArrayExt::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_fastlanes::RLEArrayExt::indices(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_fastlanes::RLEArrayExt::offset(&self) -> usize + +pub fn vortex_fastlanes::RLEArrayExt::rle_data(&self) -> &vortex_fastlanes::RLEData + +pub fn vortex_fastlanes::RLEArrayExt::values(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_fastlanes::RLEArrayExt::values_idx_offset(&self, chunk_idx: usize) -> usize + +pub fn vortex_fastlanes::RLEArrayExt::values_idx_offsets(&self) -> &vortex_array::array::erased::ArrayRef + +impl vortex_fastlanes::RLEArrayExt for vortex_array::array::typed::Array + +pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::typed::Array::indices(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::typed::Array::offset(&self) -> usize + +pub fn vortex_array::array::typed::Array::rle_data(&self) -> &vortex_fastlanes::RLEData + +pub fn vortex_array::array::typed::Array::values(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::typed::Array::values_idx_offset(&self, chunk_idx: usize) -> usize + +pub fn vortex_array::array::typed::Array::values_idx_offsets(&self) -> &vortex_array::array::erased::ArrayRef + +impl vortex_fastlanes::RLEArrayExt for vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE> + +pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE>::indices(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE>::offset(&self) -> usize + +pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE>::rle_data(&self) -> &vortex_fastlanes::RLEData + +pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE>::values(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE>::values_idx_offset(&self, chunk_idx: usize) -> usize + +pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE>::values_idx_offsets(&self) -> &vortex_array::array::erased::ArrayRef + pub fn vortex_fastlanes::delta_compress(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<(vortex_array::arrays::primitive::vtable::PrimitiveArray, vortex_array::arrays::primitive::vtable::PrimitiveArray)> pub fn vortex_fastlanes::initialize(session: &vortex_session::VortexSession) diff --git a/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs b/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs index 9b6fcbc9fd1..0a3751769e3 100644 --- a/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs +++ b/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs @@ -449,7 +449,7 @@ mod test { ); assert!(values.ptype().is_unsigned_int()); let compressed = BitPackedData::encode(&values.into_array(), 4).unwrap(); - assert!(compressed.patches(compressed.len()).is_none()); + assert!(compressed.patches().is_none()); assert_eq!( (0..(1 << 4)).collect::>(), compressed @@ -511,7 +511,7 @@ mod test { let array = PrimitiveArray::from_iter(values); let bitpacked = bitpack_encode(&array, 4, None).unwrap(); - let patches = bitpacked.patches(bitpacked.len()).unwrap(); + let patches = bitpacked.patches().unwrap(); let chunk_offsets = patches.chunk_offsets().as_ref().unwrap().to_primitive(); // chunk 0 (0-1023): patches at 100, 200 -> starts at patch index 0 @@ -534,7 +534,7 @@ mod test { let array = PrimitiveArray::from_iter(values); let bitpacked = bitpack_encode(&array, 4, None).unwrap(); - let patches = bitpacked.patches(bitpacked.len()).unwrap(); + let patches = bitpacked.patches().unwrap(); let chunk_offsets = patches.chunk_offsets().as_ref().unwrap().to_primitive(); assert_arrays_eq!(chunk_offsets, PrimitiveArray::from_iter([0u64, 2, 2])); @@ -553,7 +553,7 @@ mod test { let array = PrimitiveArray::from_iter(values); let bitpacked = bitpack_encode(&array, 4, None).unwrap(); - let patches = bitpacked.patches(bitpacked.len()).unwrap(); + let patches = bitpacked.patches().unwrap(); let chunk_offsets = patches.chunk_offsets().as_ref().unwrap().to_primitive(); // chunk 0 (0-1023): patches at 100, 200 -> starts at patch index 0 @@ -577,7 +577,7 @@ mod test { let array = PrimitiveArray::from_iter(values); let bitpacked = bitpack_encode(&array, 4, None).unwrap(); - let patches = bitpacked.patches(bitpacked.len()).unwrap(); + let patches = bitpacked.patches().unwrap(); let chunk_offsets = patches.chunk_offsets().as_ref().unwrap().to_primitive(); // Single chunk starting at patch index 0. diff --git a/encodings/fastlanes/src/bitpacking/array/mod.rs b/encodings/fastlanes/src/bitpacking/array/mod.rs index 9e8c98b1c04..7e35c12b902 100644 --- a/encodings/fastlanes/src/bitpacking/array/mod.rs +++ b/encodings/fastlanes/src/bitpacking/array/mod.rs @@ -15,7 +15,6 @@ use vortex_array::dtype::PType; use vortex_array::patches::Patches; use vortex_array::validity::Validity; use vortex_array::vtable::child_to_validity; -use vortex_array::vtable::validity_to_child; use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_ensure; @@ -57,7 +56,6 @@ pub struct BitPackedDataParts { #[derive(Clone, Debug)] pub struct BitPackedData { - pub(super) slots: Vec>, /// The offset within the first block (created with a slice). /// 0 <= offset < 1024 pub(super) offset: u16, @@ -98,14 +96,13 @@ impl BitPackedData { len: usize, offset: u16, ) -> Self { - let slots = Self::make_slots(&patches, &validity, len); + drop((validity, len)); let (patch_offset, patch_offset_within_chunk) = match &patches { Some(p) => (Some(p.offset()), p.offset_within_chunk()), None => (None, None), }; Self { - slots, offset, bit_width, packed, @@ -114,23 +111,6 @@ impl BitPackedData { } } - 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 @@ -179,14 +159,18 @@ impl BitPackedData { } } - pub(crate) fn validate_against_outer(&self, dtype: &DType, len: usize) -> VortexResult<()> { - let validity = self.validity(dtype.nullability()); - let patches = self.patches(len); + pub(crate) fn validate_against_slots( + &self, + dtype: &DType, + len: usize, + validity: &Validity, + patches: Option<&Patches>, + ) -> VortexResult<()> { Self::validate( &self.packed, dtype.as_ptype(), - &validity, - patches.as_ref(), + validity, + patches, self.bit_width, len, self.offset, @@ -254,11 +238,6 @@ impl BitPackedData { Ok(()) } - /// Returns the validity as a [`Mask`](vortex_mask::Mask). - pub fn validity_mask(&self, len: usize, nullability: Nullability) -> vortex_mask::Mask { - self.validity(nullability).to_mask(len) - } - pub fn ptype(&self, dtype: &DType) -> PType { dtype.as_ptype() } @@ -283,26 +262,6 @@ impl BitPackedData { unsafe { std::slice::from_raw_parts(packed_ptr, packed_len) } } - #[inline] - pub fn patch_indices(&self) -> Option<&ArrayRef> { - self.slots[PATCH_INDICES_SLOT].as_ref() - } - - #[inline] - pub fn patch_values(&self) -> Option<&ArrayRef> { - self.slots[PATCH_VALUES_SLOT].as_ref() - } - - #[inline] - pub fn patch_chunk_offsets(&self) -> Option<&ArrayRef> { - self.slots[PATCH_CHUNK_OFFSETS_SLOT].as_ref() - } - - #[inline] - pub fn validity_child(&self) -> Option<&ArrayRef> { - self.slots[VALIDITY_SLOT].as_ref() - } - /// Accessor for bit unpacked chunks pub fn unpacked_chunks( &self, @@ -323,53 +282,6 @@ impl BitPackedData { self.bit_width } - /// Access the patches array. - /// - /// Reconstructs a `Patches` from the stored slots and patch metadata. - /// If present, patches MUST be a `SparseArray` with equal-length to this array, and whose - /// indices indicate the locations of patches. The indices must have non-zero length. - pub fn patches(&self, len: usize) -> Option { - match (self.patch_indices(), self.patch_values()) { - (Some(indices), Some(values)) => { - let patch_offset = self - .patch_offset - .vortex_expect("has patch slots but no patch_offset"); - Some(unsafe { - Patches::new_unchecked( - len, - patch_offset, - indices.clone(), - values.clone(), - self.patch_chunk_offsets().cloned(), - self.patch_offset_within_chunk, - ) - }) - } - _ => None, - } - } - - /// Returns the validity, reconstructed from the stored slot. - pub fn validity(&self, nullability: Nullability) -> Validity { - child_to_validity(&self.validity_child().cloned(), nullability) - } - - pub fn replace_patches(&mut self, patches: Option) { - let (pi, pv, pco) = match &patches { - Some(p) => ( - Some(p.indices().clone()), - Some(p.values().clone()), - p.chunk_offsets().clone(), - ), - None => (None, None, None), - }; - self.slots[PATCH_INDICES_SLOT] = pi; - self.slots[PATCH_VALUES_SLOT] = pv; - self.slots[PATCH_CHUNK_OFFSETS_SLOT] = pco; - self.patch_offset = patches.as_ref().map(|p| p.offset()); - self.patch_offset_within_chunk = patches.as_ref().and_then(|p| p.offset_within_chunk()); - } - #[inline] pub fn offset(&self) -> u16 { self.offset @@ -403,15 +315,13 @@ impl BitPackedData { } pub fn into_parts(self, len: usize, nullability: Nullability) -> BitPackedDataParts { - let patches = self.patches(len); - let validity = self.validity(nullability); BitPackedDataParts { offset: self.offset, bit_width: self.bit_width, len, packed: self.packed, - patches, - validity, + patches: None, + validity: Validity::from(nullability), } } } @@ -420,6 +330,7 @@ pub trait BitPackedArrayExt { fn bitpacked_data(&self) -> &BitPackedData; fn bitpacked_dtype(&self) -> &DType; fn bitpacked_len(&self) -> usize; + fn as_slots(&self) -> &[Option]; #[inline] fn packed(&self) -> &BufferHandle { @@ -438,33 +349,50 @@ pub trait BitPackedArrayExt { #[inline] fn patch_indices(&self) -> Option<&ArrayRef> { - self.bitpacked_data().patch_indices() + self.as_slots()[PATCH_INDICES_SLOT].as_ref() } #[inline] fn patch_values(&self) -> Option<&ArrayRef> { - self.bitpacked_data().patch_values() + self.as_slots()[PATCH_VALUES_SLOT].as_ref() } #[inline] fn patch_chunk_offsets(&self) -> Option<&ArrayRef> { - self.bitpacked_data().patch_chunk_offsets() + self.as_slots()[PATCH_CHUNK_OFFSETS_SLOT].as_ref() } #[inline] fn validity_child(&self) -> Option<&ArrayRef> { - self.bitpacked_data().validity_child() + self.as_slots()[VALIDITY_SLOT].as_ref() } #[inline] fn patches(&self) -> Option { - self.bitpacked_data().patches(self.bitpacked_len()) + match (self.patch_indices(), self.patch_values()) { + (Some(indices), Some(values)) => { + let patch_offset = self + .bitpacked_data() + .patch_offset + .vortex_expect("has patch slots but no patch_offset"); + Some(unsafe { + Patches::new_unchecked( + self.bitpacked_len(), + patch_offset, + indices.clone(), + values.clone(), + self.patch_chunk_offsets().cloned(), + self.bitpacked_data().patch_offset_within_chunk, + ) + }) + } + _ => None, + } } #[inline] fn validity(&self) -> Validity { - self.bitpacked_data() - .validity(self.bitpacked_dtype().nullability()) + child_to_validity(&self.validity_child().cloned(), self.bitpacked_dtype().nullability()) } #[inline] @@ -496,6 +424,10 @@ impl BitPackedArrayExt for Array { fn bitpacked_len(&self) -> usize { self.len() } + + fn as_slots(&self) -> &[Option] { + self.slots() + } } impl BitPackedArrayExt for ArrayView<'_, crate::BitPacked> { @@ -510,6 +442,10 @@ impl BitPackedArrayExt for ArrayView<'_, crate::BitPacked> { fn bitpacked_len(&self) -> usize { self.len() } + + fn as_slots(&self) -> &[Option] { + self.slots() + } } #[cfg(test)] @@ -557,7 +493,7 @@ mod test { let packed_with_patches = BitPackedData::encode(&parray, 9).unwrap(); assert!( packed_with_patches - .patches(packed_with_patches.len()) + .patches() .is_some() ); assert_arrays_eq!( diff --git a/encodings/fastlanes/src/bitpacking/compute/cast.rs b/encodings/fastlanes/src/bitpacking/compute/cast.rs index 3ebb97c511b..fbcd48ce75b 100644 --- a/encodings/fastlanes/src/bitpacking/compute/cast.rs +++ b/encodings/fastlanes/src/bitpacking/compute/cast.rs @@ -11,6 +11,7 @@ use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_error::VortexResult; use crate::bitpacking::BitPacked; +use crate::bitpacking::array::BitPackedArrayExt; impl CastReduce for BitPacked { fn cast(array: ArrayView<'_, Self>, dtype: &DType) -> VortexResult> { if array.dtype().eq_ignore_nullability(dtype) { @@ -23,7 +24,7 @@ impl CastReduce for BitPacked { dtype.as_ptype(), new_validity, array - .patches(array.len()) + .patches() .map(|patches| { let new_values = patches.values().cast(dtype.clone())?; Patches::new( diff --git a/encodings/fastlanes/src/bitpacking/compute/filter.rs b/encodings/fastlanes/src/bitpacking/compute/filter.rs index b0d7629d089..f6cdc0c80c2 100644 --- a/encodings/fastlanes/src/bitpacking/compute/filter.rs +++ b/encodings/fastlanes/src/bitpacking/compute/filter.rs @@ -275,7 +275,7 @@ mod test { let unpacked = PrimitiveArray::from_iter(values.clone()); let bitpacked = BitPackedData::encode(&unpacked.into_array(), 7).unwrap(); assert!( - bitpacked.patches(bitpacked.len()).is_some(), + bitpacked.patches().is_some(), "Expected patches for values exceeding bit width" ); @@ -307,7 +307,7 @@ mod test { let unpacked = PrimitiveArray::from_iter(values.clone()); let bitpacked = BitPackedData::encode(&unpacked.into_array(), 7).unwrap(); assert!( - bitpacked.patches(bitpacked.len()).is_some(), + bitpacked.patches().is_some(), "Expected patches for values exceeding bit width" ); diff --git a/encodings/fastlanes/src/bitpacking/compute/slice.rs b/encodings/fastlanes/src/bitpacking/compute/slice.rs index 0e7dc4d7e43..0c016b17b49 100644 --- a/encodings/fastlanes/src/bitpacking/compute/slice.rs +++ b/encodings/fastlanes/src/bitpacking/compute/slice.rs @@ -11,6 +11,7 @@ use vortex_array::arrays::slice::SliceReduce; use vortex_error::VortexResult; use crate::BitPacked; +use crate::bitpacking::array::BitPackedArrayExt; impl SliceReduce for BitPacked { fn slice(array: ArrayView<'_, Self>, range: Range) -> VortexResult> { @@ -29,7 +30,7 @@ impl SliceReduce for BitPacked { array.dtype().as_ptype(), array.validity()?.slice(range.clone())?, array - .patches(array.len()) + .patches() .map(|p| p.slice(range.clone())) .transpose()? .flatten(), diff --git a/encodings/fastlanes/src/bitpacking/compute/take.rs b/encodings/fastlanes/src/bitpacking/compute/take.rs index 6a8415e293d..198bfda1a77 100644 --- a/encodings/fastlanes/src/bitpacking/compute/take.rs +++ b/encodings/fastlanes/src/bitpacking/compute/take.rs @@ -224,7 +224,7 @@ mod test { let values = (0..u16::MAX as u32 + num_patches as u32).collect::>(); let uncompressed = PrimitiveArray::new(values.clone(), Validity::NonNullable); let packed = BitPackedData::encode(&uncompressed.into_array(), 16).unwrap(); - assert!(packed.patches(packed.len()).is_some()); + assert!(packed.patches().is_some()); let rng = rng(); let range = Uniform::new(0, values.len()).unwrap(); diff --git a/encodings/fastlanes/src/bitpacking/vtable/mod.rs b/encodings/fastlanes/src/bitpacking/vtable/mod.rs index 7281cb95e8b..001c6e0ce93 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/mod.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/mod.rs @@ -29,10 +29,11 @@ use vortex_array::serde::ArrayChildren; use vortex_array::validity::Validity; use vortex_array::vtable; use vortex_array::vtable::VTable; +use vortex_array::vtable::child_to_validity; +use vortex_array::vtable::validity_to_child; 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; @@ -42,7 +43,6 @@ use crate::BitPackedData; use crate::BitPackedDataParts; 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; @@ -84,7 +84,26 @@ impl VTable for BitPacked { len: usize, slots: &[Option], ) -> VortexResult<()> { - data.validate_against_outer(dtype, len) + let validity = child_to_validity(&slots[VALIDITY_SLOT].clone(), dtype.nullability()); + let patches = match (&slots[PATCH_INDICES_SLOT], &slots[PATCH_VALUES_SLOT]) { + (Some(indices), Some(values)) => { + let patch_offset = data + .patch_offset + .vortex_expect("has patch slots but no patch_offset"); + Some(unsafe { + Patches::new_unchecked( + len, + patch_offset, + indices.clone(), + values.clone(), + slots[PATCH_CHUNK_OFFSETS_SLOT].clone(), + data.patch_offset_within_chunk, + ) + }) + } + _ => None, + }; + data.validate_against_slots(dtype, len, &validity, patches.as_ref()) } fn array_hash( @@ -185,10 +204,6 @@ impl VTable for BitPacked { RULES.evaluate(array, parent, child_idx) } - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() - } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { array.slots() } @@ -219,7 +234,7 @@ impl VTable for BitPacked { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = BitPackedMetadata::decode(metadata)?; if buffers.len() != 1 { vortex_bail!("Expected 1 buffer, got {}", buffers.len()); @@ -264,7 +279,19 @@ impl VTable for BitPacked { }) .transpose()?; - BitPackedData::try_new( + let slots = { + 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] + }; + let data = BitPackedData::try_new( packed, PType::try_from(dtype)?, validity, @@ -282,7 +309,8 @@ impl VTable for BitPacked { metadata.offset ) })?, - ) + )?; + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn append_to_builder( @@ -348,15 +376,38 @@ impl BitPacked { offset: u16, ) -> VortexResult { let dtype = DType::Primitive(ptype, validity.nullability()); + let slots = { + 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] + }; let data = BitPackedData::try_new(packed, ptype, validity, patches, bit_width, len, offset)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(BitPacked, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(BitPacked, dtype, len, data).with_slots(slots)) + }) } pub fn into_parts(array: BitPackedArray) -> BitPackedDataParts { let len = array.len(); - let nullability = array.dtype().nullability(); - array.into_data().into_parts(len, nullability) + let patches = array.patches(); + let validity = array.validity().vortex_expect("BitPacked validity"); + let data = array.into_data(); + BitPackedDataParts { + offset: data.offset, + bit_width: data.bit_width, + len, + packed: data.packed, + patches, + validity, + } } /// Encode an array into a bitpacked representation with the given bit width. diff --git a/encodings/fastlanes/src/bitpacking/vtable/operations.rs b/encodings/fastlanes/src/bitpacking/vtable/operations.rs index 49984c80ade..a22c8e1fc8d 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/operations.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/operations.rs @@ -8,6 +8,7 @@ use vortex_array::vtable::OperationsVTable; use vortex_error::VortexResult; use crate::BitPacked; +use crate::bitpacking::array::BitPackedArrayExt; use crate::bitpack_decompress; impl OperationsVTable for BitPacked { fn scalar_at( @@ -16,7 +17,7 @@ impl OperationsVTable for BitPacked { _ctx: &mut ExecutionCtx, ) -> VortexResult { Ok( - if let Some(patches) = array.patches(array.len()) + if let Some(patches) = array.patches() && let Some(patch) = patches.get_patched(index)? { patch @@ -141,14 +142,14 @@ mod test { // We create an array that has 1 element that does not fit in the 6-bit range. let array = BitPackedData::encode(&buffer![0u32..=64].into_array(), 6).unwrap(); - assert!(array.patches(array.len()).is_some()); + assert!(array.patches().is_some()); - let patch_indices = array.patches(array.len()).unwrap().indices().clone(); + let patch_indices = array.patches().unwrap().indices().clone(); assert_eq!(patch_indices.len(), 1); // Slicing drops the empty patches array. let sliced_bp = slice_via_reduce(&array, 0..64); - assert!(sliced_bp.patches(sliced_bp.len()).is_none()); + assert!(sliced_bp.patches().is_none()); } #[test] @@ -211,9 +212,9 @@ mod test { let values = (0u32..257).collect::>(); let uncompressed = values.clone().into_array(); let packed = BitPackedData::encode(&uncompressed, 8).unwrap(); - assert!(packed.patches(packed.len()).is_some()); + assert!(packed.patches().is_some()); - let patches = packed.patches(packed.len()).unwrap().indices().clone(); + let patches = packed.patches().unwrap().indices().clone(); assert_eq!( usize::try_from(&patches.scalar_at(0).unwrap()).unwrap(), 256 diff --git a/encodings/fastlanes/src/bitpacking/vtable/validity.rs b/encodings/fastlanes/src/bitpacking/vtable/validity.rs index 2313e0112eb..b3d61324af5 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/validity.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/validity.rs @@ -7,9 +7,10 @@ use vortex_array::vtable::ValidityVTable; use vortex_error::VortexResult; use crate::BitPacked; +use crate::BitPackedArrayExt; impl ValidityVTable for BitPacked { fn validity(array: ArrayView<'_, BitPacked>) -> VortexResult { - Ok(array.data().validity(array.dtype().nullability())) + Ok(BitPackedArrayExt::validity(&array)) } } diff --git a/encodings/fastlanes/src/delta/array/delta_decompress.rs b/encodings/fastlanes/src/delta/array/delta_decompress.rs index 7539bcdb0e2..95110ae37d9 100644 --- a/encodings/fastlanes/src/delta/array/delta_decompress.rs +++ b/encodings/fastlanes/src/delta/array/delta_decompress.rs @@ -16,6 +16,7 @@ use vortex_buffer::Buffer; use vortex_buffer::BufferMut; use vortex_error::VortexResult; +use crate::delta::array::DeltaArrayExt; use crate::DeltaArray; use crate::bit_transpose::untranspose_validity; diff --git a/encodings/fastlanes/src/delta/array/mod.rs b/encodings/fastlanes/src/delta/array/mod.rs index 05d9dfbbadb..a2ef1eb847d 100644 --- a/encodings/fastlanes/src/delta/array/mod.rs +++ b/encodings/fastlanes/src/delta/array/mod.rs @@ -2,7 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use fastlanes::FastLanes; +use vortex_array::Array; use vortex_array::ArrayRef; +use vortex_array::ArrayView; use vortex_array::dtype::DType; use vortex_array::dtype::PType; use vortex_array::match_each_unsigned_integer_ptype; @@ -62,7 +64,47 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["bases", "deltas"]; #[derive(Clone, Debug)] pub struct DeltaData { pub(super) offset: usize, - pub(super) slots: Vec>, +} + +pub trait DeltaArrayExt { + fn delta_data(&self) -> &DeltaData; + fn as_slots(&self) -> &[Option]; + + fn bases(&self) -> &ArrayRef { + self.as_slots()[BASES_SLOT] + .as_ref() + .vortex_expect("DeltaArray bases slot") + } + + fn deltas(&self) -> &ArrayRef { + self.as_slots()[DELTAS_SLOT] + .as_ref() + .vortex_expect("DeltaArray deltas slot") + } + + fn offset(&self) -> usize { + self.delta_data().offset + } +} + +impl DeltaArrayExt for Array { + fn delta_data(&self) -> &DeltaData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl DeltaArrayExt for ArrayView<'_, crate::Delta> { + fn delta_data(&self) -> &DeltaData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } } impl DeltaData { @@ -80,12 +122,17 @@ impl DeltaData { Ok(unsafe { Self::new_unchecked(bases, deltas, offset) }) } - pub(crate) fn validate(&self, dtype: &DType, len: usize) -> VortexResult<()> { - Self::validate_parts(self.bases(), self.deltas(), self.offset, len)?; - let expected_dtype = self - .bases() + pub(crate) fn validate_against_slots( + &self, + bases: &ArrayRef, + deltas: &ArrayRef, + dtype: &DType, + len: usize, + ) -> VortexResult<()> { + Self::validate_parts(bases, deltas, self.offset, len)?; + let expected_dtype = bases .dtype() - .with_nullability(self.deltas().dtype().nullability()); + .with_nullability(deltas.dtype().nullability()); vortex_ensure!( dtype == &expected_dtype, "DeltaArray dtype mismatch: expected {expected_dtype}, got {dtype}" @@ -134,38 +181,8 @@ impl DeltaData { } pub(crate) unsafe fn new_unchecked(bases: ArrayRef, deltas: ArrayRef, offset: usize) -> Self { - Self { - offset, - slots: vec![Some(bases), Some(deltas)], - } - } - - #[inline] - pub fn bases(&self) -> &ArrayRef { - self.slots[BASES_SLOT] - .as_ref() - .vortex_expect("DeltaArray bases slot") - } - - #[inline] - pub fn deltas(&self) -> &ArrayRef { - self.slots[DELTAS_SLOT] - .as_ref() - .vortex_expect("DeltaArray deltas slot") - } - - #[inline] - /// The logical offset into the first chunk of [`Self::deltas`]. - pub fn offset(&self) -> usize { - self.offset - } - - pub(crate) fn bases_len(&self) -> usize { - self.bases().len() - } - - pub(crate) fn deltas_len(&self) -> usize { - self.deltas().len() + drop((bases, deltas)); + Self { offset } } } diff --git a/encodings/fastlanes/src/delta/compute/cast.rs b/encodings/fastlanes/src/delta/compute/cast.rs index a9af6d09d60..4beb558dca0 100644 --- a/encodings/fastlanes/src/delta/compute/cast.rs +++ b/encodings/fastlanes/src/delta/compute/cast.rs @@ -12,6 +12,7 @@ use vortex_error::VortexResult; use vortex_error::vortex_panic; use crate::delta::Delta; +use crate::delta::array::DeltaArrayExt; impl CastReduce for Delta { fn cast(array: ArrayView<'_, Self>, dtype: &DType) -> VortexResult> { // Delta encoding stores differences between consecutive values, which requires diff --git a/encodings/fastlanes/src/delta/vtable/mod.rs b/encodings/fastlanes/src/delta/vtable/mod.rs index bc4d1d103ba..409774e31cf 100644 --- a/encodings/fastlanes/src/delta/vtable/mod.rs +++ b/encodings/fastlanes/src/delta/vtable/mod.rs @@ -24,6 +24,7 @@ use vortex_array::match_each_unsigned_integer_ptype; use vortex_array::serde::ArrayChildren; use vortex_array::vtable; use vortex_array::vtable::VTable; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_err; @@ -31,7 +32,9 @@ use vortex_error::vortex_panic; use vortex_session::VortexSession; use crate::DeltaData; -use crate::delta::array::NUM_SLOTS; +use crate::delta::array::BASES_SLOT; +use crate::delta::array::DELTAS_SLOT; +use crate::delta::array::DeltaArrayExt; use crate::delta::array::SLOT_NAMES; use crate::delta::array::delta_decompress::delta_decompress; @@ -68,7 +71,14 @@ impl VTable for Delta { len: usize, slots: &[Option], ) -> VortexResult<()> { - data.validate(dtype, len) + data.validate_against_slots( + slots[BASES_SLOT].as_ref().vortex_expect("DeltaArray bases slot"), + slots[DELTAS_SLOT] + .as_ref() + .vortex_expect("DeltaArray deltas slot"), + dtype, + len, + ) } fn array_hash( @@ -111,10 +121,6 @@ impl VTable for Delta { rules::RULES.evaluate(array, parent, child_idx) } - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() - } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { array.slots() } @@ -141,7 +147,7 @@ impl VTable for Delta { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { vortex_ensure!( buffers.is_empty(), "DeltaArray expects 0 buffers, got {}", @@ -166,7 +172,9 @@ impl VTable for Delta { let bases = children.get(0, dtype, bases_len)?; let deltas = children.get(1, dtype, deltas_len)?; - DeltaData::try_new(bases, deltas, metadata.offset as usize, len) + let slots = vec![Some(bases.clone()), Some(deltas.clone())]; + let data = DeltaData::try_new(bases, deltas, metadata.offset as usize, len)?; + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { @@ -189,8 +197,11 @@ impl Delta { len: usize, ) -> VortexResult { let dtype = bases.dtype().with_nullability(deltas.dtype().nullability()); + let slots = vec![Some(bases.clone()), Some(deltas.clone())]; let data = DeltaData::try_new(bases, deltas, offset, len)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Delta, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(Delta, dtype, len, data).with_slots(slots)) + }) } /// Compress a primitive array using Delta encoding. diff --git a/encodings/fastlanes/src/delta/vtable/slice.rs b/encodings/fastlanes/src/delta/vtable/slice.rs index c836bed33fd..b2aa2450c0b 100644 --- a/encodings/fastlanes/src/delta/vtable/slice.rs +++ b/encodings/fastlanes/src/delta/vtable/slice.rs @@ -10,6 +10,7 @@ use vortex_array::IntoArray; use vortex_array::arrays::slice::SliceReduce; use vortex_error::VortexResult; +use crate::delta::array::DeltaArrayExt; use crate::delta::array::lane_count; use crate::delta::vtable::Delta; @@ -25,12 +26,11 @@ impl SliceReduce for Delta { let deltas = array.deltas(); let lanes = lane_count(array.dtype().as_ptype()); - let new_bases = bases.slice( - min(start_chunk * lanes, array.bases_len())..min(stop_chunk * lanes, array.bases_len()), - )?; + let new_bases = + bases.slice(min(start_chunk * lanes, bases.len())..min(stop_chunk * lanes, bases.len()))?; let new_deltas = deltas.slice( - min(start_chunk * 1024, array.deltas_len())..min(stop_chunk * 1024, array.deltas_len()), + min(start_chunk * 1024, deltas.len())..min(stop_chunk * 1024, deltas.len()), )?; Ok(Some( diff --git a/encodings/fastlanes/src/delta/vtable/validity.rs b/encodings/fastlanes/src/delta/vtable/validity.rs index d1e6fc28870..d6a87ff5956 100644 --- a/encodings/fastlanes/src/delta/vtable/validity.rs +++ b/encodings/fastlanes/src/delta/vtable/validity.rs @@ -10,6 +10,7 @@ use vortex_error::VortexResult; use crate::Delta; use crate::bit_transpose::untranspose_validity; +use crate::delta::array::DeltaArrayExt; impl ValidityVTable for Delta { fn validity(array: ArrayView<'_, Delta>) -> VortexResult { diff --git a/encodings/fastlanes/src/for/array/for_compress.rs b/encodings/fastlanes/src/for/array/for_compress.rs index 86bb6de2947..5f0c831fd16 100644 --- a/encodings/fastlanes/src/for/array/for_compress.rs +++ b/encodings/fastlanes/src/for/array/for_compress.rs @@ -36,7 +36,6 @@ fn compress_primitive( // Set null values to the min value, ensuring that decompress into a value in the primitive // range (and stop them wrapping around). let encoded = parray - .into_data() .map_each_with_validity::(|(v, bool)| { if bool { v.wrapping_sub(&min) @@ -44,11 +43,7 @@ fn compress_primitive( T::zero() } })?; - Ok(PrimitiveArray::from_buffer_handle( - encoded.buffer_handle().clone(), - encoded.ptype(), - encoded.validity(), - )) + Ok(encoded) } #[cfg(test)] diff --git a/encodings/fastlanes/src/for/array/for_decompress.rs b/encodings/fastlanes/src/for/array/for_decompress.rs index 11471162285..f50d54055fb 100644 --- a/encodings/fastlanes/src/for/array/for_decompress.rs +++ b/encodings/fastlanes/src/for/array/for_decompress.rs @@ -20,6 +20,7 @@ use vortex_error::VortexResult; use crate::BitPacked; use crate::BitPackedArrayExt; use crate::FoRArray; +use crate::r#for::array::FoRArrayExt; use crate::bitpack_decompress; use crate::unpack_iter::UnpackStrategy; use crate::unpack_iter::UnpackedChunks; diff --git a/encodings/fastlanes/src/for/array/mod.rs b/encodings/fastlanes/src/for/array/mod.rs index f2cd3108250..5718b5eabd1 100644 --- a/encodings/fastlanes/src/for/array/mod.rs +++ b/encodings/fastlanes/src/for/array/mod.rs @@ -1,7 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use vortex_array::Array; use vortex_array::ArrayRef; +use vortex_array::ArrayView; use vortex_array::dtype::DType; use vortex_array::dtype::PType; use vortex_array::scalar::Scalar; @@ -23,25 +25,52 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["encoded"]; /// storage requirements when values are clustered around a specific point. #[derive(Clone, Debug)] pub struct FoRData { - pub(super) slots: Vec>, pub(super) reference: Scalar, } +pub trait FoRArrayExt { + fn for_data(&self) -> &FoRData; + fn as_slots(&self) -> &[Option]; + + fn encoded(&self) -> &ArrayRef { + self.as_slots()[ENCODED_SLOT] + .as_ref() + .vortex_expect("FoRArray encoded slot") + } + + fn reference_scalar(&self) -> &Scalar { + &self.for_data().reference + } +} + +impl FoRArrayExt for Array { + fn for_data(&self) -> &FoRData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl FoRArrayExt for ArrayView<'_, crate::FoR> { + fn for_data(&self) -> &FoRData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + impl FoRData { pub(crate) fn try_new(encoded: ArrayRef, reference: Scalar) -> VortexResult { Self::validate_parts(&encoded, &reference, reference.dtype(), encoded.len())?; - Ok(Self { - slots: vec![Some(encoded)], - reference, - }) + Ok(Self { reference }) } - pub(crate) fn validate(&self, dtype: &DType, len: usize) -> VortexResult<()> { - Self::validate_parts(self.encoded(), &self.reference, dtype, len) - } - - fn validate_parts( + pub(crate) fn validate_parts( encoded: &ArrayRef, reference: &Scalar, dtype: &DType, @@ -67,38 +96,8 @@ impl FoRData { Ok(()) } - /// Returns the length of the array. - #[inline] - pub fn len(&self) -> usize { - self.encoded().len() - } - - /// Returns `true` if the array is empty. - #[inline] - pub fn is_empty(&self) -> bool { - self.encoded().is_empty() - } - - /// Returns the dtype of the array. - #[inline] - pub fn dtype(&self) -> &DType { - self.reference.dtype() - } - #[inline] pub fn ptype(&self) -> PType { - self.dtype().as_ptype() - } - - #[inline] - pub fn encoded(&self) -> &ArrayRef { - self.slots[ENCODED_SLOT] - .as_ref() - .vortex_expect("FoRArray encoded slot") - } - - #[inline] - pub fn reference_scalar(&self) -> &Scalar { - &self.reference + self.reference.dtype().as_ptype() } } diff --git a/encodings/fastlanes/src/for/compute/cast.rs b/encodings/fastlanes/src/for/compute/cast.rs index e37b25b64a1..e534f3c76fa 100644 --- a/encodings/fastlanes/src/for/compute/cast.rs +++ b/encodings/fastlanes/src/for/compute/cast.rs @@ -10,6 +10,7 @@ use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_error::VortexResult; use crate::r#for::FoR; +use crate::r#for::array::FoRArrayExt; impl CastReduce for FoR { fn cast(array: ArrayView<'_, Self>, dtype: &DType) -> VortexResult> { // FoR only supports integer types diff --git a/encodings/fastlanes/src/for/compute/compare.rs b/encodings/fastlanes/src/for/compute/compare.rs index 853bf4c2955..e5eae1b90b0 100644 --- a/encodings/fastlanes/src/for/compute/compare.rs +++ b/encodings/fastlanes/src/for/compute/compare.rs @@ -23,6 +23,7 @@ use vortex_error::VortexExpect as _; use vortex_error::VortexResult; use crate::FoR; +use crate::r#for::array::FoRArrayExt; impl CompareKernel for FoR { fn compare( diff --git a/encodings/fastlanes/src/for/compute/is_constant.rs b/encodings/fastlanes/src/for/compute/is_constant.rs index 779e9bc900f..246a9c93226 100644 --- a/encodings/fastlanes/src/for/compute/is_constant.rs +++ b/encodings/fastlanes/src/for/compute/is_constant.rs @@ -11,6 +11,7 @@ use vortex_array::scalar::Scalar; use vortex_error::VortexResult; use crate::FoR; +use crate::r#for::array::FoRArrayExt; /// FoR-specific is_constant kernel. /// diff --git a/encodings/fastlanes/src/for/compute/is_sorted.rs b/encodings/fastlanes/src/for/compute/is_sorted.rs index 8e86dba1a2c..22e5959a9e0 100644 --- a/encodings/fastlanes/src/for/compute/is_sorted.rs +++ b/encodings/fastlanes/src/for/compute/is_sorted.rs @@ -15,6 +15,7 @@ use vortex_array::scalar::Scalar; use vortex_error::VortexResult; use crate::FoR; +use crate::r#for::array::FoRArrayExt; #[derive(Debug)] pub(crate) struct FoRIsSortedKernel; diff --git a/encodings/fastlanes/src/for/compute/mod.rs b/encodings/fastlanes/src/for/compute/mod.rs index 8bf7e93d029..7307b50d776 100644 --- a/encodings/fastlanes/src/for/compute/mod.rs +++ b/encodings/fastlanes/src/for/compute/mod.rs @@ -16,6 +16,7 @@ use vortex_error::VortexResult; use vortex_mask::Mask; use crate::FoR; +use crate::r#for::array::FoRArrayExt; impl TakeExecute for FoR { fn take( diff --git a/encodings/fastlanes/src/for/mod.rs b/encodings/fastlanes/src/for/mod.rs index 99f19486e91..98bb775bf8a 100644 --- a/encodings/fastlanes/src/for/mod.rs +++ b/encodings/fastlanes/src/for/mod.rs @@ -3,6 +3,7 @@ mod array; pub use array::FoRData; +pub use array::FoRArrayExt; pub(crate) mod compute; diff --git a/encodings/fastlanes/src/for/vtable/mod.rs b/encodings/fastlanes/src/for/vtable/mod.rs index 7732ef5266b..51daada877b 100644 --- a/encodings/fastlanes/src/for/vtable/mod.rs +++ b/encodings/fastlanes/src/for/vtable/mod.rs @@ -25,12 +25,14 @@ use vortex_array::vtable; use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityVTableFromChild; use vortex_error::VortexResult; +use vortex_error::VortexExpect; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; use crate::FoRData; +use crate::r#for::array::FoRArrayExt; use crate::r#for::array::NUM_SLOTS; use crate::r#for::array::SLOT_NAMES; use crate::r#for::array::for_decompress::decompress; @@ -62,7 +64,8 @@ impl VTable for FoR { len: usize, slots: &[Option], ) -> VortexResult<()> { - data.validate(dtype, len) + let encoded = slots[0].as_ref().vortex_expect("FoRArray encoded slot"); + FoRData::validate_parts(encoded, &data.reference, dtype, len) } fn array_hash( @@ -95,10 +98,6 @@ impl VTable for FoR { None } - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() - } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { array.slots() } @@ -122,7 +121,7 @@ impl VTable for FoR { buffers: &[BufferHandle], children: &dyn ArrayChildren, session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { vortex_ensure!( buffers.is_empty(), "FoRArray expects 0 buffers, got {}", @@ -138,8 +137,10 @@ impl VTable for FoR { let scalar_value = ScalarValue::from_proto_bytes(metadata, dtype, session)?; let reference = Scalar::try_new(dtype.clone(), scalar_value)?; let encoded = children.get(0, dtype, len)?; + let slots = vec![Some(encoded.clone())]; - FoRData::try_new(encoded, reference) + let data = FoRData::try_new(encoded, reference)?; + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn reduce_parent( @@ -178,8 +179,11 @@ impl FoR { .with_nullability(encoded.dtype().nullability()); let reference = reference.cast(&dtype)?; let len = encoded.len(); + let slots = vec![Some(encoded.clone())]; let data = FoRData::try_new(encoded, reference)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(FoR, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(FoR, dtype, len, data).with_slots(slots)) + }) } /// Encode a primitive array using Frame of Reference encoding. diff --git a/encodings/fastlanes/src/for/vtable/operations.rs b/encodings/fastlanes/src/for/vtable/operations.rs index a91eb83dfa3..e90ff7f4ad2 100644 --- a/encodings/fastlanes/src/for/vtable/operations.rs +++ b/encodings/fastlanes/src/for/vtable/operations.rs @@ -10,6 +10,7 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use super::FoR; +use crate::r#for::array::FoRArrayExt; impl OperationsVTable for FoR { fn scalar_at( array: ArrayView<'_, FoR>, diff --git a/encodings/fastlanes/src/for/vtable/rules.rs b/encodings/fastlanes/src/for/vtable/rules.rs index 3f839fe74dd..8d220a86d7f 100644 --- a/encodings/fastlanes/src/for/vtable/rules.rs +++ b/encodings/fastlanes/src/for/vtable/rules.rs @@ -13,6 +13,7 @@ use vortex_array::scalar_fn::fns::cast::CastReduceAdaptor; use vortex_error::VortexResult; use crate::FoR; +use crate::r#for::array::FoRArrayExt; pub(super) const PARENT_RULES: ParentRuleSet = ParentRuleSet::new(&[ // TODO: add BetweenReduceAdaptor(FoR) diff --git a/encodings/fastlanes/src/for/vtable/slice.rs b/encodings/fastlanes/src/for/vtable/slice.rs index acd8a4d0254..206c47ef509 100644 --- a/encodings/fastlanes/src/for/vtable/slice.rs +++ b/encodings/fastlanes/src/for/vtable/slice.rs @@ -10,6 +10,7 @@ use vortex_array::arrays::slice::SliceReduce; use vortex_error::VortexResult; use crate::FoR; +use crate::r#for::array::FoRArrayExt; impl SliceReduce for FoR { fn slice(array: ArrayView<'_, Self>, range: Range) -> VortexResult> { diff --git a/encodings/fastlanes/src/for/vtable/validity.rs b/encodings/fastlanes/src/for/vtable/validity.rs index 2131f0ba2f4..f286ac539b5 100644 --- a/encodings/fastlanes/src/for/vtable/validity.rs +++ b/encodings/fastlanes/src/for/vtable/validity.rs @@ -2,13 +2,15 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use vortex_array::ArrayRef; +use vortex_array::ArrayView; use vortex_array::vtable::ValidityChild; use super::FoR; use crate::FoRData; +use crate::r#for::array::FoRArrayExt; impl ValidityChild for FoR { - fn validity_child(array: &FoRData) -> &ArrayRef { - array.encoded() + fn validity_child(array: ArrayView<'_, FoR>) -> ArrayRef { + array.encoded().clone() } } diff --git a/encodings/fastlanes/src/rle/array/mod.rs b/encodings/fastlanes/src/rle/array/mod.rs index 2ee4a082dfa..42c2efd711e 100644 --- a/encodings/fastlanes/src/rle/array/mod.rs +++ b/encodings/fastlanes/src/rle/array/mod.rs @@ -2,6 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use vortex_array::ArrayRef; +use vortex_array::Array; +use vortex_array::ArrayView; use vortex_array::dtype::DType; use vortex_array::dtype::Nullability; use vortex_array::dtype::PType; @@ -33,7 +35,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["values", "indices", "values_i #[derive(Clone, Debug)] pub struct RLEData { - pub(super) slots: Vec>, // Offset relative to the start of the chunk. pub(super) offset: usize, } @@ -50,18 +51,16 @@ impl RLEData { Ok(()) } - pub(crate) fn validate_against_outer(&self, dtype: &DType, length: usize) -> VortexResult<()> { - Self::validate_parts( - self.values(), - self.indices(), - self.values_idx_offsets(), - self.offset, - length, - )?; - let expected_dtype = DType::Primitive( - self.values().dtype().as_ptype(), - self.indices().dtype().nullability(), - ); + pub(crate) fn validate_against_slots( + &self, + values: &ArrayRef, + indices: &ArrayRef, + value_idx_offsets: &ArrayRef, + dtype: &DType, + length: usize, + ) -> VortexResult<()> { + Self::validate_parts(values, indices, value_idx_offsets, self.offset, length)?; + let expected_dtype = DType::Primitive(values.dtype().as_ptype(), indices.dtype().nullability()); vortex_ensure!( dtype == &expected_dtype, "RLE dtype mismatch: expected {expected_dtype}, got {dtype}" @@ -147,10 +146,8 @@ impl RLEData { ) -> VortexResult { Self::validate(&values, &indices, &values_idx_offsets, offset, length)?; - Ok(Self { - slots: vec![Some(values), Some(indices), Some(values_idx_offsets)], - offset, - }) + drop((values, indices, values_idx_offsets)); + Ok(Self { offset }) } /// Create a new RLEArray without validation. @@ -166,29 +163,37 @@ impl RLEData { values_idx_offsets: ArrayRef, offset: usize, ) -> Self { - Self { - slots: vec![Some(values), Some(indices), Some(values_idx_offsets)], - offset, - } + drop((values, indices, values_idx_offsets)); + Self { offset } } #[inline] - pub fn values(&self) -> &ArrayRef { - self.slots[VALUES_SLOT] + pub fn offset(&self) -> usize { + self.offset + } +} + +pub trait RLEArrayExt { + fn rle_data(&self) -> &RLEData; + fn as_slots(&self) -> &[Option]; + + #[inline] + fn values(&self) -> &ArrayRef { + self.as_slots()[VALUES_SLOT] .as_ref() .vortex_expect("RLEArray values slot must be populated") } #[inline] - pub fn indices(&self) -> &ArrayRef { - self.slots[INDICES_SLOT] + fn indices(&self) -> &ArrayRef { + self.as_slots()[INDICES_SLOT] .as_ref() .vortex_expect("RLEArray indices slot must be populated") } #[inline] - pub fn values_idx_offsets(&self) -> &ArrayRef { - self.slots[VALUES_IDX_OFFSETS_SLOT] + fn values_idx_offsets(&self) -> &ArrayRef { + self.as_slots()[VALUES_IDX_OFFSETS_SLOT] .as_ref() .vortex_expect("RLEArray values_idx_offsets slot must be populated") } @@ -202,7 +207,7 @@ impl RLEData { clippy::expect_used, reason = "expect is safe here as scalar_at returns a valid primitive" )] - pub(crate) fn values_idx_offset(&self, chunk_idx: usize) -> usize { + fn values_idx_offset(&self, chunk_idx: usize) -> usize { self.values_idx_offsets() .scalar_at(chunk_idx) .expect("index must be in bounds") @@ -220,8 +225,28 @@ impl RLEData { /// Index offset into the array #[inline] - pub fn offset(&self) -> usize { - self.offset + fn offset(&self) -> usize { + self.rle_data().offset + } +} + +impl RLEArrayExt for Array { + fn rle_data(&self) -> &RLEData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl RLEArrayExt for ArrayView<'_, crate::RLE> { + fn rle_data(&self) -> &RLEData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() } } diff --git a/encodings/fastlanes/src/rle/array/rle_decompress.rs b/encodings/fastlanes/src/rle/array/rle_decompress.rs index d448ca1de0b..356dcb06dbe 100644 --- a/encodings/fastlanes/src/rle/array/rle_decompress.rs +++ b/encodings/fastlanes/src/rle/array/rle_decompress.rs @@ -18,6 +18,7 @@ use vortex_error::vortex_panic; use crate::FL_CHUNK_SIZE; use crate::RLEArray; +use crate::rle::RLEArrayExt; /// Decompresses an RLE array back into a primitive array. #[expect( diff --git a/encodings/fastlanes/src/rle/compute/cast.rs b/encodings/fastlanes/src/rle/compute/cast.rs index c3ae7d42e81..95286d2f3e7 100644 --- a/encodings/fastlanes/src/rle/compute/cast.rs +++ b/encodings/fastlanes/src/rle/compute/cast.rs @@ -11,6 +11,7 @@ use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_error::VortexResult; use crate::rle::RLE; +use crate::rle::RLEArrayExt; impl CastReduce for RLE { fn cast(array: ArrayView<'_, Self>, dtype: &DType) -> VortexResult> { // Cast RLE values. diff --git a/encodings/fastlanes/src/rle/kernel.rs b/encodings/fastlanes/src/rle/kernel.rs index 65f8bfdb907..14eaf6dda3d 100644 --- a/encodings/fastlanes/src/rle/kernel.rs +++ b/encodings/fastlanes/src/rle/kernel.rs @@ -14,6 +14,7 @@ use vortex_error::VortexResult; use crate::FL_CHUNK_SIZE; use crate::RLE; +use crate::rle::RLEArrayExt; pub(crate) static PARENT_KERNELS: ParentKernelSet = ParentKernelSet::new(&[ParentKernelSet::lift(&SliceExecuteAdaptor(RLE))]); diff --git a/encodings/fastlanes/src/rle/mod.rs b/encodings/fastlanes/src/rle/mod.rs index 1dd0b644156..ff1e580db1d 100644 --- a/encodings/fastlanes/src/rle/mod.rs +++ b/encodings/fastlanes/src/rle/mod.rs @@ -3,6 +3,7 @@ mod array; pub use array::RLEData; +pub use array::RLEArrayExt; mod compute; mod kernel; diff --git a/encodings/fastlanes/src/rle/vtable/mod.rs b/encodings/fastlanes/src/rle/vtable/mod.rs index 551226682cb..663ab109aed 100644 --- a/encodings/fastlanes/src/rle/vtable/mod.rs +++ b/encodings/fastlanes/src/rle/vtable/mod.rs @@ -24,11 +24,16 @@ use vortex_array::serde::ArrayChildren; use vortex_array::vtable; use vortex_array::vtable::VTable; use vortex_error::VortexResult; +use vortex_error::VortexExpect; use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; use crate::RLEData; +use crate::rle::array::INDICES_SLOT; +use crate::rle::array::RLEArrayExt; +use crate::rle::array::VALUES_IDX_OFFSETS_SLOT; +use crate::rle::array::VALUES_SLOT; use crate::rle::array::rle_decompress::rle_decompress; use crate::rle::kernel::PARENT_KERNELS; use crate::rle::vtable::rules::RULES; @@ -72,7 +77,19 @@ impl VTable for RLE { len: usize, slots: &[Option], ) -> VortexResult<()> { - data.validate_against_outer(dtype, len) + data.validate_against_slots( + slots[VALUES_SLOT] + .as_ref() + .vortex_expect("RLEArray values slot must be populated"), + slots[INDICES_SLOT] + .as_ref() + .vortex_expect("RLEArray indices slot must be populated"), + slots[VALUES_IDX_OFFSETS_SLOT] + .as_ref() + .vortex_expect("RLEArray values_idx_offsets slot must be populated"), + dtype, + len, + ) } fn array_hash( @@ -119,10 +136,6 @@ impl VTable for RLE { RULES.evaluate(array, parent, child_idx) } - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() - } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { array.slots() } @@ -154,7 +167,7 @@ impl VTable for RLE { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { vortex_ensure!( buffers.is_empty(), "RLEArray expects 0 buffers, got {}", @@ -182,13 +195,13 @@ impl VTable for RLE { usize::try_from(metadata.values_idx_offsets_len)?, )?; - RLEData::try_new( - values, - indices, - values_idx_offsets, - metadata.offset as usize, - len, - ) + let slots = vec![ + Some(values.clone()), + Some(indices.clone()), + Some(values_idx_offsets.clone()), + ]; + let data = RLEData::try_new(values, indices, values_idx_offsets, metadata.offset as usize, len)?; + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn execute_parent( @@ -221,8 +234,15 @@ impl RLE { length: usize, ) -> VortexResult { let dtype = DType::Primitive(values.dtype().as_ptype(), indices.dtype().nullability()); + let slots = vec![ + Some(values.clone()), + Some(indices.clone()), + Some(values_idx_offsets.clone()), + ]; let data = RLEData::try_new(values, indices, values_idx_offsets, offset, length)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(RLE, dtype, length, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(RLE, dtype, length, data).with_slots(slots)) + }) } /// Create a new RLE array without validation. @@ -237,8 +257,15 @@ impl RLE { length: usize, ) -> RLEArray { let dtype = DType::Primitive(values.dtype().as_ptype(), indices.dtype().nullability()); + let slots = vec![ + Some(values.clone()), + Some(indices.clone()), + Some(values_idx_offsets.clone()), + ]; let data = unsafe { RLEData::new_unchecked(values, indices, values_idx_offsets, offset) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(RLE, dtype, length, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(RLE, dtype, length, data).with_slots(slots)) + } } /// Encode a primitive array using FastLanes RLE. diff --git a/encodings/fastlanes/src/rle/vtable/operations.rs b/encodings/fastlanes/src/rle/vtable/operations.rs index e8dfc159f70..25069ecccc1 100644 --- a/encodings/fastlanes/src/rle/vtable/operations.rs +++ b/encodings/fastlanes/src/rle/vtable/operations.rs @@ -10,6 +10,7 @@ use vortex_error::VortexResult; use super::RLE; use crate::FL_CHUNK_SIZE; +use crate::rle::RLEArrayExt; impl OperationsVTable for RLE { fn scalar_at( diff --git a/encodings/fastlanes/src/rle/vtable/validity.rs b/encodings/fastlanes/src/rle/vtable/validity.rs index ecef8047cb1..917b43da996 100644 --- a/encodings/fastlanes/src/rle/vtable/validity.rs +++ b/encodings/fastlanes/src/rle/vtable/validity.rs @@ -6,6 +6,7 @@ use vortex_array::vtable::ValidityVTable; use vortex_error::VortexResult; use crate::rle::RLE; +use crate::rle::RLEArrayExt; impl ValidityVTable for RLE { fn validity(array: ArrayView<'_, RLE>) -> VortexResult { diff --git a/encodings/fsst/public-api.lock b/encodings/fsst/public-api.lock index 4989f13dca7..9a51d88d464 100644 --- a/encodings/fsst/public-api.lock +++ b/encodings/fsst/public-api.lock @@ -26,15 +26,15 @@ pub type vortex_fsst::FSST::ValidityVTable = vortex_array::array::vtable::validi pub fn vortex_fsst::FSST::append_to_builder(array: vortex_array::array::view::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_fsst::FSST::array_eq(array: &vortex_fsst::FSSTData, other: &vortex_fsst::FSSTData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fsst::FSST::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fsst::FSST::array_hash(array: &vortex_fsst::FSSTData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fsst::FSST::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_fsst::FSST::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_fsst::FSST::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option -pub fn vortex_fsst::FSST::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_fsst::FSST::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_fsst::FSST::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -52,9 +52,7 @@ pub fn vortex_fsst::FSST::slot_name(_array: vortex_array::array::view::ArrayView pub fn vortex_fsst::FSST::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_fsst::FSST::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_fsst::FSST::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_fsst::FSST::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_fsst::FSST @@ -62,7 +60,7 @@ pub fn vortex_fsst::FSST::scalar_at(array: vortex_array::array::view::ArrayView< impl vortex_array::array::vtable::validity::ValidityChild for vortex_fsst::FSST -pub fn vortex_fsst::FSST::validity_child(array: &vortex_fsst::FSSTData) -> &vortex_array::array::erased::ArrayRef +pub fn vortex_fsst::FSST::validity_child(array: vortex_array::array::view::ArrayView<'_, vortex_fsst::FSST>) -> vortex_array::array::erased::ArrayRef impl vortex_array::arrays::dict::take::TakeExecute for vortex_fsst::FSST @@ -110,11 +108,7 @@ pub fn vortex_fsst::FSSTData::symbols(&self) -> &vortex_buffer::buffer::Buffer, symbol_lengths: vortex_buffer::buffer::Buffer, codes: vortex_array::arrays::varbin::vtable::VarBinArray, uncompressed_lengths: vortex_array::array::erased::ArrayRef, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult -pub fn vortex_fsst::FSSTData::uncompressed_lengths(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_fsst::FSSTData::uncompressed_lengths_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_fsst::FSSTData::validate(&self, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_fsst::FSSTData::validate(&self, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl core::clone::Clone for vortex_fsst::FSSTData @@ -158,6 +152,30 @@ pub fn vortex_fsst::FSSTMetadata::clear(&mut self) pub fn vortex_fsst::FSSTMetadata::encoded_len(&self) -> usize +pub trait vortex_fsst::FSSTArrayExt + +pub fn vortex_fsst::FSSTArrayExt::fsst_slots(&self) -> &[core::option::Option] + +pub fn vortex_fsst::FSSTArrayExt::uncompressed_lengths(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_fsst::FSSTArrayExt::uncompressed_lengths_dtype(&self) -> &vortex_array::dtype::DType + +impl vortex_fsst::FSSTArrayExt for vortex_array::array::typed::Array + +pub fn vortex_array::array::typed::Array::fsst_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::typed::Array::uncompressed_lengths(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::typed::Array::uncompressed_lengths_dtype(&self) -> &vortex_array::dtype::DType + +impl vortex_fsst::FSSTArrayExt for vortex_array::array::view::ArrayView<'_, vortex_fsst::FSST> + +pub fn vortex_array::array::view::ArrayView<'_, vortex_fsst::FSST>::fsst_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::view::ArrayView<'_, vortex_fsst::FSST>::uncompressed_lengths(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::view::ArrayView<'_, vortex_fsst::FSST>::uncompressed_lengths_dtype(&self) -> &vortex_array::dtype::DType + pub fn vortex_fsst::fsst_compress>(strings: A, len: usize, dtype: &vortex_array::dtype::DType, compressor: &fsst::Compressor) -> vortex_fsst::FSSTArray pub fn vortex_fsst::fsst_compress_iter<'a, I>(iter: I, len: usize, dtype: vortex_array::dtype::DType, compressor: &fsst::Compressor) -> vortex_fsst::FSSTArray where I: core::iter::traits::iterator::Iterator> diff --git a/encodings/fsst/src/array.rs b/encodings/fsst/src/array.rs index d6b36a470ed..e1437f5ba0e 100644 --- a/encodings/fsst/src/array.rs +++ b/encodings/fsst/src/array.rs @@ -86,7 +86,7 @@ impl VTable for FSST { len: usize, slots: &[Option], ) -> VortexResult<()> { - data.validate(dtype, len) + data.validate(dtype, len, slots) } fn array_hash( @@ -163,7 +163,7 @@ impl VTable for FSST { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = FSSTMetadata::decode(metadata)?; let symbols = Buffer::::from_byte_buffer(buffers[0].clone().try_to_host_sync()?); let symbol_lengths = Buffer::::from_byte_buffer(buffers[1].clone().try_to_host_sync()?); @@ -192,7 +192,12 @@ impl VTable for FSST { len, )?; - return FSSTData::try_new(symbols, symbol_lengths, codes, uncompressed_lengths, dtype); + let slots = FSSTData::make_slots(&codes, &uncompressed_lengths); + let data = FSSTData::try_new(symbols, symbol_lengths, codes, uncompressed_lengths, dtype)?; + return Ok( + ArrayParts::new(self.clone(), dtype.clone(), len, data) + .with_slots(slots), + ); } // Check for the current deserialization path. @@ -233,7 +238,12 @@ impl VTable for FSST { codes_validity, )?; - return FSSTData::try_new(symbols, symbol_lengths, codes, uncompressed_lengths, dtype); + let slots = FSSTData::make_slots(&codes, &uncompressed_lengths); + let data = FSSTData::try_new(symbols, symbol_lengths, codes, uncompressed_lengths, dtype)?; + return Ok( + ArrayParts::new(self.clone(), dtype.clone(), len, data) + .with_slots(slots), + ); } vortex_bail!( @@ -242,10 +252,6 @@ impl VTable for FSST { ); } - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() - } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { array.slots() } @@ -276,7 +282,7 @@ impl VTable for FSST { // Decompress the whole block of data into a new buffer, and create some views // from it instead. - let (buffers, views) = fsst_decode_views(&array, builder.completed_block_count(), ctx)?; + let (buffers, views) = fsst_decode_views(array, builder.completed_block_count(), ctx)?; builder.push_buffer_and_adjusted_views(&buffers, &views, array.array().validity_mask()?); Ok(()) @@ -317,8 +323,6 @@ pub struct FSSTData { codes: VarBinArray, /// 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. - slots: Vec>, /// Memoized compressor used for push-down of compute by compressing the RHS. compressor: Arc Compressor + Send>>>, @@ -330,7 +334,7 @@ impl Debug for FSSTData { .field("symbols", &self.symbols) .field("symbol_lengths", &self.symbol_lengths) .field("codes", &self.codes) - .field("uncompressed_lengths", self.uncompressed_lengths()) + .field("uncompressed_lengths", &"") .finish() } } @@ -350,8 +354,20 @@ impl FSST { uncompressed_lengths: ArrayRef, ) -> VortexResult { let len = codes.len(); + let slots = vec![ + Some(uncompressed_lengths.clone()), + Some(codes.offsets().clone()), + validity_to_child( + &codes + .validity() + .vortex_expect("FSST codes validity should be derivable"), + codes.len(), + ), + ]; let data = FSSTData::try_new(symbols, symbol_lengths, codes, uncompressed_lengths, &dtype)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(FSST, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(FSST, dtype, len, data).with_slots(slots)) + }) } pub(crate) unsafe fn new_unchecked( @@ -362,14 +378,39 @@ impl FSST { uncompressed_lengths: ArrayRef, ) -> FSSTArray { let len = codes.len(); + let slots = vec![ + Some(uncompressed_lengths.clone()), + Some(codes.offsets().clone()), + validity_to_child( + &codes + .validity() + .vortex_expect("FSST codes validity should be derivable"), + codes.len(), + ), + ]; let data = unsafe { FSSTData::new_unchecked(symbols, symbol_lengths, codes, uncompressed_lengths) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(FSST, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(FSST, dtype, len, data).with_slots(slots)) + } } } impl FSSTData { + fn make_slots(codes: &VarBinArray, uncompressed_lengths: &ArrayRef) -> Vec> { + vec![ + Some(uncompressed_lengths.clone()), + Some(codes.offsets().clone()), + validity_to_child( + &codes + .validity() + .vortex_expect("FSST codes validity should be derivable"), + codes.len(), + ), + ] + } + /// Build an FSST array from a set of `symbols` and `codes`. /// /// Symbols are 8-bytes and can represent short strings, each of which is assigned @@ -405,12 +446,17 @@ impl FSSTData { } } - pub fn validate(&self, dtype: &DType, len: usize) -> VortexResult<()> { + pub fn validate( + &self, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { Self::validate_parts( &self.symbols, &self.symbol_lengths, &self.codes, - self.uncompressed_lengths(), + uncompressed_lengths_from_slots(slots), dtype, len, ) @@ -466,6 +512,7 @@ impl FSSTData { codes: VarBinArray, uncompressed_lengths: ArrayRef, ) -> Self { + drop(uncompressed_lengths); let symbols2 = symbols.clone(); let symbol_lengths2 = symbol_lengths.clone(); let compressor = Arc::new(LazyLock::new(Box::new(move || { @@ -473,24 +520,12 @@ impl FSSTData { }) 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() - .vortex_expect("FSST codes validity should be derivable"), - codes.len(), - ); Self { symbols, symbol_lengths, codes, codes_array, - slots: vec![ - Some(uncompressed_lengths), - codes_offsets_slot, - codes_validity_slot, - ], compressor, } } @@ -526,19 +561,6 @@ impl FSSTData { self.codes.dtype() } - /// Get the uncompressed length for each element in the array. - pub fn uncompressed_lengths(&self) -> &ArrayRef { - 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() - } - /// Build a [`Decompressor`][fsst::Decompressor] that can be used to decompress values from /// this array. pub fn decompressor(&self) -> Decompressor<'_> { @@ -551,9 +573,39 @@ impl FSSTData { } } +fn uncompressed_lengths_from_slots(slots: &[Option]) -> &ArrayRef { + slots[UNCOMPRESSED_LENGTHS_SLOT] + .as_ref() + .vortex_expect("FSSTArray uncompressed_lengths slot") +} + +pub trait FSSTArrayExt { + fn fsst_slots(&self) -> &[Option]; + + fn uncompressed_lengths(&self) -> &ArrayRef { + uncompressed_lengths_from_slots(self.fsst_slots()) + } + + fn uncompressed_lengths_dtype(&self) -> &DType { + self.uncompressed_lengths().dtype() + } +} + +impl FSSTArrayExt for Array { + fn fsst_slots(&self) -> &[Option] { + self.slots() + } +} + +impl FSSTArrayExt for ArrayView<'_, FSST> { + fn fsst_slots(&self) -> &[Option] { + self.slots() + } +} + impl ValidityChild for FSST { - fn validity_child(array: &FSSTData) -> &ArrayRef { - &array.codes_array + fn validity_child(array: ArrayView<'_, FSST>) -> ArrayRef { + array.codes_array.clone() } } diff --git a/encodings/fsst/src/canonical.rs b/encodings/fsst/src/canonical.rs index d534ec22173..c4c9a625027 100644 --- a/encodings/fsst/src/canonical.rs +++ b/encodings/fsst/src/canonical.rs @@ -19,13 +19,13 @@ use vortex_buffer::ByteBufferMut; use vortex_error::VortexResult; use crate::FSST; -use crate::FSSTData; +use crate::FSSTArrayExt; pub(super) fn canonicalize_fsst( array: ArrayView<'_, FSST>, ctx: &mut ExecutionCtx, ) -> VortexResult { - let (buffers, views) = fsst_decode_views(array.data(), 0, ctx)?; + let (buffers, views) = fsst_decode_views(array, 0, ctx)?; // SAFETY: FSST already validates the bytes for binary/UTF-8. We build views directly on // top of them, so the view pointers will all be valid. Ok(unsafe { @@ -40,7 +40,7 @@ pub(super) fn canonicalize_fsst( } pub(crate) fn fsst_decode_views( - fsst_array: &FSSTData, + fsst_array: ArrayView<'_, FSST>, start_buf_index: u32, ctx: &mut ExecutionCtx, ) -> VortexResult<(Vec, Buffer)> { diff --git a/encodings/fsst/src/compute/cast.rs b/encodings/fsst/src/compute/cast.rs index 82034daab21..de7502550fa 100644 --- a/encodings/fsst/src/compute/cast.rs +++ b/encodings/fsst/src/compute/cast.rs @@ -11,6 +11,7 @@ use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_error::VortexResult; use crate::FSST; +use crate::FSSTArrayExt; impl CastReduce for FSST { fn cast(array: ArrayView<'_, Self>, dtype: &DType) -> VortexResult> { // FSST is a string compression encoding. diff --git a/encodings/fsst/src/compute/compare.rs b/encodings/fsst/src/compute/compare.rs index 14ea2cbe4d6..6acf6a8fa3d 100644 --- a/encodings/fsst/src/compute/compare.rs +++ b/encodings/fsst/src/compute/compare.rs @@ -21,6 +21,7 @@ use vortex_error::VortexResult; use vortex_error::vortex_bail; use crate::FSST; +use crate::FSSTArrayExt; impl CompareKernel for FSST { fn compare( lhs: ArrayView<'_, Self>, diff --git a/encodings/fsst/src/compute/filter.rs b/encodings/fsst/src/compute/filter.rs index 0a2aa130d7a..4d6f6c7e8b6 100644 --- a/encodings/fsst/src/compute/filter.rs +++ b/encodings/fsst/src/compute/filter.rs @@ -12,6 +12,7 @@ use vortex_error::VortexResult; use vortex_mask::Mask; use crate::FSST; +use crate::FSSTArrayExt; impl FilterKernel for FSST { fn filter( diff --git a/encodings/fsst/src/compute/mod.rs b/encodings/fsst/src/compute/mod.rs index 1bc1df71a29..c77844561c3 100644 --- a/encodings/fsst/src/compute/mod.rs +++ b/encodings/fsst/src/compute/mod.rs @@ -19,6 +19,7 @@ use vortex_error::VortexResult; use vortex_error::vortex_err; use crate::FSST; +use crate::FSSTArrayExt; impl TakeExecute for FSST { fn take( diff --git a/encodings/fsst/src/slice.rs b/encodings/fsst/src/slice.rs index 5e0dd21a9f3..52392d10b80 100644 --- a/encodings/fsst/src/slice.rs +++ b/encodings/fsst/src/slice.rs @@ -12,6 +12,7 @@ use vortex_error::VortexResult; use vortex_error::vortex_err; use crate::FSST; +use crate::FSSTArrayExt; impl SliceReduce for FSST { fn slice(array: ArrayView<'_, Self>, range: Range) -> VortexResult> { diff --git a/encodings/parquet-variant/src/array.rs b/encodings/parquet-variant/src/array.rs index 932274d77f8..3aca471c2cc 100644 --- a/encodings/parquet-variant/src/array.rs +++ b/encodings/parquet-variant/src/array.rs @@ -67,10 +67,7 @@ pub(crate) const SLOT_NAMES: [&str; NUM_SLOTS] = ["validity", "metadata", "value /// 3. **Typed-value child nullability**: the `typed_value` child carries its own `DType` /// (which includes nullability). #[derive(Clone, Debug)] -pub struct ParquetVariantData { - pub(crate) nullability: Nullability, - pub(crate) slots: Vec>, -} +pub struct ParquetVariantData; impl ParquetVariant { pub fn try_new( @@ -81,9 +78,17 @@ impl ParquetVariant { ) -> VortexResult> { let len = metadata.len(); let dtype = DType::Variant(validity.nullability()); + let slots = vec![ + validity_to_child(&validity, len), + Some(metadata.clone()), + value.clone(), + typed_value.clone(), + ]; let data = ParquetVariantData::try_new(validity, metadata, value, typed_value)?; Ok(unsafe { - Array::from_parts_unchecked(ArrayParts::new(ParquetVariant, dtype, len, data)) + Array::from_parts_unchecked( + ArrayParts::new(ParquetVariant, dtype, len, data).with_slots(slots), + ) }) } } @@ -106,23 +111,19 @@ impl ParquetVariantData { &dtype, len, )?; - - let validity_child = validity_to_child(&validity, len); - let slots = vec![validity_child, Some(metadata), value, typed_value]; - - Ok(Self { - nullability: validity.nullability(), - slots, - }) + drop((validity, metadata, value, typed_value)); + Ok(Self) } - pub(crate) fn validate(&self, dtype: &DType, len: usize) -> VortexResult<()> { - let validity = self.validity(); + pub(crate) fn validate_slots(dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + let validity = child_to_validity(&slots[VALIDITY_SLOT], dtype.nullability()); Self::validate_parts( &validity, - self.metadata_array(), - self.value_array(), - self.typed_value_array(), + slots[METADATA_SLOT] + .as_ref() + .vortex_expect("ParquetVariantArray metadata slot"), + slots[VALUE_SLOT].as_ref(), + slots[TYPED_VALUE_SLOT].as_ref(), dtype, len, ) @@ -178,27 +179,6 @@ impl ParquetVariantData { Ok(()) } - /// Returns a reference to the metadata child array. - pub fn metadata_array(&self) -> &ArrayRef { - self.slots[METADATA_SLOT] - .as_ref() - .vortex_expect("ParquetVariantArray metadata slot") - } - - pub fn validity(&self) -> Validity { - child_to_validity(&self.slots[VALIDITY_SLOT], self.nullability) - } - - /// Returns a reference to the un-shredded value child array, if present. - pub fn value_array(&self) -> Option<&ArrayRef> { - self.slots[VALUE_SLOT].as_ref() - } - - /// Returns a reference to the shredded typed_value child array, if present. - pub fn typed_value_array(&self) -> Option<&ArrayRef> { - self.slots[TYPED_VALUE_SLOT].as_ref() - } - /// Converts an Arrow `parquet_variant_compute::VariantArray` into a Vortex `ArrayRef` /// wrapping `VariantArray(ParquetVariantArray(...))`. pub fn from_arrow_variant(arrow_variant: &ArrowVariantArray) -> VortexResult { @@ -241,9 +221,31 @@ impl ParquetVariantData { let pv = ParquetVariant::try_new(validity, metadata, value, typed_value)?; Ok(VariantArray::new(pv.into_array()).into_array()) } +} + +pub trait ParquetVariantArrayExt { + fn parquet_variant_dtype(&self) -> &DType; + fn as_slots(&self) -> &[Option]; + + fn metadata_array(&self) -> &ArrayRef { + self.as_slots()[METADATA_SLOT] + .as_ref() + .vortex_expect("ParquetVariantArray metadata slot") + } - /// Converts this array back to an Arrow [`parquet_variant_compute::VariantArray`]. - pub fn to_arrow(&self, ctx: &mut ExecutionCtx) -> VortexResult { + fn validity(&self) -> Validity { + child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.parquet_variant_dtype().nullability()) + } + + fn value_array(&self) -> Option<&ArrayRef> { + self.as_slots()[VALUE_SLOT].as_ref() + } + + fn typed_value_array(&self) -> Option<&ArrayRef> { + self.as_slots()[TYPED_VALUE_SLOT].as_ref() + } + + fn to_arrow(&self, ctx: &mut ExecutionCtx) -> VortexResult { let metadata = self.metadata_array(); let len = metadata.len(); let nulls = to_arrow_null_buffer(self.validity(), len, ctx)?; @@ -284,6 +286,26 @@ impl ParquetVariantData { } } +impl ParquetVariantArrayExt for Array { + fn parquet_variant_dtype(&self) -> &DType { + self.dtype() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl ParquetVariantArrayExt for vortex_array::ArrayView<'_, ParquetVariant> { + fn parquet_variant_dtype(&self) -> &DType { + self.dtype() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + #[cfg(test)] mod tests { use std::sync::Arc; diff --git a/encodings/parquet-variant/src/kernel.rs b/encodings/parquet-variant/src/kernel.rs index 6061157c432..01525f076f8 100644 --- a/encodings/parquet-variant/src/kernel.rs +++ b/encodings/parquet-variant/src/kernel.rs @@ -17,6 +17,7 @@ use vortex_array::kernel::ParentKernelSet; use vortex_error::VortexResult; use vortex_mask::Mask; +use crate::ParquetVariantArrayExt; use crate::ParquetVariant; pub(crate) static PARENT_KERNELS: ParentKernelSet = ParentKernelSet::new(&[ diff --git a/encodings/parquet-variant/src/lib.rs b/encodings/parquet-variant/src/lib.rs index 42c97d28870..9bff17b96e6 100644 --- a/encodings/parquet-variant/src/lib.rs +++ b/encodings/parquet-variant/src/lib.rs @@ -31,5 +31,6 @@ mod validity; mod vtable; pub use array::ParquetVariantData; +pub use array::ParquetVariantArrayExt; pub use vtable::ParquetVariant; pub use vtable::ParquetVariantArray; diff --git a/encodings/parquet-variant/src/operations.rs b/encodings/parquet-variant/src/operations.rs index 67b6c78016b..eb95682738c 100644 --- a/encodings/parquet-variant/src/operations.rs +++ b/encodings/parquet-variant/src/operations.rs @@ -26,6 +26,7 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_err; +use crate::ParquetVariantArrayExt; use crate::vtable::ParquetVariant; impl OperationsVTable for ParquetVariant { diff --git a/encodings/parquet-variant/src/validity.rs b/encodings/parquet-variant/src/validity.rs index 50994d8b8a7..b28c7102e22 100644 --- a/encodings/parquet-variant/src/validity.rs +++ b/encodings/parquet-variant/src/validity.rs @@ -6,10 +6,11 @@ use vortex_array::validity::Validity; use vortex_array::vtable::ValidityVTable; use vortex_error::VortexResult; +use crate::ParquetVariantArrayExt; use crate::vtable::ParquetVariant; impl ValidityVTable for ParquetVariant { fn validity(array: ArrayView<'_, ParquetVariant>) -> VortexResult { - Ok(array.data().validity()) + Ok(ParquetVariantArrayExt::validity(&array)) } } diff --git a/encodings/parquet-variant/src/vtable.rs b/encodings/parquet-variant/src/vtable.rs index 1499b4653e2..29e7c17b084 100644 --- a/encodings/parquet-variant/src/vtable.rs +++ b/encodings/parquet-variant/src/vtable.rs @@ -9,6 +9,7 @@ use vortex_array::Array; use vortex_array::ArrayEq; use vortex_array::ArrayHash; use vortex_array::ArrayId; +use vortex_array::ArrayParts; use vortex_array::ArrayRef; use vortex_array::ArrayView; use vortex_array::ExecutionCtx; @@ -23,6 +24,7 @@ use vortex_array::serde::ArrayChildren; use vortex_array::validity::Validity; use vortex_array::vtable; use vortex_array::vtable::VTable; +use vortex_array::vtable::validity_to_child; use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_err; @@ -30,8 +32,8 @@ use vortex_error::vortex_panic; use vortex_proto::dtype as pb; use vortex_session::VortexSession; -use crate::array::NUM_SLOTS; use crate::array::ParquetVariantData; +use crate::array::ParquetVariantArrayExt; use crate::array::SLOT_NAMES; use crate::kernel::PARENT_KERNELS; @@ -74,20 +76,23 @@ impl VTable for ParquetVariant { len: usize, slots: &[Option], ) -> VortexResult<()> { - data.validate(dtype, len) + let _ = data; + ParquetVariantData::validate_slots(dtype, len, slots) } fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.data().validity().array_hash(state, precision); - array.metadata_array().array_hash(state, precision); + ParquetVariantArrayExt::validity(&array).array_hash(state, precision); + ParquetVariantArrayExt::metadata_array(&array).array_hash(state, precision); // Hash discriminators so that (value=Some, typed_value=None) and // (value=None, typed_value=Some) produce different hashes. - array.value_array().is_some().hash(state); - if let Some(value) = array.value_array() { + ParquetVariantArrayExt::value_array(&array).is_some().hash(state); + if let Some(value) = ParquetVariantArrayExt::value_array(&array) { value.array_hash(state, precision); } - array.typed_value_array().is_some().hash(state); - if let Some(typed_value) = array.typed_value_array() { + ParquetVariantArrayExt::typed_value_array(&array) + .is_some() + .hash(state); + if let Some(typed_value) = ParquetVariantArrayExt::typed_value_array(&array) { typed_value.array_hash(state, precision); } } @@ -97,17 +102,17 @@ impl VTable for ParquetVariant { other: ArrayView<'_, Self>, precision: Precision, ) -> bool { - if !array - .data() - .validity() - .array_eq(&other.data().validity(), precision) - || !array - .metadata_array() - .array_eq(other.metadata_array(), precision) + if !ParquetVariantArrayExt::validity(&array) + .array_eq(&ParquetVariantArrayExt::validity(&other), precision) + || !ParquetVariantArrayExt::metadata_array(&array) + .array_eq(ParquetVariantArrayExt::metadata_array(&other), precision) { return false; } - match (array.value_array(), other.value_array()) { + match ( + ParquetVariantArrayExt::value_array(&array), + ParquetVariantArrayExt::value_array(&other), + ) { (Some(a), Some(b)) => { if !a.array_eq(b, precision) { return false; @@ -116,7 +121,10 @@ impl VTable for ParquetVariant { (None, None) => {} _ => return false, } - match (array.typed_value_array(), other.typed_value_array()) { + match ( + ParquetVariantArrayExt::typed_value_array(&array), + ParquetVariantArrayExt::typed_value_array(&other), + ) { (Some(a), Some(b)) => a.array_eq(b, precision), (None, None) => true, _ => false, @@ -135,10 +143,6 @@ impl VTable for ParquetVariant { None } - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() - } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { array.slots() } @@ -170,7 +174,7 @@ impl VTable for ParquetVariant { buffers: &[BufferHandle], children: &dyn ArrayChildren, session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { vortex_ensure!( buffers.is_empty(), "ParquetVariantArray expects 0 buffers, got {}", @@ -226,7 +230,14 @@ impl VTable for ParquetVariant { None }; - ParquetVariantData::try_new(validity, variant_metadata, value, typed_value) + let slots = vec![ + validity_to_child(&validity, len), + Some(variant_metadata.clone()), + value.clone(), + typed_value.clone(), + ]; + let data = ParquetVariantData::try_new(validity, variant_metadata, value, typed_value)?; + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { diff --git a/encodings/pco/public-api.lock b/encodings/pco/public-api.lock index 4513321e259..2f711de8db2 100644 --- a/encodings/pco/public-api.lock +++ b/encodings/pco/public-api.lock @@ -24,15 +24,15 @@ pub type vortex_pco::Pco::OperationsVTable = vortex_pco::Pco pub type vortex_pco::Pco::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromValiditySliceHelper -pub fn vortex_pco::Pco::array_eq(array: &vortex_pco::PcoData, other: &vortex_pco::PcoData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_pco::Pco::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_pco::Pco::array_hash(array: &vortex_pco::PcoData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_pco::Pco::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_pco::Pco::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_pco::Pco::buffer_name(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option -pub fn vortex_pco::Pco::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_pco::Pco::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_pco::Pco::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -48,9 +48,7 @@ pub fn vortex_pco::Pco::slot_name(_array: vortex_array::array::view::ArrayView<' pub fn vortex_pco::Pco::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_pco::Pco::validate(&self, data: &vortex_pco::PcoData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_pco::Pco::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_pco::Pco::validate(&self, data: &vortex_pco::PcoData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_pco::Pco diff --git a/encodings/pco/src/array.rs b/encodings/pco/src/array.rs index 811de5fbe27..f0ef6182c5d 100644 --- a/encodings/pco/src/array.rs +++ b/encodings/pco/src/array.rs @@ -180,7 +180,7 @@ impl VTable for Pco { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = PcoMetadata::decode(metadata)?; let validity = if children.is_empty() { Validity::from(dtype.nullability()) @@ -208,18 +208,16 @@ impl VTable for Pco { .sum::(); vortex_ensure!(pages.len() == expected_n_pages); - Ok(PcoData::new( + let slots = vec![validity_to_child(&validity, len)]; + let data = PcoData::new( chunk_metas, pages, dtype.as_ptype(), metadata, len, validity, - )) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + ); + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { @@ -285,7 +283,10 @@ impl Pco { pub(crate) fn try_new(dtype: DType, data: PcoData) -> VortexResult { let len = data.len(); data.validate(&dtype, len)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Pco, dtype, len, data)) }) + let slots = vec![validity_to_child(&data.unsliced_validity, data.unsliced_n_rows)]; + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(Pco, dtype, len, data).with_slots(slots)) + }) } /// Compress a primitive array using pcodec. @@ -313,7 +314,6 @@ pub struct PcoData { ptype: PType, pub(crate) unsliced_validity: Validity, unsliced_n_rows: usize, - pub(super) slots: Vec>, slice_start: usize, slice_stop: usize, } @@ -380,8 +380,6 @@ impl PcoData { len: usize, validity: Validity, ) -> Self { - let validity_slot = validity_to_child(&validity, len); - Self { chunk_metas, pages, @@ -389,7 +387,6 @@ impl PcoData { ptype, unsliced_validity: validity, unsliced_n_rows: len, - slots: vec![validity_slot], slice_start: 0, slice_stop: len, } diff --git a/encodings/runend/public-api.lock b/encodings/runend/public-api.lock index 975353acb75..32642d0a20c 100644 --- a/encodings/runend/public-api.lock +++ b/encodings/runend/public-api.lock @@ -48,15 +48,15 @@ pub type vortex_runend::RunEnd::OperationsVTable = vortex_runend::RunEnd pub type vortex_runend::RunEnd::ValidityVTable = vortex_runend::RunEnd -pub fn vortex_runend::RunEnd::array_eq(array: &vortex_runend::RunEndData, other: &vortex_runend::RunEndData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_runend::RunEnd::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_runend::RunEnd::array_hash(array: &vortex_runend::RunEndData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_runend::RunEnd::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_runend::RunEnd::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_runend::RunEnd::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option -pub fn vortex_runend::RunEnd::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_runend::RunEnd::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_runend::RunEnd::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -74,9 +74,7 @@ pub fn vortex_runend::RunEnd::slot_name(_array: vortex_array::array::view::Array pub fn vortex_runend::RunEnd::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_runend::RunEnd::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_runend::RunEnd::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_runend::RunEnd::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_runend::RunEnd @@ -110,24 +108,14 @@ pub struct vortex_runend::RunEndData impl vortex_runend::RunEndData -pub fn vortex_runend::RunEndData::dtype(&self) -> &vortex_array::dtype::DType - pub fn vortex_runend::RunEndData::encode(array: vortex_array::array::erased::ArrayRef) -> vortex_error::VortexResult -pub fn vortex_runend::RunEndData::ends(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_runend::RunEndData::find_physical_index(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_runend::RunEndData::into_parts(self) -> vortex_runend::RunEndDataParts +pub fn vortex_runend::RunEndData::into_parts(self, ends: vortex_array::array::erased::ArrayRef, values: vortex_array::array::erased::ArrayRef) -> vortex_runend::RunEndDataParts pub fn vortex_runend::RunEndData::new(ends: vortex_array::array::erased::ArrayRef, values: vortex_array::array::erased::ArrayRef) -> Self pub unsafe fn vortex_runend::RunEndData::new_unchecked(ends: vortex_array::array::erased::ArrayRef, values: vortex_array::array::erased::ArrayRef, offset: usize, _length: usize) -> Self -pub fn vortex_runend::RunEndData::offset(&self) -> usize - -pub fn vortex_runend::RunEndData::values(&self) -> &vortex_array::array::erased::ArrayRef - impl core::clone::Clone for vortex_runend::RunEndData pub fn vortex_runend::RunEndData::clone(&self) -> vortex_runend::RunEndData @@ -180,6 +168,54 @@ pub fn vortex_runend::RunEndMetadata::clear(&mut self) pub fn vortex_runend::RunEndMetadata::encoded_len(&self) -> usize +pub trait vortex_runend::RunEndArrayExt + +pub fn vortex_runend::RunEndArrayExt::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_runend::RunEndArrayExt::dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_runend::RunEndArrayExt::ends(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_runend::RunEndArrayExt::find_physical_index(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_runend::RunEndArrayExt::offset(&self) -> usize + +pub fn vortex_runend::RunEndArrayExt::run_end_data(&self) -> &vortex_runend::RunEndData + +pub fn vortex_runend::RunEndArrayExt::values(&self) -> &vortex_array::array::erased::ArrayRef + +impl vortex_runend::RunEndArrayExt for vortex_array::array::typed::Array + +pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::typed::Array::dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::array::typed::Array::ends(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::typed::Array::find_physical_index(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::array::typed::Array::offset(&self) -> usize + +pub fn vortex_array::array::typed::Array::run_end_data(&self) -> &vortex_runend::RunEndData + +pub fn vortex_array::array::typed::Array::values(&self) -> &vortex_array::array::erased::ArrayRef + +impl vortex_runend::RunEndArrayExt for vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd> + +pub fn vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd>::dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd>::ends(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd>::find_physical_index(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd>::offset(&self) -> usize + +pub fn vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd>::run_end_data(&self) -> &vortex_runend::RunEndData + +pub fn vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd>::values(&self) -> &vortex_array::array::erased::ArrayRef + pub fn vortex_runend::initialize(session: &vortex_session::VortexSession) pub fn vortex_runend::trimmed_ends_iter(run_ends: &[E], offset: usize, length: usize) -> impl core::iter::traits::iterator::Iterator + use<'_, E> diff --git a/encodings/runend/src/array.rs b/encodings/runend/src/array.rs index 5c48fe47fa2..c5b81f7b066 100644 --- a/encodings/runend/src/array.rs +++ b/encodings/runend/src/array.rs @@ -73,12 +73,18 @@ impl VTable for RunEnd { len: usize, slots: &[Option], ) -> VortexResult<()> { - RunEndData::validate(data.ends(), data.values(), data.offset, len)?; + let ends = slots[ENDS_SLOT] + .as_ref() + .vortex_expect("RunEndArray ends slot"); + let values = slots[VALUES_SLOT] + .as_ref() + .vortex_expect("RunEndArray values slot"); + RunEndData::validate(ends, values, data.offset, len)?; vortex_ensure!( - data.values().dtype() == dtype, + values.dtype() == dtype, "expected dtype {}, got {}", dtype, - data.values().dtype() + values.dtype() ); Ok(()) } @@ -135,24 +141,22 @@ impl VTable for RunEnd { _buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = RunEndMetadata::decode(metadata)?; let ends_dtype = DType::Primitive(metadata.ends_ptype(), Nullability::NonNullable); let runs = usize::try_from(metadata.num_runs).vortex_expect("Must be a valid usize"); let ends = children.get(0, &ends_dtype, runs)?; let values = children.get(1, dtype, runs)?; + let slots = vec![Some(ends.clone()), Some(values.clone())]; - RunEndData::try_new_offset_length( + let data = RunEndData::try_new_offset_length( ends, values, usize::try_from(metadata.offset).vortex_expect("Offset must be a valid usize"), len, - ) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + )?; + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { @@ -194,7 +198,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["ends", "values"]; #[derive(Clone, Debug)] pub struct RunEndData { - pub(super) slots: Vec>, offset: usize, } @@ -204,6 +207,62 @@ pub struct RunEndDataParts { pub offset: usize, } +pub trait RunEndArrayExt { + fn run_end_data(&self) -> &RunEndData; + fn as_slots(&self) -> &[Option]; + + fn offset(&self) -> usize { + self.run_end_data().offset + } + + fn ends(&self) -> &ArrayRef { + self.as_slots()[ENDS_SLOT] + .as_ref() + .vortex_expect("RunEndArray ends slot") + } + + fn values(&self) -> &ArrayRef { + self.as_slots()[VALUES_SLOT] + .as_ref() + .vortex_expect("RunEndArray values slot") + } + + fn dtype(&self) -> &DType { + self.values().dtype() + } + + fn find_physical_index(&self, index: usize) -> VortexResult { + Ok(self + .ends() + .as_primitive_typed() + .search_sorted( + &PValue::from(index + self.offset()), + SearchSortedSide::Right, + )? + .to_ends_index(self.ends().len())) + } +} + +impl RunEndArrayExt for Array { + fn run_end_data(&self) -> &RunEndData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl RunEndArrayExt for ArrayView<'_, RunEnd> { + fn run_end_data(&self) -> &RunEndData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + #[derive(Clone, Debug)] pub struct RunEnd; @@ -220,17 +279,23 @@ impl RunEnd { offset: usize, length: usize, ) -> RunEndArray { + let dtype = values.dtype().clone(); + let slots = vec![Some(ends.clone()), Some(values.clone())]; let data = unsafe { RunEndData::new_unchecked(ends, values, offset, length) }; - let dtype = data.dtype().clone(); - unsafe { Array::from_parts_unchecked(ArrayParts::new(RunEnd, dtype, length, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(RunEnd, dtype, length, data).with_slots(slots)) + } } /// Build a new [`RunEndArray`] from ends and values. pub fn try_new(ends: ArrayRef, values: ArrayRef) -> VortexResult { let len = RunEndData::logical_len_from_ends(&ends)?; + let dtype = values.dtype().clone(); + let slots = vec![Some(ends.clone()), Some(values.clone())]; let data = RunEndData::try_new_offset_length(ends, values, 0, len)?; - let dtype = data.dtype().clone(); - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(RunEnd, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(RunEnd, dtype, len, data).with_slots(slots)) + }) } /// Build a new [`RunEndArray`] from ends, values, offset, and length. @@ -240,9 +305,14 @@ impl RunEnd { offset: usize, length: usize, ) -> VortexResult { + let dtype = values.dtype().clone(); + let slots = vec![Some(ends.clone()), Some(values.clone())]; let data = RunEndData::try_new_offset_length(ends, values, offset, length)?; - let dtype = data.dtype().clone(); - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(RunEnd, dtype, length, data)) }) + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(RunEnd, dtype, length, data).with_slots(slots), + ) + }) } /// Build a new [`RunEndArray`] from ends and values (panics on invalid input). @@ -252,10 +322,21 @@ impl RunEnd { /// Run the array through run-end encoding. pub fn encode(array: ArrayRef) -> VortexResult { - let len = array.len(); - let data = RunEndData::encode(array)?; - let dtype = data.dtype().clone(); - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(RunEnd, dtype, len, data)) }) + if let Some(parray) = array.as_opt::() { + let (ends, values) = runend_encode(parray); + let ends = ends.into_array(); + let len = array.len(); + let dtype = values.dtype().clone(); + let slots = vec![Some(ends.clone()), Some(values.clone())]; + let data = unsafe { RunEndData::new_unchecked(ends, values, 0, len) }; + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(RunEnd, dtype, len, data).with_slots(slots), + ) + }) + } else { + vortex_bail!("REE can only encode primitive arrays") + } } } @@ -390,10 +471,7 @@ impl RunEndData { ) -> VortexResult { Self::validate(&ends, &values, offset, length)?; - Ok(Self { - slots: vec![Some(ends), Some(values)], - offset, - }) + Ok(Self { offset }) } /// Build a new `RunEndArray` without validation. @@ -411,22 +489,8 @@ impl RunEndData { offset: usize, _length: usize, ) -> Self { - Self { - slots: vec![Some(ends), Some(values)], - offset, - } - } - - /// Convert the given logical index to an index into the `values` array - pub fn find_physical_index(&self, index: usize) -> VortexResult { - Ok(self - .ends() - .as_primitive_typed() - .search_sorted( - &PValue::from(index + self.offset()), - SearchSortedSide::Right, - )? - .to_ends_index(self.ends().len())) + drop((ends, values)); + Self { offset } } /// Run the array through run-end encoding. @@ -447,50 +511,10 @@ impl RunEndData { } } - /// Returns the logical data type of the array. - #[inline] - pub fn dtype(&self) -> &DType { - self.values().dtype() - } - - /// The offset that the `ends` is relative to. - /// - /// This is generally zero for a "new" array, and non-zero after a slicing operation. - #[inline] - pub fn offset(&self) -> usize { - self.offset - } - - /// The encoded "ends" of value runs. - /// - /// The `i`-th element indicates that there is a run of the same value, beginning - /// at `ends[i]` (inclusive) and terminating at `ends[i+1]` (exclusive). - #[inline] - pub fn ends(&self) -> &ArrayRef { - self.slots[ENDS_SLOT] - .as_ref() - .vortex_expect("RunEndArray ends slot") - } - - /// The scalar values. - /// - /// The `i`-th element is the scalar value for the `i`-th repeated run. The run begins - /// at `ends[i]` (inclusive) and terminates at `ends[i+1]` (exclusive). - #[inline] - pub fn values(&self) -> &ArrayRef { - self.slots[VALUES_SLOT] - .as_ref() - .vortex_expect("RunEndArray values slot") - } - - pub fn into_parts(mut self) -> RunEndDataParts { + pub fn into_parts(self, ends: ArrayRef, values: ArrayRef) -> RunEndDataParts { RunEndDataParts { - ends: self.slots[ENDS_SLOT] - .take() - .vortex_expect("RunEndArray ends slot"), - values: self.slots[VALUES_SLOT] - .take() - .vortex_expect("RunEndArray values slot"), + ends, + values, offset: self.offset, } } diff --git a/encodings/runend/src/compress.rs b/encodings/runend/src/compress.rs index b36b549225c..cba99a70044 100644 --- a/encodings/runend/src/compress.rs +++ b/encodings/runend/src/compress.rs @@ -288,7 +288,7 @@ pub fn runend_decode_varbinview( ) }); - let parts = values.into_data().into_parts(); + let parts = values.into_data_parts(); let view_handle = BufferHandle::new_host(decoded_views.into_byte_buffer()); // SAFETY: we are expanding views from a valid VarBinViewArray with the same diff --git a/encodings/runend/src/compute/cast.rs b/encodings/runend/src/compute/cast.rs index d9ecb3a0baf..1333a8d076a 100644 --- a/encodings/runend/src/compute/cast.rs +++ b/encodings/runend/src/compute/cast.rs @@ -10,6 +10,7 @@ use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_error::VortexResult; use crate::RunEnd; +use crate::array::RunEndArrayExt; impl CastReduce for RunEnd { fn cast(array: ArrayView<'_, Self>, dtype: &DType) -> VortexResult> { // Cast the values array to the target type diff --git a/encodings/runend/src/compute/compare.rs b/encodings/runend/src/compute/compare.rs index d9926538944..8dd253e453b 100644 --- a/encodings/runend/src/compute/compare.rs +++ b/encodings/runend/src/compute/compare.rs @@ -15,6 +15,7 @@ use vortex_array::scalar_fn::fns::operators::Operator; use vortex_error::VortexResult; use crate::RunEnd; +use crate::array::RunEndArrayExt; use crate::decompress_bool::runend_decode_bools; impl CompareKernel for RunEnd { diff --git a/encodings/runend/src/compute/fill_null.rs b/encodings/runend/src/compute/fill_null.rs index abe0ef44f09..ddce31184eb 100644 --- a/encodings/runend/src/compute/fill_null.rs +++ b/encodings/runend/src/compute/fill_null.rs @@ -10,6 +10,7 @@ use vortex_array::scalar_fn::fns::fill_null::FillNullReduce; use vortex_error::VortexResult; use crate::RunEnd; +use crate::array::RunEndArrayExt; impl FillNullReduce for RunEnd { fn fill_null( diff --git a/encodings/runend/src/compute/filter.rs b/encodings/runend/src/compute/filter.rs index e0ef5382d40..11093d482ac 100644 --- a/encodings/runend/src/compute/filter.rs +++ b/encodings/runend/src/compute/filter.rs @@ -21,6 +21,7 @@ use vortex_error::VortexResult; use vortex_mask::Mask; use crate::RunEnd; +use crate::array::RunEndArrayExt; use crate::compute::take::take_indices_unchecked; const FILTER_TAKE_THRESHOLD: f64 = 0.1; @@ -38,7 +39,7 @@ impl FilterKernel for RunEnd { if runs_ratio < FILTER_TAKE_THRESHOLD || mask_values.true_count() < 25 { Ok(Some(take_indices_unchecked( - &array, + array, mask_values.indices(), &Validity::NonNullable, )?)) diff --git a/encodings/runend/src/compute/is_constant.rs b/encodings/runend/src/compute/is_constant.rs index 89e8711b6eb..53418f3ef50 100644 --- a/encodings/runend/src/compute/is_constant.rs +++ b/encodings/runend/src/compute/is_constant.rs @@ -11,6 +11,7 @@ use vortex_array::scalar::Scalar; use vortex_error::VortexResult; use crate::RunEnd; +use crate::array::RunEndArrayExt; /// RunEnd-specific is_constant kernel. /// diff --git a/encodings/runend/src/compute/is_sorted.rs b/encodings/runend/src/compute/is_sorted.rs index e3989b4972c..e26a3d8cb57 100644 --- a/encodings/runend/src/compute/is_sorted.rs +++ b/encodings/runend/src/compute/is_sorted.rs @@ -13,6 +13,7 @@ use vortex_array::scalar::Scalar; use vortex_error::VortexResult; use crate::RunEnd; +use crate::array::RunEndArrayExt; /// RunEnd-specific is_sorted kernel. /// diff --git a/encodings/runend/src/compute/min_max.rs b/encodings/runend/src/compute/min_max.rs index c44db02e1b0..2a65d9de2bf 100644 --- a/encodings/runend/src/compute/min_max.rs +++ b/encodings/runend/src/compute/min_max.rs @@ -12,6 +12,7 @@ use vortex_array::scalar::Scalar; use vortex_error::VortexResult; use crate::RunEnd; +use crate::array::RunEndArrayExt; /// RunEnd-specific min/max kernel. /// diff --git a/encodings/runend/src/compute/take.rs b/encodings/runend/src/compute/take.rs index 511b473c53b..9bbdbf6784e 100644 --- a/encodings/runend/src/compute/take.rs +++ b/encodings/runend/src/compute/take.rs @@ -20,7 +20,7 @@ use vortex_error::VortexResult; use vortex_error::vortex_bail; use crate::RunEnd; -use crate::RunEndData; +use crate::array::RunEndArrayExt; impl TakeExecute for RunEnd { #[expect( @@ -50,13 +50,13 @@ impl TakeExecute for RunEnd { }); let indices_validity = primitive_indices.validity()?; - take_indices_unchecked(&array, &checked_indices, &indices_validity).map(Some) + take_indices_unchecked(array, &checked_indices, &indices_validity).map(Some) } } /// Perform a take operation on a RunEndArray by binary searching for each of the indices. pub fn take_indices_unchecked>( - array: &RunEndData, + array: ArrayView<'_, RunEnd>, indices: &[T], validity: &Validity, ) -> VortexResult { diff --git a/encodings/runend/src/compute/take_from.rs b/encodings/runend/src/compute/take_from.rs index 85d3dcf4fae..fb18d648a15 100644 --- a/encodings/runend/src/compute/take_from.rs +++ b/encodings/runend/src/compute/take_from.rs @@ -11,6 +11,7 @@ use vortex_array::kernel::ExecuteParentKernel; use vortex_error::VortexResult; use crate::RunEnd; +use crate::array::RunEndArrayExt; #[derive(Debug)] pub(crate) struct RunEndTakeFrom; diff --git a/encodings/runend/src/kernel.rs b/encodings/runend/src/kernel.rs index 97f17c17857..432453ee609 100644 --- a/encodings/runend/src/kernel.rs +++ b/encodings/runend/src/kernel.rs @@ -17,6 +17,7 @@ use vortex_array::scalar_fn::fns::binary::CompareExecuteAdaptor; use vortex_error::VortexResult; use crate::RunEnd; +use crate::array::RunEndArrayExt; use crate::compute::take_from::RunEndTakeFrom; pub(super) const PARENT_KERNELS: ParentKernelSet = ParentKernelSet::new(&[ diff --git a/encodings/runend/src/ops.rs b/encodings/runend/src/ops.rs index d0d6716d5ad..c27885cc39a 100644 --- a/encodings/runend/src/ops.rs +++ b/encodings/runend/src/ops.rs @@ -13,6 +13,7 @@ use vortex_array::vtable::OperationsVTable; use vortex_error::VortexResult; use crate::RunEnd; +use crate::array::RunEndArrayExt; impl OperationsVTable for RunEnd { fn scalar_at( diff --git a/encodings/runend/src/rules.rs b/encodings/runend/src/rules.rs index 2c8a6607156..80f97bb9613 100644 --- a/encodings/runend/src/rules.rs +++ b/encodings/runend/src/rules.rs @@ -17,6 +17,7 @@ use vortex_array::scalar_fn::fns::fill_null::FillNullReduceAdaptor; use vortex_error::VortexResult; use crate::RunEnd; +use crate::array::RunEndArrayExt; pub(super) const RULES: ParentRuleSet = ParentRuleSet::new(&[ // CastReduceAdaptor must come before RunEndScalarFnRule so that cast operations are executed diff --git a/encodings/sequence/public-api.lock b/encodings/sequence/public-api.lock index cbbbd492efb..87e7bf273a8 100644 --- a/encodings/sequence/public-api.lock +++ b/encodings/sequence/public-api.lock @@ -26,15 +26,15 @@ pub type vortex_sequence::Sequence::OperationsVTable = vortex_sequence::Sequence pub type vortex_sequence::Sequence::ValidityVTable = vortex_sequence::Sequence -pub fn vortex_sequence::Sequence::array_eq(array: &vortex_sequence::SequenceData, other: &vortex_sequence::SequenceData, _precision: vortex_array::hash::Precision) -> bool +pub fn vortex_sequence::Sequence::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, _precision: vortex_array::hash::Precision) -> bool -pub fn vortex_sequence::Sequence::array_hash(array: &vortex_sequence::SequenceData, state: &mut H, _precision: vortex_array::hash::Precision) +pub fn vortex_sequence::Sequence::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, _precision: vortex_array::hash::Precision) pub fn vortex_sequence::Sequence::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_sequence::Sequence::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option -pub fn vortex_sequence::Sequence::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_sequence::Sequence::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_sequence::Sequence::execute(array: vortex_array::array::typed::Array, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -52,9 +52,7 @@ pub fn vortex_sequence::Sequence::slot_name(_array: vortex_array::array::view::A pub fn vortex_sequence::Sequence::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_sequence::Sequence::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_sequence::Sequence::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_sequence::Sequence::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_sequence::Sequence diff --git a/encodings/sequence/src/array.rs b/encodings/sequence/src/array.rs index a7b40a1942b..3ea0e718480 100644 --- a/encodings/sequence/src/array.rs +++ b/encodings/sequence/src/array.rs @@ -63,7 +63,6 @@ pub(super) const SLOT_NAMES: [&str; 0] = []; pub struct SequenceData { base: PValue, multiplier: PValue, - pub(super) slots: Vec>, } pub struct SequenceDataParts { @@ -144,11 +143,7 @@ impl SequenceData { /// - `base` and `multiplier` are both normalized to the same integer `ptype`. /// - they are logically compatible with the outer dtype and len. pub(crate) unsafe fn new_unchecked(base: PValue, multiplier: PValue) -> Self { - Self { - base, - multiplier, - slots: vec![], - } + Self { base, multiplier } } pub fn ptype(&self) -> PType { @@ -271,7 +266,7 @@ impl VTable for Sequence { buffers: &[BufferHandle], children: &dyn ArrayChildren, session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { vortex_ensure!( buffers.is_empty(), "SequenceArray expects 0 buffers, got {}", @@ -311,11 +306,8 @@ impl VTable for Sequence { .pvalue() .vortex_expect("sequence array multiplier should be a non-nullable primitive"); - SequenceData::try_new(base, multiplier, ptype, dtype.nullability(), len) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + let data = SequenceData::try_new(base, multiplier, ptype, dtype.nullability(), len)?; + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { diff --git a/encodings/sparse/public-api.lock b/encodings/sparse/public-api.lock index b937d3df263..c61614fa848 100644 --- a/encodings/sparse/public-api.lock +++ b/encodings/sparse/public-api.lock @@ -28,15 +28,15 @@ pub type vortex_sparse::Sparse::OperationsVTable = vortex_sparse::Sparse pub type vortex_sparse::Sparse::ValidityVTable = vortex_sparse::Sparse -pub fn vortex_sparse::Sparse::array_eq(array: &vortex_sparse::SparseData, other: &vortex_sparse::SparseData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_sparse::Sparse::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_sparse::Sparse::array_hash(array: &vortex_sparse::SparseData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_sparse::Sparse::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_sparse::Sparse::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_sparse::Sparse::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option -pub fn vortex_sparse::Sparse::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_sparse::Sparse::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_sparse::Sparse::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -54,9 +54,7 @@ pub fn vortex_sparse::Sparse::slot_name(_array: vortex_array::array::view::Array pub fn vortex_sparse::Sparse::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_sparse::Sparse::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_sparse::Sparse::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_sparse::Sparse::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_sparse::Sparse diff --git a/encodings/sparse/src/canonical.rs b/encodings/sparse/src/canonical.rs index 7afe3ce2b94..b153d7ea45a 100644 --- a/encodings/sparse/src/canonical.rs +++ b/encodings/sparse/src/canonical.rs @@ -480,8 +480,7 @@ fn execute_sparse_decimal( let filled_array = builder.finish_into_decimal(); let dtype = filled_array.dtype().clone(); let len = filled_array.len(); - let data = filled_array.into_data().patch(patches, ctx)?; - Ok(Array::try_from_parts(ArrayParts::new(Decimal, dtype, len, data))?.into_array()) + Ok(filled_array.patch(patches, ctx)?.into_array()) } fn execute_varbin( diff --git a/encodings/sparse/src/lib.rs b/encodings/sparse/src/lib.rs index d79bc4931ae..68b9461829a 100644 --- a/encodings/sparse/src/lib.rs +++ b/encodings/sparse/src/lib.rs @@ -139,7 +139,7 @@ impl VTable for Sparse { buffers: &[BufferHandle], children: &dyn ArrayChildren, session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = SparseMetadata::decode(metadata)?; // Once we have the patches metadata, we need to get the fill value from the buffers. @@ -166,20 +166,16 @@ impl VTable for Sparse { )?; let patch_values = children.get(1, dtype, metadata.patches.len()?)?; - SparseData::try_new_from_patches( - Patches::new( - len, - metadata.patches.offset()?, - patch_indices, - patch_values, - None, - )?, - fill_value, - ) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + let patches = Patches::new( + len, + metadata.patches.offset()?, + patch_indices, + patch_values, + None, + )?; + let slots = SparseData::make_slots(&patches); + let data = SparseData::try_new_from_patches(patches, fill_value)?; + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { @@ -224,7 +220,6 @@ pub(crate) const SLOT_NAMES: [&str; NUM_SLOTS] = #[derive(Clone, Debug)] pub struct SparseData { - pub(crate) slots: Vec>, patches: Patches, fill_value: Scalar, } @@ -243,22 +238,37 @@ impl Sparse { fill_value: Scalar, ) -> VortexResult { let dtype = fill_value.dtype().clone(); + let slots = SparseData::make_slots(&Patches::new( + len, + 0, + indices.clone(), + values.clone(), + None, + )?); let data = SparseData::try_new(indices, values, len, fill_value)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Sparse, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(Sparse, dtype, len, data).with_slots(slots)) + }) } pub fn try_new_from_patches(patches: Patches, fill_value: Scalar) -> VortexResult { let dtype = fill_value.dtype().clone(); let len = patches.array_len(); + let slots = SparseData::make_slots(&patches); let data = SparseData::try_new_from_patches(patches, fill_value)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Sparse, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(Sparse, dtype, len, data).with_slots(slots)) + }) } pub(crate) unsafe fn new_unchecked(patches: Patches, fill_value: Scalar) -> SparseArray { let dtype = fill_value.dtype().clone(); let len = patches.array_len(); + let slots = SparseData::make_slots(&patches); let data = unsafe { SparseData::new_unchecked(patches, fill_value) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(Sparse, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Sparse, dtype, len, data).with_slots(slots)) + } } /// Encode the given array as a [`SparseArray`]. @@ -382,24 +392,11 @@ impl SparseData { /// Build a new SparseArray from an existing set of patches. pub fn try_new_from_patches(patches: Patches, fill_value: Scalar) -> VortexResult { let patches = Self::normalize_patches_dtype(patches, &fill_value)?; - - let slots = Self::make_slots(&patches); - - Ok(Self { - slots, - patches, - fill_value, - }) + Ok(Self { patches, fill_value }) } pub(crate) unsafe fn new_unchecked(patches: Patches, fill_value: Scalar) -> Self { - let slots = Self::make_slots(&patches); - - Self { - slots, - patches, - fill_value, - } + Self { patches, fill_value } } /// Returns the length of the array. diff --git a/encodings/zigzag/public-api.lock b/encodings/zigzag/public-api.lock index ec8ed62f664..517b698e1c3 100644 --- a/encodings/zigzag/public-api.lock +++ b/encodings/zigzag/public-api.lock @@ -24,15 +24,15 @@ pub type vortex_zigzag::ZigZag::OperationsVTable = vortex_zigzag::ZigZag pub type vortex_zigzag::ZigZag::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_zigzag::ZigZag::array_eq(array: &vortex_zigzag::ZigZagData, other: &vortex_zigzag::ZigZagData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_zigzag::ZigZag::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_zigzag::ZigZag::array_hash(array: &vortex_zigzag::ZigZagData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_zigzag::ZigZag::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_zigzag::ZigZag::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_zigzag::ZigZag::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option -pub fn vortex_zigzag::ZigZag::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_zigzag::ZigZag::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_zigzag::ZigZag::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -50,9 +50,7 @@ pub fn vortex_zigzag::ZigZag::slot_name(_array: vortex_array::array::view::Array pub fn vortex_zigzag::ZigZag::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_zigzag::ZigZag::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_zigzag::ZigZag::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_zigzag::ZigZag::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_zigzag::ZigZag @@ -60,7 +58,7 @@ pub fn vortex_zigzag::ZigZag::scalar_at(array: vortex_array::array::view::ArrayV impl vortex_array::array::vtable::validity::ValidityChild for vortex_zigzag::ZigZag -pub fn vortex_zigzag::ZigZag::validity_child(array: &vortex_zigzag::ZigZagData) -> &vortex_array::array::erased::ArrayRef +pub fn vortex_zigzag::ZigZag::validity_child(array: vortex_array::array::view::ArrayView<'_, vortex_zigzag::ZigZag>) -> vortex_array::array::erased::ArrayRef impl vortex_array::arrays::dict::take::TakeExecute for vortex_zigzag::ZigZag @@ -86,16 +84,8 @@ pub struct vortex_zigzag::ZigZagData impl vortex_zigzag::ZigZagData -pub fn vortex_zigzag::ZigZagData::encoded(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_zigzag::ZigZagData::is_empty(&self) -> bool - -pub fn vortex_zigzag::ZigZagData::len(&self) -> usize - pub fn vortex_zigzag::ZigZagData::new(encoded: vortex_array::array::erased::ArrayRef) -> Self -pub fn vortex_zigzag::ZigZagData::ptype(&self) -> vortex_array::dtype::ptype::PType - pub fn vortex_zigzag::ZigZagData::try_new(encoded: vortex_array::array::erased::ArrayRef) -> vortex_error::VortexResult impl core::clone::Clone for vortex_zigzag::ZigZagData @@ -106,6 +96,30 @@ impl core::fmt::Debug for vortex_zigzag::ZigZagData pub fn vortex_zigzag::ZigZagData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub trait vortex_zigzag::ZigZagArrayExt + +pub fn vortex_zigzag::ZigZagArrayExt::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_zigzag::ZigZagArrayExt::encoded(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_zigzag::ZigZagArrayExt::ptype(&self) -> vortex_array::dtype::ptype::PType + +impl vortex_zigzag::ZigZagArrayExt for vortex_array::array::typed::Array + +pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::typed::Array::encoded(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::typed::Array::ptype(&self) -> vortex_array::dtype::ptype::PType + +impl vortex_zigzag::ZigZagArrayExt for vortex_array::array::view::ArrayView<'_, vortex_zigzag::ZigZag> + +pub fn vortex_array::array::view::ArrayView<'_, vortex_zigzag::ZigZag>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::array::view::ArrayView<'_, vortex_zigzag::ZigZag>::encoded(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_array::array::view::ArrayView<'_, vortex_zigzag::ZigZag>::ptype(&self) -> vortex_array::dtype::ptype::PType + pub fn vortex_zigzag::zigzag_decode(parray: vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_array::arrays::primitive::vtable::PrimitiveArray pub fn vortex_zigzag::zigzag_encode(parray: vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_error::VortexResult diff --git a/encodings/zigzag/src/array.rs b/encodings/zigzag/src/array.rs index 3a78f962090..9193de33b1c 100644 --- a/encodings/zigzag/src/array.rs +++ b/encodings/zigzag/src/array.rs @@ -50,20 +50,23 @@ impl VTable for ZigZag { fn validate( &self, - data: &Self::ArrayData, + _data: &Self::ArrayData, dtype: &DType, len: usize, slots: &[Option], ) -> VortexResult<()> { - let expected_dtype = ZigZagData::dtype_from_encoded_dtype(data.encoded().dtype())?; + let encoded = slots[ENCODED_SLOT] + .as_ref() + .vortex_expect("ZigZagArray encoded slot"); + let expected_dtype = ZigZagData::dtype_from_encoded_dtype(encoded.dtype())?; vortex_ensure!( dtype == &expected_dtype, "expected dtype {expected_dtype}, got {dtype}" ); vortex_ensure!( - data.encoded().len() == len, + encoded.len() == len, "expected len {len}, got {}", - data.encoded().len() + encoded.len() ); Ok(()) } @@ -108,7 +111,7 @@ impl VTable for ZigZag { _buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { if !metadata.is_empty() { vortex_bail!( "ZigZagArray expects empty metadata, got {} bytes", @@ -123,11 +126,9 @@ impl VTable for ZigZag { let encoded_type = DType::Primitive(ptype.to_unsigned(), dtype.nullability()); let encoded = children.get(0, &encoded_type, len)?; - ZigZagData::try_new(encoded) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + let slots = vec![Some(encoded.clone())]; + let data = ZigZagData::try_new(encoded)?; + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { @@ -168,8 +169,34 @@ pub(super) const NUM_SLOTS: usize = 1; pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["encoded"]; #[derive(Clone, Debug)] -pub struct ZigZagData { - pub(super) slots: Vec>, +pub struct ZigZagData {} + +pub trait ZigZagArrayExt { + fn as_slots(&self) -> &[Option]; + + fn encoded(&self) -> &ArrayRef { + self.as_slots()[ENCODED_SLOT] + .as_ref() + .vortex_expect("ZigZagArray encoded slot") + } + + fn ptype(&self) -> PType { + PType::try_from(self.encoded().dtype()) + .vortex_expect("ZigZagArray encoded dtype") + .to_signed() + } +} + +impl ZigZagArrayExt for Array { + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl ZigZagArrayExt for ArrayView<'_, ZigZag> { + fn as_slots(&self) -> &[Option] { + self.slots() + } } #[derive(Clone, Debug)] @@ -180,10 +207,13 @@ impl ZigZag { /// Construct a new [`ZigZagArray`] from an encoded unsigned integer array. pub fn try_new(encoded: ArrayRef) -> VortexResult { + let dtype = ZigZagData::dtype_from_encoded_dtype(encoded.dtype())?; + let len = encoded.len(); + let slots = vec![Some(encoded.clone())]; let data = ZigZagData::try_new(encoded)?; - let dtype = ZigZagData::dtype_from_encoded_dtype(data.encoded().dtype())?; - let len = data.len(); - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(ZigZag, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(ZigZag, dtype, len, data).with_slots(slots)) + }) } } @@ -205,33 +235,7 @@ impl ZigZagData { Self::dtype_from_encoded_dtype(&encoded_dtype)?; - Ok(Self { - slots: vec![Some(encoded)], - }) - } - - /// Returns the length of the array. - #[inline] - pub fn len(&self) -> usize { - self.encoded().len() - } - - /// Returns whether the array is empty. - #[inline] - pub fn is_empty(&self) -> bool { - self.encoded().is_empty() - } - - pub fn ptype(&self) -> PType { - PType::try_from(self.encoded().dtype()) - .vortex_expect("ZigZagArray encoded dtype") - .to_signed() - } - - pub fn encoded(&self) -> &ArrayRef { - self.slots[ENCODED_SLOT] - .as_ref() - .vortex_expect("ZigZagArray encoded slot") + Ok(Self {}) } } @@ -243,7 +247,7 @@ impl OperationsVTable for ZigZag { ) -> VortexResult { let scalar = array.encoded().scalar_at(index)?; if scalar.is_null() { - return scalar.primitive_reinterpret_cast(array.ptype()); + return scalar.primitive_reinterpret_cast(ZigZagArrayExt::ptype(&array)); } let pscalar = scalar.as_primitive(); @@ -261,8 +265,8 @@ impl OperationsVTable for ZigZag { } impl ValidityChild for ZigZag { - fn validity_child(array: &ZigZagData) -> &ArrayRef { - array.encoded() + fn validity_child(array: ArrayView<'_, ZigZag>) -> ArrayRef { + array.encoded().clone() } } diff --git a/encodings/zigzag/src/compute/cast.rs b/encodings/zigzag/src/compute/cast.rs index 138c6aae736..7f6741d9aa1 100644 --- a/encodings/zigzag/src/compute/cast.rs +++ b/encodings/zigzag/src/compute/cast.rs @@ -10,6 +10,7 @@ use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_error::VortexResult; use crate::ZigZag; +use crate::array::ZigZagArrayExt; impl CastReduce for ZigZag { fn cast(array: ArrayView<'_, Self>, dtype: &DType) -> VortexResult> { if !dtype.is_signed_int() { diff --git a/encodings/zigzag/src/compute/mod.rs b/encodings/zigzag/src/compute/mod.rs index 11fe580e6bc..f669a528553 100644 --- a/encodings/zigzag/src/compute/mod.rs +++ b/encodings/zigzag/src/compute/mod.rs @@ -17,6 +17,7 @@ use vortex_error::VortexResult; use vortex_mask::Mask; use crate::ZigZag; +use crate::array::ZigZagArrayExt; impl FilterReduce for ZigZag { fn filter(array: ArrayView<'_, Self>, mask: &Mask) -> VortexResult> { diff --git a/encodings/zigzag/src/slice.rs b/encodings/zigzag/src/slice.rs index e027cda04cb..6a7128d5111 100644 --- a/encodings/zigzag/src/slice.rs +++ b/encodings/zigzag/src/slice.rs @@ -10,6 +10,7 @@ use vortex_array::arrays::slice::SliceReduce; use vortex_error::VortexResult; use crate::ZigZag; +use crate::array::ZigZagArrayExt; impl SliceReduce for ZigZag { fn slice(array: ArrayView<'_, Self>, range: Range) -> VortexResult> { diff --git a/encodings/zstd/public-api.lock b/encodings/zstd/public-api.lock index dc7e1e63809..c253f0b18cb 100644 --- a/encodings/zstd/public-api.lock +++ b/encodings/zstd/public-api.lock @@ -32,15 +32,15 @@ pub type vortex_zstd::Zstd::OperationsVTable = vortex_zstd::Zstd pub type vortex_zstd::Zstd::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromValiditySliceHelper -pub fn vortex_zstd::Zstd::array_eq(array: &vortex_zstd::ZstdData, other: &vortex_zstd::ZstdData, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_zstd::Zstd::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_zstd::Zstd::array_hash(array: &vortex_zstd::ZstdData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_zstd::Zstd::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_zstd::Zstd::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_zstd::Zstd::buffer_name(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option -pub fn vortex_zstd::Zstd::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_zstd::Zstd::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_zstd::Zstd::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -56,9 +56,7 @@ pub fn vortex_zstd::Zstd::slot_name(_array: vortex_array::array::view::ArrayView pub fn vortex_zstd::Zstd::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_zstd::Zstd::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_zstd::Zstd::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_zstd::Zstd::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_zstd::Zstd diff --git a/encodings/zstd/src/array.rs b/encodings/zstd/src/array.rs index d5ba18a3495..d6a5070fd17 100644 --- a/encodings/zstd/src/array.rs +++ b/encodings/zstd/src/array.rs @@ -191,7 +191,7 @@ impl VTable for Zstd { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = ZstdMetadata::decode(metadata)?; let validity = if children.is_empty() { Validity::from(dtype.nullability()) @@ -222,17 +222,15 @@ impl VTable for Zstd { ) }; - Ok(ZstdData::new( + let slots = vec![validity_to_child(&validity, len)]; + let data = ZstdData::new( dictionary_buffer, compressed_buffers, metadata, len, validity, - )) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + ); + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { @@ -267,7 +265,10 @@ impl Zstd { pub fn try_new(dtype: DType, data: ZstdData) -> VortexResult { let len = data.len(); data.validate(&dtype, len)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Zstd, dtype, len, data)) }) + let slots = vec![validity_to_child(&data.unsliced_validity, data.unsliced_n_rows)]; + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(Zstd, dtype, len, data).with_slots(slots)) + }) } /// Compress a [`VarBinViewArray`] using Zstd without a dictionary. @@ -323,7 +324,6 @@ pub struct ZstdData { pub(crate) metadata: ZstdMetadata, pub(crate) unsliced_validity: Validity, unsliced_n_rows: usize, - pub(super) slots: Vec>, slice_start: usize, slice_stop: usize, } @@ -444,14 +444,12 @@ impl ZstdData { n_rows: usize, validity: Validity, ) -> Self { - let validity_slot = validity_to_child(&validity, n_rows); Self { dictionary, frames, metadata, unsliced_validity: validity, unsliced_n_rows: n_rows, - slots: vec![validity_slot], slice_start: 0, slice_stop: n_rows, } diff --git a/encodings/zstd/src/zstd_buffers.rs b/encodings/zstd/src/zstd_buffers.rs index 408e3ec871f..a74670c1ac2 100644 --- a/encodings/zstd/src/zstd_buffers.rs +++ b/encodings/zstd/src/zstd_buffers.rs @@ -79,9 +79,11 @@ impl ZstdBuffers { compressed_buffers, uncompressed_sizes, buffer_alignments, - slots: children.into_iter().map(Some).collect(), }; - let compressed = Self::try_new(array.dtype().clone(), array.len(), data)?; + let slots = children.into_iter().map(Some).collect(); + let compressed = Array::try_from_parts( + ArrayParts::new(ZstdBuffers, array.dtype().clone(), array.len(), data).with_slots(slots), + )?; compressed.statistics().inherit_from(array.statistics()); Ok(compressed) } @@ -91,9 +93,21 @@ impl ZstdBuffers { buffer_handles: &[BufferHandle], session: &VortexSession, ) -> VortexResult { - array - .data() - .build_inner(array.dtype(), array.len(), buffer_handles, session) + let registry = session.arrays().registry().clone(); + let inner_vtable = registry + .find(&array.data().inner_encoding_id) + .ok_or_else(|| vortex_err!("Unknown inner encoding: {}", array.data().inner_encoding_id))?; + + let children: Vec = array.slots().iter().flatten().cloned().collect(); + inner_vtable.build( + array.data().inner_encoding_id.clone(), + array.dtype(), + array.len(), + &array.data().inner_metadata, + buffer_handles, + &children.as_slice(), + session, + ) } fn decompress_and_build_inner( @@ -117,7 +131,6 @@ pub struct ZstdBuffersData { compressed_buffers: Vec, uncompressed_sizes: Vec, buffer_alignments: Vec, - pub(crate) slots: Vec>, } #[derive(Clone, Debug)] @@ -245,42 +258,6 @@ impl ZstdBuffersData { Ok(result) } - fn decompress_and_build_inner( - &self, - dtype: &DType, - len: usize, - session: &VortexSession, - ) -> VortexResult { - let decompressed_buffers = self.decompress_buffers()?; - self.build_inner(dtype, len, &decompressed_buffers, session) - } - - // This is exposed to help non-CPU executors pass uncompressed buffer handles - // to build the inner array. - pub fn build_inner( - &self, - dtype: &DType, - len: usize, - buffer_handles: &[BufferHandle], - session: &VortexSession, - ) -> VortexResult { - let registry = session.arrays().registry().clone(); - let inner_vtable = registry - .find(&self.inner_encoding_id) - .ok_or_else(|| vortex_err!("Unknown inner encoding: {}", self.inner_encoding_id))?; - - let children: Vec = self.slots.iter().flatten().cloned().collect(); - inner_vtable.build( - self.inner_encoding_id.clone(), - dtype, - len, - &self.inner_metadata, - buffer_handles, - &children.as_slice(), - session, - ) - } - pub fn decode_plan(&self) -> VortexResult { // If invariants are somehow broken, device decompression could have UB, so ensure // they still hold. @@ -353,7 +330,13 @@ impl VTable for ZstdBuffers { Self::ID } - fn validate(&self, data: &Self::ArrayData, _dtype: &DType, _len: usize) -> VortexResult<()> { + fn validate( + &self, + data: &Self::ArrayData, + _dtype: &DType, + _len: usize, + _slots: &[Option], + ) -> VortexResult<()> { data.validate() } @@ -369,7 +352,7 @@ impl VTable for ZstdBuffers { } array.uncompressed_sizes.hash(state); array.buffer_alignments.hash(state); - for child in array.slots.iter().flatten() { + for child in array.slots().iter().flatten() { child.array_hash(state, precision); } } @@ -389,12 +372,12 @@ impl VTable for ZstdBuffers { .all(|(a, b)| a.array_eq(b, precision)) && array.uncompressed_sizes == other.uncompressed_sizes && array.buffer_alignments == other.buffer_alignments - && array.slots.len() == other.slots.len() + && array.slots().len() == other.slots().len() && array - .slots + .slots() .iter() .flatten() - .zip(other.slots.iter().flatten()) + .zip(other.slots().iter().flatten()) .all(|(a, b)| a.array_eq(b, precision)) } @@ -410,10 +393,6 @@ impl VTable for ZstdBuffers { Some(format!("compressed_{idx}")) } - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() - } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { array.slots() } @@ -442,11 +421,11 @@ impl VTable for ZstdBuffers { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = ZstdBuffersMetadata::decode(metadata)?; let compressed_buffers: Vec = buffers.to_vec(); - let child_arrays: Vec> = (0..children.len()) + let slots: Vec> = (0..children.len()) .map(|i| children.get(i, dtype, len).map(Some)) .collect::>>()?; @@ -456,11 +435,10 @@ impl VTable for ZstdBuffers { compressed_buffers, uncompressed_sizes: metadata.uncompressed_sizes.clone(), buffer_alignments: metadata.buffer_alignments.clone(), - slots: child_arrays, }; data.validate()?; - Ok(data) + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } // with_slots handles child replacement via the slots mechanism @@ -483,11 +461,7 @@ impl OperationsVTable for ZstdBuffers { // TODO(os): maybe we should not support scalar_at, it is really slow, and adding a cache // layer here is weird. Valid use of zstd buffers array would be by executing it first into // canonical - let inner_array = array.data().decompress_and_build_inner( - array.dtype(), - array.len(), - &vortex_array::LEGACY_SESSION, - )?; + let inner_array = ZstdBuffers::decompress_and_build_inner(&array.into_owned(), &vortex_array::LEGACY_SESSION)?; inner_array.scalar_at(index) } } @@ -500,11 +474,7 @@ impl ValidityVTable for ZstdBuffers { return Ok(vortex_array::validity::Validity::NonNullable); } - let inner_array = array.data().decompress_and_build_inner( - array.dtype(), - array.len(), - &vortex_array::LEGACY_SESSION, - )?; + let inner_array = ZstdBuffers::decompress_and_build_inner(&array.into_owned(), &vortex_array::LEGACY_SESSION)?; inner_array.validity() } } diff --git a/vortex-array/public-api.lock b/vortex-array/public-api.lock index 265b63977f6..04f02e6937b 100644 --- a/vortex-array/public-api.lock +++ b/vortex-array/public-api.lock @@ -870,9 +870,9 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -882,7 +882,7 @@ pub fn vortex_array::arrays::Bool::child(array: vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Bool::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Bool::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Bool::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -906,9 +906,7 @@ pub fn vortex_array::arrays::Bool::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Bool::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Bool::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Bool @@ -958,18 +956,8 @@ pub fn vortex_array::arrays::bool::BoolData::is_empty(&self) -> bool pub fn vortex_array::arrays::bool::BoolData::len(&self) -> usize -pub fn vortex_array::arrays::bool::BoolData::maybe_to_mask(&self) -> vortex_error::VortexResult> - pub fn vortex_array::arrays::bool::BoolData::to_bit_buffer(&self) -> vortex_buffer::bit::buf::BitBuffer -pub fn vortex_array::arrays::bool::BoolData::to_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::arrays::bool::BoolData::to_mask_fill_null_false(&self) -> vortex_mask::Mask - -pub fn vortex_array::arrays::bool::BoolData::validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::arrays::bool::BoolData::validity_mask(&self) -> vortex_mask::Mask - impl core::clone::Clone for vortex_array::arrays::bool::BoolData pub fn vortex_array::arrays::bool::BoolData::clone(&self) -> vortex_array::arrays::bool::BoolData @@ -986,8 +974,6 @@ pub vortex_array::arrays::bool::BoolDataParts::len: usize pub vortex_array::arrays::bool::BoolDataParts::offset: usize -pub vortex_array::arrays::bool::BoolDataParts::validity: vortex_array::validity::Validity - pub struct vortex_array::arrays::bool::BoolMaskedValidityRule impl core::default::Default for vortex_array::arrays::bool::BoolMaskedValidityRule @@ -1036,9 +1022,9 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: &vortex_array::arrays::chunked::ChunkedData, other: &vortex_array::arrays::chunked::ChunkedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: &vortex_array::arrays::chunked::ChunkedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -1048,7 +1034,7 @@ pub fn vortex_array::arrays::Chunked::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Chunked::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::deserialize(&self, dtype: &vortex_array::dtype::DType, _len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Chunked::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -1070,11 +1056,9 @@ pub fn vortex_array::arrays::Chunked::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Chunked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Chunked::validate(&self, data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Chunked::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::validate(&self, _data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Chunked @@ -1112,43 +1096,109 @@ pub struct vortex_array::arrays::chunked::ChunkedData impl vortex_array::arrays::chunked::ChunkedData -pub fn vortex_array::arrays::chunked::ChunkedData::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ +pub unsafe fn vortex_array::arrays::chunked::ChunkedData::new_unchecked(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self -pub fn vortex_array::arrays::chunked::ChunkedData::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ +pub fn vortex_array::arrays::chunked::ChunkedData::try_new(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> vortex_error::VortexResult -pub fn vortex_array::arrays::chunked::ChunkedData::chunk(&self, idx: usize) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::chunked::ChunkedData::validate(chunks: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::chunked::ChunkedData::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer +impl core::clone::Clone for vortex_array::arrays::chunked::ChunkedData -pub fn vortex_array::arrays::chunked::ChunkedData::chunks(&self) -> alloc::vec::Vec +pub fn vortex_array::arrays::chunked::ChunkedData::clone(&self) -> vortex_array::arrays::chunked::ChunkedData -pub fn vortex_array::arrays::chunked::ChunkedData::dtype(&self) -> &vortex_array::dtype::DType +impl core::fmt::Debug for vortex_array::arrays::chunked::ChunkedData -pub fn vortex_array::arrays::chunked::ChunkedData::is_empty(&self) -> bool +pub fn vortex_array::arrays::chunked::ChunkedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::chunked::ChunkedData::iter_chunks(&self) -> impl core::iter::traits::iterator::Iterator + '_ +pub trait vortex_array::arrays::chunked::ChunkedArrayExt -pub fn vortex_array::arrays::chunked::ChunkedData::len(&self) -> usize +pub fn vortex_array::arrays::chunked::ChunkedArrayExt::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ -pub fn vortex_array::arrays::chunked::ChunkedData::nchunks(&self) -> usize +pub fn vortex_array::arrays::chunked::ChunkedArrayExt::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ -pub unsafe fn vortex_array::arrays::chunked::ChunkedData::new_unchecked(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self +pub fn vortex_array::arrays::chunked::ChunkedArrayExt::as_slots(&self) -> &[core::option::Option] -pub fn vortex_array::arrays::chunked::ChunkedData::non_empty_chunks(&self) -> impl core::iter::traits::iterator::Iterator + '_ +pub fn vortex_array::arrays::chunked::ChunkedArrayExt::chunk(&self, idx: usize) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::chunked::ChunkedData::rechunk(&self, target_bytesize: u64, target_rowsize: usize) -> vortex_error::VortexResult +pub fn vortex_array::arrays::chunked::ChunkedArrayExt::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer -pub fn vortex_array::arrays::chunked::ChunkedData::try_new(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> vortex_error::VortexResult +pub fn vortex_array::arrays::chunked::ChunkedArrayExt::chunk_offsets_array(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::chunked::ChunkedData::validate(chunks: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::chunked::ChunkedArrayExt::chunked_data(&self) -> &vortex_array::arrays::chunked::ChunkedData -impl core::clone::Clone for vortex_array::arrays::chunked::ChunkedData +pub fn vortex_array::arrays::chunked::ChunkedArrayExt::chunked_dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::chunked::ChunkedData::clone(&self) -> vortex_array::arrays::chunked::ChunkedData +pub fn vortex_array::arrays::chunked::ChunkedArrayExt::chunked_len(&self) -> usize -impl core::fmt::Debug for vortex_array::arrays::chunked::ChunkedData +pub fn vortex_array::arrays::chunked::ChunkedArrayExt::chunks(&self) -> alloc::vec::Vec -pub fn vortex_array::arrays::chunked::ChunkedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::chunked::ChunkedArrayExt::find_chunk_idx(&self, index: usize) -> vortex_error::VortexResult<(usize, usize)> + +pub fn vortex_array::arrays::chunked::ChunkedArrayExt::iter_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> + +pub fn vortex_array::arrays::chunked::ChunkedArrayExt::nchunks(&self) -> usize + +pub fn vortex_array::arrays::chunked::ChunkedArrayExt::non_empty_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> + +impl vortex_array::arrays::chunked::ChunkedArrayExt for vortex_array::Array + +pub fn vortex_array::Array::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ + +pub fn vortex_array::Array::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::chunk(&self, idx: usize) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer + +pub fn vortex_array::Array::chunk_offsets_array(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::chunked_data(&self) -> &vortex_array::arrays::chunked::ChunkedData + +pub fn vortex_array::Array::chunked_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::Array::chunked_len(&self) -> usize + +pub fn vortex_array::Array::chunks(&self) -> alloc::vec::Vec + +pub fn vortex_array::Array::find_chunk_idx(&self, index: usize) -> vortex_error::VortexResult<(usize, usize)> + +pub fn vortex_array::Array::iter_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> + +pub fn vortex_array::Array::nchunks(&self) -> usize + +pub fn vortex_array::Array::non_empty_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> + +impl vortex_array::arrays::chunked::ChunkedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Chunked> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk(&self, idx: usize) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk_offsets_array(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunked_data(&self) -> &vortex_array::arrays::chunked::ChunkedData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunked_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunked_len(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunks(&self) -> alloc::vec::Vec + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::find_chunk_idx(&self, index: usize) -> vortex_error::VortexResult<(usize, usize)> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::iter_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::nchunks(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::non_empty_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> pub type vortex_array::arrays::chunked::ChunkedArray = vortex_array::Array @@ -1186,9 +1236,9 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -1198,7 +1248,7 @@ pub fn vortex_array::arrays::Constant::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Constant::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::deserialize(&self, dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, _metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Constant::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -1220,11 +1270,9 @@ pub fn vortex_array::arrays::Constant::serialize(_array: vortex_array::ArrayView pub fn vortex_array::arrays::Constant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Constant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Constant::with_slots(_array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Constant @@ -1368,9 +1416,9 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -1380,7 +1428,7 @@ pub fn vortex_array::arrays::Decimal::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Decimal::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Decimal::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Decimal::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -1404,9 +1452,7 @@ pub fn vortex_array::arrays::Decimal::slot_name(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Decimal::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Decimal::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Decimal @@ -1474,8 +1520,6 @@ pub unsafe fn vortex_array::arrays::decimal::DecimalData::new_unchecked_from_byt pub unsafe fn vortex_array::arrays::decimal::DecimalData::new_unchecked_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::decimal::DecimalData::patch(self, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult - pub fn vortex_array::arrays::decimal::DecimalData::precision(&self) -> u8 pub fn vortex_array::arrays::decimal::DecimalData::scale(&self) -> i8 @@ -1484,8 +1528,6 @@ pub fn vortex_array::arrays::decimal::DecimalData::try_new vortex_error::VortexResult -pub fn vortex_array::arrays::decimal::DecimalData::validity(&self) -> vortex_array::validity::Validity - pub fn vortex_array::arrays::decimal::DecimalData::values_type(&self) -> vortex_array::dtype::DecimalType impl core::clone::Clone for vortex_array::arrays::decimal::DecimalData @@ -1522,6 +1564,36 @@ pub type vortex_array::arrays::decimal::DecimalMaskedValidityRule::Parent = vort pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent(&self, array: vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>, parent: vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, _child_idx: usize) -> vortex_error::VortexResult> +pub trait vortex_array::arrays::decimal::DecimalArrayExt + +pub fn vortex_array::arrays::decimal::DecimalArrayExt::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::arrays::decimal::DecimalArrayExt::decimal_data(&self) -> &vortex_array::arrays::decimal::DecimalData + +pub fn vortex_array::arrays::decimal::DecimalArrayExt::validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::arrays::decimal::DecimalArrayExt::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +impl vortex_array::arrays::decimal::DecimalArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::decimal_data(&self) -> &vortex_array::arrays::decimal::DecimalData + +pub fn vortex_array::Array::validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +impl vortex_array::arrays::decimal::DecimalArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Decimal> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::decimal_data(&self) -> &vortex_array::arrays::decimal::DecimalData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + pub fn vortex_array::arrays::decimal::narrowed_decimal(decimal_array: vortex_array::arrays::DecimalArray) -> vortex_array::arrays::DecimalArray pub type vortex_array::arrays::decimal::DecimalArray = vortex_array::Array @@ -1558,9 +1630,9 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::arrays::dict::DictData, other: &vortex_array::arrays::dict::DictData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::arrays::dict::DictData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -1570,7 +1642,7 @@ pub fn vortex_array::arrays::dict::Dict::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::dict::Dict::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::dict::Dict::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::Dict::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -1594,9 +1666,7 @@ pub fn vortex_array::arrays::dict::Dict::slot_name(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::dict::Dict::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::dict::Dict::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::dict::Dict @@ -1664,9 +1734,9 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::arrays::dict::DictData, other: &vortex_array::arrays::dict::DictData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::arrays::dict::DictData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -1676,7 +1746,7 @@ pub fn vortex_array::arrays::dict::Dict::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::dict::Dict::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::dict::Dict::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::Dict::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -1700,9 +1770,7 @@ pub fn vortex_array::arrays::dict::Dict::slot_name(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::dict::Dict::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::dict::Dict::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::dict::Dict @@ -1744,32 +1812,12 @@ pub struct vortex_array::arrays::dict::DictData impl vortex_array::arrays::dict::DictData -pub fn vortex_array::arrays::dict::DictData::codes(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::dict::DictData::dtype(&self) -> vortex_array::dtype::DType - -pub fn vortex_array::arrays::dict::DictData::has_all_values_referenced(&self) -> bool - -pub fn vortex_array::arrays::dict::DictData::into_parts(self) -> vortex_array::arrays::dict::DictDataParts - -pub fn vortex_array::arrays::dict::DictData::is_empty(&self) -> bool - -pub fn vortex_array::arrays::dict::DictData::len(&self) -> usize - pub fn vortex_array::arrays::dict::DictData::new(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self -pub unsafe fn vortex_array::arrays::dict::DictData::new_unchecked(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self +pub unsafe fn vortex_array::arrays::dict::DictData::new_unchecked(_codes: vortex_array::ArrayRef, _values: vortex_array::ArrayRef) -> Self pub unsafe fn vortex_array::arrays::dict::DictData::set_all_values_referenced(self, all_values_referenced: bool) -> Self -pub fn vortex_array::arrays::dict::DictData::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::dict::DictData::values(&self) -> &vortex_array::ArrayRef - -impl vortex_array::arrays::dict::DictData - -pub fn vortex_array::arrays::dict::DictData::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult - impl core::clone::Clone for vortex_array::arrays::dict::DictData pub fn vortex_array::arrays::dict::DictData::clone(&self) -> vortex_array::arrays::dict::DictData @@ -1778,12 +1826,6 @@ impl core::fmt::Debug for vortex_array::arrays::dict::DictData pub fn vortex_array::arrays::dict::DictData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub struct vortex_array::arrays::dict::DictDataParts - -pub vortex_array::arrays::dict::DictDataParts::codes: vortex_array::ArrayRef - -pub vortex_array::arrays::dict::DictDataParts::values: vortex_array::ArrayRef - pub struct vortex_array::arrays::dict::DictMetadata impl vortex_array::arrays::dict::DictMetadata @@ -1846,6 +1888,48 @@ pub type vortex_array::arrays::dict::TakeReduceAdaptor::Parent = vortex_array pub fn vortex_array::arrays::dict::TakeReduceAdaptor::reduce_parent(&self, array: vortex_array::ArrayView<'_, V>, parent: vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>, child_idx: usize) -> vortex_error::VortexResult> +pub trait vortex_array::arrays::dict::DictArrayExt + +pub fn vortex_array::arrays::dict::DictArrayExt::codes(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::arrays::dict::DictArrayExt::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult + +pub fn vortex_array::arrays::dict::DictArrayExt::dict_data(&self) -> &vortex_array::arrays::dict::DictData + +pub fn vortex_array::arrays::dict::DictArrayExt::has_all_values_referenced(&self) -> bool + +pub fn vortex_array::arrays::dict::DictArrayExt::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> + +pub fn vortex_array::arrays::dict::DictArrayExt::values(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::dict::DictArrayExt for vortex_array::Array + +pub fn vortex_array::Array::codes(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult + +pub fn vortex_array::Array::dict_data(&self) -> &vortex_array::arrays::dict::DictData + +pub fn vortex_array::Array::has_all_values_referenced(&self) -> bool + +pub fn vortex_array::Array::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> + +pub fn vortex_array::Array::values(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::dict::DictArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::codes(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::dict_data(&self) -> &vortex_array::arrays::dict::DictData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::has_all_values_referenced(&self) -> bool + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::values(&self) -> &vortex_array::ArrayRef + pub trait vortex_array::arrays::dict::TakeExecute: vortex_array::VTable pub fn vortex_array::arrays::dict::TakeExecute::take(array: vortex_array::ArrayView<'_, Self>, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -1952,9 +2036,9 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: &vortex_array::arrays::extension::ExtensionData, other: &vortex_array::arrays::extension::ExtensionData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: &vortex_array::arrays::extension::ExtensionData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -1964,7 +2048,7 @@ pub fn vortex_array::arrays::Extension::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Extension::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Extension::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Extension::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -1988,13 +2072,11 @@ pub fn vortex_array::arrays::Extension::slot_name(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Extension::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Extension::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityChild for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::validity_child(array: &vortex_array::arrays::extension::ExtensionData) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::Extension::validity_child(array: vortex_array::ArrayView<'_, vortex_array::arrays::Extension>) -> vortex_array::ArrayRef impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Extension @@ -2024,20 +2106,12 @@ pub struct vortex_array::arrays::extension::ExtensionData impl vortex_array::arrays::extension::ExtensionData -pub fn vortex_array::arrays::extension::ExtensionData::dtype(&self) -> vortex_array::dtype::DType - pub fn vortex_array::arrays::extension::ExtensionData::ext_dtype(&self) -> &vortex_array::dtype::extension::ExtDTypeRef -pub fn vortex_array::arrays::extension::ExtensionData::is_empty(&self) -> bool - -pub fn vortex_array::arrays::extension::ExtensionData::len(&self) -> usize - pub fn vortex_array::arrays::extension::ExtensionData::new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self pub unsafe fn vortex_array::arrays::extension::ExtensionData::new_unchecked(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self -pub fn vortex_array::arrays::extension::ExtensionData::storage_array(&self) -> &vortex_array::ArrayRef - pub fn vortex_array::arrays::extension::ExtensionData::try_new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> vortex_error::VortexResult impl core::clone::Clone for vortex_array::arrays::extension::ExtensionData @@ -2048,6 +2122,24 @@ impl core::fmt::Debug for vortex_array::arrays::extension::ExtensionData pub fn vortex_array::arrays::extension::ExtensionData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub trait vortex_array::arrays::extension::ExtensionArrayExt + +pub fn vortex_array::arrays::extension::ExtensionArrayExt::extension_data(&self) -> &vortex_array::arrays::extension::ExtensionData + +pub fn vortex_array::arrays::extension::ExtensionArrayExt::storage_array(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::extension::ExtensionArrayExt for vortex_array::Array + +pub fn vortex_array::Array::extension_data(&self) -> &vortex_array::arrays::extension::ExtensionData + +pub fn vortex_array::Array::storage_array(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::extension::ExtensionArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Extension> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Extension>::extension_data(&self) -> &vortex_array::arrays::extension::ExtensionData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Extension>::storage_array(&self) -> &vortex_array::ArrayRef + pub type vortex_array::arrays::extension::ExtensionArray = vortex_array::Array pub mod vortex_array::arrays::filter @@ -2080,9 +2172,9 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -2092,7 +2184,7 @@ pub fn vortex_array::arrays::Filter::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Filter::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Filter::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -2114,11 +2206,9 @@ pub fn vortex_array::arrays::Filter::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Filter::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Filter::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Filter @@ -2128,10 +2218,6 @@ pub struct vortex_array::arrays::filter::FilterData impl vortex_array::arrays::filter::FilterData -pub fn vortex_array::arrays::filter::FilterData::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::filter::FilterData::dtype(&self) -> &vortex_array::dtype::DType - pub fn vortex_array::arrays::filter::FilterData::filter_mask(&self) -> &vortex_mask::Mask pub fn vortex_array::arrays::filter::FilterData::into_parts(self) -> vortex_array::arrays::filter::FilterDataParts @@ -2152,8 +2238,6 @@ pub fn vortex_array::arrays::filter::FilterData::fmt(&self, f: &mut core::fmt::F pub struct vortex_array::arrays::filter::FilterDataParts -pub vortex_array::arrays::filter::FilterDataParts::child: vortex_array::ArrayRef - pub vortex_array::arrays::filter::FilterDataParts::mask: vortex_mask::Mask pub struct vortex_array::arrays::filter::FilterExecuteAdaptor(pub V) @@ -2188,6 +2272,42 @@ pub type vortex_array::arrays::filter::FilterReduceAdaptor::Parent = vortex_a pub fn vortex_array::arrays::filter::FilterReduceAdaptor::reduce_parent(&self, array: vortex_array::ArrayView<'_, V>, parent: vortex_array::ArrayView<'_, vortex_array::arrays::Filter>, child_idx: usize) -> vortex_error::VortexResult> +pub trait vortex_array::arrays::filter::FilterArrayExt + +pub fn vortex_array::arrays::filter::FilterArrayExt::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::arrays::filter::FilterArrayExt::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::arrays::filter::FilterArrayExt::filter_data(&self) -> &vortex_array::arrays::filter::FilterData + +pub fn vortex_array::arrays::filter::FilterArrayExt::filter_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::arrays::filter::FilterArrayExt::filter_len(&self) -> usize + +impl vortex_array::arrays::filter::FilterArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::filter_data(&self) -> &vortex_array::arrays::filter::FilterData + +pub fn vortex_array::Array::filter_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::Array::filter_len(&self) -> usize + +impl vortex_array::arrays::filter::FilterArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Filter> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::filter_data(&self) -> &vortex_array::arrays::filter::FilterData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::filter_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::filter_len(&self) -> usize + pub trait vortex_array::arrays::filter::FilterKernel: vortex_array::VTable pub fn vortex_array::arrays::filter::FilterKernel::filter(array: vortex_array::ArrayView<'_, Self>, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -2268,9 +2388,9 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -2280,7 +2400,7 @@ pub fn vortex_array::arrays::FixedSizeList::child(array: vortex_array::ArrayView pub fn vortex_array::arrays::FixedSizeList::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::FixedSizeList::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeList::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -2304,9 +2424,7 @@ pub fn vortex_array::arrays::FixedSizeList::slot_name(_array: vortex_array::Arra pub fn vortex_array::arrays::FixedSizeList::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::FixedSizeList::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::FixedSizeList @@ -2332,39 +2450,71 @@ pub struct vortex_array::arrays::fixed_size_list::FixedSizeListData impl vortex_array::arrays::fixed_size_list::FixedSizeListData -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::dtype(&self) -> vortex_array::dtype::DType +pub const fn vortex_array::arrays::fixed_size_list::FixedSizeListData::list_size(&self) -> u32 -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::elements(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::into_parts(self) -> (vortex_array::ArrayRef, vortex_array::validity::Validity, vortex_array::dtype::DType) +pub unsafe fn vortex_array::arrays::fixed_size_list::FixedSizeListData::new_unchecked(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::is_empty(&self) -> bool +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::validate(elements: &vortex_array::ArrayRef, len: usize, list_size: u32, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::len(&self) -> usize +impl core::clone::Clone for vortex_array::arrays::fixed_size_list::FixedSizeListData -pub const fn vortex_array::arrays::fixed_size_list::FixedSizeListData::list_size(&self) -> u32 +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::clone(&self) -> vortex_array::arrays::fixed_size_list::FixedSizeListData -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self +impl core::fmt::Debug for vortex_array::arrays::fixed_size_list::FixedSizeListData -pub unsafe fn vortex_array::arrays::fixed_size_list::FixedSizeListData::new_unchecked(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::validate(elements: &vortex_array::ArrayRef, len: usize, list_size: u32, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub struct vortex_array::arrays::fixed_size_list::FixedSizeListDataParts -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::validity(&self) -> vortex_array::validity::Validity +pub vortex_array::arrays::fixed_size_list::FixedSizeListDataParts::dtype: vortex_array::dtype::DType -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::validity_mask(&self) -> vortex_mask::Mask +pub vortex_array::arrays::fixed_size_list::FixedSizeListDataParts::elements: vortex_array::ArrayRef -impl vortex_array::arrays::fixed_size_list::FixedSizeListData +pub vortex_array::arrays::fixed_size_list::FixedSizeListDataParts::validity: vortex_array::validity::Validity -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::fixed_size_list_elements_at(&self, index: usize) -> vortex_error::VortexResult +pub trait vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt -impl core::clone::Clone for vortex_array::arrays::fixed_size_list::FixedSizeListData +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt::as_slots(&self) -> &[core::option::Option] -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::clone(&self) -> vortex_array::arrays::fixed_size_list::FixedSizeListData +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt::elements(&self) -> &vortex_array::ArrayRef -impl core::fmt::Debug for vortex_array::arrays::fixed_size_list::FixedSizeListData +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt::fixed_size_list_data(&self) -> &vortex_array::arrays::fixed_size_list::FixedSizeListData -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt::fixed_size_list_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt::fixed_size_list_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt::len(&self) -> usize + +impl vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::fixed_size_list_data(&self) -> &vortex_array::arrays::fixed_size_list::FixedSizeListData + +pub fn vortex_array::Array::fixed_size_list_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::fixed_size_list_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::Array::len(&self) -> usize + +impl vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_data(&self) -> &vortex_array::arrays::fixed_size_list::FixedSizeListData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::len(&self) -> usize pub type vortex_array::arrays::fixed_size_list::FixedSizeListArray = vortex_array::Array @@ -2398,9 +2548,9 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: &vortex_array::arrays::list::ListData, other: &vortex_array::arrays::list::ListData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: &vortex_array::arrays::list::ListData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -2410,7 +2560,7 @@ pub fn vortex_array::arrays::List::child(array: vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::List::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::List::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::List::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -2434,9 +2584,7 @@ pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::List::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::List @@ -2466,57 +2614,95 @@ pub struct vortex_array::arrays::list::ListData impl vortex_array::arrays::list::ListData -pub fn vortex_array::arrays::list::ListData::dtype(&self) -> vortex_array::dtype::DType +pub fn vortex_array::arrays::list::ListData::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self + +pub unsafe fn vortex_array::arrays::list::ListData::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self + +pub fn vortex_array::arrays::list::ListData::validate(elements: &vortex_array::ArrayRef, offsets: &vortex_array::ArrayRef, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::list::ListData::element_dtype(&self) -> &vortex_array::dtype::DType +impl core::clone::Clone for vortex_array::arrays::list::ListData -pub fn vortex_array::arrays::list::ListData::elements(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::list::ListData::clone(&self) -> vortex_array::arrays::list::ListData -pub fn vortex_array::arrays::list::ListData::into_parts(self) -> vortex_array::arrays::list::ListDataParts +impl core::fmt::Debug for vortex_array::arrays::list::ListData -pub fn vortex_array::arrays::list::ListData::is_empty(&self) -> bool +pub fn vortex_array::arrays::list::ListData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::list::ListData::len(&self) -> usize +pub struct vortex_array::arrays::list::ListDataParts -pub fn vortex_array::arrays::list::ListData::list_elements_at(&self, index: usize) -> vortex_error::VortexResult +pub vortex_array::arrays::list::ListDataParts::dtype: vortex_array::dtype::DType -pub fn vortex_array::arrays::list::ListData::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self +pub vortex_array::arrays::list::ListDataParts::elements: vortex_array::ArrayRef -pub unsafe fn vortex_array::arrays::list::ListData::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self +pub vortex_array::arrays::list::ListDataParts::offsets: vortex_array::ArrayRef -pub fn vortex_array::arrays::list::ListData::offset_at(&self, index: usize) -> vortex_error::VortexResult +pub vortex_array::arrays::list::ListDataParts::validity: vortex_array::validity::Validity -pub fn vortex_array::arrays::list::ListData::offsets(&self) -> &vortex_array::ArrayRef +pub trait vortex_array::arrays::list::ListArrayExt -pub fn vortex_array::arrays::list::ListData::sliced_elements(&self) -> vortex_error::VortexResult +pub fn vortex_array::arrays::list::ListArrayExt::as_slots(&self) -> &[core::option::Option] -pub fn vortex_array::arrays::list::ListData::validate(elements: &vortex_array::ArrayRef, offsets: &vortex_array::ArrayRef, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::list::ListArrayExt::elements(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::list::ListData::validity(&self) -> vortex_array::validity::Validity +pub fn vortex_array::arrays::list::ListArrayExt::len(&self) -> usize -pub fn vortex_array::arrays::list::ListData::validity_mask(&self) -> vortex_mask::Mask +pub fn vortex_array::arrays::list::ListArrayExt::list_data(&self) -> &vortex_array::arrays::list::ListData -impl vortex_array::arrays::list::ListData +pub fn vortex_array::arrays::list::ListArrayExt::list_elements_at(&self, index: usize) -> vortex_error::VortexResult -pub fn vortex_array::arrays::list::ListData::reset_offsets(&self, recurse: bool) -> vortex_error::VortexResult +pub fn vortex_array::arrays::list::ListArrayExt::list_validity(&self) -> vortex_array::validity::Validity -impl core::clone::Clone for vortex_array::arrays::list::ListData +pub fn vortex_array::arrays::list::ListArrayExt::list_validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::arrays::list::ListData::clone(&self) -> vortex_array::arrays::list::ListData +pub fn vortex_array::arrays::list::ListArrayExt::offset_at(&self, index: usize) -> vortex_error::VortexResult -impl core::fmt::Debug for vortex_array::arrays::list::ListData +pub fn vortex_array::arrays::list::ListArrayExt::offsets(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::list::ListData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::list::ListArrayExt::sliced_elements(&self) -> vortex_error::VortexResult -pub struct vortex_array::arrays::list::ListDataParts +impl vortex_array::arrays::list::ListArrayExt for vortex_array::Array -pub vortex_array::arrays::list::ListDataParts::dtype: vortex_array::dtype::DType +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] -pub vortex_array::arrays::list::ListDataParts::elements: vortex_array::ArrayRef +pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef -pub vortex_array::arrays::list::ListDataParts::offsets: vortex_array::ArrayRef +pub fn vortex_array::Array::len(&self) -> usize -pub vortex_array::arrays::list::ListDataParts::validity: vortex_array::validity::Validity +pub fn vortex_array::Array::list_data(&self) -> &vortex_array::arrays::list::ListData + +pub fn vortex_array::Array::list_elements_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::Array::list_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::list_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::Array::offset_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::sliced_elements(&self) -> vortex_error::VortexResult + +impl vortex_array::arrays::list::ListArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::List> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::len(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_data(&self) -> &vortex_array::arrays::list::ListData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_elements_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::offset_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::sliced_elements(&self) -> vortex_error::VortexResult pub type vortex_array::arrays::list::ListArray = vortex_array::Array @@ -2560,9 +2746,9 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: &vortex_array::arrays::listview::ListViewData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -2572,7 +2758,7 @@ pub fn vortex_array::arrays::ListView::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::ListView::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::ListView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListView::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -2596,9 +2782,7 @@ pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::ListView::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::ListView @@ -2624,42 +2808,16 @@ pub struct vortex_array::arrays::listview::ListViewData impl vortex_array::arrays::listview::ListViewData -pub fn vortex_array::arrays::listview::ListViewData::dtype(&self) -> vortex_array::dtype::DType - -pub fn vortex_array::arrays::listview::ListViewData::elements(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::listview::ListViewData::into_parts(self) -> vortex_array::arrays::listview::ListViewDataParts - -pub fn vortex_array::arrays::listview::ListViewData::is_empty(&self) -> bool - pub fn vortex_array::arrays::listview::ListViewData::is_zero_copy_to_list(&self) -> bool -pub fn vortex_array::arrays::listview::ListViewData::len(&self) -> usize - -pub fn vortex_array::arrays::listview::ListViewData::list_elements_at(&self, index: usize) -> vortex_error::VortexResult - pub fn vortex_array::arrays::listview::ListViewData::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self pub unsafe fn vortex_array::arrays::listview::ListViewData::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::listview::ListViewData::offset_at(&self, index: usize) -> usize - -pub fn vortex_array::arrays::listview::ListViewData::offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::listview::ListViewData::size_at(&self, index: usize) -> usize - -pub fn vortex_array::arrays::listview::ListViewData::sizes(&self) -> &vortex_array::ArrayRef - pub fn vortex_array::arrays::listview::ListViewData::try_new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult pub fn vortex_array::arrays::listview::ListViewData::validate(elements: &vortex_array::ArrayRef, offsets: &vortex_array::ArrayRef, sizes: &vortex_array::ArrayRef, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::listview::ListViewData::validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::arrays::listview::ListViewData::validity_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::arrays::listview::ListViewData::verify_is_zero_copy_to_list(&self) -> bool - pub unsafe fn vortex_array::arrays::listview::ListViewData::with_zero_copy_to_list(self, is_zctl: bool) -> Self impl core::clone::Clone for vortex_array::arrays::listview::ListViewData @@ -2682,6 +2840,78 @@ pub vortex_array::arrays::listview::ListViewDataParts::sizes: vortex_array::Arra pub vortex_array::arrays::listview::ListViewDataParts::validity: vortex_array::validity::Validity +pub trait vortex_array::arrays::listview::ListViewArrayExt + +pub fn vortex_array::arrays::listview::ListViewArrayExt::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::arrays::listview::ListViewArrayExt::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::arrays::listview::ListViewArrayExt::len(&self) -> usize + +pub fn vortex_array::arrays::listview::ListViewArrayExt::list_elements_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::arrays::listview::ListViewArrayExt::listview_data(&self) -> &vortex_array::arrays::listview::ListViewData + +pub fn vortex_array::arrays::listview::ListViewArrayExt::listview_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::arrays::listview::ListViewArrayExt::listview_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::arrays::listview::ListViewArrayExt::offset_at(&self, index: usize) -> usize + +pub fn vortex_array::arrays::listview::ListViewArrayExt::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::arrays::listview::ListViewArrayExt::size_at(&self, index: usize) -> usize + +pub fn vortex_array::arrays::listview::ListViewArrayExt::sizes(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::listview::ListViewArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::len(&self) -> usize + +pub fn vortex_array::Array::list_elements_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::Array::listview_data(&self) -> &vortex_array::arrays::listview::ListViewData + +pub fn vortex_array::Array::listview_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::listview_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::Array::offset_at(&self, index: usize) -> usize + +pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::size_at(&self, index: usize) -> usize + +pub fn vortex_array::Array::sizes(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::listview::ListViewArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::ListView> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::len(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::list_elements_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::listview_data(&self) -> &vortex_array::arrays::listview::ListViewData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::listview_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::listview_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::offset_at(&self, index: usize) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::size_at(&self, index: usize) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::sizes(&self) -> &vortex_array::ArrayRef + 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 @@ -2720,9 +2950,9 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: &vortex_array::arrays::masked::MaskedData, other: &vortex_array::arrays::masked::MaskedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: &vortex_array::arrays::masked::MaskedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -2732,7 +2962,7 @@ pub fn vortex_array::arrays::Masked::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Masked::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Masked::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -2754,11 +2984,9 @@ pub fn vortex_array::arrays::Masked::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Masked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Masked::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Masked @@ -2782,27 +3010,67 @@ pub fn vortex_array::arrays::Masked::mask(array: vortex_array::ArrayView<'_, vor pub struct vortex_array::arrays::masked::MaskedData -impl vortex_array::arrays::masked::MaskedData +impl core::clone::Clone for vortex_array::arrays::masked::MaskedData -pub fn vortex_array::arrays::masked::MaskedData::child(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::masked::MaskedData::clone(&self) -> vortex_array::arrays::masked::MaskedData -pub fn vortex_array::arrays::masked::MaskedData::dtype(&self) -> vortex_array::dtype::DType +impl core::fmt::Debug for vortex_array::arrays::masked::MaskedData -pub fn vortex_array::arrays::masked::MaskedData::is_empty(&self) -> bool +pub fn vortex_array::arrays::masked::MaskedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::masked::MaskedData::len(&self) -> usize +pub trait vortex_array::arrays::masked::MaskedArrayExt -pub fn vortex_array::arrays::masked::MaskedData::validity(&self) -> vortex_array::validity::Validity +pub fn vortex_array::arrays::masked::MaskedArrayExt::as_slots(&self) -> &[core::option::Option] -pub fn vortex_array::arrays::masked::MaskedData::validity_mask(&self) -> vortex_mask::Mask +pub fn vortex_array::arrays::masked::MaskedArrayExt::child(&self) -> &vortex_array::ArrayRef -impl core::clone::Clone for vortex_array::arrays::masked::MaskedData +pub fn vortex_array::arrays::masked::MaskedArrayExt::masked_data(&self) -> &vortex_array::arrays::masked::MaskedData -pub fn vortex_array::arrays::masked::MaskedData::clone(&self) -> vortex_array::arrays::masked::MaskedData +pub fn vortex_array::arrays::masked::MaskedArrayExt::masked_dtype(&self) -> &vortex_array::dtype::DType -impl core::fmt::Debug for vortex_array::arrays::masked::MaskedData +pub fn vortex_array::arrays::masked::MaskedArrayExt::masked_len(&self) -> usize -pub fn vortex_array::arrays::masked::MaskedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::masked::MaskedArrayExt::masked_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::arrays::masked::MaskedArrayExt::masked_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::arrays::masked::MaskedArrayExt::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +impl vortex_array::arrays::masked::MaskedArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::masked_data(&self) -> &vortex_array::arrays::masked::MaskedData + +pub fn vortex_array::Array::masked_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::Array::masked_len(&self) -> usize + +pub fn vortex_array::Array::masked_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::masked_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +impl vortex_array::arrays::masked::MaskedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Masked> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_data(&self) -> &vortex_array::arrays::masked::MaskedData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_len(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> 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 @@ -2842,9 +3110,9 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_array: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(_array: vortex_array::ArrayView<'_, Self>, _other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(_array: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(_array: vortex_array::ArrayView<'_, Self>, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -2854,7 +3122,7 @@ pub fn vortex_array::arrays::null::Null::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::null::Null::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::Null::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -2876,11 +3144,9 @@ pub fn vortex_array::arrays::null::Null::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::null::Null::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::null::Null::with_slots(_array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::null::Null @@ -2944,7 +3210,7 @@ pub fn vortex_array::arrays::patched::Patched::scalar_at(array: vortex_array::Ar impl vortex_array::VTable for vortex_array::arrays::patched::Patched -pub type vortex_array::arrays::patched::Patched::ArrayData = vortex_array::arrays::patched::PatchedArray +pub type vortex_array::arrays::patched::Patched::ArrayData = vortex_array::arrays::patched::PatchedData pub type vortex_array::arrays::patched::Patched::OperationsVTable = vortex_array::arrays::patched::Patched @@ -2952,9 +3218,9 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(array: &vortex_array::arrays::patched::PatchedArray, other: &vortex_array::arrays::patched::PatchedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::patched::Patched::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::patched::Patched::array_hash(array: &vortex_array::arrays::patched::PatchedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::patched::Patched::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -2964,7 +3230,7 @@ pub fn vortex_array::arrays::patched::Patched::child(array: vortex_array::ArrayV pub fn vortex_array::arrays::patched::Patched::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::patched::Patched::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::patched::Patched::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::patched::Patched::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -2988,89 +3254,137 @@ pub fn vortex_array::arrays::patched::Patched::slot_name(_array: vortex_array::A pub fn vortex_array::arrays::patched::Patched::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedArray, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> + +impl vortex_array::ValidityChild for vortex_array::arrays::patched::Patched + +pub fn vortex_array::arrays::patched::Patched::validity_child(array: vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>) -> vortex_array::ArrayRef + +impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::patched::Patched + +pub fn vortex_array::arrays::patched::Patched::take(array: vortex_array::ArrayView<'_, Self>, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> + +impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::patched::Patched + +pub fn vortex_array::arrays::patched::Patched::filter(array: vortex_array::ArrayView<'_, Self>, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> + +impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::patched::Patched + +pub fn vortex_array::arrays::patched::Patched::slice(array: vortex_array::ArrayView<'_, Self>, range: core::ops::range::Range) -> vortex_error::VortexResult> + +impl vortex_array::scalar_fn::fns::binary::CompareKernel for vortex_array::arrays::patched::Patched + +pub fn vortex_array::arrays::patched::Patched::compare(lhs: vortex_array::ArrayView<'_, Self>, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> + +pub struct vortex_array::arrays::patched::PatchedData + +impl core::clone::Clone for vortex_array::arrays::patched::PatchedData + +pub fn vortex_array::arrays::patched::PatchedData::clone(&self) -> vortex_array::arrays::patched::PatchedData + +impl core::fmt::Debug for vortex_array::arrays::patched::PatchedData + +pub fn vortex_array::arrays::patched::PatchedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +pub struct vortex_array::arrays::patched::PatchedMetadata + +impl core::clone::Clone for vortex_array::arrays::patched::PatchedMetadata + +pub fn vortex_array::arrays::patched::PatchedMetadata::clone(&self) -> vortex_array::arrays::patched::PatchedMetadata + +impl core::default::Default for vortex_array::arrays::patched::PatchedMetadata + +pub fn vortex_array::arrays::patched::PatchedMetadata::default() -> Self + +impl core::fmt::Debug for vortex_array::arrays::patched::PatchedMetadata + +pub fn vortex_array::arrays::patched::PatchedMetadata::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +impl prost::message::Message for vortex_array::arrays::patched::PatchedMetadata + +pub fn vortex_array::arrays::patched::PatchedMetadata::clear(&mut self) -pub fn vortex_array::arrays::patched::Patched::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::patched::PatchedMetadata::encoded_len(&self) -> usize -impl vortex_array::ValidityChild for vortex_array::arrays::patched::Patched +pub trait vortex_array::arrays::patched::PatchedArrayExt -pub fn vortex_array::arrays::patched::Patched::validity_child(array: &vortex_array::arrays::patched::PatchedArray) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::patched::PatchedArrayExt::base_array(&self) -> &vortex_array::ArrayRef -impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::patched::Patched +pub fn vortex_array::arrays::patched::PatchedArrayExt::lane_offsets(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::patched::Patched::take(array: vortex_array::ArrayView<'_, Self>, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::patched::PatchedArrayExt::lane_range(&self, chunk: usize, lane: usize) -> vortex_error::VortexResult> -impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::patched::Patched +pub fn vortex_array::arrays::patched::PatchedArrayExt::n_lanes(&self) -> usize -pub fn vortex_array::arrays::patched::Patched::filter(array: vortex_array::ArrayView<'_, Self>, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::patched::PatchedArrayExt::offset(&self) -> usize -impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::patched::Patched +pub fn vortex_array::arrays::patched::PatchedArrayExt::patch_indices(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::patched::Patched::slice(array: vortex_array::ArrayView<'_, Self>, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::patched::PatchedArrayExt::patch_values(&self) -> &vortex_array::ArrayRef -impl vortex_array::scalar_fn::fns::binary::CompareKernel for vortex_array::arrays::patched::Patched +pub fn vortex_array::arrays::patched::PatchedArrayExt::patched_data(&self) -> &vortex_array::arrays::patched::PatchedData -pub fn vortex_array::arrays::patched::Patched::compare(lhs: vortex_array::ArrayView<'_, Self>, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::patched::PatchedArrayExt::patched_dtype(&self) -> &vortex_array::dtype::DType -pub struct vortex_array::arrays::patched::PatchedArray +pub fn vortex_array::arrays::patched::PatchedArrayExt::patched_len(&self) -> usize -impl vortex_array::arrays::patched::PatchedArray +pub fn vortex_array::arrays::patched::PatchedArrayExt::patched_slots(&self) -> &[core::option::Option] -pub fn vortex_array::arrays::patched::PatchedArray::base_array(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::patched::PatchedArrayExt::slice_chunks(&self, chunks: core::ops::range::Range) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::patched::PatchedArray::is_empty(&self) -> bool +impl vortex_array::arrays::patched::PatchedArrayExt for vortex_array::Array -pub fn vortex_array::arrays::patched::PatchedArray::lane_offsets(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::Array::base_array(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::patched::PatchedArray::len(&self) -> usize +pub fn vortex_array::Array::lane_offsets(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::patched::PatchedArray::patch_indices(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::Array::lane_range(&self, chunk: usize, lane: usize) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::patched::PatchedArray::patch_values(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::Array::n_lanes(&self) -> usize -impl vortex_array::arrays::patched::PatchedArray +pub fn vortex_array::Array::offset(&self) -> usize -pub fn vortex_array::arrays::patched::PatchedArray::from_array_and_patches(inner: vortex_array::ArrayRef, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::Array::patch_indices(&self) -> &vortex_array::ArrayRef -impl vortex_array::arrays::patched::PatchedArray +pub fn vortex_array::Array::patch_values(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::patched::PatchedArray::to_array(&self) -> vortex_array::ArrayRef where Self: core::clone::Clone + vortex_array::IntoArray +pub fn vortex_array::Array::patched_data(&self) -> &vortex_array::arrays::patched::PatchedData -impl core::clone::Clone for vortex_array::arrays::patched::PatchedArray +pub fn vortex_array::Array::patched_dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::patched::PatchedArray::clone(&self) -> vortex_array::arrays::patched::PatchedArray +pub fn vortex_array::Array::patched_len(&self) -> usize -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::Array::patched_slots(&self) -> &[core::option::Option] -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::patched::PatchedArray) -> Self +pub fn vortex_array::Array::slice_chunks(&self, chunks: core::ops::range::Range) -> vortex_error::VortexResult> -impl core::fmt::Debug for vortex_array::arrays::patched::PatchedArray +impl vortex_array::arrays::patched::PatchedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched> -pub fn vortex_array::arrays::patched::PatchedArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::base_array(&self) -> &vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::patched::PatchedArray +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::lane_offsets(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::patched::PatchedArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::lane_range(&self, chunk: usize, lane: usize) -> vortex_error::VortexResult> -pub struct vortex_array::arrays::patched::PatchedMetadata +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::n_lanes(&self) -> usize -impl core::clone::Clone for vortex_array::arrays::patched::PatchedMetadata +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::offset(&self) -> usize -pub fn vortex_array::arrays::patched::PatchedMetadata::clone(&self) -> vortex_array::arrays::patched::PatchedMetadata +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patch_indices(&self) -> &vortex_array::ArrayRef -impl core::default::Default for vortex_array::arrays::patched::PatchedMetadata +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patch_values(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::patched::PatchedMetadata::default() -> Self +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_data(&self) -> &vortex_array::arrays::patched::PatchedData -impl core::fmt::Debug for vortex_array::arrays::patched::PatchedMetadata +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::patched::PatchedMetadata::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_len(&self) -> usize -impl prost::message::Message for vortex_array::arrays::patched::PatchedMetadata +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_slots(&self) -> &[core::option::Option] -pub fn vortex_array::arrays::patched::PatchedMetadata::clear(&mut self) +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::slice_chunks(&self, chunks: core::ops::range::Range) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::patched::PatchedMetadata::encoded_len(&self) -> usize +pub type vortex_array::arrays::patched::PatchedArray = vortex_array::Array pub mod vortex_array::arrays::primitive @@ -3168,9 +3482,9 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -3180,7 +3494,7 @@ pub fn vortex_array::arrays::Primitive::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Primitive::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Primitive::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Primitive::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -3204,9 +3518,7 @@ pub fn vortex_array::arrays::Primitive::slot_name(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Primitive::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Primitive::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Primitive @@ -3280,10 +3592,6 @@ pub fn vortex_array::arrays::primitive::PrimitiveData::to_buffer(self) -> core::result::Result, vortex_buffer::buffer::Buffer> -pub fn vortex_array::arrays::primitive::PrimitiveData::validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::arrays::primitive::PrimitiveData::validity_mask(&self) -> vortex_mask::Mask - impl vortex_array::arrays::primitive::PrimitiveData pub fn vortex_array::arrays::primitive::PrimitiveData::empty(nullability: vortex_array::dtype::Nullability) -> Self @@ -3334,6 +3642,42 @@ pub type vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::Parent = pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_parent(&self, array: vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>, parent: vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, _child_idx: usize) -> vortex_error::VortexResult> +pub trait vortex_array::arrays::primitive::PrimitiveArrayExt + +pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::primitive_data(&self) -> &vortex_array::arrays::primitive::PrimitiveData + +pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::validity_mask(&self) -> vortex_mask::Mask + +impl vortex_array::arrays::primitive::PrimitiveArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::primitive_data(&self) -> &vortex_array::arrays::primitive::PrimitiveData + +pub fn vortex_array::Array::validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::Array::validity_mask(&self) -> vortex_mask::Mask + +impl vortex_array::arrays::primitive::PrimitiveArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Primitive> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::primitive_data(&self) -> &vortex_array::arrays::primitive::PrimitiveData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::validity_mask(&self) -> vortex_mask::Mask + pub fn vortex_array::arrays::primitive::chunk_range(chunk_idx: usize, offset: usize, array_len: usize) -> core::ops::range::Range pub fn vortex_array::arrays::primitive::patch_chunk(decoded_values: &mut [T], patches_indices: &[I], patches_values: &[T], patches_offset: usize, chunk_offsets_slice: &[C], chunk_idx: usize, offset_within_chunk: usize) where T: vortex_array::dtype::NativePType, I: vortex_array::dtype::UnsignedPType, C: vortex_array::dtype::UnsignedPType @@ -3390,14 +3734,6 @@ pub struct vortex_array::arrays::scalar_fn::ScalarFnData impl vortex_array::arrays::scalar_fn::ScalarFnData -pub fn vortex_array::arrays::scalar_fn::ScalarFnData::children(&self) -> alloc::vec::Vec - -pub fn vortex_array::arrays::scalar_fn::ScalarFnData::get_child(&self, idx: usize) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::scalar_fn::ScalarFnData::iter_children(&self) -> impl core::iter::traits::iterator::Iterator + '_ - -pub fn vortex_array::arrays::scalar_fn::ScalarFnData::nchildren(&self) -> usize - pub fn vortex_array::arrays::scalar_fn::ScalarFnData::scalar_fn(&self) -> &vortex_array::scalar_fn::ScalarFnRef pub fn vortex_array::arrays::scalar_fn::ScalarFnData::try_new(scalar_fn: vortex_array::scalar_fn::ScalarFnRef, children: alloc::vec::Vec, len: usize) -> vortex_error::VortexResult @@ -3434,9 +3770,9 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -3446,7 +3782,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child(array: vortex_arra pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -3470,9 +3806,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(array: vortex_ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::scalar_fn::ScalarFnVTable @@ -3518,9 +3852,9 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: &vortex_array::arrays::shared::SharedData, other: &vortex_array::arrays::shared::SharedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: &vortex_array::arrays::shared::SharedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -3530,7 +3864,7 @@ pub fn vortex_array::arrays::Shared::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Shared::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Shared::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -3552,11 +3886,9 @@ pub fn vortex_array::arrays::Shared::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Shared::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Shared::validate(&self, data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Shared::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::validate(&self, _data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Shared @@ -3566,25 +3898,69 @@ pub struct vortex_array::arrays::shared::SharedData impl vortex_array::arrays::shared::SharedData -pub fn vortex_array::arrays::shared::SharedData::dtype(&self) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::shared::SharedData::new() -> Self -pub fn vortex_array::arrays::shared::SharedData::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult +impl core::clone::Clone for vortex_array::arrays::shared::SharedData -pub async fn vortex_array::arrays::shared::SharedData::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> +pub fn vortex_array::arrays::shared::SharedData::clone(&self) -> vortex_array::arrays::shared::SharedData -pub fn vortex_array::arrays::shared::SharedData::is_empty(&self) -> bool +impl core::fmt::Debug for vortex_array::arrays::shared::SharedData -pub fn vortex_array::arrays::shared::SharedData::len(&self) -> usize +pub fn vortex_array::arrays::shared::SharedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::shared::SharedData::new(source: vortex_array::ArrayRef) -> Self +pub trait vortex_array::arrays::shared::SharedArrayExt -impl core::clone::Clone for vortex_array::arrays::shared::SharedData +pub fn vortex_array::arrays::shared::SharedArrayExt::as_slots(&self) -> &[core::option::Option] -pub fn vortex_array::arrays::shared::SharedData::clone(&self) -> vortex_array::arrays::shared::SharedData +pub fn vortex_array::arrays::shared::SharedArrayExt::current_array_ref(&self) -> &vortex_array::ArrayRef -impl core::fmt::Debug for vortex_array::arrays::shared::SharedData +pub fn vortex_array::arrays::shared::SharedArrayExt::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult -pub fn vortex_array::arrays::shared::SharedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub async fn vortex_array::arrays::shared::SharedArrayExt::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> + +pub fn vortex_array::arrays::shared::SharedArrayExt::shared_data(&self) -> &vortex_array::arrays::shared::SharedData + +pub fn vortex_array::arrays::shared::SharedArrayExt::shared_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::arrays::shared::SharedArrayExt::shared_len(&self) -> usize + +pub fn vortex_array::arrays::shared::SharedArrayExt::source(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::shared::SharedArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::current_array_ref(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult + +pub async fn vortex_array::Array::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> + +pub fn vortex_array::Array::shared_data(&self) -> &vortex_array::arrays::shared::SharedData + +pub fn vortex_array::Array::shared_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::Array::shared_len(&self) -> usize + +pub fn vortex_array::Array::source(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::shared::SharedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Shared> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::current_array_ref(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult + +pub async fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::shared_data(&self) -> &vortex_array::arrays::shared::SharedData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::shared_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::shared_len(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::source(&self) -> &vortex_array::ArrayRef pub type vortex_array::arrays::shared::SharedArray = vortex_array::Array @@ -3618,9 +3994,9 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: &vortex_array::arrays::slice::SliceData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -3630,7 +4006,7 @@ pub fn vortex_array::arrays::slice::Slice::child(array: vortex_array::ArrayView< pub fn vortex_array::arrays::slice::Slice::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::Slice::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -3652,11 +4028,9 @@ pub fn vortex_array::arrays::slice::Slice::serialize(_array: vortex_array::Array pub fn vortex_array::arrays::slice::Slice::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::slice::Slice::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::slice::Slice::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::slice::Slice @@ -3670,10 +4044,6 @@ pub struct vortex_array::arrays::slice::SliceData impl vortex_array::arrays::slice::SliceData -pub fn vortex_array::arrays::slice::SliceData::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::slice::SliceData::dtype(&self) -> &vortex_array::dtype::DType - pub fn vortex_array::arrays::slice::SliceData::into_parts(self) -> vortex_array::arrays::slice::SliceDataParts pub fn vortex_array::arrays::slice::SliceData::is_empty(&self) -> bool @@ -3694,8 +4064,6 @@ pub fn vortex_array::arrays::slice::SliceData::fmt(&self, f: &mut core::fmt::For pub struct vortex_array::arrays::slice::SliceDataParts -pub vortex_array::arrays::slice::SliceDataParts::child: vortex_array::ArrayRef - pub vortex_array::arrays::slice::SliceDataParts::range: core::ops::range::Range pub struct vortex_array::arrays::slice::SliceExecuteAdaptor(pub V) @@ -3736,6 +4104,36 @@ pub type vortex_array::arrays::slice::SliceReduceAdaptor::Parent = vortex_arr pub fn vortex_array::arrays::slice::SliceReduceAdaptor::reduce_parent(&self, array: vortex_array::ArrayView<'_, V>, parent: ::Match, child_idx: usize) -> vortex_error::VortexResult> +pub trait vortex_array::arrays::slice::SliceArrayExt + +pub fn vortex_array::arrays::slice::SliceArrayExt::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::arrays::slice::SliceArrayExt::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::arrays::slice::SliceArrayExt::slice_data(&self) -> &vortex_array::arrays::slice::SliceData + +pub fn vortex_array::arrays::slice::SliceArrayExt::slice_len(&self) -> usize + +impl vortex_array::arrays::slice::SliceArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::slice_data(&self) -> &vortex_array::arrays::slice::SliceData + +pub fn vortex_array::Array::slice_len(&self) -> usize + +impl vortex_array::arrays::slice::SliceArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::slice_data(&self) -> &vortex_array::arrays::slice::SliceData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::slice_len(&self) -> usize + pub trait vortex_array::arrays::slice::SliceKernel: vortex_array::VTable pub fn vortex_array::arrays::slice::SliceKernel::slice(array: vortex_array::ArrayView<'_, Self>, range: core::ops::range::Range, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -3844,9 +4242,9 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: &vortex_array::arrays::struct_::StructData, other: &vortex_array::arrays::struct_::StructData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: &vortex_array::arrays::struct_::StructData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -3856,7 +4254,7 @@ pub fn vortex_array::arrays::Struct::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Struct::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Struct::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Struct::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -3880,9 +4278,7 @@ pub fn vortex_array::arrays::Struct::slot_name(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::Struct::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Struct::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Struct @@ -3912,67 +4308,97 @@ pub struct vortex_array::arrays::struct_::StructData impl vortex_array::arrays::struct_::StructData -pub fn vortex_array::arrays::struct_::StructData::dtype(&self) -> vortex_array::dtype::DType +pub fn vortex_array::arrays::struct_::StructData::names(&self) -> &vortex_array::dtype::FieldNames -pub fn vortex_array::arrays::struct_::StructData::from_fields>(items: &[(N, vortex_array::ArrayRef)]) -> vortex_error::VortexResult +pub fn vortex_array::arrays::struct_::StructData::new(names: vortex_array::dtype::FieldNames, fields: impl core::convert::Into>, length: usize, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::struct_::StructData::into_fields(self) -> alloc::vec::Vec +pub fn vortex_array::arrays::struct_::StructData::new_fieldless_with_len(len: usize) -> Self -pub fn vortex_array::arrays::struct_::StructData::into_parts(self) -> vortex_array::arrays::struct_::StructDataParts +pub unsafe fn vortex_array::arrays::struct_::StructData::new_unchecked(fields: impl core::convert::Into>, dtype: vortex_array::dtype::StructFields, length: usize, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::struct_::StructData::is_empty(&self) -> bool +pub fn vortex_array::arrays::struct_::StructData::validate(fields: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::StructFields, length: usize, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::struct_::StructData::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ +impl core::clone::Clone for vortex_array::arrays::struct_::StructData -pub fn vortex_array::arrays::struct_::StructData::len(&self) -> usize +pub fn vortex_array::arrays::struct_::StructData::clone(&self) -> vortex_array::arrays::struct_::StructData -pub fn vortex_array::arrays::struct_::StructData::names(&self) -> &vortex_array::dtype::FieldNames +impl core::fmt::Debug for vortex_array::arrays::struct_::StructData -pub fn vortex_array::arrays::struct_::StructData::new(names: vortex_array::dtype::FieldNames, fields: impl core::convert::Into>, length: usize, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::struct_::StructData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::struct_::StructData::new_fieldless_with_len(len: usize) -> Self +pub struct vortex_array::arrays::struct_::StructDataParts -pub unsafe fn vortex_array::arrays::struct_::StructData::new_unchecked(fields: impl core::convert::Into>, dtype: vortex_array::dtype::StructFields, length: usize, validity: vortex_array::validity::Validity) -> Self +pub vortex_array::arrays::struct_::StructDataParts::fields: alloc::sync::Arc<[vortex_array::ArrayRef]> -pub fn vortex_array::arrays::struct_::StructData::remove_column(&mut self, name: impl core::convert::Into) -> core::option::Option +pub vortex_array::arrays::struct_::StructDataParts::struct_fields: vortex_array::dtype::StructFields -pub fn vortex_array::arrays::struct_::StructData::struct_fields(&self) -> vortex_array::dtype::StructFields +pub vortex_array::arrays::struct_::StructDataParts::validity: vortex_array::validity::Validity -pub fn vortex_array::arrays::struct_::StructData::try_from_iter, A: vortex_array::IntoArray, T: core::iter::traits::collect::IntoIterator>(iter: T) -> vortex_error::VortexResult +pub trait vortex_array::arrays::struct_::StructArrayExt -pub fn vortex_array::arrays::struct_::StructData::try_from_iter_with_validity, A: vortex_array::IntoArray, T: core::iter::traits::collect::IntoIterator>(iter: T, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::struct_::StructArrayExt::as_slots(&self) -> &[core::option::Option] -pub fn vortex_array::arrays::struct_::StructData::unmasked_field(&self, idx: usize) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::struct_::StructArrayExt::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ -pub fn vortex_array::arrays::struct_::StructData::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> +pub fn vortex_array::arrays::struct_::StructArrayExt::names(&self) -> &vortex_array::dtype::FieldNames -pub fn vortex_array::arrays::struct_::StructData::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> +pub fn vortex_array::arrays::struct_::StructArrayExt::struct_data(&self) -> &vortex_array::arrays::struct_::StructData -pub fn vortex_array::arrays::struct_::StructData::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> +pub fn vortex_array::arrays::struct_::StructArrayExt::struct_fields(&self) -> vortex_array::dtype::StructFields -pub fn vortex_array::arrays::struct_::StructData::validate(fields: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::StructFields, length: usize, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::struct_::StructArrayExt::struct_validity(&self) -> vortex_array::validity::Validity -pub fn vortex_array::arrays::struct_::StructData::validity(&self) -> vortex_array::validity::Validity +pub fn vortex_array::arrays::struct_::StructArrayExt::unmasked_field(&self, idx: usize) -> &vortex_array::ArrayRef -impl vortex_array::arrays::struct_::StructData +pub fn vortex_array::arrays::struct_::StructArrayExt::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> -pub fn vortex_array::arrays::struct_::StructData::with_column(&self, name: impl core::convert::Into, array: vortex_array::ArrayRef) -> vortex_error::VortexResult +pub fn vortex_array::arrays::struct_::StructArrayExt::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> -impl core::clone::Clone for vortex_array::arrays::struct_::StructData +pub fn vortex_array::arrays::struct_::StructArrayExt::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> -pub fn vortex_array::arrays::struct_::StructData::clone(&self) -> vortex_array::arrays::struct_::StructData +impl vortex_array::arrays::struct_::StructArrayExt for vortex_array::Array -impl core::fmt::Debug for vortex_array::arrays::struct_::StructData +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] -pub fn vortex_array::arrays::struct_::StructData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::Array::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ -pub struct vortex_array::arrays::struct_::StructDataParts +pub fn vortex_array::Array::names(&self) -> &vortex_array::dtype::FieldNames -pub vortex_array::arrays::struct_::StructDataParts::fields: alloc::sync::Arc<[vortex_array::ArrayRef]> +pub fn vortex_array::Array::struct_data(&self) -> &vortex_array::arrays::struct_::StructData -pub vortex_array::arrays::struct_::StructDataParts::struct_fields: vortex_array::dtype::StructFields +pub fn vortex_array::Array::struct_fields(&self) -> vortex_array::dtype::StructFields -pub vortex_array::arrays::struct_::StructDataParts::validity: vortex_array::validity::Validity +pub fn vortex_array::Array::struct_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::unmasked_field(&self, idx: usize) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> + +pub fn vortex_array::Array::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::Array::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> + +impl vortex_array::arrays::struct_::StructArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Struct> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::names(&self) -> &vortex_array::dtype::FieldNames + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::struct_data(&self) -> &vortex_array::arrays::struct_::StructData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::struct_fields(&self) -> vortex_array::dtype::StructFields + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::struct_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field(&self, idx: usize) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> pub type vortex_array::arrays::struct_::StructArray = vortex_array::Array @@ -4036,9 +4462,9 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -4048,7 +4474,7 @@ pub fn vortex_array::arrays::VarBin::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::VarBin::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBin::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBin::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -4072,9 +4498,7 @@ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::VarBin::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::VarBin @@ -4114,16 +4538,6 @@ pub fn vortex_array::arrays::varbin::VarBinData::bytes_handle(&self) -> &vortex_ pub fn vortex_array::arrays::varbin::VarBinData::dtype(&self) -> vortex_array::dtype::DType -pub fn vortex_array::arrays::varbin::VarBinData::from_iter, I: core::iter::traits::collect::IntoIterator>>(iter: I, dtype: vortex_array::dtype::DType) -> Self - -pub fn vortex_array::arrays::varbin::VarBinData::from_iter_nonnull, I: core::iter::traits::collect::IntoIterator>(iter: I, dtype: vortex_array::dtype::DType) -> Self - -pub fn vortex_array::arrays::varbin::VarBinData::from_vec>(vec: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self - -pub fn vortex_array::arrays::varbin::VarBinData::is_empty(&self) -> bool - -pub fn vortex_array::arrays::varbin::VarBinData::len(&self) -> usize - pub fn vortex_array::arrays::varbin::VarBinData::new(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self pub fn vortex_array::arrays::varbin::VarBinData::new_from_handle(offset: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self @@ -4132,83 +4546,95 @@ pub unsafe fn vortex_array::arrays::varbin::VarBinData::new_unchecked(offsets: v pub unsafe fn vortex_array::arrays::varbin::VarBinData::new_unchecked_from_handle(offsets: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::varbin::VarBinData::offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::varbin::VarBinData::sliced_bytes(&self) -> vortex_buffer::ByteBuffer - pub fn vortex_array::arrays::varbin::VarBinData::try_new(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult pub fn vortex_array::arrays::varbin::VarBinData::try_new_from_handle(offsets: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult pub fn vortex_array::arrays::varbin::VarBinData::validate(offsets: &vortex_array::ArrayRef, bytes: &vortex_array::buffer::BufferHandle, dtype: &vortex_array::dtype::DType, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::varbin::VarBinData::validity(&self) -> vortex_array::validity::Validity +impl core::clone::Clone for vortex_array::arrays::varbin::VarBinData -pub fn vortex_array::arrays::varbin::VarBinData::validity_mask(&self) -> vortex_mask::Mask +pub fn vortex_array::arrays::varbin::VarBinData::clone(&self) -> vortex_array::arrays::varbin::VarBinData -impl vortex_array::arrays::varbin::VarBinData +impl core::fmt::Debug for vortex_array::arrays::varbin::VarBinData -pub fn vortex_array::arrays::varbin::VarBinData::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer +pub fn vortex_array::arrays::varbin::VarBinData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::varbin::VarBinData::into_parts(self) -> (vortex_array::dtype::DType, vortex_array::buffer::BufferHandle, vortex_array::ArrayRef, vortex_array::validity::Validity) +pub struct vortex_array::arrays::varbin::VarBinDataParts -pub fn vortex_array::arrays::varbin::VarBinData::offset_at(&self, index: usize) -> usize +pub vortex_array::arrays::varbin::VarBinDataParts::bytes: vortex_array::buffer::BufferHandle -impl core::clone::Clone for vortex_array::arrays::varbin::VarBinData +pub vortex_array::arrays::varbin::VarBinDataParts::dtype: vortex_array::dtype::DType -pub fn vortex_array::arrays::varbin::VarBinData::clone(&self) -> vortex_array::arrays::varbin::VarBinData +pub vortex_array::arrays::varbin::VarBinDataParts::offsets: vortex_array::ArrayRef -impl core::convert::From> for vortex_array::arrays::varbin::VarBinData +pub vortex_array::arrays::varbin::VarBinDataParts::validity: vortex_array::validity::Validity -pub fn vortex_array::arrays::varbin::VarBinData::from(value: alloc::vec::Vec<&[u8]>) -> Self +pub trait vortex_array::arrays::varbin::VarBinArrayExt -impl core::convert::From> for vortex_array::arrays::varbin::VarBinData +pub fn vortex_array::arrays::varbin::VarBinArrayExt::as_slots(&self) -> &[core::option::Option] -pub fn vortex_array::arrays::varbin::VarBinData::from(value: alloc::vec::Vec<&str>) -> Self +pub fn vortex_array::arrays::varbin::VarBinArrayExt::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer -impl core::convert::From> for vortex_array::arrays::varbin::VarBinData +pub fn vortex_array::arrays::varbin::VarBinArrayExt::len(&self) -> usize -pub fn vortex_array::arrays::varbin::VarBinData::from(value: alloc::vec::Vec) -> Self +pub fn vortex_array::arrays::varbin::VarBinArrayExt::offset_at(&self, index: usize) -> usize -impl core::convert::From>> for vortex_array::arrays::varbin::VarBinData +pub fn vortex_array::arrays::varbin::VarBinArrayExt::offsets(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::varbin::VarBinData::from(value: alloc::vec::Vec>) -> Self +pub fn vortex_array::arrays::varbin::VarBinArrayExt::sliced_bytes(&self) -> vortex_buffer::ByteBuffer -impl core::convert::From>> for vortex_array::arrays::varbin::VarBinData +pub fn vortex_array::arrays::varbin::VarBinArrayExt::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> -pub fn vortex_array::arrays::varbin::VarBinData::from(value: alloc::vec::Vec>) -> Self +pub fn vortex_array::arrays::varbin::VarBinArrayExt::varbin_data(&self) -> &vortex_array::arrays::varbin::VarBinData -impl core::convert::From>> for vortex_array::arrays::varbin::VarBinData +pub fn vortex_array::arrays::varbin::VarBinArrayExt::varbin_validity(&self) -> vortex_array::validity::Validity -pub fn vortex_array::arrays::varbin::VarBinData::from(value: alloc::vec::Vec>) -> Self +pub fn vortex_array::arrays::varbin::VarBinArrayExt::varbin_validity_mask(&self) -> vortex_mask::Mask -impl core::convert::From>> for vortex_array::arrays::varbin::VarBinData +impl vortex_array::arrays::varbin::VarBinArrayExt for vortex_array::Array -pub fn vortex_array::arrays::varbin::VarBinData::from(value: alloc::vec::Vec>) -> Self +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] -impl core::convert::From>>> for vortex_array::arrays::varbin::VarBinData +pub fn vortex_array::Array::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer -pub fn vortex_array::arrays::varbin::VarBinData::from(value: alloc::vec::Vec>>) -> Self +pub fn vortex_array::Array::len(&self) -> usize -impl core::fmt::Debug for vortex_array::arrays::varbin::VarBinData +pub fn vortex_array::Array::offset_at(&self, index: usize) -> usize -pub fn vortex_array::arrays::varbin::VarBinData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::sliced_bytes(&self) -> vortex_buffer::ByteBuffer + +pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::Array::varbin_data(&self) -> &vortex_array::arrays::varbin::VarBinData -impl core::iter::traits::collect::FromIterator> for vortex_array::arrays::varbin::VarBinData +pub fn vortex_array::Array::varbin_validity(&self) -> vortex_array::validity::Validity -pub fn vortex_array::arrays::varbin::VarBinData::from_iter>>(iter: T) -> Self +pub fn vortex_array::Array::varbin_validity_mask(&self) -> vortex_mask::Mask -impl core::iter::traits::collect::FromIterator>> for vortex_array::arrays::varbin::VarBinData +impl vortex_array::arrays::varbin::VarBinArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::VarBin> -pub fn vortex_array::arrays::varbin::VarBinData::from_iter>>>(iter: T) -> Self +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::as_slots(&self) -> &[core::option::Option] -impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::varbin::VarBinData +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer -pub fn vortex_array::arrays::varbin::VarBinData::from_iter>>(iter: T) -> Self +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::len(&self) -> usize -impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::varbin::VarBinData +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::offset_at(&self, index: usize) -> usize -pub fn vortex_array::arrays::varbin::VarBinData::from_iter>>(iter: T) -> Self +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::sliced_bytes(&self) -> vortex_buffer::ByteBuffer + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::varbin_data(&self) -> &vortex_array::arrays::varbin::VarBinData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::varbin_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::varbin_validity_mask(&self) -> vortex_mask::Mask pub fn vortex_array::arrays::varbin::varbin_scalar(value: vortex_buffer::ByteBuffer, dtype: &vortex_array::dtype::DType) -> vortex_array::scalar::Scalar @@ -4426,9 +4852,9 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -4438,7 +4864,7 @@ pub fn vortex_array::arrays::VarBinView::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::VarBinView::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBinView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinView::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -4462,9 +4888,7 @@ pub fn vortex_array::arrays::VarBinView::slot_name(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::VarBinView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::VarBinView::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::VarBinView @@ -4512,8 +4936,6 @@ pub fn vortex_array::arrays::varbinview::VarBinViewData::from_iter_nullable_str< pub fn vortex_array::arrays::varbinview::VarBinViewData::from_iter_str, I: core::iter::traits::collect::IntoIterator>(iter: I) -> Self -pub fn vortex_array::arrays::varbinview::VarBinViewData::into_parts(self) -> vortex_array::arrays::varbinview::VarBinViewDataParts - pub fn vortex_array::arrays::varbinview::VarBinViewData::is_empty(&self) -> bool pub fn vortex_array::arrays::varbinview::VarBinViewData::len(&self) -> usize @@ -4532,10 +4954,6 @@ pub fn vortex_array::arrays::varbinview::VarBinViewData::try_new_handle(views: v pub fn vortex_array::arrays::varbinview::VarBinViewData::validate(views: &vortex_buffer::buffer::Buffer, buffers: &alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: &vortex_array::dtype::DType, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::varbinview::VarBinViewData::validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::arrays::varbinview::VarBinViewData::validity_mask(&self) -> vortex_mask::Mask - pub fn vortex_array::arrays::varbinview::VarBinViewData::views(&self) -> &[vortex_array::arrays::varbinview::BinaryView] pub fn vortex_array::arrays::varbinview::VarBinViewData::views_handle(&self) -> &vortex_array::buffer::BufferHandle @@ -4574,6 +4992,36 @@ pub vortex_array::arrays::varbinview::VarBinViewDataParts::validity: vortex_arra pub vortex_array::arrays::varbinview::VarBinViewDataParts::views: vortex_array::buffer::BufferHandle +pub trait vortex_array::arrays::varbinview::VarBinViewArrayExt + +pub fn vortex_array::arrays::varbinview::VarBinViewArrayExt::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::arrays::varbinview::VarBinViewArrayExt::varbinview_data(&self) -> &vortex_array::arrays::varbinview::VarBinViewData + +pub fn vortex_array::arrays::varbinview::VarBinViewArrayExt::varbinview_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::arrays::varbinview::VarBinViewArrayExt::varbinview_validity_mask(&self) -> vortex_mask::Mask + +impl vortex_array::arrays::varbinview::VarBinViewArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::varbinview_data(&self) -> &vortex_array::arrays::varbinview::VarBinViewData + +pub fn vortex_array::Array::varbinview_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::varbinview_validity_mask(&self) -> vortex_mask::Mask + +impl vortex_array::arrays::varbinview::VarBinViewArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_data(&self) -> &vortex_array::arrays::varbinview::VarBinViewData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_validity_mask(&self) -> vortex_mask::Mask + pub type vortex_array::arrays::varbinview::VarBinViewArray = vortex_array::Array pub mod vortex_array::arrays::variant @@ -4606,9 +5054,9 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: &vortex_array::arrays::variant::VariantData, other: &vortex_array::arrays::variant::VariantData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: &vortex_array::arrays::variant::VariantData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -4618,7 +5066,7 @@ pub fn vortex_array::arrays::Variant::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Variant::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Variant::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -4640,11 +5088,9 @@ pub fn vortex_array::arrays::Variant::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Variant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Variant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Variant::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Variant @@ -4652,25 +5098,49 @@ pub fn vortex_array::arrays::Variant::validity(array: vortex_array::ArrayView<'_ pub struct vortex_array::arrays::variant::VariantData -impl vortex_array::arrays::variant::VariantData +impl core::clone::Clone for vortex_array::arrays::variant::VariantData -pub fn vortex_array::arrays::variant::VariantData::child(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::variant::VariantData::clone(&self) -> vortex_array::arrays::variant::VariantData -pub fn vortex_array::arrays::variant::VariantData::dtype(&self) -> vortex_array::dtype::DType +impl core::fmt::Debug for vortex_array::arrays::variant::VariantData -pub fn vortex_array::arrays::variant::VariantData::is_empty(&self) -> bool +pub fn vortex_array::arrays::variant::VariantData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::variant::VariantData::len(&self) -> usize +pub trait vortex_array::arrays::variant::VariantArrayExt -pub fn vortex_array::arrays::variant::VariantData::new(child: vortex_array::ArrayRef) -> Self +pub fn vortex_array::arrays::variant::VariantArrayExt::as_slots(&self) -> &[core::option::Option] -impl core::clone::Clone for vortex_array::arrays::variant::VariantData +pub fn vortex_array::arrays::variant::VariantArrayExt::child(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::variant::VariantData::clone(&self) -> vortex_array::arrays::variant::VariantData +pub fn vortex_array::arrays::variant::VariantArrayExt::variant_data(&self) -> &vortex_array::arrays::variant::VariantData -impl core::fmt::Debug for vortex_array::arrays::variant::VariantData +pub fn vortex_array::arrays::variant::VariantArrayExt::variant_dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::variant::VariantData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::variant::VariantArrayExt::variant_len(&self) -> usize + +impl vortex_array::arrays::variant::VariantArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::variant_data(&self) -> &vortex_array::arrays::variant::VariantData + +pub fn vortex_array::Array::variant_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::Array::variant_len(&self) -> usize + +impl vortex_array::arrays::variant::VariantArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Variant> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::variant_data(&self) -> &vortex_array::arrays::variant::VariantData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::variant_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::variant_len(&self) -> usize pub type vortex_array::arrays::variant::VariantArray = vortex_array::Array @@ -4702,9 +5172,9 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -4714,7 +5184,7 @@ pub fn vortex_array::arrays::Bool::child(array: vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Bool::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Bool::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Bool::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -4738,9 +5208,7 @@ pub fn vortex_array::arrays::Bool::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Bool::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Bool::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Bool @@ -4804,9 +5272,9 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: &vortex_array::arrays::chunked::ChunkedData, other: &vortex_array::arrays::chunked::ChunkedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: &vortex_array::arrays::chunked::ChunkedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -4816,7 +5284,7 @@ pub fn vortex_array::arrays::Chunked::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Chunked::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::deserialize(&self, dtype: &vortex_array::dtype::DType, _len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Chunked::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -4838,11 +5306,9 @@ pub fn vortex_array::arrays::Chunked::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Chunked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Chunked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Chunked::validate(&self, data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Chunked::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::validate(&self, _data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Chunked @@ -4908,9 +5374,9 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -4920,7 +5386,7 @@ pub fn vortex_array::arrays::Constant::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Constant::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::deserialize(&self, dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, _metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Constant::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -4942,11 +5408,9 @@ pub fn vortex_array::arrays::Constant::serialize(_array: vortex_array::ArrayView pub fn vortex_array::arrays::Constant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Constant::with_slots(_array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Constant @@ -5008,9 +5472,9 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5020,7 +5484,7 @@ pub fn vortex_array::arrays::Decimal::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Decimal::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Decimal::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Decimal::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5044,9 +5508,7 @@ pub fn vortex_array::arrays::Decimal::slot_name(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Decimal::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Decimal::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Decimal @@ -5110,9 +5572,9 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::arrays::dict::DictData, other: &vortex_array::arrays::dict::DictData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::arrays::dict::DictData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5122,7 +5584,7 @@ pub fn vortex_array::arrays::dict::Dict::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::dict::Dict::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::dict::Dict::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::Dict::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5146,9 +5608,7 @@ pub fn vortex_array::arrays::dict::Dict::slot_name(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::dict::Dict::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::dict::Dict::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::dict::Dict @@ -5214,9 +5674,9 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: &vortex_array::arrays::extension::ExtensionData, other: &vortex_array::arrays::extension::ExtensionData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: &vortex_array::arrays::extension::ExtensionData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5226,7 +5686,7 @@ pub fn vortex_array::arrays::Extension::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Extension::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Extension::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Extension::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5250,13 +5710,11 @@ pub fn vortex_array::arrays::Extension::slot_name(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Extension::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Extension::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityChild for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::validity_child(array: &vortex_array::arrays::extension::ExtensionData) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::Extension::validity_child(array: vortex_array::ArrayView<'_, vortex_array::arrays::Extension>) -> vortex_array::ArrayRef impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Extension @@ -5310,9 +5768,9 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -5322,7 +5780,7 @@ pub fn vortex_array::arrays::Filter::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Filter::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Filter::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5344,11 +5802,9 @@ pub fn vortex_array::arrays::Filter::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Filter::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Filter::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Filter @@ -5382,9 +5838,9 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5394,7 +5850,7 @@ pub fn vortex_array::arrays::FixedSizeList::child(array: vortex_array::ArrayView pub fn vortex_array::arrays::FixedSizeList::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::FixedSizeList::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeList::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5418,9 +5874,7 @@ pub fn vortex_array::arrays::FixedSizeList::slot_name(_array: vortex_array::Arra pub fn vortex_array::arrays::FixedSizeList::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::FixedSizeList::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::FixedSizeList @@ -5470,9 +5924,9 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: &vortex_array::arrays::list::ListData, other: &vortex_array::arrays::list::ListData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: &vortex_array::arrays::list::ListData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5482,7 +5936,7 @@ pub fn vortex_array::arrays::List::child(array: vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::List::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::List::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::List::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5506,9 +5960,7 @@ pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::List::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::List @@ -5562,9 +6014,9 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: &vortex_array::arrays::listview::ListViewData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5574,7 +6026,7 @@ pub fn vortex_array::arrays::ListView::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::ListView::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::ListView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListView::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5598,9 +6050,7 @@ pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::ListView::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::ListView @@ -5650,9 +6100,9 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: &vortex_array::arrays::masked::MaskedData, other: &vortex_array::arrays::masked::MaskedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: &vortex_array::arrays::masked::MaskedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -5662,7 +6112,7 @@ pub fn vortex_array::arrays::Masked::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Masked::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Masked::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5684,11 +6134,9 @@ pub fn vortex_array::arrays::Masked::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Masked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Masked::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Masked @@ -5742,9 +6190,9 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_array: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(_array: vortex_array::ArrayView<'_, Self>, _other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(_array: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(_array: vortex_array::ArrayView<'_, Self>, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5754,7 +6202,7 @@ pub fn vortex_array::arrays::null::Null::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::null::Null::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::Null::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5776,11 +6224,9 @@ pub fn vortex_array::arrays::null::Null::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::null::Null::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::null::Null::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::null::Null::with_slots(_array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::null::Null @@ -5822,7 +6268,7 @@ pub fn vortex_array::arrays::patched::Patched::scalar_at(array: vortex_array::Ar impl vortex_array::VTable for vortex_array::arrays::patched::Patched -pub type vortex_array::arrays::patched::Patched::ArrayData = vortex_array::arrays::patched::PatchedArray +pub type vortex_array::arrays::patched::Patched::ArrayData = vortex_array::arrays::patched::PatchedData pub type vortex_array::arrays::patched::Patched::OperationsVTable = vortex_array::arrays::patched::Patched @@ -5830,9 +6276,9 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(array: &vortex_array::arrays::patched::PatchedArray, other: &vortex_array::arrays::patched::PatchedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::patched::Patched::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::patched::Patched::array_hash(array: &vortex_array::arrays::patched::PatchedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::patched::Patched::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5842,7 +6288,7 @@ pub fn vortex_array::arrays::patched::Patched::child(array: vortex_array::ArrayV pub fn vortex_array::arrays::patched::Patched::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::patched::Patched::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::patched::Patched::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::patched::Patched::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5866,13 +6312,11 @@ pub fn vortex_array::arrays::patched::Patched::slot_name(_array: vortex_array::A pub fn vortex_array::arrays::patched::Patched::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedArray, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::patched::Patched::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityChild for vortex_array::arrays::patched::Patched -pub fn vortex_array::arrays::patched::Patched::validity_child(array: &vortex_array::arrays::patched::PatchedArray) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::patched::Patched::validity_child(array: vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>) -> vortex_array::ArrayRef impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::patched::Patched @@ -5890,46 +6334,6 @@ impl vortex_array::scalar_fn::fns::binary::CompareKernel for vortex_array::array pub fn vortex_array::arrays::patched::Patched::compare(lhs: vortex_array::ArrayView<'_, Self>, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> -pub struct vortex_array::arrays::PatchedArray - -impl vortex_array::arrays::patched::PatchedArray - -pub fn vortex_array::arrays::patched::PatchedArray::base_array(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::patched::PatchedArray::is_empty(&self) -> bool - -pub fn vortex_array::arrays::patched::PatchedArray::lane_offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::patched::PatchedArray::len(&self) -> usize - -pub fn vortex_array::arrays::patched::PatchedArray::patch_indices(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::patched::PatchedArray::patch_values(&self) -> &vortex_array::ArrayRef - -impl vortex_array::arrays::patched::PatchedArray - -pub fn vortex_array::arrays::patched::PatchedArray::from_array_and_patches(inner: vortex_array::ArrayRef, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult - -impl vortex_array::arrays::patched::PatchedArray - -pub fn vortex_array::arrays::patched::PatchedArray::to_array(&self) -> vortex_array::ArrayRef where Self: core::clone::Clone + vortex_array::IntoArray - -impl core::clone::Clone for vortex_array::arrays::patched::PatchedArray - -pub fn vortex_array::arrays::patched::PatchedArray::clone(&self) -> vortex_array::arrays::patched::PatchedArray - -impl core::convert::From for vortex_array::ArrayRef - -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::patched::PatchedArray) -> Self - -impl core::fmt::Debug for vortex_array::arrays::patched::PatchedArray - -pub fn vortex_array::arrays::patched::PatchedArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result - -impl vortex_array::IntoArray for vortex_array::arrays::patched::PatchedArray - -pub fn vortex_array::arrays::patched::PatchedArray::into_array(self) -> vortex_array::ArrayRef - pub struct vortex_array::arrays::Primitive impl vortex_array::arrays::Primitive @@ -5958,9 +6362,9 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5970,7 +6374,7 @@ pub fn vortex_array::arrays::Primitive::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Primitive::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Primitive::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Primitive::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5994,9 +6398,7 @@ pub fn vortex_array::arrays::Primitive::slot_name(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Primitive::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Primitive::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Primitive @@ -6056,9 +6458,9 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -6068,7 +6470,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child(array: vortex_arra pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -6092,9 +6494,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(array: vortex_ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::scalar_fn::ScalarFnVTable @@ -6128,9 +6528,9 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: &vortex_array::arrays::shared::SharedData, other: &vortex_array::arrays::shared::SharedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: &vortex_array::arrays::shared::SharedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -6140,7 +6540,7 @@ pub fn vortex_array::arrays::Shared::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Shared::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Shared::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -6162,11 +6562,9 @@ pub fn vortex_array::arrays::Shared::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Shared::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Shared::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Shared::validate(&self, data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Shared::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::validate(&self, _data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Shared @@ -6200,9 +6598,9 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: &vortex_array::arrays::slice::SliceData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -6212,7 +6610,7 @@ pub fn vortex_array::arrays::slice::Slice::child(array: vortex_array::ArrayView< pub fn vortex_array::arrays::slice::Slice::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::Slice::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -6234,11 +6632,9 @@ pub fn vortex_array::arrays::slice::Slice::serialize(_array: vortex_array::Array pub fn vortex_array::arrays::slice::Slice::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::slice::Slice::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::slice::Slice @@ -6276,9 +6672,9 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: &vortex_array::arrays::struct_::StructData, other: &vortex_array::arrays::struct_::StructData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: &vortex_array::arrays::struct_::StructData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -6288,7 +6684,7 @@ pub fn vortex_array::arrays::Struct::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Struct::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Struct::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Struct::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -6312,9 +6708,7 @@ pub fn vortex_array::arrays::Struct::slot_name(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::Struct::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Struct::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Struct @@ -6372,9 +6766,9 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -6384,7 +6778,7 @@ pub fn vortex_array::arrays::VarBin::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::VarBin::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBin::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBin::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -6408,9 +6802,7 @@ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::VarBin::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::VarBin @@ -6468,9 +6860,9 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -6480,7 +6872,7 @@ pub fn vortex_array::arrays::VarBinView::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::VarBinView::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBinView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinView::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -6504,9 +6896,7 @@ pub fn vortex_array::arrays::VarBinView::slot_name(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::VarBinView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::VarBinView::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::VarBinView @@ -6560,9 +6950,9 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: &vortex_array::arrays::variant::VariantData, other: &vortex_array::arrays::variant::VariantData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: &vortex_array::arrays::variant::VariantData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -6572,7 +6962,7 @@ pub fn vortex_array::arrays::Variant::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Variant::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Variant::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -6594,11 +6984,9 @@ pub fn vortex_array::arrays::Variant::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Variant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Variant::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Variant @@ -6628,6 +7016,8 @@ pub type vortex_array::arrays::MaskedArray = vortex_array::Array +pub type vortex_array::arrays::PatchedArray = vortex_array::Array + pub type vortex_array::arrays::PrimitiveArray = vortex_array::Array pub type vortex_array::arrays::ScalarFnArray = vortex_array::Array @@ -18790,9 +19180,9 @@ pub type vortex_array::vtable::ArrayVTable::ValidityVTable: vortex_array::Validi pub fn vortex_array::vtable::ArrayVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::vtable::ArrayVTable::array_eq(array: &Self::ArrayData, other: &Self::ArrayData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::vtable::ArrayVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::vtable::ArrayVTable::array_hash(array: &Self::ArrayData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::vtable::ArrayVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::vtable::ArrayVTable::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -18802,7 +19192,7 @@ pub fn vortex_array::vtable::ArrayVTable::child(array: vortex_array::ArrayView<' pub fn vortex_array::vtable::ArrayVTable::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::vtable::ArrayVTable::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::vtable::ArrayVTable::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::vtable::ArrayVTable::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -18826,9 +19216,7 @@ pub fn vortex_array::vtable::ArrayVTable::slot_name(array: vortex_array::ArrayVi pub fn vortex_array::vtable::ArrayVTable::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::vtable::ArrayVTable::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::vtable::ArrayVTable::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::vtable::ArrayVTable::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Bool @@ -18840,9 +19228,9 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -18852,7 +19240,7 @@ pub fn vortex_array::arrays::Bool::child(array: vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Bool::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Bool::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Bool::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -18876,9 +19264,7 @@ pub fn vortex_array::arrays::Bool::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Bool::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Bool::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Chunked @@ -18890,9 +19276,9 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: &vortex_array::arrays::chunked::ChunkedData, other: &vortex_array::arrays::chunked::ChunkedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: &vortex_array::arrays::chunked::ChunkedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -18902,7 +19288,7 @@ pub fn vortex_array::arrays::Chunked::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Chunked::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::deserialize(&self, dtype: &vortex_array::dtype::DType, _len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Chunked::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -18924,11 +19310,9 @@ pub fn vortex_array::arrays::Chunked::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Chunked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Chunked::validate(&self, data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Chunked::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::validate(&self, _data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Constant @@ -18940,9 +19324,9 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -18952,7 +19336,7 @@ pub fn vortex_array::arrays::Constant::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Constant::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::deserialize(&self, dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, _metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Constant::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -18974,11 +19358,9 @@ pub fn vortex_array::arrays::Constant::serialize(_array: vortex_array::ArrayView pub fn vortex_array::arrays::Constant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Constant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Constant::with_slots(_array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Decimal @@ -18990,9 +19372,9 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19002,7 +19384,7 @@ pub fn vortex_array::arrays::Decimal::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Decimal::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Decimal::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Decimal::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19026,9 +19408,7 @@ pub fn vortex_array::arrays::Decimal::slot_name(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Decimal::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Decimal::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Extension @@ -19040,9 +19420,9 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: &vortex_array::arrays::extension::ExtensionData, other: &vortex_array::arrays::extension::ExtensionData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: &vortex_array::arrays::extension::ExtensionData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19052,7 +19432,7 @@ pub fn vortex_array::arrays::Extension::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Extension::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Extension::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Extension::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19076,9 +19456,7 @@ pub fn vortex_array::arrays::Extension::slot_name(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Extension::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Extension::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Filter @@ -19090,9 +19468,9 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -19102,7 +19480,7 @@ pub fn vortex_array::arrays::Filter::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Filter::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Filter::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19124,11 +19502,9 @@ pub fn vortex_array::arrays::Filter::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Filter::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Filter::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::FixedSizeList @@ -19140,9 +19516,9 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19152,7 +19528,7 @@ pub fn vortex_array::arrays::FixedSizeList::child(array: vortex_array::ArrayView pub fn vortex_array::arrays::FixedSizeList::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::FixedSizeList::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeList::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19176,9 +19552,7 @@ pub fn vortex_array::arrays::FixedSizeList::slot_name(_array: vortex_array::Arra pub fn vortex_array::arrays::FixedSizeList::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::FixedSizeList::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::List @@ -19190,9 +19564,9 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: &vortex_array::arrays::list::ListData, other: &vortex_array::arrays::list::ListData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: &vortex_array::arrays::list::ListData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19202,7 +19576,7 @@ pub fn vortex_array::arrays::List::child(array: vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::List::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::List::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::List::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19226,9 +19600,7 @@ pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::List::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::ListView @@ -19240,9 +19612,9 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: &vortex_array::arrays::listview::ListViewData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19252,7 +19624,7 @@ pub fn vortex_array::arrays::ListView::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::ListView::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::ListView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListView::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19276,9 +19648,7 @@ pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::ListView::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Masked @@ -19290,9 +19660,9 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: &vortex_array::arrays::masked::MaskedData, other: &vortex_array::arrays::masked::MaskedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: &vortex_array::arrays::masked::MaskedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -19302,7 +19672,7 @@ pub fn vortex_array::arrays::Masked::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Masked::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Masked::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19324,11 +19694,9 @@ pub fn vortex_array::arrays::Masked::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Masked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Masked::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Primitive @@ -19340,9 +19708,9 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19352,7 +19720,7 @@ pub fn vortex_array::arrays::Primitive::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Primitive::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Primitive::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Primitive::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19376,9 +19744,7 @@ pub fn vortex_array::arrays::Primitive::slot_name(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Primitive::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Primitive::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Shared @@ -19390,9 +19756,9 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: &vortex_array::arrays::shared::SharedData, other: &vortex_array::arrays::shared::SharedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: &vortex_array::arrays::shared::SharedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -19402,7 +19768,7 @@ pub fn vortex_array::arrays::Shared::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Shared::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Shared::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19424,11 +19790,9 @@ pub fn vortex_array::arrays::Shared::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Shared::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Shared::validate(&self, data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Shared::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::validate(&self, _data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Struct @@ -19440,9 +19804,9 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: &vortex_array::arrays::struct_::StructData, other: &vortex_array::arrays::struct_::StructData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: &vortex_array::arrays::struct_::StructData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19452,7 +19816,7 @@ pub fn vortex_array::arrays::Struct::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Struct::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Struct::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Struct::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19476,9 +19840,7 @@ pub fn vortex_array::arrays::Struct::slot_name(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::Struct::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Struct::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBin @@ -19490,9 +19852,9 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19502,7 +19864,7 @@ pub fn vortex_array::arrays::VarBin::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::VarBin::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBin::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBin::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19526,9 +19888,7 @@ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::VarBin::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBinView @@ -19540,9 +19900,9 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19552,7 +19912,7 @@ pub fn vortex_array::arrays::VarBinView::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::VarBinView::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBinView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinView::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19576,9 +19936,7 @@ pub fn vortex_array::arrays::VarBinView::slot_name(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::VarBinView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::VarBinView::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Variant @@ -19590,9 +19948,9 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: &vortex_array::arrays::variant::VariantData, other: &vortex_array::arrays::variant::VariantData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: &vortex_array::arrays::variant::VariantData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19602,7 +19960,7 @@ pub fn vortex_array::arrays::Variant::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Variant::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Variant::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19624,11 +19982,9 @@ pub fn vortex_array::arrays::Variant::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Variant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Variant::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::dict::Dict @@ -19640,9 +19996,9 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::arrays::dict::DictData, other: &vortex_array::arrays::dict::DictData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::arrays::dict::DictData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19652,7 +20008,7 @@ pub fn vortex_array::arrays::dict::Dict::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::dict::Dict::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::dict::Dict::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::Dict::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19676,9 +20032,7 @@ pub fn vortex_array::arrays::dict::Dict::slot_name(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::dict::Dict::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::dict::Dict::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::null::Null @@ -19690,9 +20044,9 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_array: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(_array: vortex_array::ArrayView<'_, Self>, _other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(_array: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(_array: vortex_array::ArrayView<'_, Self>, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19702,7 +20056,7 @@ pub fn vortex_array::arrays::null::Null::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::null::Null::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::Null::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19724,15 +20078,13 @@ pub fn vortex_array::arrays::null::Null::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::null::Null::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::null::Null::with_slots(_array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::patched::Patched -pub type vortex_array::arrays::patched::Patched::ArrayData = vortex_array::arrays::patched::PatchedArray +pub type vortex_array::arrays::patched::Patched::ArrayData = vortex_array::arrays::patched::PatchedData pub type vortex_array::arrays::patched::Patched::OperationsVTable = vortex_array::arrays::patched::Patched @@ -19740,9 +20092,9 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(array: &vortex_array::arrays::patched::PatchedArray, other: &vortex_array::arrays::patched::PatchedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::patched::Patched::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::patched::Patched::array_hash(array: &vortex_array::arrays::patched::PatchedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::patched::Patched::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19752,7 +20104,7 @@ pub fn vortex_array::arrays::patched::Patched::child(array: vortex_array::ArrayV pub fn vortex_array::arrays::patched::Patched::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::patched::Patched::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::patched::Patched::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::patched::Patched::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19776,9 +20128,7 @@ pub fn vortex_array::arrays::patched::Patched::slot_name(_array: vortex_array::A pub fn vortex_array::arrays::patched::Patched::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedArray, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::patched::Patched::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::scalar_fn::ScalarFnVTable @@ -19790,9 +20140,9 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19802,7 +20152,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child(array: vortex_arra pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19826,9 +20176,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(array: vortex_ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::slice::Slice @@ -19840,9 +20188,9 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: &vortex_array::arrays::slice::SliceData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -19852,7 +20200,7 @@ pub fn vortex_array::arrays::slice::Slice::child(array: vortex_array::ArrayView< pub fn vortex_array::arrays::slice::Slice::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::Slice::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -19874,11 +20222,9 @@ pub fn vortex_array::arrays::slice::Slice::serialize(_array: vortex_array::Array pub fn vortex_array::arrays::slice::Slice::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::slice::Slice::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::slice::Slice::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> pub trait vortex_array::vtable::DynVTable: 'static + core::marker::Send + core::marker::Sync + core::fmt::Debug @@ -20014,9 +20360,9 @@ pub type vortex_array::vtable::VTable::ValidityVTable: vortex_array::ValidityVTa pub fn vortex_array::vtable::VTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::vtable::VTable::array_eq(array: &Self::ArrayData, other: &Self::ArrayData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::vtable::VTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::vtable::VTable::array_hash(array: &Self::ArrayData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::vtable::VTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::vtable::VTable::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20026,7 +20372,7 @@ pub fn vortex_array::vtable::VTable::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::vtable::VTable::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::vtable::VTable::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::vtable::VTable::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::vtable::VTable::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20050,9 +20396,7 @@ pub fn vortex_array::vtable::VTable::slot_name(array: vortex_array::ArrayView<'_ pub fn vortex_array::vtable::VTable::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::vtable::VTable::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::vtable::VTable::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::vtable::VTable::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Bool @@ -20064,9 +20408,9 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20076,7 +20420,7 @@ pub fn vortex_array::arrays::Bool::child(array: vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Bool::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Bool::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Bool::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20100,9 +20444,7 @@ pub fn vortex_array::arrays::Bool::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Bool::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Bool::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Chunked @@ -20114,9 +20456,9 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: &vortex_array::arrays::chunked::ChunkedData, other: &vortex_array::arrays::chunked::ChunkedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: &vortex_array::arrays::chunked::ChunkedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20126,7 +20468,7 @@ pub fn vortex_array::arrays::Chunked::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Chunked::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::deserialize(&self, dtype: &vortex_array::dtype::DType, _len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Chunked::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20148,11 +20490,9 @@ pub fn vortex_array::arrays::Chunked::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Chunked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Chunked::validate(&self, data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Chunked::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::validate(&self, _data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Constant @@ -20164,9 +20504,9 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20176,7 +20516,7 @@ pub fn vortex_array::arrays::Constant::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Constant::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::deserialize(&self, dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, _metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Constant::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20198,11 +20538,9 @@ pub fn vortex_array::arrays::Constant::serialize(_array: vortex_array::ArrayView pub fn vortex_array::arrays::Constant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Constant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Constant::with_slots(_array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Decimal @@ -20214,9 +20552,9 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20226,7 +20564,7 @@ pub fn vortex_array::arrays::Decimal::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Decimal::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Decimal::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Decimal::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20250,9 +20588,7 @@ pub fn vortex_array::arrays::Decimal::slot_name(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Decimal::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Decimal::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Extension @@ -20264,9 +20600,9 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: &vortex_array::arrays::extension::ExtensionData, other: &vortex_array::arrays::extension::ExtensionData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: &vortex_array::arrays::extension::ExtensionData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20276,7 +20612,7 @@ pub fn vortex_array::arrays::Extension::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Extension::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Extension::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Extension::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20300,9 +20636,7 @@ pub fn vortex_array::arrays::Extension::slot_name(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Extension::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Extension::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Filter @@ -20314,9 +20648,9 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -20326,7 +20660,7 @@ pub fn vortex_array::arrays::Filter::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Filter::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Filter::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20348,11 +20682,9 @@ pub fn vortex_array::arrays::Filter::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Filter::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Filter::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::FixedSizeList @@ -20364,9 +20696,9 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20376,7 +20708,7 @@ pub fn vortex_array::arrays::FixedSizeList::child(array: vortex_array::ArrayView pub fn vortex_array::arrays::FixedSizeList::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::FixedSizeList::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeList::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20400,9 +20732,7 @@ pub fn vortex_array::arrays::FixedSizeList::slot_name(_array: vortex_array::Arra pub fn vortex_array::arrays::FixedSizeList::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::FixedSizeList::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::List @@ -20414,9 +20744,9 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: &vortex_array::arrays::list::ListData, other: &vortex_array::arrays::list::ListData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: &vortex_array::arrays::list::ListData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20426,7 +20756,7 @@ pub fn vortex_array::arrays::List::child(array: vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::List::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::List::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::List::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20450,9 +20780,7 @@ pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::List::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::ListView @@ -20464,9 +20792,9 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: &vortex_array::arrays::listview::ListViewData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20476,7 +20804,7 @@ pub fn vortex_array::arrays::ListView::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::ListView::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::ListView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListView::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20500,9 +20828,7 @@ pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::ListView::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Masked @@ -20514,9 +20840,9 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: &vortex_array::arrays::masked::MaskedData, other: &vortex_array::arrays::masked::MaskedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: &vortex_array::arrays::masked::MaskedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -20526,7 +20852,7 @@ pub fn vortex_array::arrays::Masked::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Masked::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Masked::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20548,11 +20874,9 @@ pub fn vortex_array::arrays::Masked::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Masked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Masked::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Primitive @@ -20564,9 +20888,9 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20576,7 +20900,7 @@ pub fn vortex_array::arrays::Primitive::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Primitive::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Primitive::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Primitive::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20600,9 +20924,7 @@ pub fn vortex_array::arrays::Primitive::slot_name(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Primitive::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Primitive::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Shared @@ -20614,9 +20936,9 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: &vortex_array::arrays::shared::SharedData, other: &vortex_array::arrays::shared::SharedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: &vortex_array::arrays::shared::SharedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -20626,7 +20948,7 @@ pub fn vortex_array::arrays::Shared::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Shared::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Shared::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20648,11 +20970,9 @@ pub fn vortex_array::arrays::Shared::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Shared::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Shared::validate(&self, data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Shared::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::validate(&self, _data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Struct @@ -20664,9 +20984,9 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: &vortex_array::arrays::struct_::StructData, other: &vortex_array::arrays::struct_::StructData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: &vortex_array::arrays::struct_::StructData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20676,7 +20996,7 @@ pub fn vortex_array::arrays::Struct::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Struct::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Struct::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Struct::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20700,9 +21020,7 @@ pub fn vortex_array::arrays::Struct::slot_name(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::Struct::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Struct::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBin @@ -20714,9 +21032,9 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20726,7 +21044,7 @@ pub fn vortex_array::arrays::VarBin::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::VarBin::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBin::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBin::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20750,9 +21068,7 @@ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::VarBin::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBinView @@ -20764,9 +21080,9 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20776,7 +21092,7 @@ pub fn vortex_array::arrays::VarBinView::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::VarBinView::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBinView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinView::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20800,9 +21116,7 @@ pub fn vortex_array::arrays::VarBinView::slot_name(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::VarBinView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::VarBinView::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Variant @@ -20814,9 +21128,9 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: &vortex_array::arrays::variant::VariantData, other: &vortex_array::arrays::variant::VariantData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: &vortex_array::arrays::variant::VariantData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20826,7 +21140,7 @@ pub fn vortex_array::arrays::Variant::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Variant::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Variant::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20848,11 +21162,9 @@ pub fn vortex_array::arrays::Variant::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Variant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Variant::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::dict::Dict @@ -20864,9 +21176,9 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::arrays::dict::DictData, other: &vortex_array::arrays::dict::DictData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::arrays::dict::DictData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20876,7 +21188,7 @@ pub fn vortex_array::arrays::dict::Dict::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::dict::Dict::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::dict::Dict::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::Dict::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20900,9 +21212,7 @@ pub fn vortex_array::arrays::dict::Dict::slot_name(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::dict::Dict::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::dict::Dict::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::null::Null @@ -20914,9 +21224,9 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_array: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(_array: vortex_array::ArrayView<'_, Self>, _other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(_array: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(_array: vortex_array::ArrayView<'_, Self>, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20926,7 +21236,7 @@ pub fn vortex_array::arrays::null::Null::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::null::Null::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::Null::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20948,15 +21258,13 @@ pub fn vortex_array::arrays::null::Null::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::null::Null::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::null::Null::with_slots(_array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::patched::Patched -pub type vortex_array::arrays::patched::Patched::ArrayData = vortex_array::arrays::patched::PatchedArray +pub type vortex_array::arrays::patched::Patched::ArrayData = vortex_array::arrays::patched::PatchedData pub type vortex_array::arrays::patched::Patched::OperationsVTable = vortex_array::arrays::patched::Patched @@ -20964,9 +21272,9 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(array: &vortex_array::arrays::patched::PatchedArray, other: &vortex_array::arrays::patched::PatchedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::patched::Patched::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::patched::Patched::array_hash(array: &vortex_array::arrays::patched::PatchedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::patched::Patched::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20976,7 +21284,7 @@ pub fn vortex_array::arrays::patched::Patched::child(array: vortex_array::ArrayV pub fn vortex_array::arrays::patched::Patched::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::patched::Patched::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::patched::Patched::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::patched::Patched::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21000,9 +21308,7 @@ pub fn vortex_array::arrays::patched::Patched::slot_name(_array: vortex_array::A pub fn vortex_array::arrays::patched::Patched::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedArray, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::patched::Patched::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::scalar_fn::ScalarFnVTable @@ -21014,9 +21320,9 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -21026,7 +21332,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child(array: vortex_arra pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21050,9 +21356,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(array: vortex_ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::slice::Slice @@ -21064,9 +21368,9 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: &vortex_array::arrays::slice::SliceData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -21076,7 +21380,7 @@ pub fn vortex_array::arrays::slice::Slice::child(array: vortex_array::ArrayView< pub fn vortex_array::arrays::slice::Slice::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::Slice::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21098,23 +21402,21 @@ pub fn vortex_array::arrays::slice::Slice::serialize(_array: vortex_array::Array pub fn vortex_array::arrays::slice::Slice::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::slice::Slice::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::slice::Slice::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> pub trait vortex_array::vtable::ValidityChild -pub fn vortex_array::vtable::ValidityChild::validity_child(array: &::ArrayData) -> &vortex_array::ArrayRef +pub fn vortex_array::vtable::ValidityChild::validity_child(array: vortex_array::ArrayView<'_, V>) -> vortex_array::ArrayRef impl vortex_array::ValidityChild for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::validity_child(array: &vortex_array::arrays::extension::ExtensionData) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::Extension::validity_child(array: vortex_array::ArrayView<'_, vortex_array::arrays::Extension>) -> vortex_array::ArrayRef impl vortex_array::ValidityChild for vortex_array::arrays::patched::Patched -pub fn vortex_array::arrays::patched::Patched::validity_child(array: &vortex_array::arrays::patched::PatchedArray) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::patched::Patched::validity_child(array: vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>) -> vortex_array::ArrayRef pub trait vortex_array::vtable::ValidityChildSliceHelper @@ -21488,12 +21790,18 @@ pub fn vortex_array::Array::from_indices::into_bit_buffer(self) -> vortex_buffer::bit::buf::BitBuffer +pub fn vortex_array::Array::maybe_to_mask(&self) -> vortex_error::VortexResult> + pub fn vortex_array::Array::new(bits: vortex_buffer::bit::buf::BitBuffer, validity: vortex_array::validity::Validity) -> Self pub fn vortex_array::Array::new_handle(handle: vortex_array::buffer::BufferHandle, offset: usize, len: usize, validity: vortex_array::validity::Validity) -> Self pub unsafe fn vortex_array::Array::new_unchecked(bits: vortex_buffer::bit::buf::BitBuffer, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::Array::to_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::Array::to_mask_fill_null_false(&self) -> vortex_mask::Mask + pub fn vortex_array::Array::try_new(bits: vortex_buffer::bit::buf::BitBuffer, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult pub fn vortex_array::Array::try_new_from_handle(bits: vortex_array::buffer::BufferHandle, offset: usize, len: usize, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult @@ -21506,6 +21814,22 @@ pub fn vortex_array::Array::patch(self, patches: &vo impl vortex_array::Array +pub fn vortex_array::Array::chunk(&self, idx: usize) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer + +pub fn vortex_array::Array::chunk_offsets_array(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::chunks(&self) -> alloc::vec::Vec + +pub fn vortex_array::Array::iter_chunks(&self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + '_)> + +pub fn vortex_array::Array::nchunks(&self) -> usize + +pub fn vortex_array::Array::non_empty_chunks(&self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + '_)> + +impl vortex_array::Array + pub unsafe fn vortex_array::Array::new_unchecked(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self pub fn vortex_array::Array::rechunk(&self, target_bytesize: u64, target_rowsize: usize) -> vortex_error::VortexResult @@ -21530,12 +21854,20 @@ pub unsafe fn vortex_array::Array::new_unchecked< pub unsafe fn vortex_array::Array::new_unchecked_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::Array::patch(self, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult + pub fn vortex_array::Array::try_new(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +impl vortex_array::Array + +pub fn vortex_array::Array::into_data_parts(self) -> vortex_array::arrays::decimal::DecimalDataParts + impl vortex_array::Array pub fn vortex_array::Array::new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self +pub fn vortex_array::Array::storage_array(&self) -> &vortex_array::ArrayRef + pub fn vortex_array::Array::try_new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> vortex_error::VortexResult impl vortex_array::Array @@ -21546,28 +21878,82 @@ pub fn vortex_array::Array::try_new(array: vortex_ impl vortex_array::Array +pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::fixed_size_list_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::fixed_size_list_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::Array::into_data_parts(self) -> vortex_array::arrays::fixed_size_list::FixedSizeListDataParts + +pub fn vortex_array::Array::list_size(&self) -> u32 + pub fn vortex_array::Array::new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self pub unsafe fn vortex_array::Array::new_unchecked(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self pub fn vortex_array::Array::try_new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> vortex_error::VortexResult +impl vortex_array::Array + +pub fn vortex_array::Array::fixed_size_list_elements_at(&self, index: usize) -> vortex_error::VortexResult + impl vortex_array::Array +pub fn vortex_array::Array::element_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::into_data_parts(self) -> vortex_array::arrays::list::ListDataParts + +pub fn vortex_array::Array::list_elements_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::Array::list_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::list_validity_mask(&self) -> vortex_mask::Mask + pub fn vortex_array::Array::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self pub unsafe fn vortex_array::Array::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::Array::offset_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::reset_offsets(&self, recurse: bool) -> vortex_error::VortexResult + +pub fn vortex_array::Array::sliced_elements(&self) -> vortex_error::VortexResult + pub fn vortex_array::Array::try_new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult impl vortex_array::Array +pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::into_data_parts(self) -> vortex_array::arrays::listview::ListViewDataParts + +pub fn vortex_array::Array::list_elements_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::Array::listview_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::listview_validity_mask(&self) -> vortex_mask::Mask + pub fn vortex_array::Array::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self pub unsafe fn vortex_array::Array::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::Array::offset_at(&self, index: usize) -> usize + +pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::size_at(&self, index: usize) -> usize + +pub fn vortex_array::Array::sizes(&self) -> &vortex_array::ArrayRef + pub fn vortex_array::Array::try_new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::Array::verify_is_zero_copy_to_list(&self) -> bool + pub unsafe fn vortex_array::Array::with_zero_copy_to_list(self, is_zctl: bool) -> Self impl vortex_array::Array @@ -21588,6 +21974,10 @@ pub fn vortex_array::Array::from_byte_buffer(bu pub fn vortex_array::Array::from_values_byte_buffer(valid_elems_buffer: vortex_buffer::ByteBuffer, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity, n_rows: usize) -> Self +pub fn vortex_array::Array::into_data_parts(self) -> vortex_array::arrays::primitive::PrimitiveDataParts + +pub fn vortex_array::Array::map_each_with_validity(self, f: F) -> vortex_error::VortexResult where T: vortex_array::dtype::NativePType, R: vortex_array::dtype::NativePType, F: core::ops::function::FnMut((T, bool)) -> R + pub fn vortex_array::Array::new(buffer: impl core::convert::Into>, validity: vortex_array::validity::Validity) -> Self pub unsafe fn vortex_array::Array::new_unchecked(buffer: vortex_buffer::buffer::Buffer, validity: vortex_array::validity::Validity) -> Self @@ -21632,6 +22022,8 @@ impl vortex_array::Array pub fn vortex_array::Array::from_fields>(items: &[(N, vortex_array::ArrayRef)]) -> vortex_error::VortexResult +pub fn vortex_array::Array::into_data_parts(self) -> vortex_array::arrays::struct_::StructDataParts + pub fn vortex_array::Array::new(names: vortex_array::dtype::FieldNames, fields: impl core::convert::Into>, length: usize, validity: vortex_array::validity::Validity) -> Self pub fn vortex_array::Array::new_fieldless_with_len(len: usize) -> Self @@ -21640,6 +22032,8 @@ pub unsafe fn vortex_array::Array::new_unchecked(f pub fn vortex_array::Array::project(&self, projection: &[vortex_array::dtype::FieldName]) -> vortex_error::VortexResult +pub fn vortex_array::Array::remove_column(&self, name: impl core::convert::Into) -> core::option::Option<(Self, vortex_array::ArrayRef)> + pub fn vortex_array::Array::try_from_iter, A: vortex_array::IntoArray, T: core::iter::traits::collect::IntoIterator>(iter: T) -> vortex_error::VortexResult pub fn vortex_array::Array::try_from_iter_with_validity, A: vortex_array::IntoArray, T: core::iter::traits::collect::IntoIterator>(iter: T, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult @@ -21652,8 +22046,30 @@ impl vortex_array::Array pub fn vortex_array::Array::into_record_batch_with_schema(self, schema: impl core::convert::AsRef) -> vortex_error::VortexResult +impl vortex_array::Array + +pub fn vortex_array::Array::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ + +pub fn vortex_array::Array::names(&self) -> &vortex_array::dtype::FieldNames + +pub fn vortex_array::Array::remove_column_owned(&self, name: impl core::convert::Into) -> core::option::Option<(Self, vortex_array::ArrayRef)> + +pub fn vortex_array::Array::struct_fields(&self) -> vortex_array::dtype::StructFields + +pub fn vortex_array::Array::unmasked_field(&self, idx: usize) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> + +pub fn vortex_array::Array::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::Array::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> + +pub fn vortex_array::Array::with_column(&self, name: impl core::convert::Into, array: vortex_array::ArrayRef) -> vortex_error::VortexResult + impl vortex_array::Array +pub fn vortex_array::Array::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer + pub fn vortex_array::Array::from_bytes(value: alloc::vec::Vec<&[u8]>) -> Self pub fn vortex_array::Array::from_iter, I: core::iter::traits::collect::IntoIterator>>(iter: I, dtype: vortex_array::dtype::DType) -> Self @@ -21668,6 +22084,14 @@ pub fn vortex_array::Array::from_strs(value: alloc pub fn vortex_array::Array::from_vec>(vec: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self +pub fn vortex_array::Array::into_data_parts(self) -> vortex_array::arrays::varbin::VarBinDataParts + +pub fn vortex_array::Array::offset_at(&self, index: usize) -> usize + +pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::sliced_bytes(&self) -> vortex_buffer::ByteBuffer + impl vortex_array::Array pub fn vortex_array::Array::new(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self @@ -21696,6 +22120,8 @@ pub fn vortex_array::Array::from_iter_nullable pub fn vortex_array::Array::from_iter_str, I: core::iter::traits::collect::IntoIterator>(iter: I) -> Self +pub fn vortex_array::Array::into_data_parts(self) -> vortex_array::arrays::varbinview::VarBinViewDataParts + pub fn vortex_array::Array::new_handle(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self pub unsafe fn vortex_array::Array::new_handle_unchecked(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self @@ -21704,12 +22130,22 @@ pub unsafe fn vortex_array::Array::new_uncheck pub fn vortex_array::Array::try_new(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::Array::varbinview_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::varbinview_validity_mask(&self) -> vortex_mask::Mask + impl vortex_array::Array pub fn vortex_array::Array::new(child: vortex_array::ArrayRef) -> Self impl vortex_array::Array +pub fn vortex_array::Array::codes(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult + +pub fn vortex_array::Array::has_all_values_referenced(&self) -> bool + pub fn vortex_array::Array::new(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self pub unsafe fn vortex_array::Array::new_unchecked(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self @@ -21718,14 +22154,28 @@ pub unsafe fn vortex_array::Array::set_all_val pub fn vortex_array::Array::try_new(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> vortex_error::VortexResult +pub fn vortex_array::Array::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> + +pub fn vortex_array::Array::values(&self) -> &vortex_array::ArrayRef + impl vortex_array::Array pub fn vortex_array::Array::new(len: usize) -> Self +impl vortex_array::Array + +pub fn vortex_array::Array::from_array_and_patches(inner: vortex_array::ArrayRef, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult + impl vortex_array::Array pub fn vortex_array::Array::children(&self) -> alloc::vec::Vec +pub fn vortex_array::Array::get_child(&self, idx: usize) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::iter_children(&self) -> impl core::iter::traits::iterator::Iterator + '_ + +pub fn vortex_array::Array::nchildren(&self) -> usize + pub fn vortex_array::Array::scalar_fn(&self) -> &vortex_array::scalar_fn::ScalarFnRef pub fn vortex_array::Array::try_new(scalar_fn: vortex_array::scalar_fn::ScalarFnRef, children: alloc::vec::Vec, len: usize) -> vortex_error::VortexResult @@ -21792,6 +22242,8 @@ pub fn vortex_array::Array::is_empty(&self) -> bool pub fn vortex_array::Array::len(&self) -> usize +pub fn vortex_array::Array::slots(&self) -> &[core::option::Option] + pub fn vortex_array::Array::statistics(&self) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::Array::try_from_array_ref(array: vortex_array::ArrayRef) -> core::result::Result @@ -21858,6 +22310,288 @@ impl core::iter::traits::collect::FromIterator for vorte pub fn vortex_array::Array::from_iter>(iter: T) -> Self +impl vortex_array::arrays::chunked::ChunkedArrayExt for vortex_array::Array + +pub fn vortex_array::Array::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ + +pub fn vortex_array::Array::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::chunk(&self, idx: usize) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer + +pub fn vortex_array::Array::chunk_offsets_array(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::chunked_data(&self) -> &vortex_array::arrays::chunked::ChunkedData + +pub fn vortex_array::Array::chunked_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::Array::chunked_len(&self) -> usize + +pub fn vortex_array::Array::chunks(&self) -> alloc::vec::Vec + +pub fn vortex_array::Array::find_chunk_idx(&self, index: usize) -> vortex_error::VortexResult<(usize, usize)> + +pub fn vortex_array::Array::iter_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> + +pub fn vortex_array::Array::nchunks(&self) -> usize + +pub fn vortex_array::Array::non_empty_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> + +impl vortex_array::arrays::decimal::DecimalArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::decimal_data(&self) -> &vortex_array::arrays::decimal::DecimalData + +pub fn vortex_array::Array::validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +impl vortex_array::arrays::dict::DictArrayExt for vortex_array::Array + +pub fn vortex_array::Array::codes(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult + +pub fn vortex_array::Array::dict_data(&self) -> &vortex_array::arrays::dict::DictData + +pub fn vortex_array::Array::has_all_values_referenced(&self) -> bool + +pub fn vortex_array::Array::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> + +pub fn vortex_array::Array::values(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::extension::ExtensionArrayExt for vortex_array::Array + +pub fn vortex_array::Array::extension_data(&self) -> &vortex_array::arrays::extension::ExtensionData + +pub fn vortex_array::Array::storage_array(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::filter::FilterArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::filter_data(&self) -> &vortex_array::arrays::filter::FilterData + +pub fn vortex_array::Array::filter_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::Array::filter_len(&self) -> usize + +impl vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::fixed_size_list_data(&self) -> &vortex_array::arrays::fixed_size_list::FixedSizeListData + +pub fn vortex_array::Array::fixed_size_list_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::fixed_size_list_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::Array::len(&self) -> usize + +impl vortex_array::arrays::list::ListArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::len(&self) -> usize + +pub fn vortex_array::Array::list_data(&self) -> &vortex_array::arrays::list::ListData + +pub fn vortex_array::Array::list_elements_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::Array::list_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::list_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::Array::offset_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::sliced_elements(&self) -> vortex_error::VortexResult + +impl vortex_array::arrays::listview::ListViewArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::len(&self) -> usize + +pub fn vortex_array::Array::list_elements_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::Array::listview_data(&self) -> &vortex_array::arrays::listview::ListViewData + +pub fn vortex_array::Array::listview_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::listview_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::Array::offset_at(&self, index: usize) -> usize + +pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::size_at(&self, index: usize) -> usize + +pub fn vortex_array::Array::sizes(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::masked::MaskedArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::masked_data(&self) -> &vortex_array::arrays::masked::MaskedData + +pub fn vortex_array::Array::masked_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::Array::masked_len(&self) -> usize + +pub fn vortex_array::Array::masked_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::masked_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +impl vortex_array::arrays::patched::PatchedArrayExt for vortex_array::Array + +pub fn vortex_array::Array::base_array(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::lane_offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::lane_range(&self, chunk: usize, lane: usize) -> vortex_error::VortexResult> + +pub fn vortex_array::Array::n_lanes(&self) -> usize + +pub fn vortex_array::Array::offset(&self) -> usize + +pub fn vortex_array::Array::patch_indices(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::patch_values(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::patched_data(&self) -> &vortex_array::arrays::patched::PatchedData + +pub fn vortex_array::Array::patched_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::Array::patched_len(&self) -> usize + +pub fn vortex_array::Array::patched_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::slice_chunks(&self, chunks: core::ops::range::Range) -> vortex_error::VortexResult> + +impl vortex_array::arrays::primitive::PrimitiveArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::primitive_data(&self) -> &vortex_array::arrays::primitive::PrimitiveData + +pub fn vortex_array::Array::validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::Array::validity_mask(&self) -> vortex_mask::Mask + +impl vortex_array::arrays::shared::SharedArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::current_array_ref(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult + +pub async fn vortex_array::Array::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> + +pub fn vortex_array::Array::shared_data(&self) -> &vortex_array::arrays::shared::SharedData + +pub fn vortex_array::Array::shared_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::Array::shared_len(&self) -> usize + +pub fn vortex_array::Array::source(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::slice::SliceArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::slice_data(&self) -> &vortex_array::arrays::slice::SliceData + +pub fn vortex_array::Array::slice_len(&self) -> usize + +impl vortex_array::arrays::struct_::StructArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ + +pub fn vortex_array::Array::names(&self) -> &vortex_array::dtype::FieldNames + +pub fn vortex_array::Array::struct_data(&self) -> &vortex_array::arrays::struct_::StructData + +pub fn vortex_array::Array::struct_fields(&self) -> vortex_array::dtype::StructFields + +pub fn vortex_array::Array::struct_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::unmasked_field(&self, idx: usize) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> + +pub fn vortex_array::Array::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::Array::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> + +impl vortex_array::arrays::varbin::VarBinArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer + +pub fn vortex_array::Array::len(&self) -> usize + +pub fn vortex_array::Array::offset_at(&self, index: usize) -> usize + +pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::sliced_bytes(&self) -> vortex_buffer::ByteBuffer + +pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::Array::varbin_data(&self) -> &vortex_array::arrays::varbin::VarBinData + +pub fn vortex_array::Array::varbin_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::varbin_validity_mask(&self) -> vortex_mask::Mask + +impl vortex_array::arrays::varbinview::VarBinViewArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::varbinview_data(&self) -> &vortex_array::arrays::varbinview::VarBinViewData + +pub fn vortex_array::Array::varbinview_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::Array::varbinview_validity_mask(&self) -> vortex_mask::Mask + +impl vortex_array::arrays::variant::VariantArrayExt for vortex_array::Array + +pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::Array::variant_data(&self) -> &vortex_array::arrays::variant::VariantData + +pub fn vortex_array::Array::variant_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::Array::variant_len(&self) -> usize + impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::Array pub fn vortex_array::Array::from_iter>>(iter: T) -> Self @@ -21908,12 +22642,16 @@ pub vortex_array::ArrayParts::dtype: vortex_array::dtype::DType pub vortex_array::ArrayParts::len: usize +pub vortex_array::ArrayParts::slots: alloc::vec::Vec> + pub vortex_array::ArrayParts::vtable: V impl vortex_array::ArrayParts pub fn vortex_array::ArrayParts::new(vtable: V, dtype: vortex_array::dtype::DType, len: usize, data: ::ArrayData) -> Self +pub fn vortex_array::ArrayParts::with_slots(self, slots: alloc::vec::Vec>) -> Self + pub struct vortex_array::ArrayRef(_) impl vortex_array::ArrayRef @@ -22094,10 +22832,6 @@ impl core::convert::From for vorte pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::datetime::TemporalData) -> Self -impl core::convert::From for vortex_array::ArrayRef - -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::patched::PatchedArray) -> Self - impl core::convert::TryFrom<&vortex_array::ArrayRef> for arrow_array::record_batch::RecordBatch pub type arrow_array::record_batch::RecordBatch::Error = vortex_error::VortexError @@ -22384,6 +23118,136 @@ pub fn vortex_array::ArrayRef::from(value: vortex_array::Array) -> vortex_arr pub struct vortex_array::ArrayView<'a, V: vortex_array::VTable> +impl vortex_array::ArrayView<'_, vortex_array::arrays::Chunked> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk(&self, idx: usize) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk_offsets_array(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunks(&self) -> alloc::vec::Vec + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::iter_chunks(&self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + '_)> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::nchunks(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::non_empty_chunks(&self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + '_)> + +impl vortex_array::ArrayView<'_, vortex_array::arrays::Extension> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Extension>::storage_array(&self) -> &vortex_array::ArrayRef + +impl vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_elements_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::list_size(&self) -> u32 + +impl vortex_array::ArrayView<'_, vortex_array::arrays::List> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::element_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_elements_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::offset_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::sliced_elements(&self) -> vortex_error::VortexResult + +impl vortex_array::ArrayView<'_, vortex_array::arrays::ListView> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::list_elements_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::listview_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::listview_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::offset_at(&self, index: usize) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::size_at(&self, index: usize) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::sizes(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::verify_is_zero_copy_to_list(&self) -> bool + +impl vortex_array::ArrayView<'_, vortex_array::arrays::Struct> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::names(&self) -> &vortex_array::dtype::FieldNames + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::struct_fields(&self) -> vortex_array::dtype::StructFields + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::struct_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field(&self, idx: usize) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> + +impl vortex_array::ArrayView<'_, vortex_array::arrays::VarBin> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::offset_at(&self, index: usize) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::sliced_bytes(&self) -> vortex_buffer::ByteBuffer + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::varbin_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::varbin_validity_mask(&self) -> vortex_mask::Mask + +impl vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_validity_mask(&self) -> vortex_mask::Mask + +impl vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::codes(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::has_all_values_referenced(&self) -> bool + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::values(&self) -> &vortex_array::ArrayRef + +impl vortex_array::ArrayView<'_, vortex_array::arrays::scalar_fn::ScalarFnVTable> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::scalar_fn::ScalarFnVTable>::children(&self) -> alloc::vec::Vec + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::scalar_fn::ScalarFnVTable>::get_child(&self, idx: usize) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::scalar_fn::ScalarFnVTable>::iter_children(&self) -> impl core::iter::traits::iterator::Iterator + '_ + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::scalar_fn::ScalarFnVTable>::nchildren(&self) -> usize + impl<'a, V: vortex_array::VTable> vortex_array::ArrayView<'a, V> pub fn vortex_array::ArrayView<'a, V>::array(&self) -> &'a vortex_array::ArrayRef @@ -22400,10 +23264,294 @@ pub fn vortex_array::ArrayView<'a, V>::is_empty(&self) -> bool pub fn vortex_array::ArrayView<'a, V>::len(&self) -> usize +pub fn vortex_array::ArrayView<'a, V>::slots(&self) -> &'a [core::option::Option] + pub fn vortex_array::ArrayView<'a, V>::statistics(&self) -> vortex_array::stats::StatsSetRef<'_> pub fn vortex_array::ArrayView<'a, V>::validity(&self) -> vortex_error::VortexResult +impl vortex_array::arrays::chunked::ChunkedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Chunked> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk(&self, idx: usize) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk_offsets_array(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunked_data(&self) -> &vortex_array::arrays::chunked::ChunkedData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunked_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunked_len(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunks(&self) -> alloc::vec::Vec + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::find_chunk_idx(&self, index: usize) -> vortex_error::VortexResult<(usize, usize)> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::iter_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::nchunks(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::non_empty_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> + +impl vortex_array::arrays::decimal::DecimalArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Decimal> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::decimal_data(&self) -> &vortex_array::arrays::decimal::DecimalData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +impl vortex_array::arrays::dict::DictArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::codes(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::dict_data(&self) -> &vortex_array::arrays::dict::DictData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::has_all_values_referenced(&self) -> bool + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::values(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::extension::ExtensionArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Extension> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Extension>::extension_data(&self) -> &vortex_array::arrays::extension::ExtensionData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Extension>::storage_array(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::filter::FilterArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Filter> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::filter_data(&self) -> &vortex_array::arrays::filter::FilterData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::filter_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::filter_len(&self) -> usize + +impl vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_data(&self) -> &vortex_array::arrays::fixed_size_list::FixedSizeListData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::len(&self) -> usize + +impl vortex_array::arrays::list::ListArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::List> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::len(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_data(&self) -> &vortex_array::arrays::list::ListData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_elements_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::offset_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::sliced_elements(&self) -> vortex_error::VortexResult + +impl vortex_array::arrays::listview::ListViewArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::ListView> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::elements(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::len(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::list_elements_at(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::listview_data(&self) -> &vortex_array::arrays::listview::ListViewData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::listview_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::listview_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::offset_at(&self, index: usize) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::size_at(&self, index: usize) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::sizes(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::masked::MaskedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Masked> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_data(&self) -> &vortex_array::arrays::masked::MaskedData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_len(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_validity_mask(&self) -> vortex_mask::Mask + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +impl vortex_array::arrays::patched::PatchedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::base_array(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::lane_offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::lane_range(&self, chunk: usize, lane: usize) -> vortex_error::VortexResult> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::n_lanes(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::offset(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patch_indices(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patch_values(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_data(&self) -> &vortex_array::arrays::patched::PatchedData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_len(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::slice_chunks(&self, chunks: core::ops::range::Range) -> vortex_error::VortexResult> + +impl vortex_array::arrays::primitive::PrimitiveArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Primitive> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::primitive_data(&self) -> &vortex_array::arrays::primitive::PrimitiveData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::validity_mask(&self) -> vortex_mask::Mask + +impl vortex_array::arrays::shared::SharedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Shared> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::current_array_ref(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult + +pub async fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::shared_data(&self) -> &vortex_array::arrays::shared::SharedData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::shared_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::shared_len(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::source(&self) -> &vortex_array::ArrayRef + +impl vortex_array::arrays::slice::SliceArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::slice_data(&self) -> &vortex_array::arrays::slice::SliceData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::slice_len(&self) -> usize + +impl vortex_array::arrays::struct_::StructArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Struct> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::names(&self) -> &vortex_array::dtype::FieldNames + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::struct_data(&self) -> &vortex_array::arrays::struct_::StructData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::struct_fields(&self) -> vortex_array::dtype::StructFields + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::struct_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field(&self, idx: usize) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> + +impl vortex_array::arrays::varbin::VarBinArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::VarBin> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::len(&self) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::offset_at(&self, index: usize) -> usize + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::offsets(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::sliced_bytes(&self) -> vortex_buffer::ByteBuffer + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::varbin_data(&self) -> &vortex_array::arrays::varbin::VarBinData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::varbin_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::varbin_validity_mask(&self) -> vortex_mask::Mask + +impl vortex_array::arrays::varbinview::VarBinViewArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_data(&self) -> &vortex_array::arrays::varbinview::VarBinViewData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_validity(&self) -> vortex_array::validity::Validity + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_validity_mask(&self) -> vortex_mask::Mask + +impl vortex_array::arrays::variant::VariantArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Variant> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::as_slots(&self) -> &[core::option::Option] + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::variant_data(&self) -> &vortex_array::arrays::variant::VariantData + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::variant_dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::variant_len(&self) -> usize + impl core::clone::Clone for vortex_array::ArrayView<'_, V> pub fn vortex_array::ArrayView<'_, V>::clone(&self) -> Self @@ -22678,9 +23826,9 @@ pub type vortex_array::ArrayVTable::ValidityVTable: vortex_array::ValidityVTable pub fn vortex_array::ArrayVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::ArrayVTable::array_eq(array: &Self::ArrayData, other: &Self::ArrayData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::ArrayVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::ArrayVTable::array_hash(array: &Self::ArrayData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::ArrayVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::ArrayVTable::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -22690,7 +23838,7 @@ pub fn vortex_array::ArrayVTable::child(array: vortex_array::ArrayView<'_, Self> pub fn vortex_array::ArrayVTable::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::ArrayVTable::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::ArrayVTable::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::ArrayVTable::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22714,9 +23862,7 @@ pub fn vortex_array::ArrayVTable::slot_name(array: vortex_array::ArrayView<'_, S pub fn vortex_array::ArrayVTable::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::ArrayVTable::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::ArrayVTable::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::ArrayVTable::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Bool @@ -22728,9 +23874,9 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -22740,7 +23886,7 @@ pub fn vortex_array::arrays::Bool::child(array: vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Bool::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Bool::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Bool::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22764,9 +23910,7 @@ pub fn vortex_array::arrays::Bool::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Bool::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Bool::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Chunked @@ -22778,9 +23922,9 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: &vortex_array::arrays::chunked::ChunkedData, other: &vortex_array::arrays::chunked::ChunkedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: &vortex_array::arrays::chunked::ChunkedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -22790,7 +23934,7 @@ pub fn vortex_array::arrays::Chunked::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Chunked::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::deserialize(&self, dtype: &vortex_array::dtype::DType, _len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Chunked::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22812,11 +23956,9 @@ pub fn vortex_array::arrays::Chunked::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Chunked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Chunked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Chunked::validate(&self, data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Chunked::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::validate(&self, _data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Constant @@ -22828,9 +23970,9 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -22840,7 +23982,7 @@ pub fn vortex_array::arrays::Constant::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Constant::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::deserialize(&self, dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, _metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Constant::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22862,11 +24004,9 @@ pub fn vortex_array::arrays::Constant::serialize(_array: vortex_array::ArrayView pub fn vortex_array::arrays::Constant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Constant::with_slots(_array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Decimal @@ -22878,9 +24018,9 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -22890,7 +24030,7 @@ pub fn vortex_array::arrays::Decimal::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Decimal::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Decimal::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Decimal::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22914,9 +24054,7 @@ pub fn vortex_array::arrays::Decimal::slot_name(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Decimal::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Decimal::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Extension @@ -22928,9 +24066,9 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: &vortex_array::arrays::extension::ExtensionData, other: &vortex_array::arrays::extension::ExtensionData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: &vortex_array::arrays::extension::ExtensionData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -22940,7 +24078,7 @@ pub fn vortex_array::arrays::Extension::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Extension::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Extension::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Extension::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22964,9 +24102,7 @@ pub fn vortex_array::arrays::Extension::slot_name(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Extension::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Extension::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Filter @@ -22978,9 +24114,9 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -22990,7 +24126,7 @@ pub fn vortex_array::arrays::Filter::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Filter::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Filter::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23012,11 +24148,9 @@ pub fn vortex_array::arrays::Filter::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Filter::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Filter::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Filter::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::FixedSizeList @@ -23028,9 +24162,9 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23040,7 +24174,7 @@ pub fn vortex_array::arrays::FixedSizeList::child(array: vortex_array::ArrayView pub fn vortex_array::arrays::FixedSizeList::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::FixedSizeList::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeList::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23064,9 +24198,7 @@ pub fn vortex_array::arrays::FixedSizeList::slot_name(_array: vortex_array::Arra pub fn vortex_array::arrays::FixedSizeList::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::FixedSizeList::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::List @@ -23078,9 +24210,9 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: &vortex_array::arrays::list::ListData, other: &vortex_array::arrays::list::ListData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: &vortex_array::arrays::list::ListData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23090,7 +24222,7 @@ pub fn vortex_array::arrays::List::child(array: vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::List::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::List::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::List::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23114,9 +24246,7 @@ pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::List::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::ListView @@ -23128,9 +24258,9 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: &vortex_array::arrays::listview::ListViewData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23140,7 +24270,7 @@ pub fn vortex_array::arrays::ListView::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::ListView::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::ListView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListView::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23164,9 +24294,7 @@ pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::ListView::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Masked @@ -23178,9 +24306,9 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: &vortex_array::arrays::masked::MaskedData, other: &vortex_array::arrays::masked::MaskedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: &vortex_array::arrays::masked::MaskedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -23190,7 +24318,7 @@ pub fn vortex_array::arrays::Masked::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Masked::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Masked::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23212,11 +24340,9 @@ pub fn vortex_array::arrays::Masked::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Masked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Masked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Masked::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Primitive @@ -23228,9 +24354,9 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23240,7 +24366,7 @@ pub fn vortex_array::arrays::Primitive::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Primitive::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Primitive::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Primitive::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23264,9 +24390,7 @@ pub fn vortex_array::arrays::Primitive::slot_name(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Primitive::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Primitive::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Shared @@ -23278,9 +24402,9 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: &vortex_array::arrays::shared::SharedData, other: &vortex_array::arrays::shared::SharedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: &vortex_array::arrays::shared::SharedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -23290,7 +24414,7 @@ pub fn vortex_array::arrays::Shared::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Shared::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Shared::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23312,11 +24436,9 @@ pub fn vortex_array::arrays::Shared::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Shared::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Shared::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Shared::validate(&self, data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Shared::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::validate(&self, _data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Struct @@ -23328,9 +24450,9 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: &vortex_array::arrays::struct_::StructData, other: &vortex_array::arrays::struct_::StructData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: &vortex_array::arrays::struct_::StructData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23340,7 +24462,7 @@ pub fn vortex_array::arrays::Struct::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Struct::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Struct::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Struct::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23364,9 +24486,7 @@ pub fn vortex_array::arrays::Struct::slot_name(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::Struct::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Struct::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBin @@ -23378,9 +24498,9 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23390,7 +24510,7 @@ pub fn vortex_array::arrays::VarBin::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::VarBin::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBin::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBin::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23414,9 +24534,7 @@ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::VarBin::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBinView @@ -23428,9 +24546,9 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23440,7 +24558,7 @@ pub fn vortex_array::arrays::VarBinView::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::VarBinView::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBinView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinView::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23464,9 +24582,7 @@ pub fn vortex_array::arrays::VarBinView::slot_name(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::VarBinView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::VarBinView::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Variant @@ -23478,9 +24594,9 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: &vortex_array::arrays::variant::VariantData, other: &vortex_array::arrays::variant::VariantData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: &vortex_array::arrays::variant::VariantData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23490,7 +24606,7 @@ pub fn vortex_array::arrays::Variant::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Variant::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Variant::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23512,11 +24628,9 @@ pub fn vortex_array::arrays::Variant::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Variant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Variant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Variant::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::dict::Dict @@ -23528,9 +24642,9 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::arrays::dict::DictData, other: &vortex_array::arrays::dict::DictData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::arrays::dict::DictData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23540,7 +24654,7 @@ pub fn vortex_array::arrays::dict::Dict::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::dict::Dict::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::dict::Dict::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::Dict::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23564,9 +24678,7 @@ pub fn vortex_array::arrays::dict::Dict::slot_name(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::dict::Dict::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::dict::Dict::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::null::Null @@ -23578,9 +24690,9 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_array: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(_array: vortex_array::ArrayView<'_, Self>, _other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(_array: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(_array: vortex_array::ArrayView<'_, Self>, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23590,7 +24702,7 @@ pub fn vortex_array::arrays::null::Null::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::null::Null::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::Null::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23612,15 +24724,13 @@ pub fn vortex_array::arrays::null::Null::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::null::Null::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::null::Null::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::null::Null::with_slots(_array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::patched::Patched -pub type vortex_array::arrays::patched::Patched::ArrayData = vortex_array::arrays::patched::PatchedArray +pub type vortex_array::arrays::patched::Patched::ArrayData = vortex_array::arrays::patched::PatchedData pub type vortex_array::arrays::patched::Patched::OperationsVTable = vortex_array::arrays::patched::Patched @@ -23628,9 +24738,9 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(array: &vortex_array::arrays::patched::PatchedArray, other: &vortex_array::arrays::patched::PatchedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::patched::Patched::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::patched::Patched::array_hash(array: &vortex_array::arrays::patched::PatchedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::patched::Patched::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23640,7 +24750,7 @@ pub fn vortex_array::arrays::patched::Patched::child(array: vortex_array::ArrayV pub fn vortex_array::arrays::patched::Patched::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::patched::Patched::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::patched::Patched::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::patched::Patched::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23664,9 +24774,7 @@ pub fn vortex_array::arrays::patched::Patched::slot_name(_array: vortex_array::A pub fn vortex_array::arrays::patched::Patched::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedArray, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::patched::Patched::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::scalar_fn::ScalarFnVTable @@ -23678,9 +24786,9 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23690,7 +24798,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child(array: vortex_arra pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23714,9 +24822,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(array: vortex_ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::slice::Slice @@ -23728,9 +24834,9 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: &vortex_array::arrays::slice::SliceData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -23740,7 +24846,7 @@ pub fn vortex_array::arrays::slice::Slice::child(array: vortex_array::ArrayView< pub fn vortex_array::arrays::slice::Slice::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::Slice::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23762,11 +24868,9 @@ pub fn vortex_array::arrays::slice::Slice::serialize(_array: vortex_array::Array pub fn vortex_array::arrays::slice::Slice::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::slice::Slice::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> pub trait vortex_array::DeserializeMetadata where Self: core::marker::Sized @@ -23944,10 +25048,6 @@ impl vortex_array::IntoArray for vortex_array::arrays::datetime::TemporalData pub fn vortex_array::arrays::datetime::TemporalData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::patched::PatchedArray - -pub fn vortex_array::arrays::patched::PatchedArray::into_array(self) -> vortex_array::ArrayRef - impl vortex_array::IntoArray for vortex_buffer::bit::buf::BitBuffer pub fn vortex_buffer::bit::buf::BitBuffer::into_array(self) -> vortex_array::ArrayRef @@ -24142,9 +25242,9 @@ pub type vortex_array::VTable::ValidityVTable: vortex_array::ValidityVTable, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::VTable::array_eq(array: &Self::ArrayData, other: &Self::ArrayData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::VTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::VTable::array_hash(array: &Self::ArrayData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::VTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::VTable::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24154,7 +25254,7 @@ pub fn vortex_array::VTable::child(array: vortex_array::ArrayView<'_, Self>, idx pub fn vortex_array::VTable::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::VTable::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::VTable::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::VTable::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24178,9 +25278,7 @@ pub fn vortex_array::VTable::slot_name(array: vortex_array::ArrayView<'_, Self>, pub fn vortex_array::VTable::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::VTable::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::VTable::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::VTable::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Bool @@ -24192,9 +25290,9 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24204,7 +25302,7 @@ pub fn vortex_array::arrays::Bool::child(array: vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Bool::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Bool::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Bool::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24228,9 +25326,7 @@ pub fn vortex_array::arrays::Bool::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Bool::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Bool::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Chunked @@ -24242,9 +25338,9 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: &vortex_array::arrays::chunked::ChunkedData, other: &vortex_array::arrays::chunked::ChunkedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: &vortex_array::arrays::chunked::ChunkedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24254,7 +25350,7 @@ pub fn vortex_array::arrays::Chunked::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Chunked::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::deserialize(&self, dtype: &vortex_array::dtype::DType, _len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Chunked::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24276,11 +25372,9 @@ pub fn vortex_array::arrays::Chunked::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Chunked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Chunked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Chunked::validate(&self, data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Chunked::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::validate(&self, _data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Constant @@ -24292,9 +25386,9 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24304,7 +25398,7 @@ pub fn vortex_array::arrays::Constant::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Constant::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::deserialize(&self, dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, _metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Constant::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24326,11 +25420,9 @@ pub fn vortex_array::arrays::Constant::serialize(_array: vortex_array::ArrayView pub fn vortex_array::arrays::Constant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Constant::with_slots(_array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Decimal @@ -24342,9 +25434,9 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24354,7 +25446,7 @@ pub fn vortex_array::arrays::Decimal::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Decimal::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Decimal::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Decimal::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24378,9 +25470,7 @@ pub fn vortex_array::arrays::Decimal::slot_name(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Decimal::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Decimal::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Extension @@ -24392,9 +25482,9 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: &vortex_array::arrays::extension::ExtensionData, other: &vortex_array::arrays::extension::ExtensionData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: &vortex_array::arrays::extension::ExtensionData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24404,7 +25494,7 @@ pub fn vortex_array::arrays::Extension::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Extension::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Extension::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Extension::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24428,9 +25518,7 @@ pub fn vortex_array::arrays::Extension::slot_name(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Extension::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Extension::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Filter @@ -24442,9 +25530,9 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -24454,7 +25542,7 @@ pub fn vortex_array::arrays::Filter::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Filter::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Filter::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24476,11 +25564,9 @@ pub fn vortex_array::arrays::Filter::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Filter::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Filter::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Filter::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::FixedSizeList @@ -24492,9 +25578,9 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24504,7 +25590,7 @@ pub fn vortex_array::arrays::FixedSizeList::child(array: vortex_array::ArrayView pub fn vortex_array::arrays::FixedSizeList::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::FixedSizeList::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeList::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24528,9 +25614,7 @@ pub fn vortex_array::arrays::FixedSizeList::slot_name(_array: vortex_array::Arra pub fn vortex_array::arrays::FixedSizeList::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::FixedSizeList::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::List @@ -24542,9 +25626,9 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: &vortex_array::arrays::list::ListData, other: &vortex_array::arrays::list::ListData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: &vortex_array::arrays::list::ListData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24554,7 +25638,7 @@ pub fn vortex_array::arrays::List::child(array: vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::List::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::List::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::List::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24578,9 +25662,7 @@ pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::List::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::ListView @@ -24592,9 +25674,9 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: &vortex_array::arrays::listview::ListViewData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24604,7 +25686,7 @@ pub fn vortex_array::arrays::ListView::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::ListView::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::ListView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListView::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24628,9 +25710,7 @@ pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::ListView::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Masked @@ -24642,9 +25722,9 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: &vortex_array::arrays::masked::MaskedData, other: &vortex_array::arrays::masked::MaskedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: &vortex_array::arrays::masked::MaskedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -24654,7 +25734,7 @@ pub fn vortex_array::arrays::Masked::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Masked::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Masked::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24676,11 +25756,9 @@ pub fn vortex_array::arrays::Masked::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Masked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Masked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Masked::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Primitive @@ -24692,9 +25770,9 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24704,7 +25782,7 @@ pub fn vortex_array::arrays::Primitive::child(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Primitive::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Primitive::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Primitive::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24728,9 +25806,7 @@ pub fn vortex_array::arrays::Primitive::slot_name(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Primitive::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Primitive::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Shared @@ -24742,9 +25818,9 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: &vortex_array::arrays::shared::SharedData, other: &vortex_array::arrays::shared::SharedData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: &vortex_array::arrays::shared::SharedData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -24754,7 +25830,7 @@ pub fn vortex_array::arrays::Shared::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Shared::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Shared::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24776,11 +25852,9 @@ pub fn vortex_array::arrays::Shared::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Shared::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Shared::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Shared::validate(&self, data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Shared::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::validate(&self, _data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Struct @@ -24792,9 +25866,9 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: &vortex_array::arrays::struct_::StructData, other: &vortex_array::arrays::struct_::StructData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: &vortex_array::arrays::struct_::StructData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24804,7 +25878,7 @@ pub fn vortex_array::arrays::Struct::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Struct::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Struct::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Struct::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24828,9 +25902,7 @@ pub fn vortex_array::arrays::Struct::slot_name(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::Struct::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Struct::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBin @@ -24842,9 +25914,9 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24854,7 +25926,7 @@ pub fn vortex_array::arrays::VarBin::child(array: vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::VarBin::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBin::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBin::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24878,9 +25950,7 @@ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::VarBin::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBinView @@ -24892,9 +25962,9 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24904,7 +25974,7 @@ pub fn vortex_array::arrays::VarBinView::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::VarBinView::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBinView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinView::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24928,9 +25998,7 @@ pub fn vortex_array::arrays::VarBinView::slot_name(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::VarBinView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::VarBinView::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Variant @@ -24942,9 +26010,9 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: &vortex_array::arrays::variant::VariantData, other: &vortex_array::arrays::variant::VariantData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: &vortex_array::arrays::variant::VariantData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24954,7 +26022,7 @@ pub fn vortex_array::arrays::Variant::child(array: vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::Variant::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Variant::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -24976,11 +26044,9 @@ pub fn vortex_array::arrays::Variant::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Variant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::Variant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::Variant::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::dict::Dict @@ -24992,9 +26058,9 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::arrays::dict::DictData, other: &vortex_array::arrays::dict::DictData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::arrays::dict::DictData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25004,7 +26070,7 @@ pub fn vortex_array::arrays::dict::Dict::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::dict::Dict::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::dict::Dict::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::Dict::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -25028,9 +26094,7 @@ pub fn vortex_array::arrays::dict::Dict::slot_name(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::dict::Dict::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::dict::Dict::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::null::Null @@ -25042,9 +26106,9 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_array: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(_array: vortex_array::ArrayView<'_, Self>, _other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(_array: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(_array: vortex_array::ArrayView<'_, Self>, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25054,7 +26118,7 @@ pub fn vortex_array::arrays::null::Null::child(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::null::Null::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::Null::execute(array: vortex_array::Array, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -25076,15 +26140,13 @@ pub fn vortex_array::arrays::null::Null::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::null::Null::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] +pub fn vortex_array::arrays::null::Null::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::null::Null::with_slots(_array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::patched::Patched -pub type vortex_array::arrays::patched::Patched::ArrayData = vortex_array::arrays::patched::PatchedArray +pub type vortex_array::arrays::patched::Patched::ArrayData = vortex_array::arrays::patched::PatchedData pub type vortex_array::arrays::patched::Patched::OperationsVTable = vortex_array::arrays::patched::Patched @@ -25092,9 +26154,9 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(array: &vortex_array::arrays::patched::PatchedArray, other: &vortex_array::arrays::patched::PatchedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::patched::Patched::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::patched::Patched::array_hash(array: &vortex_array::arrays::patched::PatchedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::patched::Patched::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25104,7 +26166,7 @@ pub fn vortex_array::arrays::patched::Patched::child(array: vortex_array::ArrayV pub fn vortex_array::arrays::patched::Patched::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::patched::Patched::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::patched::Patched::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::patched::Patched::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -25128,9 +26190,7 @@ pub fn vortex_array::arrays::patched::Patched::slot_name(_array: vortex_array::A pub fn vortex_array::arrays::patched::Patched::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedArray, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::patched::Patched::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::scalar_fn::ScalarFnVTable @@ -25142,9 +26202,9 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25154,7 +26214,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child(array: vortex_arra pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -25178,9 +26238,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(array: vortex_ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::slice::Slice @@ -25192,9 +26250,9 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: &vortex_array::arrays::slice::SliceData, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -25204,7 +26262,7 @@ pub fn vortex_array::arrays::slice::Slice::child(array: vortex_array::ArrayView< pub fn vortex_array::arrays::slice::Slice::child_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::deserialize(&self, _dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::Slice::execute(array: vortex_array::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -25226,23 +26284,21 @@ pub fn vortex_array::arrays::slice::Slice::serialize(_array: vortex_array::Array pub fn vortex_array::arrays::slice::Slice::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] -pub fn vortex_array::arrays::slice::Slice::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> pub trait vortex_array::ValidityChild -pub fn vortex_array::ValidityChild::validity_child(array: &::ArrayData) -> &vortex_array::ArrayRef +pub fn vortex_array::ValidityChild::validity_child(array: vortex_array::ArrayView<'_, V>) -> vortex_array::ArrayRef impl vortex_array::ValidityChild for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::validity_child(array: &vortex_array::arrays::extension::ExtensionData) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::Extension::validity_child(array: vortex_array::ArrayView<'_, vortex_array::arrays::Extension>) -> vortex_array::ArrayRef impl vortex_array::ValidityChild for vortex_array::arrays::patched::Patched -pub fn vortex_array::arrays::patched::Patched::validity_child(array: &vortex_array::arrays::patched::PatchedArray) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::patched::Patched::validity_child(array: vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>) -> vortex_array::ArrayRef pub trait vortex_array::ValidityChildSliceHelper diff --git a/vortex-array/src/array/erased.rs b/vortex-array/src/array/erased.rs index f34dda91e03..b59074a08c6 100644 --- a/vortex-array/src/array/erased.rs +++ b/vortex-array/src/array/erased.rs @@ -350,7 +350,7 @@ impl ArrayRef { /// Returns a reference to the typed `ArrayInner` if this array matches the given vtable type. pub fn as_typed(&self) -> Option> { let inner = self.0.as_any().downcast_ref::>()?; - Some(unsafe { ArrayView::new_unchecked(self, &inner.data, &inner.slots) }) + Some(unsafe { ArrayView::new_unchecked(self, &inner.data) }) } /// Returns the constant scalar if this is a constant array. @@ -385,16 +385,37 @@ impl ArrayRef { /// Returns a new array with the slot at `slot_idx` replaced by `replacement`. /// + /// This is only valid for physical rewrites: the replacement must have the same logical + /// `DType` and `len` as the existing slot. + /// /// Takes ownership to allow in-place mutation when the refcount is 1. pub fn with_slot(self, slot_idx: usize, replacement: ArrayRef) -> VortexResult { - let nslots = self.slots().len(); + let slots = self.slots(); + let nslots = slots.len(); vortex_ensure!( slot_idx < nslots, "slot index {} out of bounds for array with {} slots", slot_idx, nslots ); - let mut slots = self.slots().to_vec(); + let existing = slots[slot_idx] + .as_ref() + .vortex_expect("with_slot cannot replace an absent slot"); + vortex_ensure!( + existing.dtype() == replacement.dtype(), + "slot {} dtype changed from {} to {} during physical rewrite", + slot_idx, + existing.dtype(), + replacement.dtype() + ); + vortex_ensure!( + existing.len() == replacement.len(), + "slot {} len changed from {} to {} during physical rewrite", + slot_idx, + existing.len(), + replacement.len() + ); + let mut slots = slots; slots[slot_idx] = Some(replacement); let vtable = self.vtable().clone_boxed(); vtable.with_slots(self, slots) @@ -517,6 +538,6 @@ impl Matcher for V { fn try_match<'a>(array: &'a ArrayRef) -> Option> { let inner = array.0.as_any().downcast_ref::>()?; - Some(unsafe { ArrayView::new_unchecked(array, &inner.data, &inner.slots) }) + Some(unsafe { ArrayView::new_unchecked(array, &inner.data) }) } } diff --git a/vortex-array/src/array/mod.rs b/vortex-array/src/array/mod.rs index 9534255aebf..2cfd5325c2e 100644 --- a/vortex-array/src/array/mod.rs +++ b/vortex-array/src/array/mod.rs @@ -175,7 +175,7 @@ impl DynArray for ArrayInner { } fn scalar_at(&self, this: &ArrayRef, index: usize) -> VortexResult { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; >::scalar_at( view, index, @@ -185,7 +185,7 @@ impl DynArray for ArrayInner { fn validity(&self, this: &ArrayRef) -> VortexResult { if self.dtype.is_nullable() { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; let validity = >::validity(view)?; if let Validity::Array(array) = &validity { vortex_ensure!(array.len() == self.len, "Validity array length mismatch"); @@ -216,7 +216,7 @@ impl DynArray for ArrayInner { } let len = builder.len(); - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; V::append_to_builder(view, builder, ctx)?; assert_eq!( @@ -233,29 +233,29 @@ impl DynArray for ArrayInner { } fn children(&self, this: &ArrayRef) -> Vec { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; (0..V::nchildren(view)).map(|i| V::child(view, i)).collect() } fn nchildren(&self, this: &ArrayRef) -> usize { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; V::nchildren(view) } fn nth_child(&self, this: &ArrayRef, idx: usize) -> Option { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; (idx < V::nchildren(view)).then(|| V::child(view, idx)) } fn children_names(&self, this: &ArrayRef) -> Vec { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; (0..V::nchildren(view)) .map(|i| V::child_name(view, i)) .collect() } fn named_children(&self, this: &ArrayRef) -> Vec<(String, ArrayRef)> { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; (0..V::nchildren(view)) .map(|i| (V::child_name(view, i), V::child(view, i))) .collect() @@ -266,48 +266,48 @@ impl DynArray for ArrayInner { } fn slot_name(&self, this: &ArrayRef, idx: usize) -> String { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; V::slot_name(view, idx) } fn buffers(&self, this: &ArrayRef) -> Vec { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; (0..V::nbuffers(view)) .map(|i| V::buffer(view, i).to_host_sync()) .collect() } fn buffer_handles(&self, this: &ArrayRef) -> Vec { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; (0..V::nbuffers(view)).map(|i| V::buffer(view, i)).collect() } fn buffer_names(&self, this: &ArrayRef) -> Vec { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; (0..V::nbuffers(view)) .filter_map(|i| V::buffer_name(view, i)) .collect() } fn named_buffers(&self, this: &ArrayRef) -> Vec<(String, BufferHandle)> { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; (0..V::nbuffers(view)) .filter_map(|i| V::buffer_name(view, i).map(|name| (name, V::buffer(view, i)))) .collect() } fn nbuffers(&self, this: &ArrayRef) -> usize { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; V::nbuffers(view) } fn metadata(&self, this: &ArrayRef) -> VortexResult>> { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; V::serialize(view) } fn metadata_fmt(&self, this: &ArrayRef, f: &mut Formatter<'_>) -> std::fmt::Result { - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; V::fmt_metadata(view, f) } @@ -316,7 +316,7 @@ impl DynArray for ArrayInner { self.len.hash(&mut wrapper); self.dtype.hash(&mut wrapper); self.vtable.id().hash(&mut wrapper); - let view = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; V::array_hash(view, &mut wrapper, precision); } @@ -326,9 +326,9 @@ impl DynArray for ArrayInner { && self.dtype == *other.dtype() && self.vtable.id() == other.encoding_id() && { - let this = unsafe { ArrayView::new_unchecked(this, &self.data, &self.slots) }; + let this = unsafe { ArrayView::new_unchecked(this, &self.data) }; let other = unsafe { - ArrayView::new_unchecked(other, &other_inner.data, &other_inner.slots) + ArrayView::new_unchecked(other, &other_inner.data) }; V::array_eq(this, other, precision) } diff --git a/vortex-array/src/array/typed.rs b/vortex-array/src/array/typed.rs index dfb3dfdca08..ac99da335da 100644 --- a/vortex-array/src/array/typed.rs +++ b/vortex-array/src/array/typed.rs @@ -73,10 +73,7 @@ pub(crate) struct ArrayInner { impl ArrayInner { /// Create a new inner array from explicit construction parameters. #[doc(hidden)] - pub fn try_new(mut new: ArrayParts) -> VortexResult { - if new.slots.is_empty() { - new.slots = V::infer_slots(&new.data); - } + pub fn try_new(new: ArrayParts) -> VortexResult { new.vtable.validate(&new.data, &new.dtype, new.len, &new.slots)?; Ok(unsafe { Self::from_data_unchecked( @@ -196,18 +193,13 @@ impl Array { /// Caller must ensure the provided parts are logically consistent. #[doc(hidden)] pub unsafe fn from_parts_unchecked(new: ArrayParts) -> Self { - let slots = if new.slots.is_empty() { - V::infer_slots(&new.data) - } else { - new.slots - }; let inner = ArrayRef::from_inner(Arc::new(unsafe { ArrayInner::::from_data_unchecked( new.vtable, new.dtype, new.len, new.data, - slots, + new.slots, ArrayStats::default(), ) })); @@ -308,7 +300,7 @@ impl Array { pub fn as_view(&self) -> ArrayView<'_, V> { let inner = self.downcast_inner(); // SAFETY: `inner.data` is the `V::ArrayData` stored inside `self.inner`. - unsafe { ArrayView::new_unchecked(&self.inner, &inner.data, &inner.slots) } + unsafe { ArrayView::new_unchecked(&self.inner, &inner.data) } } /// Downcast the inner `ArrayRef` to `&ArrayInner`. diff --git a/vortex-array/src/array/view.rs b/vortex-array/src/array/view.rs index ccb39a47ed6..789f551b097 100644 --- a/vortex-array/src/array/view.rs +++ b/vortex-array/src/array/view.rs @@ -10,6 +10,7 @@ use vortex_error::VortexResult; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayId; +use crate::array::ArrayInner; use crate::array::VTable; use crate::dtype::DType; use crate::stats::StatsSetRef; @@ -19,7 +20,6 @@ use crate::validity::Validity; pub struct ArrayView<'a, V: VTable> { array: &'a ArrayRef, data: &'a V::ArrayData, - slots: &'a [Option], } impl Copy for ArrayView<'_, V> {} @@ -36,10 +36,9 @@ impl<'a, V: VTable> ArrayView<'a, V> { pub(crate) unsafe fn new_unchecked( array: &'a ArrayRef, data: &'a V::ArrayData, - slots: &'a [Option], ) -> Self { debug_assert!(array.is::()); - Self { array, data, slots } + Self { array, data } } pub fn array(&self) -> &'a ArrayRef { @@ -51,7 +50,13 @@ impl<'a, V: VTable> ArrayView<'a, V> { } pub fn slots(&self) -> &'a [Option] { - self.slots + &self + .array + .inner() + .as_any() + .downcast_ref::>() + .expect("ArrayView slots requested for mismatched array type") + .slots } pub fn dtype(&self) -> &DType { diff --git a/vortex-array/src/array/vtable/dyn_.rs b/vortex-array/src/array/vtable/dyn_.rs index 3118b862fd2..656f7eba6fa 100644 --- a/vortex-array/src/array/vtable/dyn_.rs +++ b/vortex-array/src/array/vtable/dyn_.rs @@ -44,6 +44,9 @@ pub trait DynVTable: 'static + Send + Sync + Debug { ) -> VortexResult; /// Rebuilds the array with the provided outer slots. + /// + /// This is only for physical rewrites of existing slots. Slot count, presence, logical dtype, + /// and logical len must remain unchanged. fn with_slots(&self, array: ArrayRef, slots: Vec>) -> VortexResult; /// See [`VTable::reduce`] @@ -85,12 +88,43 @@ impl DynVTable for V { children: &dyn ArrayChildren, session: &VortexSession, ) -> VortexResult { - let inner = self.deserialize(dtype, len, metadata, buffers, children, session)?; - Ok(Array::::try_from_parts(ArrayParts::new(self.clone(), dtype.clone(), len, inner))? - .into_array()) + Ok(Array::::try_from_parts( + self.deserialize(dtype, len, metadata, buffers, children, session)?, + )? + .into_array()) } fn with_slots(&self, array: ArrayRef, slots: Vec>) -> VortexResult { + let old_slots = array.slots(); + vortex_ensure!( + old_slots.len() == slots.len(), + "slot count changed from {} to {} during physical rewrite", + old_slots.len(), + slots.len() + ); + for (idx, (old_slot, new_slot)) in old_slots.iter().zip(slots.iter()).enumerate() { + vortex_ensure!( + old_slot.is_some() == new_slot.is_some(), + "slot {} presence changed during physical rewrite", + idx + ); + if let (Some(old_slot), Some(new_slot)) = (old_slot.as_ref(), new_slot.as_ref()) { + vortex_ensure!( + old_slot.dtype() == new_slot.dtype(), + "slot {} dtype changed from {} to {} during physical rewrite", + idx, + old_slot.dtype(), + new_slot.dtype() + ); + vortex_ensure!( + old_slot.len() == new_slot.len(), + "slot {} len changed from {} to {} during physical rewrite", + idx, + old_slot.len(), + new_slot.len() + ); + } + } let typed = array .as_opt::() .vortex_expect("Failed to downcast array"); diff --git a/vortex-array/src/array/vtable/mod.rs b/vortex-array/src/array/vtable/mod.rs index 0853b64f16d..c48fb26389f 100644 --- a/vortex-array/src/array/vtable/mod.rs +++ b/vortex-array/src/array/vtable/mod.rs @@ -69,12 +69,6 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { slots: &[Option], ) -> VortexResult<()>; - /// Temporary migration hook for encodings that still store slot state inside `ArrayData`. - fn infer_slots(data: &Self::ArrayData) -> Vec> { - _ = data; - Vec::new() - } - /// Hashes the array contents. fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision); @@ -155,7 +149,7 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { buffers: &[BufferHandle], children: &dyn ArrayChildren, session: &VortexSession, - ) -> VortexResult; + ) -> VortexResult>; /// Writes the array into a canonical builder. fn append_to_builder( @@ -185,8 +179,6 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { /// The backing storage is a `Vec` (rather than a fixed-size array) so that it can be /// moved out of an `ArrayData` into the concrete `Array` type during deserialization /// without copying. - /// - /// TODO: once no encodings rely on `infer_slots`, replace it with direct outer storage only. fn slots<'a>(array: ArrayView<'a, Self>) -> &'a [Option] { array.slots() } diff --git a/vortex-array/src/array/vtable/validity.rs b/vortex-array/src/array/vtable/validity.rs index 02eac298f46..350ef5d3ab7 100644 --- a/vortex-array/src/array/vtable/validity.rs +++ b/vortex-array/src/array/vtable/validity.rs @@ -44,7 +44,7 @@ where pub struct ValidityVTableFromChild; pub trait ValidityChild { - fn validity_child(array: &V::ArrayData) -> &ArrayRef; + fn validity_child(array: ArrayView<'_, V>) -> ArrayRef; } impl ValidityVTable for ValidityVTableFromChild @@ -52,7 +52,7 @@ where V: ValidityChild, { fn validity(array: ArrayView<'_, V>) -> VortexResult { - V::validity_child(array.data()).validity() + V::validity_child(array).validity() } } diff --git a/vortex-array/src/arrays/bool/array.rs b/vortex-array/src/arrays/bool/array.rs index e66deb32cc1..a0824b8cd3a 100644 --- a/vortex-array/src/arrays/bool/array.rs +++ b/vortex-array/src/arrays/bool/array.rs @@ -13,13 +13,13 @@ use crate::ArrayRef; use crate::IntoArray; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::Bool; use crate::arrays::BoolArray; use crate::buffer::BufferHandle; use crate::dtype::DType; -use crate::dtype::Nullability; use crate::validity::Validity; /// The validity bitmap indicating which elements are non-null. @@ -61,9 +61,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["validity"]; /// ``` #[derive(Clone, Debug)] pub struct BoolData { - /// Child arrays stored as slots. See [`VTable::slots`] for design rationale. - pub(super) slots: Vec>, - pub(super) nullability: Nullability, pub(super) bits: BufferHandle, pub(super) offset: usize, pub(super) len: usize, @@ -73,7 +70,84 @@ pub struct BoolDataParts { pub bits: BufferHandle, pub offset: usize, pub len: usize, - pub validity: Validity, +} + +pub trait BoolArrayExt { + fn bool_data(&self) -> &BoolData; + fn as_slots(&self) -> &[Option]; + fn dtype(&self) -> &DType; + + fn nullability(&self) -> crate::dtype::Nullability { + match self.dtype() { + DType::Bool(nullability) => *nullability, + _ => unreachable!("BoolArrayExt requires a bool dtype"), + } + } + + fn validity_child(&self) -> Option<&ArrayRef> { + self.as_slots()[VALIDITY_SLOT].as_ref() + } + + fn validity(&self) -> Validity { + child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.nullability()) + } + + fn bool_validity_mask(&self) -> Mask { + self.validity().to_mask(self.bool_data().len) + } + + fn maybe_to_mask(&self) -> VortexResult> { + let all_valid = match &self.validity() { + Validity::NonNullable | Validity::AllValid => true, + Validity::AllInvalid => false, + Validity::Array(a) => a.statistics().compute_min::().unwrap_or(false), + }; + Ok(all_valid.then(|| Mask::from_buffer(self.bool_data().to_bit_buffer()))) + } + + fn to_mask(&self) -> Mask { + self.maybe_to_mask() + .vortex_expect("failed to check validity") + .vortex_expect("cannot convert nullable boolean array to mask") + } + + fn to_mask_fill_null_false(&self) -> Mask { + let validity_mask = self.bool_validity_mask(); + let buffer = match validity_mask { + Mask::AllTrue(_) => self.bool_data().to_bit_buffer(), + Mask::AllFalse(_) => return Mask::new_false(self.bool_data().len), + Mask::Values(validity) => validity.bit_buffer() & self.bool_data().to_bit_buffer(), + }; + Mask::from_buffer(buffer) + } +} + +impl BoolArrayExt for Array { + fn bool_data(&self) -> &BoolData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } + + fn dtype(&self) -> &DType { + Array::dtype(self) + } +} + +impl BoolArrayExt for ArrayView<'_, Bool> { + fn bool_data(&self) -> &BoolData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } + + fn dtype(&self) -> &DType { + ArrayView::dtype(self) + } } /// Field accessors and non-consuming methods on the inner bool data. @@ -83,27 +157,11 @@ impl BoolData { self.len } - /// Returns the [`DType`] of this array. - pub fn dtype(&self) -> DType { - DType::Bool(self.nullability) - } - /// Returns `true` if this array is empty. pub fn is_empty(&self) -> bool { self.len() == 0 } - /// Returns the [`Validity`] of this array. - #[allow(clippy::same_name_method)] - pub fn validity(&self) -> Validity { - child_to_validity(&self.slots[VALIDITY_SLOT], self.nullability) - } - - /// Returns the validity as a [`Mask`]. - pub fn validity_mask(&self) -> Mask { - self.validity().to_mask(self.len()) - } - /// Returns the underlying [`BitBuffer`] of the array. pub fn to_bit_buffer(&self) -> BitBuffer { let buffer = self.bits.as_host().clone(); @@ -119,42 +177,14 @@ impl BoolData { /// Splits into owned parts #[inline] pub fn into_parts(self) -> BoolDataParts { - let validity = self.validity(); BoolDataParts { bits: self.bits, offset: self.offset, len: self.len, - validity, } } - pub fn to_mask(&self) -> Mask { - self.maybe_to_mask() - .vortex_expect("failed to check validity") - .vortex_expect("cannot convert nullable boolean array to mask") - } - - pub fn maybe_to_mask(&self) -> VortexResult> { - let validity = self.validity(); - let all_valid = match &validity { - Validity::NonNullable | Validity::AllValid => true, - Validity::AllInvalid => false, - Validity::Array(a) => a.statistics().compute_min::().unwrap_or(false), - }; - Ok(all_valid.then(|| Mask::from_buffer(self.to_bit_buffer()))) - } - - pub fn to_mask_fill_null_false(&self) -> Mask { - let validity_mask = self.validity_mask(); - let buffer = match validity_mask { - Mask::AllTrue(_) => self.to_bit_buffer(), - Mask::AllFalse(_) => return Mask::new_false(self.len()), - Mask::Values(validity) => validity.bit_buffer() & self.to_bit_buffer(), - }; - Mask::from_buffer(buffer) - } - - fn make_slots(validity: &Validity, len: usize) -> Vec> { + pub(crate) fn make_slots(validity: &Validity, len: usize) -> Vec> { vec![validity_to_child(validity, len)] } } @@ -188,8 +218,11 @@ impl Array { pub fn try_new(bits: BitBuffer, validity: Validity) -> VortexResult { let dtype = DType::Bool(validity.nullability()); let len = bits.len(); + let slots = BoolData::make_slots(&validity, len); let data = BoolData::try_new(bits, validity)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Bool, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(Bool, dtype, len, data).with_slots(slots)) + }) } /// Build a new bool array from a `BufferHandle`, returning an error if the offset is @@ -201,8 +234,11 @@ impl Array { validity: Validity, ) -> VortexResult { let dtype = DType::Bool(validity.nullability()); + let slots = BoolData::make_slots(&validity, len); let data = BoolData::try_new_from_handle(bits, offset, len, validity)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Bool, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(Bool, dtype, len, data).with_slots(slots)) + }) } /// Creates a new [`BoolArray`] without validation. @@ -213,9 +249,12 @@ impl Array { pub unsafe fn new_unchecked(bits: BitBuffer, validity: Validity) -> Self { let dtype = DType::Bool(validity.nullability()); let len = bits.len(); + let slots = BoolData::make_slots(&validity, len); // SAFETY: caller guarantees validity length equals bit buffer length. let data = unsafe { BoolData::new_unchecked(bits, validity) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(Bool, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Bool, dtype, len, data).with_slots(slots)) + } } /// Validates the components that would be used to create a [`BoolArray`]. @@ -240,6 +279,17 @@ impl Array { pub fn into_bit_buffer(self) -> BitBuffer { self.into_data().into_bit_buffer() } + pub fn maybe_to_mask(&self) -> VortexResult> { + BoolArrayExt::maybe_to_mask(self) + } + + pub fn to_mask(&self) -> Mask { + BoolArrayExt::to_mask(self) + } + + pub fn to_mask_fill_null_false(&self) -> Mask { + BoolArrayExt::to_mask_fill_null_false(self) + } } /// Internal constructors on BoolData (used by Array constructors and VTable::build). @@ -250,10 +300,7 @@ impl BoolData { let (offset, len, buffer) = bits.into_inner(); - let slots = Self::make_slots(&validity, len); Ok(Self { - slots, - nullability: validity.nullability(), bits: BufferHandle::new_host(buffer), offset, len, @@ -281,10 +328,7 @@ impl BoolData { bits.len() * 8, ); - let slots = Self::make_slots(&validity, len); Ok(Self { - slots, - nullability: validity.nullability(), bits, offset, len, @@ -296,11 +340,8 @@ impl BoolData { Self::try_new(bits, validity).vortex_expect("Failed to create BoolData") } else { let (offset, len, buffer) = bits.into_inner(); - let slots = Self::make_slots(&validity, len); Self { - slots, - nullability: validity.nullability(), bits: BufferHandle::new_host(buffer), offset, len, diff --git a/vortex-array/src/arrays/bool/vtable/mod.rs b/vortex-array/src/arrays/bool/vtable/mod.rs index 37cada50511..6912f4e5c03 100644 --- a/vortex-array/src/arrays/bool/vtable/mod.rs +++ b/vortex-array/src/arrays/bool/vtable/mod.rs @@ -18,6 +18,7 @@ use crate::ExecutionResult; use crate::array::Array; use crate::array::ArrayView; use crate::array::VTable; +use crate::arrays::bool::array::BoolArrayExt; use crate::arrays::bool::BoolData; use crate::arrays::bool::array::NUM_SLOTS; use crate::arrays::bool::array::SLOT_NAMES; @@ -58,14 +59,14 @@ impl VTable for Bool { fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.to_bit_buffer().array_hash(state, precision); - array.data().validity().array_hash(state, precision); + BoolArrayExt::validity(&array).array_hash(state, precision); } fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array .to_bit_buffer() .array_eq(&other.to_bit_buffer(), precision) - && array.data().validity().array_eq(&other.data().validity(), precision) + && BoolArrayExt::validity(&array).array_eq(&BoolArrayExt::validity(&other), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -101,6 +102,9 @@ impl VTable for Bool { } fn validate(&self, data: &BoolData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + let DType::Bool(nullability) = dtype else { + vortex_bail!("Expected bool dtype, got {dtype:?}"); + }; vortex_ensure!( data.len() == len, "BoolArray length {} does not match outer length {}", @@ -108,13 +112,15 @@ impl VTable for Bool { len ); - let actual_dtype = data.dtype(); - vortex_ensure!( - &actual_dtype == dtype, - "BoolArray dtype {} does not match outer dtype {}", - actual_dtype, - dtype - ); + let validity = crate::array::child_to_validity(&slots[0], *nullability); + if let Some(validity_len) = validity.maybe_len() { + vortex_ensure!( + validity_len == len, + "BoolArray validity len {} does not match outer length {}", + validity_len, + len + ); + } Ok(()) } @@ -128,7 +134,7 @@ impl VTable for Bool { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = BoolMetadata::decode(metadata)?; if buffers.len() != 1 { vortex_bail!("Expected 1 buffer, got {}", buffers.len()); @@ -144,12 +150,9 @@ impl VTable for Bool { }; let buffer = buffers[0].clone(); - - BoolData::try_new_from_handle(buffer, metadata.offset as usize, len, validity) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + let slots = BoolData::make_slots(&validity, len); + let data = BoolData::try_new_from_handle(buffer, metadata.offset as usize, len, validity)?; + Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { diff --git a/vortex-array/src/arrays/bool/vtable/validity.rs b/vortex-array/src/arrays/bool/vtable/validity.rs index d0f3c3eeec5..f6325b7f392 100644 --- a/vortex-array/src/arrays/bool/vtable/validity.rs +++ b/vortex-array/src/arrays/bool/vtable/validity.rs @@ -5,11 +5,12 @@ use vortex_error::VortexResult; use crate::array::ArrayView; use crate::array::ValidityVTable; +use crate::arrays::bool::array::BoolArrayExt; use crate::arrays::bool::vtable::Bool; use crate::validity::Validity; impl ValidityVTable for Bool { fn validity(array: ArrayView<'_, Bool>) -> VortexResult { - Ok(array.data().validity()) + Ok(BoolArrayExt::validity(&array)) } } diff --git a/vortex-array/src/arrays/chunked/array.rs b/vortex-array/src/arrays/chunked/array.rs index 719cd19a2f9..f1fe56e3811 100644 --- a/vortex-array/src/arrays/chunked/array.rs +++ b/vortex-array/src/arrays/chunked/array.rs @@ -15,11 +15,15 @@ use vortex_error::VortexResult; use vortex_error::vortex_bail; use crate::ArrayRef; +use crate::Canonical; use crate::IntoArray; +use crate::LEGACY_SESSION; +use crate::VortexSessionExecute; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::arrays::Chunked; -use crate::arrays::primitive::PrimitiveData; +use crate::arrays::PrimitiveArray; use crate::dtype::DType; use crate::iter::ArrayIterator; use crate::iter::ArrayIteratorAdapter; @@ -33,29 +37,202 @@ pub(super) const CHUNK_OFFSETS_SLOT: usize = 0; pub(super) const CHUNKS_OFFSET: usize = 1; #[derive(Clone, Debug)] -pub struct ChunkedData { - pub(super) chunk_offsets: PrimitiveData, - pub(super) chunks: Vec, - pub(super) slots: Vec>, +pub struct ChunkedData; + +pub trait ChunkedArrayExt { + fn chunked_data(&self) -> &ChunkedData; + fn chunked_dtype(&self) -> &DType; + fn chunked_len(&self) -> usize; + fn as_slots(&self) -> &[Option]; + + fn chunk_offsets_array(&self) -> &ArrayRef { + self.as_slots()[CHUNK_OFFSETS_SLOT] + .as_ref() + .expect("validated chunk offsets slot") + } + + fn nchunks(&self) -> usize { + self.as_slots().len().saturating_sub(CHUNKS_OFFSET) + } + + fn chunk(&self, idx: usize) -> &ArrayRef { + self.as_slots()[CHUNKS_OFFSET + idx] + .as_ref() + .expect("validated chunk slot") + } + + fn iter_chunks<'a>(&'a self) -> Box + 'a> { + Box::new( + self.as_slots()[CHUNKS_OFFSET..] + .iter() + .map(|slot| slot.as_ref().expect("validated chunk slot")), + ) + } + + fn chunks(&self) -> Vec { + self.iter_chunks().cloned().collect() + } + + fn non_empty_chunks<'a>(&'a self) -> Box + 'a> { + Box::new(self.iter_chunks().filter(|chunk| !chunk.is_empty())) + } + + fn chunk_offsets(&self) -> Buffer { + let chunk_offsets = self + .chunk_offsets_array() + .clone() + .execute::(&mut LEGACY_SESSION.create_execution_ctx()) + .vortex_expect("failed to execute chunk offsets") + .into_primitive(); + chunk_offsets.to_buffer::() + } + + fn find_chunk_idx(&self, index: usize) -> VortexResult<(usize, usize)> { + assert!(index <= self.chunked_len(), "Index out of bounds of the array"); + let index = index as u64; + let chunk_offsets = self.chunk_offsets(); + let index_chunk = chunk_offsets + .search_sorted(&index, SearchSortedSide::Right)? + .to_ends_index(self.nchunks() + 1) + .saturating_sub(1); + let chunk_start = chunk_offsets[index_chunk]; + let index_in_chunk = + usize::try_from(index - chunk_start).vortex_expect("Index is too large for usize"); + Ok((index_chunk, index_in_chunk)) + } + + fn array_iterator(&self) -> impl ArrayIterator + '_ { + ArrayIteratorAdapter::new( + self.chunked_dtype().clone(), + self.iter_chunks().map(|chunk| Ok(chunk.clone())), + ) + } + + fn array_stream(&self) -> impl ArrayStream + '_ { + ArrayStreamAdapter::new( + self.chunked_dtype().clone(), + stream::iter(self.iter_chunks().map(|chunk| Ok(chunk.clone()))), + ) + } +} + +impl ChunkedArrayExt for Array { + fn chunked_data(&self) -> &ChunkedData { + self.data() + } + + fn chunked_dtype(&self) -> &DType { + self.dtype() + } + + fn chunked_len(&self) -> usize { + self.len() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl ChunkedArrayExt for ArrayView<'_, Chunked> { + fn chunked_data(&self) -> &ChunkedData { + self.data() + } + + fn chunked_dtype(&self) -> &DType { + self.dtype() + } + + fn chunked_len(&self) -> usize { + self.len() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl Array { + pub fn chunk_offsets_array(&self) -> &ArrayRef { + ::chunk_offsets_array(self) + } + + pub fn chunk_offsets(&self) -> Buffer { + ::chunk_offsets(self) + } + + pub fn nchunks(&self) -> usize { + ::nchunks(self) + } + + pub fn chunk(&self, idx: usize) -> &ArrayRef { + ::chunk(self, idx) + } + + pub fn iter_chunks(&self) -> Box + '_> { + ::iter_chunks(self) + } + + pub fn chunks(&self) -> Vec { + ::chunks(self) + } + + pub fn non_empty_chunks(&self) -> Box + '_> { + ::non_empty_chunks(self) + } + + pub(crate) fn find_chunk_idx(&self, index: usize) -> VortexResult<(usize, usize)> { + ::find_chunk_idx(self, index) + } +} + +impl ArrayView<'_, Chunked> { + pub fn chunk_offsets_array(&self) -> &ArrayRef { + ::chunk_offsets_array(self) + } + + pub fn chunk_offsets(&self) -> Buffer { + ::chunk_offsets(self) + } + + pub fn nchunks(&self) -> usize { + ::nchunks(self) + } + + pub fn chunk(&self, idx: usize) -> &ArrayRef { + ::chunk(self, idx) + } + + pub fn iter_chunks(&self) -> Box + '_> { + ::iter_chunks(self) + } + + pub fn chunks(&self) -> Vec { + ::chunks(self) + } + + pub fn non_empty_chunks(&self) -> Box + '_> { + ::non_empty_chunks(self) + } + + pub(crate) fn find_chunk_idx(&self, index: usize) -> VortexResult<(usize, usize)> { + ::find_chunk_idx(self, index) + } } impl ChunkedData { - /// Builds the slots vector from chunk_offsets and chunks. - pub(super) fn make_slots( - chunk_offsets: &PrimitiveData, - chunks: &[ArrayRef], - ) -> Vec> { + pub(super) fn make_slots(chunks: &[ArrayRef]) -> Vec> { + let mut chunk_offsets_buf = BufferMut::::with_capacity(chunks.len() + 1); + unsafe { chunk_offsets_buf.push_unchecked(0) } + let mut curr_offset = 0; + for chunk in chunks { + curr_offset += chunk.len() as u64; + unsafe { chunk_offsets_buf.push_unchecked(curr_offset) } + } + let mut slots = Vec::with_capacity(1 + chunks.len()); slots.push(Some( - unsafe { - Array::from_parts_unchecked(ArrayParts::new( - crate::arrays::Primitive, - chunk_offsets.dtype(), - chunk_offsets.len(), - chunk_offsets.clone(), - )) - } - .into_array(), + PrimitiveArray::new(chunk_offsets_buf.freeze(), Validity::NonNullable).into_array(), )); slots.extend(chunks.iter().map(|c| Some(c.clone()))); slots @@ -71,9 +248,7 @@ impl ChunkedData { /// `ChunkedArray::new_unchecked`. pub fn try_new(chunks: Vec, dtype: DType) -> VortexResult { Self::validate(&chunks, &dtype)?; - - // SAFETY: validation done above. - unsafe { Ok(Self::new_unchecked(chunks, dtype)) } + Ok(Self) } /// Creates a new `ChunkedArray` without validation from these components: @@ -88,27 +263,9 @@ impl ChunkedData { #[cfg(debug_assertions)] Self::validate(&chunks, &dtype) .vortex_expect("[Debug Assertion]: Invalid `ChunkedArray` parameters"); - - let nchunks = chunks.len(); - - let mut chunk_offsets_buf = BufferMut::::with_capacity(nchunks + 1); - // SAFETY: nchunks + 1 - unsafe { chunk_offsets_buf.push_unchecked(0) } - let mut curr_offset = 0; - for c in &chunks { - curr_offset += c.len() as u64; - // SAFETY: nchunks + 1 - unsafe { chunk_offsets_buf.push_unchecked(curr_offset) } - } - - let chunk_offsets = PrimitiveData::new(chunk_offsets_buf.freeze(), Validity::NonNullable); - - let slots = Self::make_slots(&chunk_offsets, &chunks); - Self { - chunk_offsets, - chunks, - slots, - } + drop(chunks); + drop(dtype); + Self } /// Validates the components that would be used to create a `ChunkedArray`. @@ -123,93 +280,22 @@ impl ChunkedData { Ok(()) } +} - /// Returns the length of this array. - pub fn len(&self) -> usize { - self.chunk_offsets() - .last() - .copied() - .and_then(|len| usize::try_from(len).ok()) - .vortex_expect("chunk offset must fit in usize") - } - - /// Returns `true` if this array is empty. - pub fn is_empty(&self) -> bool { - self.len() == 0 - } - - #[inline] - pub fn chunk(&self, idx: usize) -> &ArrayRef { - assert!(idx < self.nchunks(), "chunk index {idx} out of bounds"); - &self.chunks[idx] - } - - pub fn nchunks(&self) -> usize { - self.chunks.len() - } - - /// Returns the chunk offsets as a `PrimitiveData`. - pub(crate) fn chunk_offsets_data(&self) -> &PrimitiveData { - &self.chunk_offsets - } - - #[inline] - pub fn chunk_offsets(&self) -> Buffer { - self.chunk_offsets_data().to_buffer() - } - - pub(crate) fn find_chunk_idx(&self, index: usize) -> VortexResult<(usize, usize)> { - assert!(index <= self.len(), "Index out of bounds of the array"); - let index = index as u64; - - // Since there might be duplicate values in offsets because of empty chunks we want to search from right - // and take the last chunk (we subtract 1 since there's a leading 0) - let index_chunk = self - .chunk_offsets() - .search_sorted(&index, SearchSortedSide::Right)? - .to_ends_index(self.nchunks() + 1) - .saturating_sub(1); - let chunk_start = self.chunk_offsets()[index_chunk]; - - let index_in_chunk = - usize::try_from(index - chunk_start).vortex_expect("Index is too large for usize"); - Ok((index_chunk, index_in_chunk)) - } - - /// Returns an iterator over chunk references without allocation. - pub fn iter_chunks(&self) -> impl Iterator + '_ { - self.chunks.iter() - } - - /// Returns the chunks as a vector of owned references. - pub fn chunks(&self) -> Vec { - self.chunks.clone() - } - - pub fn non_empty_chunks(&self) -> impl Iterator + '_ { - self.chunks.iter().filter(|c| !c.is_empty()) - } - - pub fn array_iterator(&self, dtype: &DType) -> impl ArrayIterator + '_ { - ArrayIteratorAdapter::new( - dtype.clone(), - self.chunks.iter().map(|c| Ok(c.clone())), - ) - } - - pub fn array_stream(&self, dtype: &DType) -> impl ArrayStream + '_ { - ArrayStreamAdapter::new( - dtype.clone(), - stream::iter(self.chunks.iter().map(|c| Ok(c.clone()))), - ) +impl Array { + /// Constructs a new `ChunkedArray`. + pub fn try_new(chunks: Vec, dtype: DType) -> VortexResult { + ChunkedData::validate(&chunks, &dtype)?; + let len = chunks.iter().map(|chunk| chunk.len()).sum(); + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Chunked, dtype, len, ChunkedData) + .with_slots(ChunkedData::make_slots(&chunks)), + ) + }) } - pub fn rechunk( - &self, - dtype: &DType, - target_bytesize: u64, - target_rowsize: usize, - ) -> VortexResult { + pub fn rechunk(&self, target_bytesize: u64, target_rowsize: usize) -> VortexResult { let mut new_chunks = Vec::new(); let mut chunks_to_combine = Vec::new(); let mut new_chunk_n_bytes = 0; @@ -223,14 +309,10 @@ impl ChunkedData { && !chunks_to_combine.is_empty() { new_chunks.push( - // SAFETY: chunks_to_combine contains valid chunks of the same dtype as self. - // All chunks are guaranteed to be valid arrays matching `dtype`. - unsafe { - Array::::new_unchecked(chunks_to_combine, dtype.clone()) - } - .into_array() - .to_canonical()? - .into_array(), + unsafe { Array::::new_unchecked(chunks_to_combine, self.dtype().clone()) } + .into_array() + .to_canonical()? + .into_array(), ); new_chunk_n_bytes = 0; @@ -249,39 +331,14 @@ impl ChunkedData { if !chunks_to_combine.is_empty() { new_chunks.push( - // SAFETY: chunks_to_combine contains valid chunks of the same dtype as `dtype`. - unsafe { Array::::new_unchecked(chunks_to_combine, dtype.clone()) } + unsafe { Array::::new_unchecked(chunks_to_combine, self.dtype().clone()) } .into_array() .to_canonical()? .into_array(), ); } - // SAFETY: new_chunks contains valid arrays of the same dtype as `dtype`. - unsafe { Ok(Self::new_unchecked(new_chunks, dtype.clone())) } - } -} - -impl Array { - /// Constructs a new `ChunkedArray`. - pub fn try_new(chunks: Vec, dtype: DType) -> VortexResult { - let data = ChunkedData::try_new(chunks, dtype.clone())?; - let len = data.len(); - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Chunked, dtype, len, data)) }) - } - - pub fn rechunk(&self, target_bytesize: u64, target_rowsize: usize) -> VortexResult { - let data = self - .data() - .rechunk(self.dtype(), target_bytesize, target_rowsize)?; - Ok(unsafe { - Array::from_parts_unchecked(ArrayParts::new( - Chunked, - self.dtype().clone(), - data.len(), - data, - )) - }) + unsafe { Ok(Self::new_unchecked(new_chunks, self.dtype().clone())) } } /// Creates a new `ChunkedArray` without validation. @@ -290,9 +347,13 @@ impl Array { /// /// See [`ChunkedData::new_unchecked`]. pub unsafe fn new_unchecked(chunks: Vec, dtype: DType) -> Self { - let data = unsafe { ChunkedData::new_unchecked(chunks, dtype.clone()) }; - let len = data.len(); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Chunked, dtype, len, data)) } + let len = chunks.iter().map(|chunk| chunk.len()).sum(); + unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Chunked, dtype, len, ChunkedData) + .with_slots(ChunkedData::make_slots(&chunks)), + ) + } } } diff --git a/vortex-array/src/arrays/chunked/mod.rs b/vortex-array/src/arrays/chunked/mod.rs index e48c3488ecc..8b5f32a9586 100644 --- a/vortex-array/src/arrays/chunked/mod.rs +++ b/vortex-array/src/arrays/chunked/mod.rs @@ -3,6 +3,7 @@ mod array; pub use array::ChunkedData; +pub use array::ChunkedArrayExt; pub use vtable::ChunkedArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/chunked/paired_chunks.rs b/vortex-array/src/arrays/chunked/paired_chunks.rs index 5adfd6b4059..9db5a5ba03c 100644 --- a/vortex-array/src/arrays/chunked/paired_chunks.rs +++ b/vortex-array/src/arrays/chunked/paired_chunks.rs @@ -6,7 +6,9 @@ use std::ops::Range; use vortex_error::VortexResult; use crate::ArrayRef; -use crate::arrays::chunked::ChunkedData; +use crate::array::Array; +use crate::array::ArrayView; +use crate::arrays::Chunked; pub(crate) struct AlignedPair { pub left: ArrayRef, @@ -67,8 +69,24 @@ pub(crate) struct PairedChunks { total_len: usize, } -impl ChunkedData { - pub(crate) fn paired_chunks(&self, other: &ChunkedData) -> PairedChunks { +impl Array { + pub(crate) fn paired_chunks(&self, other: &Array) -> PairedChunks { + assert_eq!( + self.len(), + other.len(), + "paired_chunks requires arrays of equal length" + ); + PairedChunks { + left: ChunkCursor::new(self.chunks()), + right: ChunkCursor::new(other.chunks()), + pos: 0, + total_len: self.len(), + } + } +} + +impl ArrayView<'_, Chunked> { + pub(crate) fn paired_chunks(&self, other: &ArrayView<'_, Chunked>) -> PairedChunks { assert_eq!( self.len(), other.len(), diff --git a/vortex-array/src/arrays/chunked/tests.rs b/vortex-array/src/arrays/chunked/tests.rs index 9a056846976..8b258b959b3 100644 --- a/vortex-array/src/arrays/chunked/tests.rs +++ b/vortex-array/src/arrays/chunked/tests.rs @@ -8,8 +8,6 @@ use vortex_buffer::buffer; use crate::IntoArray; use crate::accessor::ArrayAccessor; -use crate::array::ArrayParts; -use crate::array::VTable; use crate::arrays::Chunked; use crate::arrays::ChunkedArray; use crate::arrays::ListArray; @@ -36,6 +34,33 @@ fn chunked_array() -> ChunkedArray { .unwrap() } +#[test] +fn with_slot_rewrites_chunk_and_offsets() { + let array = chunked_array().into_array(); + + let replacement = buffer![10u64, 11, 12].into_array(); + let array = array.with_slot(1, replacement).unwrap(); + let array = array.as_::(); + + assert_eq!(array.nchunks(), 3); + assert_eq!(array.chunk_offsets(), buffer![0u64, 3, 6, 9]); + assert_arrays_eq!(array.chunk(0).clone(), PrimitiveArray::from_iter([10u64, 11, 12])); + assert_arrays_eq!( + array.array().clone(), + PrimitiveArray::from_iter([10u64, 11, 12, 4, 5, 6, 7, 8, 9]) + ); +} + +#[test] +fn with_slot_rejects_len_mismatch() { + let err = chunked_array() + .into_array() + .with_slot(1, buffer![10u64, 11].into_array()) + .unwrap_err(); + + assert!(err.to_string().contains("physical rewrite")); +} + #[test] fn slice_middle() { assert_arrays_eq!( @@ -197,5 +222,3 @@ pub fn pack_nested_lists() { assert_eq!(l1.scalar_at(0).unwrap(), canon_values.scalar_at(0).unwrap()); assert_eq!(l2.scalar_at(0).unwrap(), canon_values.scalar_at(1).unwrap()); } - -#[test] diff --git a/vortex-array/src/arrays/chunked/vtable/mod.rs b/vortex-array/src/arrays/chunked/vtable/mod.rs index ee3da130687..983db6bb2d5 100644 --- a/vortex-array/src/arrays/chunked/vtable/mod.rs +++ b/vortex-array/src/arrays/chunked/vtable/mod.rs @@ -2,6 +2,7 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use itertools::Itertools; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -18,25 +19,24 @@ use crate::Precision; use crate::ToCanonical; use crate::array::Array; use crate::array::ArrayId; +use crate::array::ArrayParts; use crate::array::ArrayView; use crate::array::VTable; -use crate::arrays::PrimitiveArray; use crate::arrays::chunked::ChunkedData; use crate::arrays::chunked::array::CHUNK_OFFSETS_SLOT; use crate::arrays::chunked::array::CHUNKS_OFFSET; use crate::arrays::chunked::compute::kernel::PARENT_KERNELS; use crate::arrays::chunked::compute::rules::PARENT_RULES; use crate::arrays::chunked::vtable::canonical::_canonicalize; -use crate::arrays::primitive::PrimitiveData; use crate::buffer::BufferHandle; use crate::builders::ArrayBuilder; use crate::dtype::DType; use crate::dtype::Nullability; use crate::dtype::PType; +use crate::executor::VortexSessionExecute; use crate::hash::ArrayEq; use crate::hash::ArrayHash; use crate::serde::ArrayChildren; -use crate::validity::Validity; use crate::vtable; mod canonical; mod operations; @@ -61,31 +61,15 @@ impl VTable for Chunked { } fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - PrimitiveArray::new( - array.chunk_offsets.to_buffer::(), - Validity::NonNullable, - ) - .into_array() - .array_hash(state, precision); - for chunk in &array.chunks { + array.chunk_offsets_array().array_hash(state, precision); + for chunk in array.iter_chunks() { chunk.array_hash(state, precision); } } fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - PrimitiveArray::new( - array.chunk_offsets.to_buffer::(), - Validity::NonNullable, - ) - .into_array() - .array_eq( - &PrimitiveArray::new( - other.chunk_offsets.to_buffer::(), - Validity::NonNullable, - ) - .into_array(), - precision, - ) && array.chunks.len() == other.chunks.len() + array.chunk_offsets_array().array_eq(other.chunk_offsets_array(), precision) + && array.nchunks() == other.nchunks() && array .iter_chunks() .zip(other.iter_chunks()) @@ -108,15 +92,64 @@ impl VTable for Chunked { Ok(Some(vec![])) } - fn validate(&self, data: &ChunkedData, dtype: &DType, len: usize, _slots: &[Option]) -> VortexResult<()> { + fn validate( + &self, + _data: &ChunkedData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { + vortex_ensure!( + !slots.is_empty(), + "ChunkedArray must have at least a chunk offsets slot" + ); + let chunk_offsets = slots[CHUNK_OFFSETS_SLOT] + .as_ref() + .vortex_expect("validated chunk offsets slot"); + vortex_ensure!( + chunk_offsets.dtype() == &DType::Primitive(PType::U64, Nullability::NonNullable), + "ChunkedArray chunk offsets must be non-nullable u64, found {}", + chunk_offsets.dtype() + ); + vortex_ensure!( + chunk_offsets.len() == slots.len() - CHUNKS_OFFSET + 1, + "ChunkedArray chunk offsets length {} does not match {} chunks", + chunk_offsets.len(), + slots.len() - CHUNKS_OFFSET + ); + let chunk_offsets = chunk_offsets + .clone() + .execute::(&mut crate::LEGACY_SESSION.create_execution_ctx())? + .into_primitive() + .to_buffer::(); vortex_ensure!( - data.len() == len, + chunk_offsets + .last() + .copied() + .and_then(|v| usize::try_from(v).ok()) + .vortex_expect("chunk offset must fit in usize") + == len, "ChunkedArray length {} does not match outer length {}", - data.len(), + chunk_offsets.last().copied().unwrap_or_default(), len ); - for chunk in &data.chunks { - vortex_ensure!(chunk.dtype() == dtype, "ChunkedArray chunk dtype {} does not match outer dtype {}", chunk.dtype(), dtype); + for (idx, (start, end)) in chunk_offsets.iter().copied().tuple_windows().enumerate() { + let chunk = slots[CHUNKS_OFFSET + idx] + .as_ref() + .vortex_expect("validated chunk slot"); + vortex_ensure!( + chunk.dtype() == dtype, + "ChunkedArray chunk dtype {} does not match outer dtype {}", + chunk.dtype(), + dtype + ); + vortex_ensure!( + chunk.len() == usize::try_from(end - start).vortex_expect("chunk len must fit in usize"), + "ChunkedArray chunk {} len {} does not match offsets span {}", + idx, + chunk.len(), + end - start + ); } Ok(()) } @@ -124,13 +157,12 @@ impl VTable for Chunked { fn deserialize( &self, dtype: &DType, - _len: usize, + len: usize, metadata: &[u8], - _buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { if !metadata.is_empty() { vortex_bail!( "ChunkedArray expects empty metadata, got {} bytes", @@ -142,48 +174,21 @@ impl VTable for Chunked { } let nchunks = children.len() - 1; + let chunk_offsets = children.get( + CHUNK_OFFSETS_SLOT, + &DType::Primitive(PType::U64, Nullability::NonNullable), + nchunks + 1, + )?; + let chunk_offsets_buf = chunk_offsets.clone().to_primitive().to_buffer::(); + let mut slots = Vec::with_capacity(children.len()); + slots.push(Some(chunk_offsets)); + for (idx, (start, end)) in chunk_offsets_buf.iter().copied().tuple_windows().enumerate() { + let chunk_len = usize::try_from(end - start) + .map_err(|_| vortex_err!("chunk_len {} exceeds usize range", end - start))?; + slots.push(Some(children.get(idx + CHUNKS_OFFSET, dtype, chunk_len)?)); + } - // The first child contains the row offsets of the chunks - let chunk_offsets_array = children - .get( - 0, - &DType::Primitive(PType::U64, Nullability::NonNullable), - // 1 extra offset for the end of the last chunk - nchunks + 1, - )? - .to_primitive(); - - let chunk_offsets_buf = chunk_offsets_array.to_buffer::(); - - // The remaining children contain the actual data of the chunks - let chunks: Vec = chunk_offsets_buf - .iter() - .tuple_windows() - .enumerate() - .map(|(idx, (start, end))| { - let chunk_len = usize::try_from(end - start) - .map_err(|_| vortex_err!("chunk_len {} exceeds usize range", end - start))?; - children.get(idx + 1, dtype, chunk_len) - }) - .try_collect()?; - - let chunk_offsets = PrimitiveData::new(chunk_offsets_buf, Validity::NonNullable); - - let slots = ChunkedData::make_slots(&chunk_offsets, &chunks); - // Construct directly using the struct fields to avoid recomputing chunk_offsets - Ok(ChunkedData { - chunk_offsets, - chunks, - slots, - }) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() - } - - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, ChunkedData).with_slots(slots)) } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { @@ -210,7 +215,7 @@ impl VTable for Chunked { } fn reduce(array: ArrayView<'_, Self>) -> VortexResult> { - Ok(match array.chunks.len() { + Ok(match array.nchunks() { 0 => Some(Canonical::empty(array.dtype()).into_array()), 1 => Some(array.chunk(0).clone()), _ => None, diff --git a/vortex-array/src/arrays/constant/vtable/mod.rs b/vortex-array/src/arrays/constant/vtable/mod.rs index cf2a30f96bb..c02153fe712 100644 --- a/vortex-array/src/arrays/constant/vtable/mod.rs +++ b/vortex-array/src/arrays/constant/vtable/mod.rs @@ -127,13 +127,13 @@ impl VTable for Constant { fn deserialize( &self, dtype: &DType, - _len: usize, + len: usize, _metadata: &[u8], buffers: &[BufferHandle], _children: &dyn ArrayChildren, session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { vortex_ensure!( buffers.len() == 1, "Expected 1 buffer, got {}", @@ -146,7 +146,12 @@ impl VTable for Constant { let scalar_value = ScalarValue::from_proto_bytes(bytes, dtype, session)?; let scalar = Scalar::try_new(dtype.clone(), scalar_value)?; - Ok(ConstantData::new(scalar)) + Ok(crate::array::ArrayParts::new( + self.clone(), + dtype.clone(), + len, + ConstantData::new(scalar), + )) } fn reduce_parent( diff --git a/vortex-array/src/arrays/decimal/array.rs b/vortex-array/src/arrays/decimal/array.rs index df5be8ce202..d80c9d00da9 100644 --- a/vortex-array/src/arrays/decimal/array.rs +++ b/vortex-array/src/arrays/decimal/array.rs @@ -16,6 +16,7 @@ use crate::ExecutionCtx; use crate::IntoArray; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::Decimal; @@ -98,7 +99,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["validity"]; /// ``` #[derive(Clone, Debug)] pub struct DecimalData { - pub(super) slots: Vec>, pub(super) decimal_dtype: DecimalDType, pub(super) nullability: Nullability, pub(super) values: BufferHandle, @@ -112,6 +112,39 @@ pub struct DecimalDataParts { pub validity: Validity, } +pub trait DecimalArrayExt { + fn decimal_data(&self) -> &DecimalData; + fn as_slots(&self) -> &[Option]; + + fn validity_child(&self) -> Option<&ArrayRef> { + self.as_slots()[VALIDITY_SLOT].as_ref() + } + + fn validity(&self) -> Validity { + child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.decimal_data().nullability) + } +} + +impl DecimalArrayExt for Array { + fn decimal_data(&self) -> &DecimalData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl DecimalArrayExt for ArrayView<'_, Decimal> { + fn decimal_data(&self) -> &DecimalData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + impl DecimalData { /// Build the slots vector for this array. pub(super) fn make_slots(validity: &Validity, len: usize) -> Vec> { @@ -240,7 +273,6 @@ impl DecimalData { let len = values.len() / values_type.byte_width(); Self { - slots: Self::make_slots(&validity, len), values, values_type, decimal_dtype, @@ -310,18 +342,12 @@ impl DecimalData { self.len() == 0 } - /// Reconstructs the validity from the slot state. - pub fn validity(&self) -> Validity { - child_to_validity(&self.slots[VALIDITY_SLOT], self.nullability) - } - pub fn into_parts(self) -> DecimalDataParts { - let validity = self.validity(); DecimalDataParts { decimal_dtype: self.decimal_dtype, values: self.values, values_type: self.values_type, - validity, + validity: Validity::from(self.nullability), } } @@ -398,43 +424,18 @@ impl DecimalData { Validity::from(validity.freeze()), ) } +} - #[expect( - clippy::cognitive_complexity, - reason = "complexity from nested match_each_* macros" - )] - pub fn patch(self, patches: &Patches, ctx: &mut ExecutionCtx) -> VortexResult { - let offset = patches.offset(); - let patch_indices = patches.indices().clone().execute::(ctx)?; - let patch_values = patches.values().clone().execute::(ctx)?; - - let patch_validity = patch_values.validity()?; - let patched_validity = self.validity().patch( - self.len(), - offset, - &patch_indices.clone().into_array(), - &patch_validity, - ctx, - )?; - assert_eq!(self.decimal_dtype(), patch_values.decimal_dtype()); - - Ok(match_each_integer_ptype!(patch_indices.ptype(), |I| { - let patch_indices = patch_indices.as_slice::(); - match_each_decimal_value_type!(patch_values.values_type(), |PatchDVT| { - let patch_values = patch_values.buffer::(); - match_each_decimal_value_type!(self.values_type(), |ValuesDVT| { - let buffer = self.buffer::().into_mut(); - patch_typed( - buffer, - self.decimal_dtype(), - patch_indices, - offset, - patch_values, - patched_validity, - ) - }) - }) - })) +impl Array { + pub fn into_data_parts(self) -> DecimalDataParts { + let validity = DecimalArrayExt::validity(&self); + let data = self.into_data(); + DecimalDataParts { + decimal_dtype: data.decimal_dtype, + values: data.values, + values_type: data.values_type, + validity, + } } } @@ -447,8 +448,11 @@ impl Array { ) -> Self { let dtype = DType::Decimal(decimal_dtype, validity.nullability()); let len = buffer.len(); + let slots = DecimalData::make_slots(&validity, len); let data = DecimalData::new(buffer, decimal_dtype, validity); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + } } /// Creates a new [`DecimalArray`] without validation. @@ -463,8 +467,11 @@ impl Array { ) -> Self { let dtype = DType::Decimal(decimal_dtype, validity.nullability()); let len = buffer.len(); + let slots = DecimalData::make_slots(&validity, len); let data = unsafe { DecimalData::new_unchecked(buffer, decimal_dtype, validity) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + } } /// Creates a new [`DecimalArray`] from a host-native buffer with validation. @@ -475,8 +482,11 @@ impl Array { ) -> VortexResult { let dtype = DType::Decimal(decimal_dtype, validity.nullability()); let len = buffer.len(); + let slots = DecimalData::make_slots(&validity, len); let data = DecimalData::try_new(buffer, decimal_dtype, validity)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + }) } /// Creates a new [`DecimalArray`] from an iterator of values. @@ -491,7 +501,10 @@ impl Array { let data = DecimalData::from_iter(iter, decimal_dtype); let dtype = data.dtype(); let len = data.len(); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data)) } + let slots = DecimalData::make_slots(&Validity::from(dtype.nullability()), len); + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + } } /// Creates a new [`DecimalArray`] from an iterator of optional values. @@ -502,7 +515,10 @@ impl Array { let data = DecimalData::from_option_iter(iter, decimal_dtype); let dtype = data.dtype(); let len = data.len(); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data)) } + let slots = DecimalData::make_slots(&Validity::from(dtype.nullability()), len); + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + } } /// Creates a new [`DecimalArray`] from a [`BufferHandle`]. @@ -514,8 +530,11 @@ impl Array { ) -> Self { let dtype = DType::Decimal(decimal_dtype, validity.nullability()); let len = values.len() / values_type.byte_width(); + let slots = DecimalData::make_slots(&validity, len); let data = DecimalData::new_handle(values, values_type, decimal_dtype, validity); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + } } /// Creates a new [`DecimalArray`] without validation from a [`BufferHandle`]. @@ -531,10 +550,54 @@ impl Array { ) -> Self { let dtype = DType::Decimal(decimal_dtype, validity.nullability()); let len = values.len() / values_type.byte_width(); + let slots = DecimalData::make_slots(&validity, len); let data = unsafe { DecimalData::new_unchecked_handle(values, values_type, decimal_dtype, validity) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + } + } + + pub fn patch(self, patches: &Patches, ctx: &mut ExecutionCtx) -> VortexResult { + let offset = patches.offset(); + let dtype = self.dtype().clone(); + let len = self.len(); + let patch_indices = patches.indices().clone().execute::(ctx)?; + let patch_values = patches.values().clone().execute::(ctx)?; + + let patch_validity = patch_values.validity()?; + let patched_validity = self.validity()?.patch( + self.len(), + offset, + &patch_indices.clone().into_array(), + &patch_validity, + ctx, + )?; + assert_eq!(self.decimal_dtype(), patch_values.decimal_dtype()); + + let data = self.into_data(); + let data = match_each_integer_ptype!(patch_indices.ptype(), |I| { + let patch_indices = patch_indices.as_slice::(); + match_each_decimal_value_type!(patch_values.values_type(), |PatchDVT| { + let patch_values = patch_values.buffer::(); + match_each_decimal_value_type!(data.values_type(), |ValuesDVT| { + let buffer = data.buffer::().into_mut(); + patch_typed( + buffer, + data.decimal_dtype(), + patch_indices, + offset, + patch_values, + patched_validity.clone(), + ) + }) + }) + }); + let slots = DecimalData::make_slots(&patched_validity, len); + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + }) } } diff --git a/vortex-array/src/arrays/decimal/mod.rs b/vortex-array/src/arrays/decimal/mod.rs index a0b90613f52..95a105cb804 100644 --- a/vortex-array/src/arrays/decimal/mod.rs +++ b/vortex-array/src/arrays/decimal/mod.rs @@ -4,6 +4,7 @@ mod array; pub use array::DecimalData; pub use array::DecimalDataParts; +pub use array::DecimalArrayExt; pub use vtable::DecimalArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/decimal/vtable/mod.rs b/vortex-array/src/arrays/decimal/vtable/mod.rs index fff877eabaa..a3c0de45f04 100644 --- a/vortex-array/src/arrays/decimal/vtable/mod.rs +++ b/vortex-array/src/arrays/decimal/vtable/mod.rs @@ -16,6 +16,7 @@ use crate::ExecutionResult; use crate::array::Array; use crate::array::ArrayView; use crate::array::VTable; +use crate::arrays::decimal::DecimalArrayExt; use crate::arrays::decimal::DecimalData; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -60,13 +61,14 @@ impl VTable for Decimal { fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.values.array_hash(state, precision); std::mem::discriminant(&array.values_type).hash(state); - array.data().validity().array_hash(state, precision); + DecimalArrayExt::validity(&array).array_hash(state, precision); } fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.values.array_eq(&other.values, precision) && array.values_type == other.values_type - && array.data().validity().array_eq(&other.data().validity(), precision) + && DecimalArrayExt::validity(&array) + .array_eq(&DecimalArrayExt::validity(&other), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -111,6 +113,15 @@ impl VTable for Decimal { actual_dtype, dtype ); + let validity = crate::array::child_to_validity(&slots[0], data.nullability); + if let Some(validity_len) = validity.maybe_len() { + vortex_ensure!( + validity_len == len, + "DecimalArray validity len {} does not match outer length {}", + validity_len, + len + ); + } Ok(()) } @@ -124,7 +135,7 @@ impl VTable for Decimal { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = DecimalMetadata::decode(metadata)?; if buffers.len() != 1 { vortex_bail!("Expected 1 buffer, got {}", buffers.len()); @@ -144,7 +155,8 @@ impl VTable for Decimal { vortex_bail!("Expected Decimal dtype, got {:?}", dtype) }; - match_each_decimal_value_type!(metadata.values_type(), |D| { + let slots = DecimalData::make_slots(&validity, len); + let data = match_each_decimal_value_type!(metadata.values_type(), |D| { // Check and reinterpret-cast the buffer vortex_ensure!( values.is_aligned_to(Alignment::of::()), @@ -152,11 +164,8 @@ impl VTable for Decimal { D::DECIMAL_TYPE ); DecimalData::try_new_handle(values, metadata.values_type(), *decimal_dtype, validity) - }) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + })?; + Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { diff --git a/vortex-array/src/arrays/decimal/vtable/validity.rs b/vortex-array/src/arrays/decimal/vtable/validity.rs index 5479ac890f3..500fb191fad 100644 --- a/vortex-array/src/arrays/decimal/vtable/validity.rs +++ b/vortex-array/src/arrays/decimal/vtable/validity.rs @@ -5,11 +5,12 @@ use vortex_error::VortexResult; use crate::array::ArrayView; use crate::array::ValidityVTable; +use crate::arrays::decimal::DecimalArrayExt; use crate::arrays::decimal::vtable::Decimal; use crate::validity::Validity; impl ValidityVTable for Decimal { fn validity(array: ArrayView<'_, Decimal>) -> VortexResult { - Ok(array.data().validity()) + Ok(DecimalArrayExt::validity(&array)) } } diff --git a/vortex-array/src/arrays/dict/array.rs b/vortex-array/src/arrays/dict/array.rs index a791d79b798..698c53c8fd1 100644 --- a/vortex-array/src/arrays/dict/array.rs +++ b/vortex-array/src/arrays/dict/array.rs @@ -11,6 +11,7 @@ use vortex_mask::AllOr; use crate::ArrayRef; use crate::ToCanonical; use crate::array::Array; +use crate::array::ArrayView; use crate::array::ArrayParts; use crate::arrays::Dict; use crate::dtype::DType; @@ -42,7 +43,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["codes", "values"]; #[derive(Debug, Clone)] pub struct DictData { - pub(super) slots: Vec>, /// Indicates whether all dictionary values are definitely referenced by at least one code. /// `true` = all values are referenced (computed during encoding). /// `false` = unknown/might have unreferenced values. @@ -51,11 +51,6 @@ pub struct DictData { pub(super) all_values_referenced: bool, } -pub struct DictDataParts { - pub codes: ArrayRef, - pub values: ArrayRef, -} - impl DictData { /// Build a new `DictArray` without validating the codes or values. /// @@ -63,9 +58,8 @@ impl DictData { /// This should be called only when you can guarantee the invariants checked /// by the safe `DictArray::try_new` constructor are valid, for example when /// you are filtering or slicing an existing valid `DictArray`. - pub unsafe fn new_unchecked(codes: ArrayRef, values: ArrayRef) -> Self { + pub unsafe fn new_unchecked(_codes: ArrayRef, _values: ArrayRef) -> Self { Self { - slots: vec![Some(codes), Some(values)], all_values_referenced: false, } } @@ -81,14 +75,6 @@ impl DictData { /// that all values are referenced. pub unsafe fn set_all_values_referenced(mut self, all_values_referenced: bool) -> Self { self.all_values_referenced = all_values_referenced; - - #[cfg(debug_assertions)] - { - use vortex_error::VortexExpect; - self.validate_all_values_referenced() - .vortex_expect("validation should succeed when all values are referenced") - } - self } @@ -118,97 +104,160 @@ impl DictData { Ok(unsafe { Self::new_unchecked(codes, values) }) } +} - /// Returns the length of this array. - pub fn len(&self) -> usize { - self.codes().len() - } +pub trait DictArrayExt { + fn dict_data(&self) -> &DictData; + fn codes(&self) -> &ArrayRef; + fn values(&self) -> &ArrayRef; - /// Returns the [`DType`] of this array. - pub fn dtype(&self) -> DType { - self.values() - .dtype() - .union_nullability(self.codes().dtype().nullability()) + #[inline] + fn has_all_values_referenced(&self) -> bool { + self.dict_data().all_values_referenced } - /// Returns `true` if this array is empty. - pub fn is_empty(&self) -> bool { - self.len() == 0 + fn validate_all_values_referenced(&self) -> VortexResult<()> { + if self.has_all_values_referenced() { + if !self.codes().is_host() { + return Ok(()); + } + + let referenced_mask = self.compute_referenced_values_mask(true)?; + let all_referenced = referenced_mask.iter().all(|v| v); + + vortex_ensure!(all_referenced, "value in dict not referenced"); + } + + Ok(()) } - pub fn into_parts(mut self) -> DictDataParts { - DictDataParts { - codes: self.slots[CODES_SLOT] - .take() - .vortex_expect("DictArray codes slot"), - values: self.slots[VALUES_SLOT] - .take() - .vortex_expect("DictArray values slot"), + fn compute_referenced_values_mask(&self, referenced: bool) -> VortexResult { + let codes_validity = self.codes().validity_mask()?; + let codes_primitive = self.codes().to_primitive(); + let values_len = self.values().len(); + + let init_value = !referenced; + let referenced_value = referenced; + + let mut values_vec = vec![init_value; values_len]; + match codes_validity.bit_buffer() { + AllOr::All => { + match_each_integer_ptype!(codes_primitive.ptype(), |P| { + #[allow( + clippy::cast_possible_truncation, + clippy::cast_sign_loss, + reason = "codes are non-negative indices; a negative signed code would wrap to a large usize and panic on the bounds-checked array index" + )] + for &idx in codes_primitive.as_slice::

() { + values_vec[idx as usize] = referenced_value; + } + }); + } + AllOr::None => {} + AllOr::Some(mask) => { + match_each_integer_ptype!(codes_primitive.ptype(), |P| { + #[allow( + clippy::cast_possible_truncation, + clippy::cast_sign_loss, + reason = "codes are non-negative indices; a negative signed code would wrap to a large usize and panic on the bounds-checked array index" + )] + for (valid, &idx) in mask.iter().zip(codes_primitive.as_slice::

()) { + if valid { + values_vec[idx as usize] = referenced_value; + } + } + }); + } } + + Ok(BitBuffer::from(values_vec)) } +} - #[inline] - pub fn codes(&self) -> &ArrayRef { - self.slots[CODES_SLOT] +impl DictArrayExt for Array { + fn dict_data(&self) -> &DictData { + self.data() + } + + fn codes(&self) -> &ArrayRef { + self.slots()[CODES_SLOT] .as_ref() .vortex_expect("DictArray codes slot") } - #[inline] - pub fn values(&self) -> &ArrayRef { - self.slots[VALUES_SLOT] + fn values(&self) -> &ArrayRef { + 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. - /// - /// When `true`, operations like min/max can safely operate on all values without needing to - /// compute which values are actually referenced. When `false`, it is unknown whether all - /// values are referenced (conservative default). +impl DictArrayExt for ArrayView<'_, Dict> { + fn dict_data(&self) -> &DictData { + self.data() + } + + fn codes(&self) -> &ArrayRef { + self.slots()[CODES_SLOT] + .as_ref() + .vortex_expect("DictArray codes slot") + } + + fn values(&self) -> &ArrayRef { + self.slots()[VALUES_SLOT] + .as_ref() + .vortex_expect("DictArray values slot") + } +} + +impl Array { #[inline] - pub fn has_all_values_referenced(&self) -> bool { - self.all_values_referenced + pub fn codes(&self) -> &ArrayRef { + DictArrayExt::codes(self) } - /// Validates that the `all_values_referenced` flag matches reality. - /// - /// Returns `Ok(())` if the flag is consistent with the actual referenced values, - /// or an error describing the mismatch. - /// - /// This is primarily useful for testing and debugging. - pub fn validate_all_values_referenced(&self) -> VortexResult<()> { - if self.all_values_referenced { - // Skip host-only validation when codes are not host-resident. - if !self.codes().is_host() { - return Ok(()); - } + #[inline] + pub fn values(&self) -> &ArrayRef { + DictArrayExt::values(self) + } - let referenced_mask = self.compute_referenced_values_mask(true)?; - let all_referenced = referenced_mask.iter().all(|v| v); + #[inline] + pub fn has_all_values_referenced(&self) -> bool { + DictArrayExt::has_all_values_referenced(self) + } - vortex_ensure!(all_referenced, "value in dict not referenced"); - } + pub fn validate_all_values_referenced(&self) -> VortexResult<()> { + DictArrayExt::validate_all_values_referenced(self) + } - Ok(()) + pub fn compute_referenced_values_mask(&self, referenced: bool) -> VortexResult { + DictArrayExt::compute_referenced_values_mask(self, referenced) } -} -impl Array { /// Build a new `DictArray` from its components, `codes` and `values`. pub fn new(codes: ArrayRef, values: ArrayRef) -> Self { - let data = DictData::new(codes, values); - let dtype = data.dtype(); - let len = data.len(); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Dict, dtype, len, data)) } + let dtype = values.dtype().union_nullability(codes.dtype().nullability()); + let len = codes.len(); + let data = DictData::new(codes.clone(), values.clone()); + unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Dict, dtype, len, data) + .with_slots(vec![Some(codes), Some(values)]), + ) + } } /// Build a new `DictArray` from its components, `codes` and `values`. pub fn try_new(codes: ArrayRef, values: ArrayRef) -> VortexResult { - let data = DictData::try_new(codes, values)?; - let dtype = data.dtype(); - let len = data.len(); - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Dict, dtype, len, data)) }) + let dtype = values.dtype().union_nullability(codes.dtype().nullability()); + let len = codes.len(); + let data = DictData::try_new(codes.clone(), values.clone())?; + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Dict, dtype, len, data) + .with_slots(vec![Some(codes), Some(values)]), + ) + }) } /// Build a new `DictArray` without validating the codes or values. @@ -217,10 +266,15 @@ impl Array { /// /// See [`DictData::new_unchecked`]. pub unsafe fn new_unchecked(codes: ArrayRef, values: ArrayRef) -> Self { - let data = unsafe { DictData::new_unchecked(codes, values) }; - let dtype = data.dtype(); - let len = data.len(); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Dict, dtype, len, data)) } + let dtype = values.dtype().union_nullability(codes.dtype().nullability()); + let len = codes.len(); + let data = unsafe { DictData::new_unchecked(codes.clone(), values.clone()) }; + unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Dict, dtype, len, data) + .with_slots(vec![Some(codes), Some(values)]), + ) + } } /// Set whether all values in the dictionary are referenced by at least one code. @@ -231,57 +285,41 @@ impl Array { pub unsafe fn set_all_values_referenced(self, all_values_referenced: bool) -> Self { let dtype = self.dtype().clone(); let len = self.len(); + let slots = self.slots().to_vec(); let data = unsafe { self.into_data() .set_all_values_referenced(all_values_referenced) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(Dict, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Dict, dtype, len, data).with_slots(slots), + ) + } } } -impl DictData { - pub fn compute_referenced_values_mask(&self, referenced: bool) -> VortexResult { - let codes_validity = self.codes().validity_mask()?; - let codes_primitive = self.codes().to_primitive(); - let values_len = self.values().len(); +impl ArrayView<'_, Dict> { + #[inline] + pub fn codes(&self) -> &ArrayRef { + DictArrayExt::codes(self) + } - // Initialize with the starting value: false for referenced, true for unreferenced - let init_value = !referenced; - // Value to set when we find a referenced code: true for referenced, false for unreferenced - let referenced_value = referenced; + #[inline] + pub fn values(&self) -> &ArrayRef { + DictArrayExt::values(self) + } - let mut values_vec = vec![init_value; values_len]; - match codes_validity.bit_buffer() { - AllOr::All => { - match_each_integer_ptype!(codes_primitive.ptype(), |P| { - #[allow( - clippy::cast_possible_truncation, - clippy::cast_sign_loss, - reason = "codes are non-negative indices; a negative signed code would wrap to a large usize and panic on the bounds-checked array index" - )] - for &code in codes_primitive.as_slice::

().iter() { - values_vec[code as usize] = referenced_value; - } - }); - } - AllOr::None => {} - AllOr::Some(buf) => { - match_each_integer_ptype!(codes_primitive.ptype(), |P| { - let codes = codes_primitive.as_slice::

(); + #[inline] + pub fn has_all_values_referenced(&self) -> bool { + DictArrayExt::has_all_values_referenced(self) + } - #[allow( - clippy::cast_possible_truncation, - clippy::cast_sign_loss, - reason = "codes are non-negative indices; a negative signed code would wrap to a large usize and panic on the bounds-checked array index" - )] - buf.set_indices().for_each(|idx| { - values_vec[codes[idx] as usize] = referenced_value; - }) - }); - } - } + pub fn validate_all_values_referenced(&self) -> VortexResult<()> { + DictArrayExt::validate_all_values_referenced(self) + } - Ok(BitBuffer::collect_bool(values_len, |idx| values_vec[idx])) + pub fn compute_referenced_values_mask(&self, referenced: bool) -> VortexResult { + DictArrayExt::compute_referenced_values_mask(self, referenced) } } diff --git a/vortex-array/src/arrays/dict/vtable/mod.rs b/vortex-array/src/arrays/dict/vtable/mod.rs index d4d687b5cfc..4a3ecee7b57 100644 --- a/vortex-array/src/arrays/dict/vtable/mod.rs +++ b/vortex-array/src/arrays/dict/vtable/mod.rs @@ -12,10 +12,11 @@ use vortex_error::vortex_panic; use vortex_session::VortexSession; use super::DictData; -use super::DictDataParts; +use super::DictArrayExt; use super::DictMetadata; -use super::array::NUM_SLOTS; +use super::array::CODES_SLOT; use super::array::SLOT_NAMES; +use super::array::VALUES_SLOT; use super::take_canonical; use crate::AnyCanonical; use crate::ArrayRef; @@ -64,9 +65,14 @@ impl VTable for Dict { } fn validate(&self, data: &DictData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { - vortex_ensure!(data.codes().len() == len, "DictArray codes length mismatch"); + _ = data; + let codes = slots[CODES_SLOT].as_ref().vortex_expect("DictArray codes slot"); + let values = slots[VALUES_SLOT] + .as_ref() + .vortex_expect("DictArray values slot"); + vortex_ensure!(codes.len() == len, "DictArray codes length mismatch"); vortex_ensure!( - data.dtype() == *dtype, + values.dtype().union_nullability(codes.dtype().nullability()) == *dtype, "DictArray dtype does not match codes/values dtype" ); Ok(()) @@ -105,7 +111,7 @@ impl VTable for Dict { ) })?, is_nullable_codes: Some(array.codes().dtype().is_nullable()), - all_values_referenced: Some(array.all_values_referenced), + all_values_referenced: Some(array.has_all_values_referenced()), } .encode_to_vec(), )) @@ -120,7 +126,7 @@ impl VTable for Dict { _buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = DictMetadata::decode(metadata)?; if children.len() != 2 { vortex_bail!( @@ -139,14 +145,18 @@ impl VTable for Dict { let values = children.get(1, dtype, metadata.values_len as usize)?; let all_values_referenced = metadata.all_values_referenced.unwrap_or(false); - // SAFETY: We've validated the metadata and children. - Ok(unsafe { - DictData::new_unchecked(codes, values).set_all_values_referenced(all_values_referenced) - }) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + Ok( + crate::array::ArrayParts::new( + self.clone(), + dtype.clone(), + len, + unsafe { + DictData::new_unchecked(codes.clone(), values.clone()) + .set_all_values_referenced(all_values_referenced) + }, + ) + .with_slots(vec![Some(codes), Some(values)]), + ) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { @@ -180,12 +190,13 @@ impl VTable for Dict { let array = require_child!(array, array.values(), 1 => AnyCanonical); - let DictDataParts { codes, values, .. } = array.into_data().into_parts(); - - let codes = codes + let codes = array + .codes() + .clone() .try_into::() .ok() .vortex_expect("must be primitive"); + let values = array.values().clone(); debug_assert!(values.is_canonical()); // TODO: add canonical owned cast. let values = values.to_canonical()?; diff --git a/vortex-array/src/arrays/extension/array.rs b/vortex-array/src/arrays/extension/array.rs index 757c3042484..2c11008fd04 100644 --- a/vortex-array/src/arrays/extension/array.rs +++ b/vortex-array/src/arrays/extension/array.rs @@ -6,6 +6,7 @@ use vortex_error::VortexResult; use crate::ArrayRef; use crate::array::Array; +use crate::array::ArrayView; use crate::array::ArrayParts; use crate::arrays::Extension; use crate::dtype::DType; @@ -58,7 +59,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["storage"]; pub struct ExtensionData { /// The storage dtype. This **must** be a [`Extension::DType`] variant. pub(super) ext_dtype: ExtDTypeRef, - pub(super) slots: Vec>, } impl ExtensionData { @@ -110,38 +110,50 @@ impl ExtensionData { Self { ext_dtype, - slots: vec![Some(storage_array)], } } - /// Returns the length of this array. - pub fn len(&self) -> usize { - self.storage_array().len() + /// The extension dtype of this array. + pub fn ext_dtype(&self) -> &ExtDTypeRef { + &self.ext_dtype } +} + +pub trait ExtensionArrayExt { + fn extension_data(&self) -> &ExtensionData; + fn storage_array(&self) -> &ArrayRef; +} - /// Returns the [`DType`] of this array. - pub fn dtype(&self) -> DType { - DType::Extension(self.ext_dtype.clone()) +impl ExtensionArrayExt for Array { + fn extension_data(&self) -> &ExtensionData { + self.data() } - /// Returns `true` if this array is empty. - pub fn is_empty(&self) -> bool { - self.len() == 0 + fn storage_array(&self) -> &ArrayRef { + self.slots()[STORAGE_SLOT] + .as_ref() + .vortex_expect("ExtensionArray storage slot") } +} - /// The extension dtype of this array. - pub fn ext_dtype(&self) -> &ExtDTypeRef { - &self.ext_dtype +impl ExtensionArrayExt for ArrayView<'_, Extension> { + fn extension_data(&self) -> &ExtensionData { + self.data() } - pub fn storage_array(&self) -> &ArrayRef { - self.slots[STORAGE_SLOT] + fn storage_array(&self) -> &ArrayRef { + self.slots()[STORAGE_SLOT] .as_ref() .vortex_expect("ExtensionArray storage slot") } } impl Array { + #[inline] + pub fn storage_array(&self) -> &ArrayRef { + ExtensionArrayExt::storage_array(self) + } + /// Constructs a new `ExtensionArray`. /// /// # Panics @@ -150,15 +162,32 @@ impl Array { pub fn new(ext_dtype: ExtDTypeRef, storage_array: ArrayRef) -> Self { let dtype = DType::Extension(ext_dtype.clone()); let len = storage_array.len(); - let data = ExtensionData::new(ext_dtype, storage_array); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Extension, dtype, len, data)) } + let data = ExtensionData::new(ext_dtype, storage_array.clone()); + unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Extension, dtype, len, data) + .with_slots(vec![Some(storage_array)]), + ) + } } /// Tries to construct a new `ExtensionArray`. pub fn try_new(ext_dtype: ExtDTypeRef, storage_array: ArrayRef) -> VortexResult { let dtype = DType::Extension(ext_dtype.clone()); let len = storage_array.len(); - let data = ExtensionData::try_new(ext_dtype, storage_array)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Extension, dtype, len, data)) }) + let data = ExtensionData::try_new(ext_dtype, storage_array.clone())?; + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Extension, dtype, len, data) + .with_slots(vec![Some(storage_array)]), + ) + }) + } +} + +impl ArrayView<'_, Extension> { + #[inline] + pub fn storage_array(&self) -> &ArrayRef { + ExtensionArrayExt::storage_array(self) } } diff --git a/vortex-array/src/arrays/extension/mod.rs b/vortex-array/src/arrays/extension/mod.rs index 3e4502cc522..19b81cfd2df 100644 --- a/vortex-array/src/arrays/extension/mod.rs +++ b/vortex-array/src/arrays/extension/mod.rs @@ -3,6 +3,7 @@ mod array; pub use array::ExtensionData; +pub use array::ExtensionArrayExt; pub use vtable::ExtensionArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/extension/vtable/mod.rs b/vortex-array/src/arrays/extension/vtable/mod.rs index 873efa53ea9..131b257a4f6 100644 --- a/vortex-array/src/arrays/extension/vtable/mod.rs +++ b/vortex-array/src/arrays/extension/vtable/mod.rs @@ -6,6 +6,7 @@ mod operations; mod validity; use kernel::PARENT_KERNELS; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -21,8 +22,9 @@ use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; use crate::array::ValidityVTableFromChild; +use crate::arrays::extension::ExtensionArrayExt; use crate::arrays::extension::ExtensionData; -use crate::arrays::extension::array::NUM_SLOTS; +use crate::arrays::extension::array::STORAGE_SLOT; use crate::arrays::extension::array::SLOT_NAMES; use crate::arrays::extension::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; @@ -70,10 +72,6 @@ impl VTable for Extension { None } - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() - } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { array.slots() } @@ -87,14 +85,18 @@ impl VTable for Extension { } fn validate(&self, data: &ExtensionData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + _ = data; + let storage = slots[STORAGE_SLOT] + .as_ref() + .vortex_expect("ExtensionArray storage slot"); vortex_ensure!( - data.len() == len, + storage.len() == len, "ExtensionArray length {} does not match outer length {}", - data.len(), + storage.len(), len ); - let actual_dtype = data.dtype(); + let actual_dtype = DType::Extension(data.ext_dtype.clone()); vortex_ensure!( &actual_dtype == dtype, "ExtensionArray dtype {} does not match outer dtype {}", @@ -114,7 +116,7 @@ impl VTable for Extension { _buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { if !metadata.is_empty() { vortex_bail!( "ExtensionArray expects empty metadata, got {} bytes", @@ -128,7 +130,15 @@ impl VTable for Extension { vortex_bail!("Expected 1 child, got {}", children.len()); } let storage = children.get(0, ext_dtype.storage_dtype(), len)?; - Ok(ExtensionData::new(ext_dtype.clone(), storage)) + Ok( + crate::array::ArrayParts::new( + self.clone(), + dtype.clone(), + len, + ExtensionData::new(ext_dtype.clone(), storage.clone()), + ) + .with_slots(vec![Some(storage)]), + ) } diff --git a/vortex-array/src/arrays/extension/vtable/validity.rs b/vortex-array/src/arrays/extension/vtable/validity.rs index a264f9133aa..6d535687088 100644 --- a/vortex-array/src/arrays/extension/vtable/validity.rs +++ b/vortex-array/src/arrays/extension/vtable/validity.rs @@ -2,12 +2,13 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use crate::ArrayRef; +use crate::array::ArrayView; use crate::array::ValidityChild; use crate::arrays::Extension; -use crate::arrays::extension::ExtensionData; +use crate::arrays::extension::ExtensionArrayExt; impl ValidityChild for Extension { - fn validity_child(array: &ExtensionData) -> &ArrayRef { - array.storage_array() + fn validity_child(array: ArrayView<'_, Extension>) -> ArrayRef { + array.storage_array().clone() } } diff --git a/vortex-array/src/arrays/filter/rules.rs b/vortex-array/src/arrays/filter/rules.rs index 9d970d66e63..45e938d7768 100644 --- a/vortex-array/src/arrays/filter/rules.rs +++ b/vortex-array/src/arrays/filter/rules.rs @@ -75,7 +75,7 @@ impl ArrayReduceRule for FilterStructRule { struct_fields, validity, .. - } = struct_array.into_owned().into_data().into_parts(); + } = struct_array.into_owned().into_data_parts(); let filtered_validity = validity.filter(mask)?; diff --git a/vortex-array/src/arrays/filter/vtable.rs b/vortex-array/src/arrays/filter/vtable.rs index 6aeae157b0b..b9a13a7e37a 100644 --- a/vortex-array/src/arrays/filter/vtable.rs +++ b/vortex-array/src/arrays/filter/vtable.rs @@ -127,7 +127,7 @@ impl VTable for Filter { _buffers: &[BufferHandle], _children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { vortex_bail!("Filter array is not serializable") } diff --git a/vortex-array/src/arrays/fixed_size_list/array.rs b/vortex-array/src/arrays/fixed_size_list/array.rs index eb1ef6d7aff..5e117db4e06 100644 --- a/vortex-array/src/arrays/fixed_size_list/array.rs +++ b/vortex-array/src/arrays/fixed_size_list/array.rs @@ -10,11 +10,11 @@ use vortex_error::vortex_ensure; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::FixedSizeList; use crate::dtype::DType; -use crate::dtype::Nullability; use crate::validity::Validity; /// The `elements` data array, where each fixed-size list scalar is a _slice_ of the `elements` @@ -81,17 +81,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["elements", "validity"]; /// ``` #[derive(Clone, Debug)] pub struct FixedSizeListData { - /// The nullability of the fixed-size list array. - pub(super) nullability: Nullability, - - /// Slots holding [elements]. - pub(super) slots: Vec>, - - /// The size of each fixed-size list scalar in the array. - /// - /// We store the size of each fixed-size list in the array as a field for convenience. - list_size: u32, - /// The length of the array. /// /// Note that this is different from the size of each fixed-size list scalar (`list_size`). @@ -102,7 +91,21 @@ pub struct FixedSizeListData { pub(super) degenerate_len: usize, } +pub struct FixedSizeListDataParts { + pub elements: ArrayRef, + pub validity: Validity, + pub dtype: DType, +} + impl FixedSizeListData { + pub(crate) fn make_slots( + elements: ArrayRef, + validity: &Validity, + len: usize, + ) -> Vec> { + vec![Some(elements), validity_to_child(validity, len)] + } + /// Creates a new `FixedSizeListArray`. /// /// # Panics @@ -160,29 +163,11 @@ impl FixedSizeListData { Self::validate(&elements, len, list_size, &validity) .vortex_expect("[Debug Assertion]: Invalid `FixedSizeListArray` parameters"); - let nullability = validity.nullability(); - let validity_slot = validity_to_child(&validity, len); - Self { - nullability, - slots: vec![Some(elements), validity_slot], - list_size, degenerate_len: if list_size == 0 { len } else { 0 }, } } - pub fn into_parts(mut self) -> (ArrayRef, Validity, DType) { - let dtype = self.dtype(); - let validity = self.validity(); - ( - self.slots[ELEMENTS_SLOT] - .take() - .vortex_expect("FixedSizeListArray elements slot"), - validity, - dtype, - ) - } - /// Validates the components that would be used to create a `FixedSizeListArray`. /// /// This function checks all the invariants required by `FixedSizeListArray::new_unchecked`. @@ -219,50 +204,77 @@ impl FixedSizeListData { Ok(()) } - /// Returns the dtype of the array. - pub fn dtype(&self) -> DType { - DType::FixedSizeList( - Arc::new(self.elements().dtype().clone()), - self.list_size, - self.nullability, - ) - } +} + +pub trait FixedSizeListArrayExt { + fn fixed_size_list_data(&self) -> &FixedSizeListData; + fn as_slots(&self) -> &[Option]; + fn len(&self) -> usize; + fn dtype(&self) -> &DType; - /// Returns the length of the array. - pub fn len(&self) -> usize { - if self.list_size == 0 { - self.degenerate_len - } else { - self.elements().len() / self.list_size as usize + fn dtype_parts(&self) -> (&DType, u32, crate::dtype::Nullability) { + match self.dtype() { + DType::FixedSizeList(element_dtype, list_size, nullability) => { + (element_dtype.as_ref(), *list_size, *nullability) + } + _ => unreachable!("FixedSizeListArrayExt requires a fixed-size list dtype"), } } - /// Returns `true` if the array is empty. - pub fn is_empty(&self) -> bool { - self.len() == 0 + fn elements(&self) -> &ArrayRef { + self.as_slots()[ELEMENTS_SLOT] + .as_ref() + .vortex_expect("FixedSizeListArray elements slot") } - /// Returns the validity of the array. - #[allow(clippy::same_name_method)] - pub fn validity(&self) -> Validity { - child_to_validity(&self.slots[VALIDITY_SLOT], self.nullability) + fn list_size(&self) -> u32 { + let (_, list_size, _) = self.dtype_parts(); + list_size } - /// Returns the validity as a [`Mask`](vortex_mask::Mask). - pub fn validity_mask(&self) -> vortex_mask::Mask { - self.validity().to_mask(self.len()) + fn fixed_size_list_validity(&self) -> Validity { + let (_, _, nullability) = self.dtype_parts(); + child_to_validity(&self.as_slots()[VALIDITY_SLOT], nullability) } - /// Returns the elements array. - pub fn elements(&self) -> &ArrayRef { - self.slots[ELEMENTS_SLOT] - .as_ref() - .vortex_expect("FixedSizeListArray elements slot") + fn fixed_size_list_validity_mask(&self) -> vortex_mask::Mask { + self.fixed_size_list_validity().to_mask(self.len()) + } +} + +impl FixedSizeListArrayExt for Array { + fn fixed_size_list_data(&self) -> &FixedSizeListData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } + + fn len(&self) -> usize { + Array::len(self) + } + + fn dtype(&self) -> &DType { + Array::dtype(self) + } +} + +impl FixedSizeListArrayExt for ArrayView<'_, FixedSizeList> { + fn fixed_size_list_data(&self) -> &FixedSizeListData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() } - /// The size of each fixed-size list scalar in the array. - pub const fn list_size(&self) -> u32 { - self.list_size + fn len(&self) -> usize { + ArrayView::len(self) + } + + fn dtype(&self) -> &DType { + ArrayView::dtype(self) } } @@ -274,8 +286,13 @@ impl Array { list_size, validity.nullability(), ); + let slots = FixedSizeListData::make_slots(elements.clone(), &validity, len); let data = FixedSizeListData::new(elements, list_size, validity, len); - unsafe { Array::from_parts_unchecked(ArrayParts::new(FixedSizeList, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked( + ArrayParts::new(FixedSizeList, dtype, len, data).with_slots(slots), + ) + } } /// Constructs a new `FixedSizeListArray`. @@ -290,12 +307,13 @@ impl Array { list_size, validity.nullability(), ); + let slots = FixedSizeListData::make_slots(elements.clone(), &validity, len); let data = FixedSizeListData::try_new(elements, list_size, validity, len)?; - Ok( - unsafe { - Array::from_parts_unchecked(ArrayParts::new(FixedSizeList, dtype, len, data)) - }, - ) + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(FixedSizeList, dtype, len, data).with_slots(slots), + ) + }) } /// Creates a new `FixedSizeListArray` without validation. @@ -314,23 +332,87 @@ impl Array { list_size, validity.nullability(), ); + let slots = FixedSizeListData::make_slots(elements.clone(), &validity, len); let data = unsafe { FixedSizeListData::new_unchecked(elements, list_size, validity, len) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(FixedSizeList, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked( + ArrayParts::new(FixedSizeList, dtype, len, data).with_slots(slots), + ) + } + } + + pub fn elements(&self) -> &ArrayRef { + FixedSizeListArrayExt::elements(self) + } + + pub fn list_size(&self) -> u32 { + FixedSizeListArrayExt::list_size(self) + } + + pub fn fixed_size_list_validity(&self) -> Validity { + FixedSizeListArrayExt::fixed_size_list_validity(self) + } + + pub fn fixed_size_list_validity_mask(&self) -> vortex_mask::Mask { + FixedSizeListArrayExt::fixed_size_list_validity_mask(self) + } + + pub fn into_data_parts(self) -> FixedSizeListDataParts { + let parts = self.into_parts(); + FixedSizeListDataParts { + elements: parts.slots[ELEMENTS_SLOT] + .clone() + .vortex_expect("FixedSizeListArray elements slot"), + validity: child_to_validity(&parts.slots[VALIDITY_SLOT], parts.dtype.nullability()), + dtype: parts.dtype, + } } } -impl FixedSizeListData { +impl Array { + pub fn fixed_size_list_elements_at(&self, index: usize) -> VortexResult { + debug_assert!( + index < Array::len(self), + "index {} out of bounds: the len is {}", + index, + Array::len(self), + ); + debug_assert!(self.fixed_size_list_validity().is_valid(index).unwrap_or(false)); + + let start = self.list_size() as usize * index; + let end = self.list_size() as usize * (index + 1); + self.elements().slice(start..end) + } +} + +impl ArrayView<'_, FixedSizeList> { + pub fn elements(&self) -> &ArrayRef { + FixedSizeListArrayExt::elements(self) + } + + pub fn list_size(&self) -> u32 { + FixedSizeListArrayExt::list_size(self) + } + + pub fn fixed_size_list_validity(&self) -> Validity { + FixedSizeListArrayExt::fixed_size_list_validity(self) + } + + pub fn fixed_size_list_validity_mask(&self) -> vortex_mask::Mask { + FixedSizeListArrayExt::fixed_size_list_validity_mask(self) + } + pub fn fixed_size_list_elements_at(&self, index: usize) -> VortexResult { debug_assert!( - index < self.len(), + index < ArrayView::len(self), "index {} out of bounds: the len is {}", index, - self.len(), + ArrayView::len(self), ); - debug_assert!(self.validity().is_valid(index).unwrap_or(false)); + debug_assert!(self.fixed_size_list_validity().is_valid(index).unwrap_or(false)); - let start = self.list_size as usize * index; - let end = self.list_size as usize * (index + 1); + let start = self.list_size() as usize * index; + let end = self.list_size() as usize * (index + 1); self.elements().slice(start..end) } } diff --git a/vortex-array/src/arrays/fixed_size_list/compute/take.rs b/vortex-array/src/arrays/fixed_size_list/compute/take.rs index ac9090c5a4b..560d649effe 100644 --- a/vortex-array/src/arrays/fixed_size_list/compute/take.rs +++ b/vortex-array/src/arrays/fixed_size_list/compute/take.rs @@ -13,6 +13,7 @@ use crate::array::ArrayView; use crate::arrays::FixedSizeList; use crate::arrays::FixedSizeListArray; use crate::arrays::Primitive; +use crate::arrays::primitive::PrimitiveArrayExt; use crate::arrays::PrimitiveArray; use crate::arrays::dict::TakeExecute; use crate::dtype::IntegerPType; @@ -146,7 +147,7 @@ fn take_nullable_fsl( let indices: &[I] = indices_array.as_slice::(); let new_len = indices.len(); - let array_validity = array.validity_mask(); + let array_validity = array.fixed_size_list_validity_mask(); let indices_validity = indices_array.validity_mask(); // We must use placeholder zeros for null lists to maintain the array length without diff --git a/vortex-array/src/arrays/fixed_size_list/mod.rs b/vortex-array/src/arrays/fixed_size_list/mod.rs index 875ee8ba393..5d55d22d880 100644 --- a/vortex-array/src/arrays/fixed_size_list/mod.rs +++ b/vortex-array/src/arrays/fixed_size_list/mod.rs @@ -2,7 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; +pub use array::FixedSizeListArrayExt; pub use array::FixedSizeListData; +pub use array::FixedSizeListDataParts; pub use vtable::FixedSizeListArray; pub(crate) mod compute; 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 962de8cf3f4..9b346a1152d 100644 --- a/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs +++ b/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs @@ -2,7 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use std::hash::Hash; +use std::sync::Arc; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -17,6 +19,7 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; +use crate::arrays::fixed_size_list::FixedSizeListArrayExt; use crate::arrays::fixed_size_list::FixedSizeListData; use crate::arrays::fixed_size_list::array::NUM_SLOTS; use crate::arrays::fixed_size_list::array::SLOT_NAMES; @@ -58,7 +61,7 @@ impl VTable for FixedSizeList { ) { array.elements().array_hash(state, precision); array.list_size().hash(state); - array.data().validity().array_hash(state, precision); + array.fixed_size_list_validity().array_hash(state, precision); } fn array_eq( @@ -68,7 +71,9 @@ impl VTable for FixedSizeList { ) -> bool { array.elements().array_eq(other.elements(), precision) && array.list_size() == other.list_size() - && array.data().validity().array_eq(&other.data().validity(), precision) + && array + .fixed_size_list_validity() + .array_eq(&other.fixed_size_list_validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -105,14 +110,29 @@ impl VTable for FixedSizeList { } fn validate(&self, data: &FixedSizeListData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + vortex_ensure!(slots.len() == NUM_SLOTS, "FixedSizeListArray expected {NUM_SLOTS} slots, found {}", slots.len()); + let DType::FixedSizeList(_, list_size, nullability) = dtype else { + vortex_bail!("Expected `DType::FixedSizeList`, got {dtype:?}"); + }; + let elements = slots[crate::arrays::fixed_size_list::array::ELEMENTS_SLOT] + .as_ref() + .vortex_expect("FixedSizeListArray elements slot"); vortex_ensure!( - data.len() == len, + if *list_size == 0 { + data.degenerate_len == len + } else { + elements.len() / *list_size as usize == len + }, "FixedSizeListArray length {} does not match outer length {}", - data.len(), + len, len ); - let actual_dtype = data.dtype(); + let actual_dtype = DType::FixedSizeList( + Arc::new(elements.dtype().clone()), + *list_size, + *nullability, + ); vortex_ensure!( &actual_dtype == dtype, "FixedSizeListArray dtype {} does not match outer dtype {}", @@ -132,7 +152,7 @@ impl VTable for FixedSizeList { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { if !metadata.is_empty() { vortex_bail!( "FixedSizeListArray expects empty metadata, got {} bytes", @@ -165,11 +185,9 @@ impl VTable for FixedSizeList { let num_elements = len * (*list_size as usize); let elements = children.get(0, element_dtype.as_ref(), num_elements)?; - FixedSizeListData::try_new(elements, *list_size, validity, len) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + let data = FixedSizeListData::try_new(elements.clone(), *list_size, validity.clone(), len)?; + let slots = FixedSizeListData::make_slots(elements, &validity, len); + Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { diff --git a/vortex-array/src/arrays/fixed_size_list/vtable/validity.rs b/vortex-array/src/arrays/fixed_size_list/vtable/validity.rs index 5be93a4cc97..2740dd95d9c 100644 --- a/vortex-array/src/arrays/fixed_size_list/vtable/validity.rs +++ b/vortex-array/src/arrays/fixed_size_list/vtable/validity.rs @@ -5,11 +5,12 @@ use vortex_error::VortexResult; use crate::array::ArrayView; use crate::array::ValidityVTable; +use crate::arrays::fixed_size_list::FixedSizeListArrayExt; use crate::arrays::fixed_size_list::vtable::FixedSizeList; use crate::validity::Validity; impl ValidityVTable for FixedSizeList { fn validity(array: ArrayView<'_, FixedSizeList>) -> VortexResult { - Ok(array.data().validity()) + Ok(array.fixed_size_list_validity()) } } diff --git a/vortex-array/src/arrays/list/array.rs b/vortex-array/src/arrays/list/array.rs index b8f99c35804..acd6b1fc306 100644 --- a/vortex-array/src/arrays/list/array.rs +++ b/vortex-array/src/arrays/list/array.rs @@ -17,6 +17,7 @@ use crate::VortexSessionExecute; use crate::aggregate_fn::fns::min_max::min_max; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::ConstantArray; @@ -25,7 +26,6 @@ use crate::arrays::Primitive; use crate::builtins::ArrayBuiltins; use crate::dtype::DType; use crate::dtype::NativePType; -use crate::dtype::Nullability; use crate::match_each_integer_ptype; use crate::match_each_native_ptype; use crate::scalar_fn::fns::operators::Operator; @@ -92,11 +92,8 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["elements", "offsets", "validi /// let third_list = list_array.list_elements_at(2).unwrap(); /// assert!(third_list.is_empty()); // [] /// ``` -#[derive(Clone, Debug)] -pub struct ListData { - pub(super) nullability: Nullability, - pub(super) slots: Vec>, -} +#[derive(Clone, Debug, Default)] +pub struct ListData; pub struct ListDataParts { pub elements: ArrayRef, @@ -106,6 +103,15 @@ pub struct ListDataParts { } impl ListData { + pub(crate) fn make_slots( + elements: ArrayRef, + offsets: ArrayRef, + validity: &Validity, + len: usize, + ) -> Vec> { + vec![Some(elements), Some(offsets), validity_to_child(validity, len)] + } + /// Creates a new `ListArray`. /// /// # Panics @@ -156,13 +162,8 @@ impl ListData { 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 { - nullability: validity.nullability(), - slots: vec![Some(elements), Some(offsets), validity_slot], - } + drop(validity); + Self } /// Validates the components that would be used to create a `ListArray`. @@ -249,41 +250,47 @@ impl ListData { Ok(()) } - /// Returns the dtype of the array. - pub fn dtype(&self) -> DType { - DType::List(Arc::new(self.elements().dtype().clone()), self.nullability) + // TODO(connor)[ListView]: Create 2 functions `reset_offsets` and `recursive_reset_offsets`, + // where `reset_offsets` is infallible. + // Also, `reset_offsets` can be made more efficient by replacing `sub_scalar` with a match on + // the offset type and manual subtraction and fast path where `offsets[0] == 0`. +} + +pub trait ListArrayExt { + fn list_data(&self) -> &ListData; + fn as_slots(&self) -> &[Option]; + fn len(&self) -> usize; + fn dtype(&self) -> &DType; + + fn nullability(&self) -> crate::dtype::Nullability { + match self.dtype() { + DType::List(_, nullability) => *nullability, + _ => unreachable!("ListArrayExt requires a list dtype"), + } } - /// Returns the length of the array. - pub fn len(&self) -> usize { - self.offsets().len().saturating_sub(1) + fn elements(&self) -> &ArrayRef { + self.as_slots()[ELEMENTS_SLOT] + .as_ref() + .vortex_expect("ListArray elements slot") } - /// Returns `true` if the array is empty. - pub fn is_empty(&self) -> bool { - self.len() == 0 + fn offsets(&self) -> &ArrayRef { + self.as_slots()[OFFSETS_SLOT] + .as_ref() + .vortex_expect("ListArray offsets slot") } - /// Returns the validity of the array. - #[allow(clippy::same_name_method)] - pub fn validity(&self) -> Validity { - child_to_validity(&self.slots[VALIDITY_SLOT], self.nullability) + fn list_validity(&self) -> Validity { + child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.nullability()) } - /// Returns the validity as a [`Mask`](vortex_mask::Mask). - pub fn validity_mask(&self) -> vortex_mask::Mask { - self.validity().to_mask(self.len()) + fn list_validity_mask(&self) -> vortex_mask::Mask { + self.list_validity().to_mask(self.len()) } - /// Returns the offset at the given index from the list array. - /// - /// Returns an error if the index is out of bounds or scalar_at fails. - pub fn offset_at(&self, index: usize) -> VortexResult { - vortex_ensure!( - index <= self.len(), - "Index {index} out of bounds 0..={}", - self.len() - ); + fn offset_at(&self, index: usize) -> VortexResult { + vortex_ensure!(index <= self.len(), "Index {index} out of bounds 0..={}", self.len()); if let Some(p) = self.offsets().as_opt::() { Ok(match_each_native_ptype!(p.ptype(), |P| { @@ -298,61 +305,53 @@ impl ListData { } } - /// Returns the elements of the list scalar at the given index of the list array. - pub fn list_elements_at(&self, index: usize) -> VortexResult { + fn list_elements_at(&self, index: usize) -> VortexResult { let start = self.offset_at(index)?; let end = self.offset_at(index + 1)?; self.elements().slice(start..end) } - /// Returns elements of the list array referenced by the offsets array. - /// - /// This is useful for discarding any potentially unused parts of the underlying `elements` - /// child array. - pub fn sliced_elements(&self) -> VortexResult { + fn sliced_elements(&self) -> VortexResult { let start = self.offset_at(0)?; let end = self.offset_at(self.len())?; self.elements().slice(start..end) } +} - /// Returns the offsets array. - pub fn offsets(&self) -> &ArrayRef { - self.slots[OFFSETS_SLOT] - .as_ref() - .vortex_expect("ListArray offsets slot") +impl ListArrayExt for Array { + fn list_data(&self) -> &ListData { + self.data() } - /// Returns the element dtype of the list array. - pub fn element_dtype(&self) -> &DType { - self.elements().dtype() + fn as_slots(&self) -> &[Option] { + self.slots() } - /// Returns the elements array. - pub fn elements(&self) -> &ArrayRef { - self.slots[ELEMENTS_SLOT] - .as_ref() - .vortex_expect("ListArray elements slot") + fn len(&self) -> usize { + Array::len(self) } - pub fn into_parts(mut self) -> ListDataParts { - let dtype = self.dtype(); - let validity = self.validity(); - ListDataParts { - elements: self.slots[ELEMENTS_SLOT] - .take() - .vortex_expect("ListArray elements slot"), - offsets: self.slots[OFFSETS_SLOT] - .take() - .vortex_expect("ListArray offsets slot"), - validity, - dtype, - } + fn dtype(&self) -> &DType { + Array::dtype(self) } +} - // TODO(connor)[ListView]: Create 2 functions `reset_offsets` and `recursive_reset_offsets`, - // where `reset_offsets` is infallible. - // Also, `reset_offsets` can be made more efficient by replacing `sub_scalar` with a match on - // the offset type and manual subtraction and fast path where `offsets[0] == 0`. +impl ListArrayExt for ArrayView<'_, List> { + fn list_data(&self) -> &ListData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } + + fn len(&self) -> usize { + ArrayView::len(self) + } + + fn dtype(&self) -> &DType { + ArrayView::dtype(self) + } } impl Array { @@ -360,8 +359,9 @@ impl Array { pub fn new(elements: ArrayRef, offsets: ArrayRef, validity: Validity) -> Self { let dtype = DType::List(Arc::new(elements.dtype().clone()), validity.nullability()); let len = offsets.len().saturating_sub(1); + let slots = ListData::make_slots(elements.clone(), offsets.clone(), &validity, len); let data = ListData::new(elements, offsets, validity); - unsafe { Array::from_parts_unchecked(ArrayParts::new(List, dtype, len, data)) } + unsafe { Array::from_parts_unchecked(ArrayParts::new(List, dtype, len, data).with_slots(slots)) } } /// Constructs a new `ListArray`. @@ -372,8 +372,9 @@ impl Array { ) -> VortexResult { let dtype = DType::List(Arc::new(elements.dtype().clone()), validity.nullability()); let len = offsets.len().saturating_sub(1); + let slots = ListData::make_slots(elements.clone(), offsets.clone(), &validity, len); let data = ListData::try_new(elements, offsets, validity)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(List, dtype, len, data)) }) + Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(List, dtype, len, data).with_slots(slots)) }) } /// Creates a new `ListArray` without validation. @@ -384,23 +385,63 @@ impl Array { pub unsafe fn new_unchecked(elements: ArrayRef, offsets: ArrayRef, validity: Validity) -> Self { let dtype = DType::List(Arc::new(elements.dtype().clone()), validity.nullability()); let len = offsets.len().saturating_sub(1); + let slots = ListData::make_slots(elements.clone(), offsets.clone(), &validity, len); let data = unsafe { ListData::new_unchecked(elements, offsets, validity) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(List, dtype, len, data)) } + unsafe { Array::from_parts_unchecked(ArrayParts::new(List, dtype, len, data).with_slots(slots)) } + } + + pub fn elements(&self) -> &ArrayRef { + ListArrayExt::elements(self) + } + + pub fn offsets(&self) -> &ArrayRef { + ListArrayExt::offsets(self) + } + + pub fn offset_at(&self, index: usize) -> VortexResult { + ListArrayExt::offset_at(self, index) + } + + pub fn list_elements_at(&self, index: usize) -> VortexResult { + ListArrayExt::list_elements_at(self, index) + } + + pub fn sliced_elements(&self) -> VortexResult { + ListArrayExt::sliced_elements(self) + } + + pub fn element_dtype(&self) -> &DType { + self.elements().dtype() + } + + pub fn list_validity(&self) -> Validity { + ListArrayExt::list_validity(self) + } + + pub fn list_validity_mask(&self) -> vortex_mask::Mask { + ListArrayExt::list_validity_mask(self) + } + + pub fn into_data_parts(self) -> ListDataParts { + let parts = self.into_parts(); + ListDataParts { + elements: parts.slots[ELEMENTS_SLOT] + .clone() + .vortex_expect("ListArray elements slot"), + offsets: parts.slots[OFFSETS_SLOT] + .clone() + .vortex_expect("ListArray offsets slot"), + validity: child_to_validity(&parts.slots[VALIDITY_SLOT], parts.dtype.nullability()), + dtype: parts.dtype, + } } -} -impl ListData { pub fn reset_offsets(&self, recurse: bool) -> VortexResult { let mut elements = self.sliced_elements()?; if recurse && elements.is_canonical() { elements = elements.to_canonical()?.compact()?.into_array(); } else if recurse && let Some(child_list_array) = elements.as_opt::() { - let data = child_list_array.reset_offsets(recurse)?; - let dtype = data.dtype(); - let len = data.len(); - elements = - unsafe { Array::from_parts_unchecked(ArrayParts::new(List, dtype, len, data)) } - .into_array(); + elements = child_list_array.into_owned().reset_offsets(recurse)?.into_array(); } let offsets = self.offsets(); @@ -410,6 +451,40 @@ impl ListData { Operator::Sub, )?; - Self::try_new(elements, adjusted_offsets, self.validity()) + Self::try_new(elements, adjusted_offsets, self.list_validity()) + } +} + +impl ArrayView<'_, List> { + pub fn elements(&self) -> &ArrayRef { + ListArrayExt::elements(self) + } + + pub fn offsets(&self) -> &ArrayRef { + ListArrayExt::offsets(self) + } + + pub fn offset_at(&self, index: usize) -> VortexResult { + ListArrayExt::offset_at(self, index) + } + + pub fn list_elements_at(&self, index: usize) -> VortexResult { + ListArrayExt::list_elements_at(self, index) + } + + pub fn sliced_elements(&self) -> VortexResult { + ListArrayExt::sliced_elements(self) + } + + pub fn element_dtype(&self) -> &DType { + self.elements().dtype() + } + + pub fn list_validity(&self) -> Validity { + ListArrayExt::list_validity(self) + } + + pub fn list_validity_mask(&self) -> vortex_mask::Mask { + ListArrayExt::list_validity_mask(self) } } diff --git a/vortex-array/src/arrays/list/compute/take.rs b/vortex-array/src/arrays/list/compute/take.rs index cc053c1d588..478ee6c3dad 100644 --- a/vortex-array/src/arrays/list/compute/take.rs +++ b/vortex-array/src/arrays/list/compute/take.rs @@ -10,6 +10,7 @@ use crate::array::ArrayView; use crate::arrays::List; use crate::arrays::ListArray; use crate::arrays::Primitive; +use crate::arrays::primitive::PrimitiveArrayExt; use crate::arrays::PrimitiveArray; use crate::arrays::dict::TakeExecute; use crate::builders::ArrayBuilder; @@ -57,7 +58,7 @@ fn _take( indices_array: ArrayView<'_, Primitive>, ctx: &mut ExecutionCtx, ) -> VortexResult { - let data_validity = array.validity_mask(); + let data_validity = array.list_validity_mask(); let indices_validity = indices_array.validity_mask(); if !indices_validity.all_true() || !data_validity.all_true() { @@ -122,7 +123,7 @@ fn _take_nullable(ctx)?; let offsets: &[O] = offsets_array.as_slice(); let indices: &[I] = indices_array.as_slice(); - let data_validity = array.validity_mask(); + let data_validity = array.list_validity_mask(); let indices_validity = indices_array.validity_mask(); let mut new_offsets = PrimitiveBuilder::::with_capacity( diff --git a/vortex-array/src/arrays/list/mod.rs b/vortex-array/src/arrays/list/mod.rs index 3147097ca80..c884f343a10 100644 --- a/vortex-array/src/arrays/list/mod.rs +++ b/vortex-array/src/arrays/list/mod.rs @@ -2,6 +2,7 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; +pub use array::ListArrayExt; pub use array::ListData; pub use array::ListDataParts; pub use vtable::ListArray; diff --git a/vortex-array/src/arrays/list/vtable/mod.rs b/vortex-array/src/arrays/list/vtable/mod.rs index cbe99cb6935..5be7503226c 100644 --- a/vortex-array/src/arrays/list/vtable/mod.rs +++ b/vortex-array/src/arrays/list/vtable/mod.rs @@ -1,7 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::sync::Arc; + use prost::Message; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -17,6 +20,7 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; +use crate::arrays::list::ListArrayExt; use crate::arrays::list::ListData; use crate::arrays::list::array::NUM_SLOTS; use crate::arrays::list::array::SLOT_NAMES; @@ -57,13 +61,13 @@ impl VTable for List { fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.elements().array_hash(state, precision); array.offsets().array_hash(state, precision); - array.data().validity().array_hash(state, precision); + array.list_validity().array_hash(state, precision); } fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.elements().array_eq(other.elements(), precision) && array.offsets().array_eq(other.offsets(), precision) - && array.data().validity().array_eq(&other.data().validity(), precision) + && array.list_validity().array_eq(&other.list_validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -96,15 +100,22 @@ impl VTable for List { )) } - fn validate(&self, data: &ListData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + fn validate(&self, _data: &ListData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + vortex_ensure!(slots.len() == NUM_SLOTS, "ListArray expected {NUM_SLOTS} slots, found {}", slots.len()); + let elements = slots[crate::arrays::list::array::ELEMENTS_SLOT] + .as_ref() + .vortex_expect("ListArray elements slot"); + let offsets = slots[crate::arrays::list::array::OFFSETS_SLOT] + .as_ref() + .vortex_expect("ListArray offsets slot"); vortex_ensure!( - data.len() == len, + offsets.len().saturating_sub(1) == len, "ListArray length {} does not match outer length {}", - data.len(), + offsets.len().saturating_sub(1), len ); - let actual_dtype = data.dtype(); + let actual_dtype = DType::List(Arc::new(elements.dtype().clone()), dtype.nullability()); vortex_ensure!( &actual_dtype == dtype, "ListArray dtype {} does not match outer dtype {}", @@ -124,7 +135,7 @@ impl VTable for List { _buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = ListMetadata::decode(metadata)?; let validity = if children.len() == 2 { Validity::from(dtype.nullability()) @@ -150,11 +161,9 @@ impl VTable for List { len + 1, )?; - ListData::try_new(elements, offsets, validity) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + let data = ListData::try_new(elements.clone(), offsets.clone(), validity.clone())?; + let slots = ListData::make_slots(elements, offsets, &validity, len); + Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { diff --git a/vortex-array/src/arrays/list/vtable/validity.rs b/vortex-array/src/arrays/list/vtable/validity.rs index 5d6b6c14d4f..f786c432656 100644 --- a/vortex-array/src/arrays/list/vtable/validity.rs +++ b/vortex-array/src/arrays/list/vtable/validity.rs @@ -10,6 +10,6 @@ use crate::validity::Validity; impl ValidityVTable for List { fn validity(array: ArrayView<'_, List>) -> VortexResult { - Ok(array.data().validity()) + Ok(array.list_validity()) } } diff --git a/vortex-array/src/arrays/listview/array.rs b/vortex-array/src/arrays/listview/array.rs index c25dce40f43..58af73d1833 100644 --- a/vortex-array/src/arrays/listview/array.rs +++ b/vortex-array/src/arrays/listview/array.rs @@ -14,6 +14,7 @@ use crate::ArrayRef; use crate::ToCanonical; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::ListView; @@ -22,7 +23,6 @@ use crate::arrays::PrimitiveArray; use crate::arrays::bool; use crate::dtype::DType; use crate::dtype::IntegerPType; -use crate::dtype::Nullability; use crate::match_each_integer_ptype; use crate::validity::Validity; @@ -108,12 +108,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["elements", "offsets", "sizes" /// [`ListArray`]: crate::arrays::ListArray #[derive(Clone, Debug)] pub struct ListViewData { - /// The nullability of the list array. - pub(super) nullability: Nullability, - - /// 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). /// @@ -142,6 +136,21 @@ pub struct ListViewDataParts { } impl ListViewData { + pub(crate) fn make_slots( + elements: ArrayRef, + offsets: ArrayRef, + sizes: ArrayRef, + validity: &Validity, + len: usize, + ) -> Vec> { + vec![ + Some(elements), + Some(offsets), + Some(sizes), + validity_to_child(validity, len), + ] + } + /// Creates a new `ListViewArray`. /// /// # Panics @@ -167,12 +176,7 @@ impl ListViewData { ) -> VortexResult { Self::validate(&elements, &offsets, &sizes, &validity)?; - let len = offsets.len(); - let validity_slot = validity_to_child(&validity, len); - Ok(Self { - nullability: validity.nullability(), - slots: vec![Some(elements), Some(offsets), Some(sizes), validity_slot], is_zero_copy_to_list: false, }) } @@ -207,12 +211,7 @@ impl ListViewData { .vortex_expect("Failed to crate `ListViewArray`"); } - let len = offsets.len(); - let validity_slot = validity_to_child(&validity, len); - Self { - nullability: validity.nullability(), - slots: vec![Some(elements), Some(offsets), Some(sizes), validity_slot], is_zero_copy_to_list: false, } } @@ -299,106 +298,62 @@ impl ListViewData { /// /// Note that leading and trailing unreferenced elements **ARE** allowed. 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(), - ) - .vortex_expect("Failed to validate zero-copy to list flag"); - } self.is_zero_copy_to_list = is_zctl; self } - /// Verifies that the `ListViewArray` is zero-copyable to a [`ListArray`]. - /// - /// This will run an expensive validation of the `ListViewArray`'s components. It will check the - /// following things: - /// - /// - Offsets must be sorted (but not strictly sorted, zero-length lists are allowed). - /// - No gaps in elements between first and last referenced elements. - /// - No overlapping list views (each element referenced at most once). - /// - /// Note that leading and trailing unreferenced elements **ARE** allowed. - /// - /// This method should really only be called if the caller knows that the `ListViewArray` will - /// be converted into a [`ListArray`] in the future, and the caller wants to set the - /// optimization flag to `true` with the unsafe [`with_zero_copy_to_list`] method. - /// - /// [`ListArray`]: crate::arrays::ListArray - /// [`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(), - ) - .is_ok() + /// Returns true if the `ListViewArray` is zero-copyable to a + /// [`ListArray`](crate::arrays::ListArray). + pub fn is_zero_copy_to_list(&self) -> bool { + self.is_zero_copy_to_list } +} - pub fn into_parts(mut self) -> ListViewDataParts { - let validity = self.validity(); - ListViewDataParts { - elements_dtype: Arc::new(self.elements().dtype().clone()), - elements: self.slots[ELEMENTS_SLOT] - .take() - .vortex_expect("ListViewArray elements slot"), - offsets: self.slots[OFFSETS_SLOT] - .take() - .vortex_expect("ListViewArray offsets slot"), - sizes: self.slots[SIZES_SLOT] - .take() - .vortex_expect("ListViewArray sizes slot"), - validity, +pub trait ListViewArrayExt { + fn listview_data(&self) -> &ListViewData; + fn as_slots(&self) -> &[Option]; + fn len(&self) -> usize; + fn dtype(&self) -> &DType; + + fn nullability(&self) -> crate::dtype::Nullability { + match self.dtype() { + DType::List(_, nullability) => *nullability, + _ => unreachable!("ListViewArrayExt requires a list dtype"), } } - /// Returns the dtype of the array. - pub fn dtype(&self) -> DType { - DType::List(Arc::new(self.elements().dtype().clone()), self.nullability) + fn elements(&self) -> &ArrayRef { + self.as_slots()[ELEMENTS_SLOT] + .as_ref() + .vortex_expect("ListViewArray elements slot") } - /// Returns the length of the array. - pub fn len(&self) -> usize { - debug_assert_eq!(self.offsets().len(), self.sizes().len()); - self.offsets().len() + fn offsets(&self) -> &ArrayRef { + self.as_slots()[OFFSETS_SLOT] + .as_ref() + .vortex_expect("ListViewArray offsets slot") } - /// Returns `true` if the array is empty. - pub fn is_empty(&self) -> bool { - self.len() == 0 + fn sizes(&self) -> &ArrayRef { + self.as_slots()[SIZES_SLOT] + .as_ref() + .vortex_expect("ListViewArray sizes slot") } - /// Returns the validity of the array. - #[allow(clippy::same_name_method)] - pub fn validity(&self) -> Validity { - child_to_validity(&self.slots[VALIDITY_SLOT], self.nullability) + fn listview_validity(&self) -> Validity { + child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.nullability()) } - /// Returns the validity as a [`Mask`](vortex_mask::Mask). - pub fn validity_mask(&self) -> vortex_mask::Mask { - self.validity().to_mask(self.len()) + fn listview_validity_mask(&self) -> vortex_mask::Mask { + self.listview_validity().to_mask(self.len()) } - /// Returns the offset at the given index. - /// - /// Note that it is possible the corresponding list view is null (which is only defined by the - /// validity map). Regardless, we are still guaranteed that this offset is valid by the - /// invariants of `ListViewArray`. - pub fn offset_at(&self, index: usize) -> usize { - assert!( - index < self.len(), - "Index {index} out of bounds 0..{}", - self.len() - ); - - // Fast path for `PrimitiveArray`. + fn offset_at(&self, index: usize) -> usize { + assert!(index < self.len(), "Index {index} out of bounds 0..{}", self.len()); 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() .scalar_at(index) .vortex_expect("offsets must support scalar_at") @@ -408,25 +363,12 @@ impl ListViewData { }) } - /// Returns the size at the given index. - /// - /// Note that it is possible the corresponding list view is null (which is only defined by the - /// validity map). Regardless, we are still guaranteed that this size is valid by the invariants - /// of `ListViewArray`. - pub fn size_at(&self, index: usize) -> usize { - assert!( - index < self.len(), - "Index {} out of bounds 0..{}", - index, - self.len() - ); - - // Fast path for `PrimitiveArray`. + fn size_at(&self, index: usize) -> usize { + assert!(index < self.len(), "Index {} out of bounds 0..{}", index, self.len()); 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() .scalar_at(index) .vortex_expect("sizes must support scalar_at") @@ -436,42 +378,46 @@ impl ListViewData { }) } - /// Returns the elements at the given index from the list array. - /// - /// # Errors - /// - /// Returns an error if the slice operation fails. - pub fn list_elements_at(&self, index: usize) -> VortexResult { + fn list_elements_at(&self, index: usize) -> VortexResult { let offset = self.offset_at(index); let size = self.size_at(index); self.elements().slice(offset..offset + size) } +} - /// Returns the offsets array. - pub fn offsets(&self) -> &ArrayRef { - self.slots[OFFSETS_SLOT] - .as_ref() - .vortex_expect("ListViewArray offsets slot") +impl ListViewArrayExt for Array { + fn listview_data(&self) -> &ListViewData { + self.data() } - /// Returns the sizes array. - pub fn sizes(&self) -> &ArrayRef { - self.slots[SIZES_SLOT] - .as_ref() - .vortex_expect("ListViewArray sizes slot") + fn as_slots(&self) -> &[Option] { + self.slots() } - /// Returns the elements array. - pub fn elements(&self) -> &ArrayRef { - self.slots[ELEMENTS_SLOT] - .as_ref() - .vortex_expect("ListViewArray elements slot") + fn len(&self) -> usize { + Array::len(self) } - /// Returns true if the `ListViewArray` is zero-copyable to a - /// [`ListArray`](crate::arrays::ListArray). - pub fn is_zero_copy_to_list(&self) -> bool { - self.is_zero_copy_to_list + fn dtype(&self) -> &DType { + Array::dtype(self) + } +} + +impl ListViewArrayExt for ArrayView<'_, ListView> { + fn listview_data(&self) -> &ListViewData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } + + fn len(&self) -> usize { + ArrayView::len(self) + } + + fn dtype(&self) -> &DType { + ArrayView::dtype(self) } } @@ -480,8 +426,12 @@ impl Array { pub fn new(elements: ArrayRef, offsets: ArrayRef, sizes: ArrayRef, validity: Validity) -> Self { let dtype = DType::List(Arc::new(elements.dtype().clone()), validity.nullability()); let len = offsets.len(); + let slots = + ListViewData::make_slots(elements.clone(), offsets.clone(), sizes.clone(), &validity, len); let data = ListViewData::new(elements, offsets, sizes, validity); - unsafe { Array::from_parts_unchecked(ArrayParts::new(ListView, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(ListView, dtype, len, data).with_slots(slots)) + } } /// Constructs a new `ListViewArray`. @@ -493,8 +443,12 @@ impl Array { ) -> VortexResult { let dtype = DType::List(Arc::new(elements.dtype().clone()), validity.nullability()); let len = offsets.len(); + let slots = + ListViewData::make_slots(elements.clone(), offsets.clone(), sizes.clone(), &validity, len); let data = ListViewData::try_new(elements, offsets, sizes, validity)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(ListView, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(ListView, dtype, len, data).with_slots(slots)) + }) } /// Creates a new `ListViewArray` without validation. @@ -510,8 +464,12 @@ impl Array { ) -> Self { let dtype = DType::List(Arc::new(elements.dtype().clone()), validity.nullability()); let len = offsets.len(); + let slots = + ListViewData::make_slots(elements.clone(), offsets.clone(), sizes.clone(), &validity, len); let data = unsafe { ListViewData::new_unchecked(elements, offsets, sizes, validity) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(ListView, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(ListView, dtype, len, data).with_slots(slots)) + } } /// Mark whether this list view can be zero-copy converted to a list. @@ -520,10 +478,116 @@ impl Array { /// /// See [`ListViewData::with_zero_copy_to_list`]. pub unsafe fn with_zero_copy_to_list(self, is_zctl: bool) -> Self { + if cfg!(debug_assertions) && is_zctl { + validate_zctl(self.elements(), self.offsets().to_primitive(), self.sizes().to_primitive()) + .vortex_expect("Failed to validate zero-copy to list flag"); + } let dtype = self.dtype().clone(); let len = self.len(); + let slots = self.slots().to_vec(); let data = unsafe { self.into_data().with_zero_copy_to_list(is_zctl) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(ListView, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(ListView, dtype, len, data).with_slots(slots)) + } + } + + pub fn verify_is_zero_copy_to_list(&self) -> bool { + validate_zctl(self.elements(), self.offsets().to_primitive(), self.sizes().to_primitive()) + .is_ok() + } + + pub fn elements(&self) -> &ArrayRef { + ListViewArrayExt::elements(self) + } + + pub fn offsets(&self) -> &ArrayRef { + ListViewArrayExt::offsets(self) + } + + pub fn sizes(&self) -> &ArrayRef { + ListViewArrayExt::sizes(self) + } + + pub fn offset_at(&self, index: usize) -> usize { + ListViewArrayExt::offset_at(self, index) + } + + pub fn size_at(&self, index: usize) -> usize { + ListViewArrayExt::size_at(self, index) + } + + pub fn list_elements_at(&self, index: usize) -> VortexResult { + ListViewArrayExt::list_elements_at(self, index) + } + + pub fn listview_validity(&self) -> Validity { + ListViewArrayExt::listview_validity(self) + } + + pub fn listview_validity_mask(&self) -> vortex_mask::Mask { + ListViewArrayExt::listview_validity_mask(self) + } + + pub fn into_data_parts(self) -> ListViewDataParts { + let parts = self.into_parts(); + ListViewDataParts { + elements_dtype: Arc::new( + parts.slots[ELEMENTS_SLOT] + .as_ref() + .vortex_expect("ListViewArray elements slot") + .dtype() + .clone(), + ), + elements: parts.slots[ELEMENTS_SLOT] + .clone() + .vortex_expect("ListViewArray elements slot"), + offsets: parts.slots[OFFSETS_SLOT] + .clone() + .vortex_expect("ListViewArray offsets slot"), + sizes: parts.slots[SIZES_SLOT] + .clone() + .vortex_expect("ListViewArray sizes slot"), + validity: child_to_validity(&parts.slots[VALIDITY_SLOT], parts.dtype.nullability()), + } + } +} + +impl ArrayView<'_, ListView> { + pub fn elements(&self) -> &ArrayRef { + ListViewArrayExt::elements(self) + } + + pub fn offsets(&self) -> &ArrayRef { + ListViewArrayExt::offsets(self) + } + + pub fn sizes(&self) -> &ArrayRef { + ListViewArrayExt::sizes(self) + } + + pub fn offset_at(&self, index: usize) -> usize { + ListViewArrayExt::offset_at(self, index) + } + + pub fn size_at(&self, index: usize) -> usize { + ListViewArrayExt::size_at(self, index) + } + + pub fn list_elements_at(&self, index: usize) -> VortexResult { + ListViewArrayExt::list_elements_at(self, index) + } + + pub fn listview_validity(&self) -> Validity { + ListViewArrayExt::listview_validity(self) + } + + pub fn listview_validity_mask(&self) -> vortex_mask::Mask { + ListViewArrayExt::listview_validity_mask(self) + } + + pub fn verify_is_zero_copy_to_list(&self) -> bool { + validate_zctl(self.elements(), self.offsets().to_primitive(), self.sizes().to_primitive()) + .is_ok() } } diff --git a/vortex-array/src/arrays/listview/conversion.rs b/vortex-array/src/arrays/listview/conversion.rs index c6b0633bbcf..8d244b8b722 100644 --- a/vortex-array/src/arrays/listview/conversion.rs +++ b/vortex-array/src/arrays/listview/conversion.rs @@ -38,11 +38,7 @@ pub fn list_view_from_list(list: ListArray, ctx: &mut ExecutionCtx) -> VortexRes // We reset the offsets here because mostly for convenience, and also because callers of this // function might not expect the output `ListViewArray` to have a bunch of leading and trailing // garbage data when they turn it back into a `ListArray`. - let data = list.reset_offsets(false).vortex_expect("This can't fail"); - let dtype = data.dtype(); - let len = data.len(); - let list: ListArray = - unsafe { Array::from_parts_unchecked(ArrayParts::new(List, dtype, len, data)) }; + let list = list.reset_offsets(false).vortex_expect("This can't fail"); let list_offsets = list.offsets().clone(); diff --git a/vortex-array/src/arrays/listview/mod.rs b/vortex-array/src/arrays/listview/mod.rs index 20dd6fe15d5..52faadf92ea 100644 --- a/vortex-array/src/arrays/listview/mod.rs +++ b/vortex-array/src/arrays/listview/mod.rs @@ -4,6 +4,7 @@ mod array; pub use array::ListViewData; pub use array::ListViewDataParts; +pub use array::ListViewArrayExt; pub use vtable::ListViewArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/listview/vtable/mod.rs b/vortex-array/src/arrays/listview/vtable/mod.rs index de5bb16e3a2..3a6d403b60d 100644 --- a/vortex-array/src/arrays/listview/vtable/mod.rs +++ b/vortex-array/src/arrays/listview/vtable/mod.rs @@ -1,7 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::sync::Arc; + use prost::Message; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; @@ -16,6 +19,7 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; +use crate::arrays::listview::ListViewArrayExt; use crate::arrays::listview::ListViewData; use crate::arrays::listview::array::NUM_SLOTS; use crate::arrays::listview::array::SLOT_NAMES; @@ -64,14 +68,16 @@ impl VTable for ListView { array.elements().array_hash(state, precision); array.offsets().array_hash(state, precision); array.sizes().array_hash(state, precision); - array.data().validity().array_hash(state, precision); + array.listview_validity().array_hash(state, precision); } fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.elements().array_eq(other.elements(), precision) && array.offsets().array_eq(other.offsets(), precision) && array.sizes().array_eq(other.sizes(), precision) - && array.data().validity().array_eq(&other.data().validity(), precision) + && array + .listview_validity() + .array_eq(&other.listview_validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -97,15 +103,25 @@ impl VTable for ListView { )) } - fn validate(&self, data: &ListViewData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + fn validate(&self, _data: &ListViewData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + vortex_ensure!(slots.len() == NUM_SLOTS, "ListViewArray expected {NUM_SLOTS} slots, found {}", slots.len()); + let elements = slots[crate::arrays::listview::array::ELEMENTS_SLOT] + .as_ref() + .vortex_expect("ListViewArray elements slot"); + let offsets = slots[crate::arrays::listview::array::OFFSETS_SLOT] + .as_ref() + .vortex_expect("ListViewArray offsets slot"); + let sizes = slots[crate::arrays::listview::array::SIZES_SLOT] + .as_ref() + .vortex_expect("ListViewArray sizes slot"); vortex_ensure!( - data.len() == len, + offsets.len() == len && sizes.len() == len, "ListViewArray length {} does not match outer length {}", - data.len(), + offsets.len(), len ); - let actual_dtype = data.dtype(); + let actual_dtype = DType::List(Arc::new(elements.dtype().clone()), dtype.nullability()); vortex_ensure!( &actual_dtype == dtype, "ListViewArray dtype {} does not match outer dtype {}", @@ -125,7 +141,7 @@ impl VTable for ListView { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = ListViewMetadata::decode(metadata)?; vortex_ensure!( buffers.is_empty(), @@ -169,11 +185,9 @@ impl VTable for ListView { len, )?; - ListViewData::try_new(elements, offsets, sizes, validity) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + let data = ListViewData::try_new(elements.clone(), offsets.clone(), sizes.clone(), validity.clone())?; + let slots = ListViewData::make_slots(elements, offsets, sizes, &validity, len); + Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { diff --git a/vortex-array/src/arrays/listview/vtable/validity.rs b/vortex-array/src/arrays/listview/vtable/validity.rs index 02be6bcedfd..64ede5cc142 100644 --- a/vortex-array/src/arrays/listview/vtable/validity.rs +++ b/vortex-array/src/arrays/listview/vtable/validity.rs @@ -5,11 +5,12 @@ use vortex_error::VortexResult; use crate::array::ArrayView; use crate::array::ValidityVTable; +use crate::arrays::listview::ListViewArrayExt; use crate::arrays::listview::vtable::ListView; use crate::validity::Validity; impl ValidityVTable for ListView { fn validity(array: ArrayView<'_, ListView>) -> VortexResult { - Ok(array.data().validity()) + Ok(array.listview_validity()) } } diff --git a/vortex-array/src/arrays/masked/vtable/mod.rs b/vortex-array/src/arrays/masked/vtable/mod.rs index de928eacc6e..1621d2973d8 100644 --- a/vortex-array/src/arrays/masked/vtable/mod.rs +++ b/vortex-array/src/arrays/masked/vtable/mod.rs @@ -19,6 +19,7 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; +use crate::array::validity_to_child; use crate::arrays::ConstantArray; use crate::arrays::masked::array::CHILD_SLOT; use crate::arrays::masked::MaskedData; @@ -112,7 +113,7 @@ impl VTable for Masked { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { if !metadata.is_empty() { vortex_bail!( "MaskedArray expects empty metadata, got {} bytes", @@ -138,7 +139,12 @@ impl VTable for Masked { Validity::from(dtype.nullability()) }; - MaskedData::try_new(child, validity) + let validity_slot = validity_to_child(&validity, len); + let data = MaskedData::try_new(child.clone(), validity)?; + Ok( + crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data) + .with_slots(vec![Some(child), validity_slot]), + ) } fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { diff --git a/vortex-array/src/arrays/null/mod.rs b/vortex-array/src/arrays/null/mod.rs index 327e5848bab..e6c30e37c69 100644 --- a/vortex-array/src/arrays/null/mod.rs +++ b/vortex-array/src/arrays/null/mod.rs @@ -92,20 +92,25 @@ impl VTable for Null { fn deserialize( &self, - _dtype: &DType, - _len: usize, + dtype: &DType, + len: usize, metadata: &[u8], _buffers: &[BufferHandle], _children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { vortex_ensure!( metadata.is_empty(), "NullArray expects empty metadata, got {} bytes", metadata.len() ); - Ok(NullData::new()) + Ok(ArrayParts::new( + self.clone(), + dtype.clone(), + len, + NullData::new(), + )) } fn reduce_parent( diff --git a/vortex-array/src/arrays/patched/array.rs b/vortex-array/src/arrays/patched/array.rs index 0f1d5ba4ca3..8677f428e6e 100644 --- a/vortex-array/src/arrays/patched/array.rs +++ b/vortex-array/src/arrays/patched/array.rs @@ -16,11 +16,13 @@ use crate::ExecutionCtx; use crate::IntoArray; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::arrays::Patched; use crate::arrays::PrimitiveArray; use crate::arrays::patched::TransposedPatches; use crate::arrays::patched::patch_lanes; use crate::buffer::BufferHandle; +use crate::dtype::DType; use crate::dtype::IntegerPType; use crate::dtype::NativePType; use crate::dtype::PType; @@ -42,14 +44,7 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["inner", "lane_offsets", "patch_indices", "patch_values"]; #[derive(Debug, Clone)] -pub struct PatchedArray { - /// Child arrays stored as slots: - /// 0: inner - the inner array being patched - /// 1: lane_offsets - u32 array for indexing into indices/values - /// 2: indices - u16 array of chunk indices - /// 3: values - array of patch values - pub(super) slots: Vec>, - +pub struct PatchedData { /// Number of lanes the patch indices and values have been split into. Each of the `n_chunks` /// of 1024 values is split into `n_lanes` lanes horizontally, each lane having 1024 / n_lanes /// values that might be patched. @@ -63,32 +58,189 @@ pub struct PatchedArray { pub(super) offset: usize, } -impl IntoArray for PatchedArray { - fn into_array(self) -> ArrayRef { - let dtype = self.base_array().dtype().clone(); - let len = self.len(); - unsafe { - Array::::from_parts_unchecked(ArrayParts::new(Patched, dtype, len, self)) - } - .into_array() +impl PatchedData { + pub(crate) fn validate( + &self, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { + let base_array = base_array_from_slots(slots); + let patch_indices = patch_indices_from_slots(slots); + let patch_values = patch_values_from_slots(slots); + + vortex_ensure!( + base_array.dtype() == dtype, + "PatchedArray base dtype {} does not match outer dtype {}", + base_array.dtype(), + dtype + ); + vortex_ensure!( + base_array.len() == len, + "PatchedArray base len {} does not match outer len {}", + base_array.len(), + len + ); + vortex_ensure!( + patch_indices.len() == patch_values.len(), + "PatchedArray patch indices len {} does not match patch values len {}", + patch_indices.len(), + patch_values.len() + ); + Ok(()) } } -impl From for ArrayRef { - fn from(value: PatchedArray) -> Self { - value.into_array() +fn base_array_from_slots(slots: &[Option]) -> &ArrayRef { + slots[INNER_SLOT] + .as_ref() + .vortex_expect("PatchedArray inner slot") +} + +fn lane_offsets_from_slots(slots: &[Option]) -> &ArrayRef { + slots[LANE_OFFSETS_SLOT] + .as_ref() + .vortex_expect("PatchedArray lane_offsets slot") +} + +fn patch_indices_from_slots(slots: &[Option]) -> &ArrayRef { + slots[INDICES_SLOT] + .as_ref() + .vortex_expect("PatchedArray indices slot") +} + +fn patch_values_from_slots(slots: &[Option]) -> &ArrayRef { + slots[VALUES_SLOT] + .as_ref() + .vortex_expect("PatchedArray values slot") +} + +pub trait PatchedArrayExt { + fn patched_data(&self) -> &PatchedData; + fn patched_slots(&self) -> &[Option]; + fn patched_len(&self) -> usize; + fn patched_dtype(&self) -> &DType; + + #[inline] + fn base_array(&self) -> &ArrayRef { + base_array_from_slots(self.patched_slots()) + } + + #[inline] + fn lane_offsets(&self) -> &ArrayRef { + lane_offsets_from_slots(self.patched_slots()) + } + + #[inline] + fn patch_indices(&self) -> &ArrayRef { + patch_indices_from_slots(self.patched_slots()) + } + + #[inline] + fn patch_values(&self) -> &ArrayRef { + patch_values_from_slots(self.patched_slots()) + } + + #[inline] + fn n_lanes(&self) -> usize { + self.patched_data().n_lanes + } + + #[inline] + fn offset(&self) -> usize { + self.patched_data().offset + } + + #[inline] + fn lane_range(&self, chunk: usize, lane: usize) -> VortexResult> { + assert!(chunk * 1024 <= self.patched_len() + self.offset()); + assert!(lane < self.n_lanes()); + + let start = self.lane_offsets().scalar_at(chunk * self.n_lanes() + lane)?; + let stop = self + .lane_offsets() + .scalar_at(chunk * self.n_lanes() + lane + 1)?; + + let start = start + .as_primitive() + .as_::() + .ok_or_else(|| vortex_err!("could not cast lane_offset to usize"))?; + + let stop = stop + .as_primitive() + .as_::() + .ok_or_else(|| vortex_err!("could not cast lane_offset to usize"))?; + + Ok(start..stop) + } + + fn slice_chunks(&self, chunks: Range) -> VortexResult> { + let lane_offsets_start = chunks.start * self.n_lanes(); + let lane_offsets_stop = chunks.end * self.n_lanes() + 1; + + let sliced_lane_offsets = self + .lane_offsets() + .slice(lane_offsets_start..lane_offsets_stop)?; + let indices = self.patch_indices().clone(); + let values = self.patch_values().clone(); + + let begin = (chunks.start * 1024).saturating_sub(self.offset()); + let end = (chunks.end * 1024) + .saturating_sub(self.offset()) + .min(self.patched_len()); + + let offset = if chunks.start == 0 { self.offset() } else { 0 }; + let inner = self.base_array().slice(begin..end)?; + let len = inner.len(); + let dtype = self.patched_dtype().clone(); + let slots = vec![ + Some(inner), + Some(sliced_lane_offsets), + Some(indices), + Some(values), + ]; + + Ok(unsafe { Array::::from_prevalidated_parts(dtype, len, slots, self.n_lanes(), offset) }) } } -impl PatchedArray { - /// Create a new `PatchedArray` from a child array and a set of [`Patches`]. - /// - /// # Errors - /// - /// The `inner` array must be primitive type, and it must have the same `DType` as the patches. - /// - /// The patches cannot contain nulls themselves. Any nulls must be stored in the `inner` array's - /// validity. +impl PatchedArrayExt for Array { + fn patched_data(&self) -> &PatchedData { + self.data() + } + + fn patched_slots(&self) -> &[Option] { + self.slots() + } + + fn patched_len(&self) -> usize { + self.len() + } + + fn patched_dtype(&self) -> &DType { + self.dtype() + } +} + +impl PatchedArrayExt for ArrayView<'_, Patched> { + fn patched_data(&self) -> &PatchedData { + self.data() + } + + fn patched_slots(&self) -> &[Option] { + self.slots() + } + + fn patched_len(&self) -> usize { + self.len() + } + + fn patched_dtype(&self) -> &DType { + self.dtype() + } +} + +impl Array { pub fn from_array_and_patches( inner: ArrayRef, patches: &Patches, @@ -142,120 +294,25 @@ impl PatchedArray { ) .into_array(); - Ok(Self { - slots: vec![Some(inner), Some(lane_offsets), Some(indices), Some(values)], - n_lanes, - offset: 0, - }) - } -} - -impl PatchedArray { - /// Returns a reference to the base array being patched. - #[inline] - pub fn base_array(&self) -> &ArrayRef { - self.slots[INNER_SLOT] - .as_ref() - .vortex_expect("PatchedArray inner slot") - } - - /// Returns a reference to the lane offsets array (u32). - #[inline] - pub fn lane_offsets(&self) -> &ArrayRef { - self.slots[LANE_OFFSETS_SLOT] - .as_ref() - .vortex_expect("PatchedArray lane_offsets slot") - } - - /// Returns a reference to the indices array (u16). - #[inline] - pub fn patch_indices(&self) -> &ArrayRef { - self.slots[INDICES_SLOT] - .as_ref() - .vortex_expect("PatchedArray indices slot") - } - - /// Returns a reference to the patch values array. - #[inline] - pub fn patch_values(&self) -> &ArrayRef { - self.slots[VALUES_SLOT] - .as_ref() - .vortex_expect("PatchedArray values slot") - } - - #[inline] - pub fn len(&self) -> usize { - self.base_array().len() + let dtype = inner.dtype().clone(); + let len = inner.len(); + let slots = vec![Some(inner), Some(lane_offsets), Some(indices), Some(values)]; + Ok(unsafe { Self::from_prevalidated_parts(dtype, len, slots, n_lanes, 0) }) } - #[inline] - pub fn is_empty(&self) -> bool { - self.len() == 0 - } -} - -impl PatchedArray { - /// Get a range of indices that can be used to access the `indices` and `values` children - /// to retrieve all patches for a specified lane. - /// - /// # Panics - /// - /// Note that this function will panic if the caller requests out of bounds chunk/lane ordinals. - pub(crate) fn lane_range(&self, chunk: usize, lane: usize) -> VortexResult> { - assert!(chunk * 1024 <= self.len() + self.offset); - assert!(lane < self.n_lanes); - - let start = self.lane_offsets().scalar_at(chunk * self.n_lanes + lane)?; - let stop = self - .lane_offsets() - .scalar_at(chunk * self.n_lanes + lane + 1)?; - - let start = start - .as_primitive() - .as_::() - .ok_or_else(|| vortex_err!("could not cast lane_offset to usize"))?; - - let stop = stop - .as_primitive() - .as_::() - .ok_or_else(|| vortex_err!("could not cast lane_offset to usize"))?; - - Ok(start..stop) - } - - /// Slice the array to just the patches and inner values that are within the chunk range. - pub(crate) fn slice_chunks(&self, chunks: Range) -> VortexResult { - let lane_offsets_start = chunks.start * self.n_lanes; - let lane_offsets_stop = chunks.end * self.n_lanes + 1; - - let sliced_lane_offsets = self - .lane_offsets() - .slice(lane_offsets_start..lane_offsets_stop)?; - let indices = self.patch_indices().clone(); - let values = self.patch_values().clone(); - - // Find the new start/end for slicing the inner array. - // The inner array has already been sliced to start at position `offset` in absolute terms, - // so we need to convert chunk boundaries to inner-relative coordinates. - let begin = (chunks.start * 1024).saturating_sub(self.offset); - let end = (chunks.end * 1024) - .saturating_sub(self.offset) - .min(self.len()); - - let offset = if chunks.start == 0 { self.offset } else { 0 }; - - let inner = self.base_array().slice(begin..end)?; - - Ok(PatchedArray { - slots: vec![ - Some(inner), - Some(sliced_lane_offsets), - Some(indices), - Some(values), - ], - n_lanes: self.n_lanes, - offset, - }) + pub(crate) unsafe fn from_prevalidated_parts( + dtype: DType, + len: usize, + slots: Vec>, + n_lanes: usize, + offset: usize, + ) -> Self { + unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Patched, dtype, len, PatchedData { n_lanes, offset }) + .with_slots(slots), + ) + } } } @@ -305,7 +362,6 @@ fn transpose( offset: usize, array_len: usize, ) -> TransposedPatches { - // Total number of slots is number of chunks times number of lanes. let n_chunks = array_len.div_ceil(1024); assert!( n_chunks <= u32::MAX as usize, @@ -314,14 +370,10 @@ fn transpose( let n_lanes = patch_lanes::(); - // We know upfront how many indices and values we'll have. let mut indices_buffer = BufferMut::with_capacity(indices_in.len()); let mut values_buffer = BufferMut::with_capacity(values_in.len()); - - // number of patches in each chunk. let mut lane_offsets: BufferMut = BufferMut::zeroed(n_chunks * n_lanes + 1); - // Scan the index/values once to get chunk/lane counts for index in indices_in { let index = index.as_() - offset; let chunk = index / 1024; @@ -330,12 +382,10 @@ fn transpose( lane_offsets[chunk * n_lanes + lane + 1] += 1; } - // Prefix-sum sizes -> offsets for index in 1..lane_offsets.len() { lane_offsets[index] += lane_offsets[index - 1]; } - // Loop over patches, writing them to final positions let indices_out = indices_buffer.spare_capacity_mut(); let values_out = values_buffer.spare_capacity_mut(); for (index, &value) in std::iter::zip(indices_in, values_in) { @@ -349,14 +399,11 @@ fn transpose( *position += 1; } - // SAFETY: we know there are exactly indices_in.len() indices/values, and we just - // set them to the appropriate values in the loop above. unsafe { indices_buffer.set_len(indices_in.len()); values_buffer.set_len(values_in.len()); } - // Now, pass over all the indices and values again and subtract out the position increments. for index in indices_in { let index = index.as_() - offset; let chunk = index / 1024; diff --git a/vortex-array/src/arrays/patched/compute/compare.rs b/vortex-array/src/arrays/patched/compute/compare.rs index 54c89c1744d..c103062e52b 100644 --- a/vortex-array/src/arrays/patched/compute/compare.rs +++ b/vortex-array/src/arrays/patched/compute/compare.rs @@ -9,10 +9,12 @@ use crate::ArrayRef; use crate::Canonical; use crate::ExecutionCtx; use crate::IntoArray; +use crate::array::child_to_validity; use crate::array::ArrayView; use crate::arrays::BoolArray; use crate::arrays::ConstantArray; use crate::arrays::Patched; +use crate::arrays::patched::PatchedArrayExt; use crate::arrays::PrimitiveArray; use crate::arrays::bool::BoolDataParts; use crate::arrays::primitive::NativeValue; @@ -55,18 +57,18 @@ impl CompareKernel for Patched { bits, offset, len, - validity, } = result.data.into_parts(); + let validity = child_to_validity(&result.slots[0], result.dtype.nullability()); let mut bits = BitBufferMut::from_buffer(bits.unwrap_host().into_mut(), offset, len); let lane_offsets = lhs.lane_offsets().clone().execute::(ctx)?; let indices = lhs.patch_indices().clone().execute::(ctx)?; let values = lhs.patch_values().clone().execute::(ctx)?; - let n_lanes = lhs.n_lanes; + let n_lanes = lhs.n_lanes(); match_each_native_ptype!(values.ptype(), |V| { - let offset = lhs.offset; + let offset = lhs.offset(); let indices = indices.as_slice::(); let values = values.as_slice::(); let constant = constant diff --git a/vortex-array/src/arrays/patched/compute/filter.rs b/vortex-array/src/arrays/patched/compute/filter.rs index 0a2060964aa..01b392b2880 100644 --- a/vortex-array/src/arrays/patched/compute/filter.rs +++ b/vortex-array/src/arrays/patched/compute/filter.rs @@ -10,6 +10,7 @@ use crate::IntoArray; use crate::array::ArrayView; use crate::arrays::FilterArray; use crate::arrays::Patched; +use crate::arrays::patched::PatchedArrayExt; use crate::arrays::filter::FilterReduce; impl FilterReduce for Patched { @@ -31,13 +32,13 @@ impl FilterReduce for Patched { // Convert mask indices to absolute positions by adding offset ( - (array.offset + first) / 1024, - (array.offset + last).div_ceil(1024), + (array.offset() + first) / 1024, + (array.offset() + last).div_ceil(1024), ) } }; - let n_chunks = (array.offset + array.len()).div_ceil(1024); + let n_chunks = (array.offset() + array.len()).div_ceil(1024); // If all chunks already covered, there is nothing to do. if chunk_start == 0 && chunk_stop == n_chunks { @@ -48,9 +49,9 @@ impl FilterReduce for Patched { // Slice the mask according to if the chunk is sliced. // Convert chunk bounds back to mask indices by subtracting offset. - let mask_start = (chunk_start * 1024).saturating_sub(array.offset); + let mask_start = (chunk_start * 1024).saturating_sub(array.offset()); let mask_end = (chunk_stop * 1024) - .saturating_sub(array.offset) + .saturating_sub(array.offset()) .min(array.len()); let remainder = mask.slice(mask_start..mask_end); diff --git a/vortex-array/src/arrays/patched/compute/take.rs b/vortex-array/src/arrays/patched/compute/take.rs index 1257eec5169..f0c21d64bba 100644 --- a/vortex-array/src/arrays/patched/compute/take.rs +++ b/vortex-array/src/arrays/patched/compute/take.rs @@ -10,6 +10,7 @@ use crate::ExecutionCtx; use crate::IntoArray; use crate::array::ArrayView; use crate::arrays::Patched; +use crate::arrays::patched::PatchedArrayExt; use crate::arrays::PrimitiveArray; use crate::arrays::dict::TakeExecute; use crate::arrays::primitive::PrimitiveDataParts; @@ -39,7 +40,7 @@ impl TakeExecute for Patched { buffer, validity, ptype, - } = inner.into_data().into_parts(); + } = inner.into_data_parts(); let indices_ptype = indices.dtype().as_ptype(); @@ -62,9 +63,9 @@ impl TakeExecute for Patched { take_map( output.as_mut(), indices.as_slice::(), - array.offset, + array.offset(), array.len(), - array.n_lanes, + array.n_lanes(), lane_offsets.as_slice::(), patch_indices.as_slice::(), patch_values.as_slice::(), diff --git a/vortex-array/src/arrays/patched/vtable/mod.rs b/vortex-array/src/arrays/patched/vtable/mod.rs index 7207e1734d9..e0e6e60b5cf 100644 --- a/vortex-array/src/arrays/patched/vtable/mod.rs +++ b/vortex-array/src/arrays/patched/vtable/mod.rs @@ -12,7 +12,6 @@ use std::hash::Hasher; use vortex_buffer::Buffer; use vortex_error::VortexExpect; use vortex_error::VortexResult; -use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; @@ -25,14 +24,15 @@ use crate::ExecutionResult; use crate::IntoArray; use crate::Precision; use crate::array::Array; +use crate::array::ArrayParts; use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; use crate::array::ValidityChild; use crate::array::ValidityVTableFromChild; use crate::arrays::PrimitiveArray; -use crate::arrays::patched::PatchedArray; -use crate::arrays::patched::array::NUM_SLOTS; +use crate::arrays::patched::PatchedArrayExt; +use crate::arrays::patched::PatchedData; use crate::arrays::patched::array::SLOT_NAMES; use crate::arrays::patched::compute::rules::PARENT_RULES; use crate::arrays::patched::vtable::kernels::PARENT_KERNELS; @@ -47,14 +47,14 @@ use crate::match_each_native_ptype; use crate::serde::ArrayChildren; use crate::vtable; -vtable!(Patched); +vtable!(Patched, Patched, PatchedData); #[derive(Clone, Debug)] pub struct Patched; impl ValidityChild for Patched { - fn validity_child(array: &PatchedArray) -> &ArrayRef { - array.base_array() + fn validity_child(array: ArrayView<'_, Patched>) -> ArrayRef { + array.base_array().clone() } } @@ -76,7 +76,7 @@ pub struct PatchedMetadata { } impl VTable for Patched { - type ArrayData = PatchedArray; + type ArrayData = PatchedData; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromChild; @@ -85,8 +85,8 @@ impl VTable for Patched { } fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.offset.hash(state); - array.n_lanes.hash(state); + array.offset().hash(state); + array.n_lanes().hash(state); array.base_array().array_hash(state, precision); array.lane_offsets().array_hash(state, precision); array.patch_indices().array_hash(state, precision); @@ -94,8 +94,8 @@ impl VTable for Patched { } fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.offset == other.offset - && array.n_lanes == other.n_lanes + array.offset() == other.offset() + && array.n_lanes() == other.n_lanes() && array.base_array().array_eq(other.base_array(), precision) && array .lane_offsets() @@ -112,26 +112,8 @@ impl VTable for Patched { 0 } - fn validate(&self, data: &PatchedArray, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { - vortex_ensure!( - data.base_array().dtype() == dtype, - "PatchedArray base dtype {} does not match outer dtype {}", - data.base_array().dtype(), - dtype - ); - vortex_ensure!( - data.len() == len, - "PatchedArray base len {} does not match outer len {}", - data.len(), - len - ); - vortex_ensure!( - data.patch_indices().len() == data.patch_values().len(), - "PatchedArray patch indices len {} does not match patch values len {}", - data.patch_indices().len(), - data.patch_values().len() - ); - Ok(()) + fn validate(&self, data: &PatchedData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + data.validate(dtype, len, slots) } fn buffer(_array: ArrayView<'_, Self>, idx: usize) -> BufferHandle { @@ -156,8 +138,8 @@ impl VTable for Patched { Ok(Some( PatchedMetadata { n_patches: u32::try_from(array.patch_indices().len())?, - n_lanes: u32::try_from(array.n_lanes)?, - offset: u32::try_from(array.offset)?, + n_lanes: u32::try_from(array.n_lanes())?, + offset: u32::try_from(array.offset())?, } .encode_to_vec(), )) @@ -171,7 +153,7 @@ impl VTable for Patched { _buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = PatchedMetadata::decode(metadata)?; let n_patches = metadata.n_patches as usize; let n_lanes = metadata.n_lanes as usize; @@ -186,11 +168,13 @@ impl VTable for Patched { let indices = children.get(2, PType::U16.into(), n_patches)?; let values = children.get(3, dtype, n_patches)?; - Ok(PatchedArray { - slots: vec![Some(inner), Some(lane_offsets), Some(indices), Some(values)], - n_lanes, - offset, - }) + let data = PatchedData { n_lanes, offset }; + Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(vec![ + Some(inner), + Some(lane_offsets), + Some(indices), + Some(values), + ])) } fn append_to_builder( @@ -217,7 +201,7 @@ impl VTable for Patched { array.base_array().append_to_builder(builder, ctx)?; - let offset = array.offset; + let offset = array.offset(); let lane_offsets = array .lane_offsets() .clone() @@ -246,7 +230,7 @@ impl VTable for Patched { &mut output[trailer..], offset, len, - array.n_lanes, + array.n_lanes(), lane_offsets.as_slice::(), indices.as_slice::(), values.as_slice::(), @@ -256,10 +240,6 @@ impl VTable for Patched { Ok(()) } - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() - } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { array.slots() } @@ -280,7 +260,7 @@ impl VTable for Patched { buffer, ptype, validity, - } = inner.into_data().into_parts(); + } = inner.into_data_parts(); let lane_offsets = array .lane_offsets() @@ -298,7 +278,7 @@ impl VTable for Patched { .execute::(ctx)?; let patched_values = match_each_native_ptype!(values.ptype(), |V| { - let offset = array.offset; + let offset = array.offset(); let len = array.len(); let mut output = Buffer::::from_byte_buffer(buffer.unwrap_host()).into_mut(); @@ -307,7 +287,7 @@ impl VTable for Patched { &mut output, offset, len, - array.n_lanes, + array.n_lanes(), lane_offsets.as_slice::(), indices.as_slice::(), values.as_slice::(), diff --git a/vortex-array/src/arrays/patched/vtable/operations.rs b/vortex-array/src/arrays/patched/vtable/operations.rs index 87b29392cb7..7cde8382064 100644 --- a/vortex-array/src/arrays/patched/vtable/operations.rs +++ b/vortex-array/src/arrays/patched/vtable/operations.rs @@ -8,6 +8,7 @@ use crate::array::ArrayView; use crate::array::OperationsVTable; use crate::arrays::PrimitiveArray; use crate::arrays::patched::Patched; +use crate::arrays::patched::PatchedArrayExt; use crate::optimizer::ArrayOptimizer; use crate::scalar::Scalar; @@ -17,15 +18,15 @@ impl OperationsVTable for Patched { index: usize, ctx: &mut ExecutionCtx, ) -> VortexResult { - let chunk = (index + array.offset) / 1024; + let chunk = (index + array.offset()) / 1024; #[expect( clippy::cast_possible_truncation, reason = "N % 1024 always fits in u16" )] - let chunk_index = ((index + array.offset) % 1024) as u16; + let chunk_index = ((index + array.offset()) % 1024) as u16; - let lane = (index + array.offset) % array.n_lanes; + let lane = (index + array.offset()) % array.n_lanes(); let range = array.lane_range(chunk, lane)?; diff --git a/vortex-array/src/arrays/patched/vtable/slice.rs b/vortex-array/src/arrays/patched/vtable/slice.rs index bbdb4df2464..44f82aca57f 100644 --- a/vortex-array/src/arrays/patched/vtable/slice.rs +++ b/vortex-array/src/arrays/patched/vtable/slice.rs @@ -10,18 +10,19 @@ use crate::IntoArray; use crate::array::ArrayView; use crate::arrays::Patched; use crate::arrays::PatchedArray; +use crate::arrays::patched::PatchedArrayExt; use crate::arrays::slice::SliceReduce; impl SliceReduce for Patched { fn slice(array: ArrayView<'_, Self>, range: Range) -> VortexResult> { // We **always** slice the patches at 1024-element chunk boundaries. We keep the offset + len // around so that when we execute we know how much to chop off. - let new_offset = (range.start + array.offset) % 1024; - let chunk_start = (range.start + array.offset) / 1024; - let chunk_stop = (range.end + array.offset).div_ceil(1024); + let new_offset = (range.start + array.offset()) % 1024; + let chunk_start = (range.start + array.offset()) / 1024; + let chunk_stop = (range.end + array.offset()).div_ceil(1024); let sliced_lane_offsets = array .lane_offsets() - .slice((chunk_start * array.n_lanes)..(chunk_stop * array.n_lanes) + 1)?; + .slice((chunk_start * array.n_lanes())..(chunk_stop * array.n_lanes()) + 1)?; // Unlike the patches, we slice the inner to the exact range. This is handled // at execution time by making sure to skip patch indices that are < offset @@ -29,15 +30,19 @@ impl SliceReduce for Patched { let inner = array.base_array().slice(range.start..range.end)?; Ok(Some( - PatchedArray { - slots: vec![ - Some(inner), - Some(sliced_lane_offsets), - Some(array.patch_indices().clone()), - Some(array.patch_values().clone()), - ], - n_lanes: array.n_lanes, - offset: new_offset, + unsafe { + PatchedArray::from_prevalidated_parts( + array.dtype().clone(), + inner.len(), + vec![ + Some(inner), + Some(sliced_lane_offsets), + Some(array.patch_indices().clone()), + Some(array.patch_values().clone()), + ], + array.n_lanes(), + new_offset, + ) } .into_array(), )) diff --git a/vortex-array/src/arrays/primitive/array/cast.rs b/vortex-array/src/arrays/primitive/array/cast.rs index 65406688afe..fd1dccbcf1c 100644 --- a/vortex-array/src/arrays/primitive/array/cast.rs +++ b/vortex-array/src/arrays/primitive/array/cast.rs @@ -17,6 +17,7 @@ use crate::builtins::ArrayBuiltins; use crate::dtype::DType; use crate::dtype::NativePType; use crate::dtype::PType; +use crate::validity::Validity; impl PrimitiveData { /// Return a slice of the array's buffer. @@ -56,7 +57,11 @@ impl PrimitiveData { "can't reinterpret cast between integers of two different widths" ); - PrimitiveData::from_buffer_handle(self.buffer_handle().clone(), ptype, self.validity()) + PrimitiveData::from_buffer_handle( + self.buffer_handle().clone(), + ptype, + Validity::from(self.nullability), + ) } } diff --git a/vortex-array/src/arrays/primitive/array/mod.rs b/vortex-array/src/arrays/primitive/array/mod.rs index 25cbf8c755b..8550cb16bb4 100644 --- a/vortex-array/src/arrays/primitive/array/mod.rs +++ b/vortex-array/src/arrays/primitive/array/mod.rs @@ -16,7 +16,9 @@ use vortex_error::vortex_panic; use crate::ToCanonical; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::arrays::Primitive; +use crate::arrays::PrimitiveArray; use crate::dtype::DType; use crate::dtype::NativePType; use crate::dtype::Nullability; @@ -75,7 +77,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["validity"]; /// ``` #[derive(Clone, Debug)] pub struct PrimitiveData { - pub(super) slots: Vec>, pub(super) ptype: PType, pub(super) nullability: Nullability, pub(super) buffer: BufferHandle, @@ -87,6 +88,43 @@ pub struct PrimitiveDataParts { pub validity: Validity, } +pub trait PrimitiveArrayExt { + fn primitive_data(&self) -> &PrimitiveData; + fn as_slots(&self) -> &[Option]; + + fn validity_child(&self) -> Option<&ArrayRef> { + self.as_slots()[VALIDITY_SLOT].as_ref() + } + + fn validity(&self) -> Validity { + child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.primitive_data().nullability) + } + + fn validity_mask(&self) -> vortex_mask::Mask { + self.validity().to_mask(self.primitive_data().len()) + } +} + +impl PrimitiveArrayExt for Array { + fn primitive_data(&self) -> &PrimitiveData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl PrimitiveArrayExt for ArrayView<'_, Primitive> { + fn primitive_data(&self) -> &PrimitiveData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + // TODO(connor): There are a lot of places where we could be using `new_unchecked` in the codebase. impl PrimitiveData { /// Build the slots vector for this array. @@ -106,9 +144,7 @@ impl PrimitiveData { validity: Validity, ) -> Self { let len = handle.len() / ptype.byte_width(); - let slots = Self::make_slots(&validity, len); Self { - slots, buffer: handle, ptype, nullability: validity.nullability(), @@ -161,9 +197,7 @@ impl PrimitiveData { .vortex_expect("[Debug Assertion]: Invalid `PrimitiveArray` parameters"); let len = buffer.len(); - let slots = Self::make_slots(&validity, len); Self { - slots, ptype: T::PTYPE, nullability: validity.nullability(), buffer: BufferHandle::new_host(buffer.into_byte_buffer()), @@ -198,7 +232,10 @@ impl Array { let dtype = DType::Primitive(T::PTYPE, nullability); let len = 0; let data = PrimitiveData::empty::(nullability); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data)) } + let slots = PrimitiveData::make_slots(&Validity::from(nullability), len); + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) + } } /// Creates a new `PrimitiveArray`. @@ -210,16 +247,22 @@ impl Array { let buffer = buffer.into(); let dtype = DType::Primitive(T::PTYPE, validity.nullability()); let len = buffer.len(); + let slots = PrimitiveData::make_slots(&validity, len); let data = PrimitiveData::new(buffer, validity); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) + } } /// Constructs a new `PrimitiveArray`. pub fn try_new(buffer: Buffer, validity: Validity) -> VortexResult { let dtype = DType::Primitive(T::PTYPE, validity.nullability()); let len = buffer.len(); + let slots = PrimitiveData::make_slots(&validity, len); let data = PrimitiveData::try_new(buffer, validity)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) + }) } /// Creates a new `PrimitiveArray` without validation. @@ -230,8 +273,11 @@ impl Array { pub unsafe fn new_unchecked(buffer: Buffer, validity: Validity) -> Self { let dtype = DType::Primitive(T::PTYPE, validity.nullability()); let len = buffer.len(); + let slots = PrimitiveData::make_slots(&validity, len); let data = unsafe { PrimitiveData::new_unchecked(buffer, validity) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) + } } /// Create a new array from a buffer handle. @@ -246,16 +292,20 @@ impl Array { ) -> Self { let dtype = DType::Primitive(ptype, validity.nullability()); let len = handle.len() / ptype.byte_width(); + let slots = PrimitiveData::make_slots(&validity, len); let data = unsafe { PrimitiveData::new_unchecked_from_handle(handle, ptype, validity) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) + } } /// Creates a new `PrimitiveArray` from a [`BufferHandle`]. pub fn from_buffer_handle(handle: BufferHandle, ptype: PType, validity: Validity) -> Self { let dtype = DType::Primitive(ptype, validity.nullability()); let len = handle.len() / ptype.byte_width(); + let slots = PrimitiveData::make_slots(&validity, len); let data = PrimitiveData::from_buffer_handle(handle, ptype, validity); - Array::try_from_parts(ArrayParts::new(Primitive, dtype, len, data)) + Array::try_from_parts(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) .vortex_expect("PrimitiveData is always valid") } @@ -263,8 +313,11 @@ impl Array { pub fn from_byte_buffer(buffer: ByteBuffer, ptype: PType, validity: Validity) -> Self { let dtype = DType::Primitive(ptype, validity.nullability()); let len = buffer.len() / ptype.byte_width(); + let slots = PrimitiveData::make_slots(&validity, len); let data = PrimitiveData::from_byte_buffer(buffer, ptype, validity); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) + } } /// Create a PrimitiveArray from a byte buffer containing only the valid elements. @@ -276,26 +329,62 @@ impl Array { ) -> Self { let dtype = DType::Primitive(ptype, validity.nullability()); let len = n_rows; + let slots = PrimitiveData::make_slots(&validity, len); let data = PrimitiveData::from_values_byte_buffer(valid_elems_buffer, ptype, validity, n_rows); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) + } } /// Validates the components that would be used to create a `PrimitiveArray`. pub fn validate(buffer: &Buffer, validity: &Validity) -> VortexResult<()> { PrimitiveData::validate(buffer, validity) } + + pub fn into_data_parts(self) -> PrimitiveDataParts { + let validity = PrimitiveArrayExt::validity(&self); + let data = self.into_data(); + PrimitiveDataParts { + ptype: data.ptype(), + buffer: data.buffer, + validity, + } + } + + pub fn map_each_with_validity(self, f: F) -> VortexResult + where + T: NativePType, + R: NativePType, + F: FnMut((T, bool)) -> R, + { + let validity = PrimitiveArrayExt::validity(&self); + let data = self.into_data(); + let buf_iter = data.to_buffer::().into_iter(); + + let buffer = match &validity { + Validity::NonNullable | Validity::AllValid => { + BufferMut::::from_iter(buf_iter.zip(iter::repeat(true)).map(f)) + } + Validity::AllInvalid => { + BufferMut::::from_iter(buf_iter.zip(iter::repeat(false)).map(f)) + } + Validity::Array(val) => { + let val = val.to_bool().into_bit_buffer(); + BufferMut::::from_iter(buf_iter.zip(val.iter()).map(f)) + } + }; + Ok(PrimitiveArray::new(buffer.freeze(), validity)) + } } impl PrimitiveData { /// Consume the primitive array and returns its component parts. pub fn into_parts(self) -> PrimitiveDataParts { - let ptype = self.ptype(); - let validity = self.validity(); PrimitiveDataParts { - ptype, + ptype: self.ptype(), buffer: self.buffer, - validity, + validity: Validity::from(self.nullability), } } } @@ -316,17 +405,6 @@ impl PrimitiveData { self.len() == 0 } - /// Reconstructs the validity from the slot state. - #[allow(clippy::same_name_method)] - pub fn validity(&self) -> Validity { - child_to_validity(&self.slots[VALIDITY_SLOT], self.nullability) - } - - /// Returns the validity as a [`Mask`](vortex_mask::Mask). - pub fn validity_mask(&self) -> vortex_mask::Mask { - self.validity().to_mask(self.len()) - } - pub fn ptype(&self) -> PType { self.ptype } @@ -338,9 +416,7 @@ impl PrimitiveData { pub fn from_buffer_handle(handle: BufferHandle, ptype: PType, validity: Validity) -> Self { let len = handle.len() / ptype.byte_width(); - let slots = Self::make_slots(&validity, len); Self { - slots, buffer: handle, ptype, nullability: validity.nullability(), @@ -406,7 +482,7 @@ impl PrimitiveData { R: NativePType, F: FnMut(T) -> R, { - let validity = self.validity(); + let validity = Validity::from(self.nullability); let buffer = match self.try_into_buffer_mut() { Ok(buffer_mut) => buffer_mut.map_each_in_place(f), Err(buffer) => BufferMut::from_iter(buffer.iter().copied().map(f)), @@ -424,7 +500,7 @@ impl PrimitiveData { R: NativePType, F: FnMut((T, bool)) -> R, { - let validity = self.validity(); + let validity = Validity::from(self.nullability); let buf_iter = self.to_buffer::().into_iter(); diff --git a/vortex-array/src/arrays/primitive/compute/cast.rs b/vortex-array/src/arrays/primitive/compute/cast.rs index f2467f6f1ab..4e547a734bf 100644 --- a/vortex-array/src/arrays/primitive/compute/cast.rs +++ b/vortex-array/src/arrays/primitive/compute/cast.rs @@ -15,6 +15,7 @@ use crate::IntoArray; use crate::aggregate_fn; use crate::array::ArrayView; use crate::arrays::Primitive; +use crate::arrays::primitive::PrimitiveArrayExt; use crate::arrays::PrimitiveArray; use crate::dtype::DType; use crate::dtype::NativePType; diff --git a/vortex-array/src/arrays/primitive/mod.rs b/vortex-array/src/arrays/primitive/mod.rs index 7c526c2cfbb..4bd6c1aa028 100644 --- a/vortex-array/src/arrays/primitive/mod.rs +++ b/vortex-array/src/arrays/primitive/mod.rs @@ -4,6 +4,7 @@ mod array; pub use array::PrimitiveData; pub use array::PrimitiveDataParts; +pub use array::PrimitiveArrayExt; pub use array::chunk_range; pub use array::patch_chunk; pub use vtable::PrimitiveArray; diff --git a/vortex-array/src/arrays/primitive/vtable/mod.rs b/vortex-array/src/arrays/primitive/vtable/mod.rs index e16ec285d0a..1d4f64c344a 100644 --- a/vortex-array/src/arrays/primitive/vtable/mod.rs +++ b/vortex-array/src/arrays/primitive/vtable/mod.rs @@ -13,6 +13,7 @@ use crate::ExecutionResult; use crate::array::Array; use crate::array::ArrayView; use crate::array::VTable; +use crate::arrays::primitive::array::PrimitiveArrayExt; use crate::arrays::primitive::PrimitiveData; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -51,12 +52,13 @@ impl VTable for Primitive { fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.buffer.array_hash(state, precision); - array.data().validity().array_hash(state, precision); + PrimitiveArrayExt::validity(&array).array_hash(state, precision); } fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.buffer.array_eq(&other.buffer, precision) - && array.data().validity().array_eq(&other.data().validity(), precision) + && PrimitiveArrayExt::validity(&array) + .array_eq(&PrimitiveArrayExt::validity(&other), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -96,6 +98,15 @@ impl VTable for Primitive { actual_dtype, dtype ); + let validity = crate::array::child_to_validity(&slots[0], data.nullability); + if let Some(validity_len) = validity.maybe_len() { + vortex_ensure!( + validity_len == len, + "PrimitiveArray validity len {} does not match outer length {}", + validity_len, + len + ); + } Ok(()) } @@ -109,7 +120,7 @@ impl VTable for Primitive { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { if !metadata.is_empty() { vortex_bail!( "PrimitiveArray expects empty metadata, got {} bytes", @@ -155,15 +166,9 @@ impl VTable for Primitive { ); // SAFETY: checked ahead of time - unsafe { - Ok(PrimitiveData::new_unchecked_from_handle( - buffer, ptype, validity, - )) - } - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + let slots = PrimitiveData::make_slots(&validity, len); + let data = unsafe { PrimitiveData::new_unchecked_from_handle(buffer, ptype, validity) }; + Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { diff --git a/vortex-array/src/arrays/primitive/vtable/validity.rs b/vortex-array/src/arrays/primitive/vtable/validity.rs index 87659128064..cd6bfc28870 100644 --- a/vortex-array/src/arrays/primitive/vtable/validity.rs +++ b/vortex-array/src/arrays/primitive/vtable/validity.rs @@ -5,11 +5,12 @@ use vortex_error::VortexResult; use crate::array::ArrayView; use crate::array::ValidityVTable; +use crate::arrays::primitive::array::PrimitiveArrayExt; use crate::arrays::primitive::vtable::Primitive; use crate::validity::Validity; impl ValidityVTable for Primitive { fn validity(array: ArrayView<'_, Primitive>) -> VortexResult { - Ok(array.data().validity()) + Ok(PrimitiveArrayExt::validity(&array)) } } diff --git a/vortex-array/src/arrays/scalar_fn/array.rs b/vortex-array/src/arrays/scalar_fn/array.rs index 1fc9accc886..aee80a8af1b 100644 --- a/vortex-array/src/arrays/scalar_fn/array.rs +++ b/vortex-array/src/arrays/scalar_fn/array.rs @@ -7,6 +7,7 @@ use vortex_error::vortex_ensure; use crate::ArrayRef; use crate::array::Array; +use crate::array::ArrayView; use crate::array::ArrayParts; use crate::arrays::ScalarFnVTable; use crate::scalar_fn::ScalarFnRef; @@ -16,7 +17,6 @@ use crate::scalar_fn::ScalarFnRef; #[derive(Clone, Debug)] pub struct ScalarFnData { pub(super) scalar_fn: ScalarFnRef, - pub(super) slots: Vec>, } impl ScalarFnData { @@ -30,10 +30,8 @@ impl ScalarFnData { children.iter().all(|c| c.len() == len), "ScalarFnArray must have children equal to the array length" ); - - let slots = children.into_iter().map(Some).collect(); - - Ok(Self { scalar_fn, slots }) + drop(children); + Ok(Self { scalar_fn }) } /// Get the scalar function bound to this array. @@ -42,29 +40,51 @@ impl ScalarFnData { pub fn scalar_fn(&self) -> &ScalarFnRef { &self.scalar_fn } +} - /// Get a child array by index. - pub fn get_child(&self, idx: usize) -> &ArrayRef { - self.slots[idx] +pub trait ScalarFnArrayDataExt { + fn scalar_fn_data(&self) -> &ScalarFnData; + fn get_child(&self, idx: usize) -> &ArrayRef; + fn nchildren(&self) -> usize; + + fn iter_children(&self) -> impl Iterator + '_ { + (0..self.nchildren()).map(|idx| self.get_child(idx)) + } + + fn children(&self) -> Vec { + self.iter_children().cloned().collect() + } +} + +impl ScalarFnArrayDataExt for Array { + fn scalar_fn_data(&self) -> &ScalarFnData { + self.data() + } + + fn get_child(&self, idx: usize) -> &ArrayRef { + self.slots()[idx] .as_ref() .vortex_expect("ScalarFnArray child slot") } - /// Get the number of children. - pub fn nchildren(&self) -> usize { - self.slots.len() + fn nchildren(&self) -> usize { + self.slots().len() } +} - /// Iterate over the children arrays without allocation. - pub fn iter_children(&self) -> impl Iterator + '_ { - self.slots - .iter() - .map(|s| s.as_ref().vortex_expect("ScalarFnArray child slot")) +impl ScalarFnArrayDataExt for ArrayView<'_, ScalarFnVTable> { + fn scalar_fn_data(&self) -> &ScalarFnData { + self.data() } - /// Get the children arrays of this scalar function array. - pub fn children(&self) -> Vec { - self.iter_children().cloned().collect() + fn get_child(&self, idx: usize) -> &ArrayRef { + self.slots()[idx] + .as_ref() + .vortex_expect("ScalarFnArray child slot") + } + + fn nchildren(&self) -> usize { + self.slots().len() } } @@ -79,7 +99,19 @@ impl Array { /// Get the children arrays of this scalar function array. #[allow(clippy::same_name_method)] pub fn children(&self) -> Vec { - self.data().children() + ScalarFnArrayDataExt::children(self) + } + + pub fn get_child(&self, idx: usize) -> &ArrayRef { + ScalarFnArrayDataExt::get_child(self, idx) + } + + pub fn nchildren(&self) -> usize { + ScalarFnArrayDataExt::nchildren(self) + } + + pub fn iter_children(&self) -> impl Iterator + '_ { + (0..self.nchildren()).map(|idx| self.get_child(idx)) } /// Create a new ScalarFnArray from a scalar function and its children. @@ -90,8 +122,32 @@ impl Array { ) -> VortexResult { let arg_dtypes: Vec<_> = children.iter().map(|c| c.dtype().clone()).collect(); let dtype = scalar_fn.return_dtype(&arg_dtypes)?; - let data = ScalarFnData::try_new(scalar_fn.clone(), children, len)?; + let data = ScalarFnData::try_new(scalar_fn.clone(), children.clone(), len)?; let vtable = ScalarFnVTable { scalar_fn }; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(vtable, dtype, len, data)) }) + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(vtable, dtype, len, data) + .with_slots(children.into_iter().map(Some).collect()), + ) + }) + } +} + +impl ArrayView<'_, ScalarFnVTable> { + #[allow(clippy::same_name_method)] + pub fn children(&self) -> Vec { + ScalarFnArrayDataExt::children(self) + } + + pub fn get_child(&self, idx: usize) -> &ArrayRef { + ScalarFnArrayDataExt::get_child(self, idx) + } + + pub fn nchildren(&self) -> usize { + ScalarFnArrayDataExt::nchildren(self) + } + + pub fn iter_children(&self) -> impl Iterator + '_ { + (0..self.nchildren()).map(|idx| self.get_child(idx)) } } diff --git a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs index b160ba970bc..bf118094144 100644 --- a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs +++ b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs @@ -27,6 +27,7 @@ use crate::array::ArrayParts; use crate::array::ArrayView; use crate::array::VTable; use crate::arrays::scalar_fn::array::ScalarFnData; +use crate::arrays::scalar_fn::array::ScalarFnArrayDataExt; use crate::arrays::scalar_fn::rules::PARENT_RULES; use crate::arrays::scalar_fn::rules::RULES; use crate::buffer::BufferHandle; @@ -68,12 +69,16 @@ impl VTable for ScalarFnVTable { "ScalarFnArray data scalar_fn does not match vtable" ); vortex_ensure!( - data.iter_children().all(|c| c.len() == len), + slots + .iter() + .flatten() + .all(|c| c.len() == len), "All child arrays must have the same length as the scalar function array" ); - let child_dtypes = data - .iter_children() + let child_dtypes = slots + .iter() + .flatten() .map(|c| c.dtype().clone()) .collect_vec(); vortex_ensure!( @@ -128,14 +133,10 @@ impl VTable for ScalarFnVTable { _buffers: &[BufferHandle], _children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { vortex_bail!("Deserialization of ScalarFnVTable metadata is not supported"); } - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() - } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { array.slots() } @@ -193,12 +194,16 @@ pub trait ScalarFnArrayExt: scalar_fn::ScalarFnVTable { let data = ScalarFnData { scalar_fn: scalar_fn.clone(), - slots: children.into_iter().map(Some).collect(), }; let vtable = ScalarFnVTable { scalar_fn }; Ok( - unsafe { Array::from_parts_unchecked(ArrayParts::new(vtable, dtype, len, data)) } - .into_array(), + unsafe { + Array::from_parts_unchecked( + ArrayParts::new(vtable, dtype, len, data) + .with_slots(children.into_iter().map(Some).collect()), + ) + } + .into_array(), ) } } diff --git a/vortex-array/src/arrays/shared/vtable.rs b/vortex-array/src/arrays/shared/vtable.rs index 1aace564851..cd3931f41c0 100644 --- a/vortex-array/src/arrays/shared/vtable.rs +++ b/vortex-array/src/arrays/shared/vtable.rs @@ -103,7 +103,7 @@ impl VTable for Shared { _buffers: &[BufferHandle], _children: &dyn crate::serde::ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { vortex_error::vortex_bail!("Shared array is not serializable") } diff --git a/vortex-array/src/arrays/slice/vtable.rs b/vortex-array/src/arrays/slice/vtable.rs index e23e9eaded5..c29b07bc1aa 100644 --- a/vortex-array/src/arrays/slice/vtable.rs +++ b/vortex-array/src/arrays/slice/vtable.rs @@ -129,7 +129,7 @@ impl VTable for Slice { _buffers: &[BufferHandle], _children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { vortex_bail!("Slice array is not serializable") } diff --git a/vortex-array/src/arrays/struct_/array.rs b/vortex-array/src/arrays/struct_/array.rs index 86ea3aef1f4..079483b972b 100644 --- a/vortex-array/src/arrays/struct_/array.rs +++ b/vortex-array/src/arrays/struct_/array.rs @@ -14,6 +14,7 @@ use crate::ArrayRef; use crate::IntoArray; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::Struct; @@ -150,9 +151,7 @@ pub(super) const FIELDS_OFFSET: usize = 1; #[derive(Clone, Debug)] pub struct StructData { pub(super) names: FieldNames, - pub(super) nullability: crate::dtype::Nullability, pub(super) fieldless_len: Option, - pub(super) slots: Vec>, } pub struct StructDataParts { @@ -162,80 +161,18 @@ pub struct StructDataParts { } impl StructData { - /// Returns the length of this array. - pub fn len(&self) -> usize { - self.slots[FIELDS_OFFSET..] - .first() - .and_then(|slot| slot.as_ref()) - .map_or_else(|| self.fieldless_len.unwrap_or(0), |field| field.len()) - } - - /// Returns the [`DType`] of this array. - pub fn dtype(&self) -> DType { - DType::Struct(self.struct_fields(), self.nullability) - } - - /// Returns `true` if this array is empty. - pub fn is_empty(&self) -> bool { - self.len() == 0 - } - - /// Reconstructs the validity from the slots. - pub fn validity(&self) -> Validity { - child_to_validity(&self.slots[VALIDITY_SLOT], self.nullability) - } - - /// Return an iterator over the struct fields without the validity of the struct applied. - pub fn iter_unmasked_fields(&self) -> impl Iterator + '_ { - self.slots[FIELDS_OFFSET..] - .iter() - .map(|s| s.as_ref().vortex_expect("StructArray field slot")) - } - - /// Return the struct fields without the validity of the struct applied. - pub fn unmasked_fields(&self) -> Arc<[ArrayRef]> { - self.iter_unmasked_fields().cloned().collect() - } - - /// Return the struct field at the given index without the validity of the struct applied. - pub fn unmasked_field(&self, idx: usize) -> &ArrayRef { - self.slots[FIELDS_OFFSET + idx] - .as_ref() - .vortex_expect("StructArray field slot") - } - - /// Return the struct field without the validity of the struct applied - pub fn unmasked_field_by_name(&self, name: impl AsRef) -> VortexResult<&ArrayRef> { - let name = name.as_ref(); - self.unmasked_field_by_name_opt(name).ok_or_else(|| { - vortex_err!( - "Field {name} not found in struct array with names {:?}", - self.names() - ) - }) - } - - /// 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.names.find(name).map(|idx| { - self.slots[FIELDS_OFFSET + idx] - .as_ref() - .vortex_expect("StructArray field slot") - }) - } - pub fn names(&self) -> &FieldNames { &self.names } - pub fn struct_fields(&self) -> StructFields { - StructFields::new( - self.names.clone(), - self.iter_unmasked_fields() - .map(|field| field.dtype().clone()) - .collect(), - ) + pub(crate) fn make_slots( + fields: &[ArrayRef], + validity: &Validity, + length: usize, + ) -> Vec> { + once(validity_to_child(validity, length)) + .chain(fields.iter().cloned().map(Some)) + .collect() } /// Create a new `StructArray` with the given length, but without any fields. @@ -326,16 +263,9 @@ impl StructData { Self::validate(&fields, &dtype, length, &validity) .vortex_expect("[Debug Assertion]: Invalid `StructArray` parameters"); - let validity_slot = validity_to_child(&validity, length); - let slots = once(validity_slot) - .chain(fields.iter().map(|f| Some(f.clone()))) - .collect(); - Self { names: dtype.names().clone(), - nullability: validity.nullability(), fieldless_len: fields.is_empty().then_some(length), - slots, } } @@ -404,112 +334,94 @@ impl StructData { // SAFETY: validate ensures all invariants are met. Ok(unsafe { Self::new_unchecked(fields, dtype, length, validity) }) } +} - pub fn into_parts(self) -> StructDataParts { - let StructData { - names, - slots, - nullability, - .. - } = self; - let validity = child_to_validity(&slots[VALIDITY_SLOT], nullability); - let struct_fields = StructFields::new( - names, - slots - .iter() - .skip(FIELDS_OFFSET) - .map(|slot| { - slot.as_ref() - .vortex_expect("StructArray field slot") - .dtype() - .clone() - }) - .collect(), - ); - let fields: Arc<[ArrayRef]> = slots - .into_iter() - .skip(FIELDS_OFFSET) - .map(|s| s.vortex_expect("StructArray field slot")) - .collect(); - StructDataParts { - struct_fields, - fields, - validity, +pub trait StructArrayExt { + fn struct_data(&self) -> &StructData; + fn as_slots(&self) -> &[Option]; + fn dtype(&self) -> &DType; + + fn nullability(&self) -> crate::dtype::Nullability { + match self.dtype() { + DType::Struct(_, nullability) => *nullability, + _ => unreachable!("StructArrayExt requires a struct dtype"), } } - pub fn into_fields(self) -> Vec { - self.into_parts().fields.to_vec() + fn names(&self) -> &FieldNames { + self.struct_data().names() } - pub fn from_fields>(items: &[(N, ArrayRef)]) -> VortexResult { - Self::try_from_iter(items.iter().map(|(a, b)| (a, b.clone()))) + fn struct_validity(&self) -> Validity { + child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.nullability()) } - pub fn try_from_iter_with_validity< - N: AsRef, - A: IntoArray, - T: IntoIterator, - >( - iter: T, - validity: Validity, - ) -> VortexResult { - let (names, fields): (Vec, Vec) = iter - .into_iter() - .map(|(name, fields)| (FieldName::from(name.as_ref()), fields.into_array())) - .unzip(); - let len = fields - .first() - .map(|f| f.len()) - .ok_or_else(|| vortex_err!("StructArray cannot be constructed from an empty slice of arrays because the length is unspecified"))?; + fn iter_unmasked_fields(&self) -> impl Iterator + '_ { + self.as_slots()[FIELDS_OFFSET..] + .iter() + .map(|s| s.as_ref().vortex_expect("StructArray field slot")) + } - Self::try_new(FieldNames::from_iter(names), fields, len, validity) + fn unmasked_fields(&self) -> Arc<[ArrayRef]> { + self.iter_unmasked_fields().cloned().collect() } - pub fn try_from_iter, A: IntoArray, T: IntoIterator>( - iter: T, - ) -> VortexResult { - Self::try_from_iter_with_validity(iter, Validity::NonNullable) + fn unmasked_field(&self, idx: usize) -> &ArrayRef { + self.as_slots()[FIELDS_OFFSET + idx] + .as_ref() + .vortex_expect("StructArray field slot") } - /// Removes and returns a column from the struct array by name. - /// If the column does not exist, returns `None`. - pub fn remove_column(&mut self, name: impl Into) -> Option { - let name = name.into(); + fn unmasked_field_by_name_opt(&self, name: impl AsRef) -> Option<&ArrayRef> { + let name = name.as_ref(); + self.names().find(name).map(|idx| self.unmasked_field(idx)) + } - let struct_dtype = self.struct_fields(); - let len = self.len(); + fn unmasked_field_by_name(&self, name: impl AsRef) -> VortexResult<&ArrayRef> { + let name = name.as_ref(); + self.unmasked_field_by_name_opt(name).ok_or_else(|| { + vortex_err!( + "Field {name} not found in struct array with names {:?}", + self.names() + ) + }) + } - let position = struct_dtype - .names() - .iter() - .position(|field_name| field_name.as_ref() == name.as_ref())?; + fn struct_fields(&self) -> StructFields { + StructFields::new( + self.names().clone(), + self.iter_unmasked_fields() + .map(|field| field.dtype().clone()) + .collect(), + ) + } +} - let slot_position = FIELDS_OFFSET + position; - let field = self.slots[slot_position] - .as_ref() - .vortex_expect("StructArray field slot") - .clone(); - let new_slots: Vec> = self - .slots - .iter() - .enumerate() - .filter(|(i, _)| *i != slot_position) - .map(|(_, s)| s.clone()) - .collect(); +impl StructArrayExt for Array { + fn struct_data(&self) -> &StructData { + self.data() + } - if let Ok(new_dtype) = struct_dtype.without_field(position) { - self.slots = new_slots; - self.names = new_dtype.names().clone(); - self.fieldless_len = self - .slots - .get(FIELDS_OFFSET) - .and_then(|slot| slot.as_ref()) - .map(|_| None) - .unwrap_or(Some(len)); - return Some(field); - } - None + fn as_slots(&self) -> &[Option] { + self.slots() + } + + fn dtype(&self) -> &DType { + Array::dtype(self) + } +} + +impl StructArrayExt for ArrayView<'_, Struct> { + fn struct_data(&self) -> &StructData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } + + fn dtype(&self) -> &DType { + ArrayView::dtype(self) } } @@ -521,10 +433,12 @@ impl Array { length: usize, validity: Validity, ) -> Self { + let fields = fields.into(); + let field_dtypes: Vec<_> = fields.iter().map(|d| d.dtype().clone()).collect(); + let dtype = DType::Struct(StructFields::new(names.clone(), field_dtypes), validity.nullability()); + let slots = StructData::make_slots(&fields, &validity, length); let data = StructData::new(names, fields, length, validity); - let dtype = data.dtype(); - let len = data.len(); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, len, data)) } + unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, length, data).with_slots(slots)) } } /// Constructs a new `StructArray`. @@ -534,10 +448,12 @@ impl Array { length: usize, validity: Validity, ) -> VortexResult { + let fields = fields.into(); + let field_dtypes: Vec<_> = fields.iter().map(|d| d.dtype().clone()).collect(); + let dtype = DType::Struct(StructFields::new(names.clone(), field_dtypes), validity.nullability()); + let slots = StructData::make_slots(&fields, &validity, length); let data = StructData::try_new(names, fields, length, validity)?; - let dtype = data.dtype(); - let len = data.len(); - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, len, data)) }) + Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, length, data).with_slots(slots)) }) } /// Creates a new `StructArray` without validation. @@ -551,10 +467,11 @@ impl Array { length: usize, validity: Validity, ) -> Self { + let fields = fields.into(); + let outer_dtype = DType::Struct(dtype.clone(), validity.nullability()); + let slots = StructData::make_slots(&fields, &validity, length); let data = unsafe { StructData::new_unchecked(fields, dtype, length, validity) }; - let dtype = data.dtype(); - let len = data.len(); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, len, data)) } + unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, outer_dtype, length, data).with_slots(slots)) } } /// Constructs a new `StructArray` with an explicit dtype. @@ -564,18 +481,16 @@ impl Array { length: usize, validity: Validity, ) -> VortexResult { + let fields = fields.into(); + let outer_dtype = DType::Struct(dtype.clone(), validity.nullability()); + let slots = StructData::make_slots(&fields, &validity, length); let data = StructData::try_new_with_dtype(fields, dtype, length, validity)?; - let dtype = data.dtype(); - let len = data.len(); - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, len, data)) }) + Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, outer_dtype, length, data).with_slots(slots)) }) } /// Construct a `StructArray` from named fields. pub fn from_fields>(items: &[(N, ArrayRef)]) -> VortexResult { - let data = StructData::from_fields(items)?; - let dtype = data.dtype(); - let len = data.len(); - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, len, data)) }) + Self::try_from_iter(items.iter().map(|(a, b)| (a, b.clone()))) } /// Create a `StructArray` from an iterator of (name, array) pairs with validity. @@ -587,20 +502,32 @@ impl Array { iter: T, validity: Validity, ) -> VortexResult { - let data = StructData::try_from_iter_with_validity(iter, validity)?; - let dtype = data.dtype(); - let len = data.len(); - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, len, data)) }) + let (names, fields): (Vec, Vec) = iter + .into_iter() + .map(|(name, fields)| (FieldName::from(name.as_ref()), fields.into_array())) + .unzip(); + let len = fields + .first() + .map(|f| f.len()) + .ok_or_else(|| vortex_err!("StructArray cannot be constructed from an empty slice of arrays because the length is unspecified"))?; + + Self::try_new(FieldNames::from_iter(names), fields, len, validity) } /// Create a `StructArray` from an iterator of (name, array) pairs. pub fn try_from_iter, A: IntoArray, T: IntoIterator>( iter: T, ) -> VortexResult { - let data = StructData::try_from_iter(iter)?; - let dtype = data.dtype(); - let len = data.len(); - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, len, data)) }) + let (names, fields): (Vec, Vec) = iter + .into_iter() + .map(|(name, field)| (FieldName::from(name.as_ref()), field.into_array())) + .unzip(); + let len = fields + .first() + .map(ArrayRef::len) + .ok_or_else(|| vortex_err!("StructArray cannot be constructed from an empty slice of arrays because the length is unspecified"))?; + + Self::try_new(FieldNames::from_iter(names), fields, len, Validity::NonNullable) } // TODO(aduffy): Add equivalent function to support field masks for nested column access. @@ -636,13 +563,79 @@ impl Array { /// Create a fieldless `StructArray` with the given length. pub fn new_fieldless_with_len(len: usize) -> Self { let data = StructData::new_fieldless_with_len(len); - let dtype = data.dtype(); - let len = data.len(); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, len, data)) } + let dtype = DType::Struct( + StructFields::new(FieldNames::default(), Vec::new()), + crate::dtype::Nullability::NonNullable, + ); + let slots = StructData::make_slots(&[], &Validity::NonNullable, len); + unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, len, data).with_slots(slots)) } + } + + pub fn into_data_parts(self) -> StructDataParts { + let parts = self.into_parts(); + let struct_fields = StructFields::new( + parts.data.names.clone(), + parts.slots[FIELDS_OFFSET..] + .iter() + .map(|slot| slot.as_ref().vortex_expect("StructArray field slot").dtype().clone()) + .collect(), + ); + let fields: Arc<[ArrayRef]> = parts.slots[FIELDS_OFFSET..] + .iter() + .map(|s| s.as_ref().vortex_expect("StructArray field slot").clone()) + .collect(); + let validity = child_to_validity(&parts.slots[VALIDITY_SLOT], parts.dtype.nullability()); + StructDataParts { struct_fields, fields, validity } + } + + pub fn remove_column(&self, name: impl Into) -> Option<(Self, ArrayRef)> { + let name = name.into(); + let struct_dtype = self.struct_fields(); + let len = self.len(); + + let position = struct_dtype + .names() + .iter() + .position(|field_name| field_name.as_ref() == name.as_ref())?; + + let slot_position = FIELDS_OFFSET + position; + let field = self.slots()[slot_position] + .as_ref() + .vortex_expect("StructArray field slot") + .clone(); + let new_slots: Vec> = self + .slots() + .iter() + .enumerate() + .filter(|(i, _)| *i != slot_position) + .map(|(_, s)| s.clone()) + .collect(); + + let new_dtype = struct_dtype.without_field(position).ok()?; + let data = StructData { + names: new_dtype.names().clone(), + fieldless_len: new_slots + .get(FIELDS_OFFSET) + .and_then(|slot| slot.as_ref()) + .map(|_| None) + .unwrap_or(Some(len)), + }; + let new_array = unsafe { + Array::from_parts_unchecked( + ArrayParts::new( + Struct, + DType::Struct(new_dtype, self.dtype().nullability()), + len, + data, + ) + .with_slots(new_slots), + ) + }; + Some((new_array, field)) } } -impl StructData { +impl Array { pub fn with_column(&self, name: impl Into, array: ArrayRef) -> VortexResult { let name = name.into(); let struct_dtype = self.struct_fields(); @@ -651,12 +644,78 @@ impl StructData { 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[FIELDS_OFFSET..] + let children: Arc<[ArrayRef]> = self.slots()[FIELDS_OFFSET..] .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()) + Self::try_new_with_dtype(children, new_fields, self.len(), self.validity()?) + } + + pub fn names(&self) -> &FieldNames { + StructArrayExt::names(self) + } + + pub fn iter_unmasked_fields(&self) -> impl Iterator + '_ { + StructArrayExt::iter_unmasked_fields(self) + } + + pub fn unmasked_fields(&self) -> Arc<[ArrayRef]> { + StructArrayExt::unmasked_fields(self) + } + + pub fn unmasked_field(&self, idx: usize) -> &ArrayRef { + StructArrayExt::unmasked_field(self, idx) + } + + pub fn unmasked_field_by_name(&self, name: impl AsRef) -> VortexResult<&ArrayRef> { + StructArrayExt::unmasked_field_by_name(self, name) + } + + pub fn unmasked_field_by_name_opt(&self, name: impl AsRef) -> Option<&ArrayRef> { + StructArrayExt::unmasked_field_by_name_opt(self, name) + } + + pub fn struct_fields(&self) -> StructFields { + StructArrayExt::struct_fields(self) + } + + pub fn remove_column_owned(&self, name: impl Into) -> Option<(Self, ArrayRef)> { + self.remove_column(name) + } +} + +impl ArrayView<'_, Struct> { + pub fn names(&self) -> &FieldNames { + StructArrayExt::names(self) + } + + pub fn iter_unmasked_fields(&self) -> impl Iterator + '_ { + StructArrayExt::iter_unmasked_fields(self) + } + + pub fn unmasked_field(&self, idx: usize) -> &ArrayRef { + StructArrayExt::unmasked_field(self, idx) + } + + pub fn unmasked_field_by_name(&self, name: impl AsRef) -> VortexResult<&ArrayRef> { + StructArrayExt::unmasked_field_by_name(self, name) + } + + pub fn unmasked_field_by_name_opt(&self, name: impl AsRef) -> Option<&ArrayRef> { + StructArrayExt::unmasked_field_by_name_opt(self, name) + } + + pub fn unmasked_fields(&self) -> Arc<[ArrayRef]> { + StructArrayExt::unmasked_fields(self) + } + + pub fn struct_fields(&self) -> StructFields { + StructArrayExt::struct_fields(self) + } + + pub fn struct_validity(&self) -> Validity { + StructArrayExt::struct_validity(self) } } diff --git a/vortex-array/src/arrays/struct_/mod.rs b/vortex-array/src/arrays/struct_/mod.rs index 65b53e2d603..3888bffabea 100644 --- a/vortex-array/src/arrays/struct_/mod.rs +++ b/vortex-array/src/arrays/struct_/mod.rs @@ -4,6 +4,7 @@ mod array; pub use array::StructData; pub use array::StructDataParts; +pub use array::StructArrayExt; pub use vtable::StructArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/struct_/tests.rs b/vortex-array/src/arrays/struct_/tests.rs index 6fb3078c993..ffdb20fa304 100644 --- a/vortex-array/src/arrays/struct_/tests.rs +++ b/vortex-array/src/arrays/struct_/tests.rs @@ -68,8 +68,7 @@ fn test_remove_column() { ) .unwrap(); - let mut data = struct_a.into_data(); - let removed = data.remove_column("xs").unwrap(); + let (data, removed) = struct_a.remove_column("xs").unwrap(); assert_eq!( removed.dtype(), &DType::Primitive(PType::I64, Nullability::NonNullable) diff --git a/vortex-array/src/arrays/struct_/vtable/mod.rs b/vortex-array/src/arrays/struct_/vtable/mod.rs index af6d0d4f78e..347666b343b 100644 --- a/vortex-array/src/arrays/struct_/vtable/mod.rs +++ b/vortex-array/src/arrays/struct_/vtable/mod.rs @@ -15,6 +15,7 @@ use crate::ExecutionResult; use crate::array::Array; use crate::array::ArrayView; use crate::array::VTable; +use crate::array::child_to_validity; use crate::arrays::struct_::StructData; use crate::arrays::struct_::array::FIELDS_OFFSET; use crate::arrays::struct_::array::VALIDITY_SLOT; @@ -49,16 +50,16 @@ impl VTable for Struct { for field in array.iter_unmasked_fields() { field.array_hash(state, precision); } - array.data().validity().array_hash(state, precision); + array.struct_validity().array_hash(state, precision); } fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.slots.len() == other.slots.len() + array.slots().len() == other.slots().len() && array .iter_unmasked_fields() .zip(other.iter_unmasked_fields()) .all(|(a, b)| a.array_eq(b, precision)) - && array.data().validity().array_eq(&other.data().validity(), precision) + && array.struct_validity().array_eq(&other.struct_validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -66,25 +67,74 @@ impl VTable for Struct { } fn validate(&self, data: &StructData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { - match dtype { - DType::Struct(..) => {} - _ => vortex_bail!("Expected struct dtype, found {:?}", dtype), + let DType::Struct(struct_dtype, nullability) = dtype else { + vortex_bail!("Expected struct dtype, found {:?}", dtype) + }; + + if data.names() != struct_dtype.names() { + vortex_bail!( + InvalidArgument: "StructArray field names {:?} do not match dtype names {:?}", + data.names(), + struct_dtype.names() + ); } - if data.len() != len { + + let expected_slots = struct_dtype.nfields() + 1; + if slots.len() != expected_slots { vortex_bail!( - InvalidArgument: "StructArray length {} does not match outer length {}", - data.len(), - len + InvalidArgument: "StructArray has {} slots but expected {}", + slots.len(), + expected_slots ); } - let data_dtype = data.dtype(); - if &data_dtype != dtype { + + let validity = child_to_validity(&slots[VALIDITY_SLOT], *nullability); + if let Some(validity_len) = validity.maybe_len() + && validity_len != len + { vortex_bail!( - InvalidArgument: "StructArray dtype {} does not match outer dtype {}", - data_dtype, - dtype + InvalidArgument: "StructArray validity length {} does not match outer length {}", + validity_len, + len ); } + + let field_slots = &slots[FIELDS_OFFSET..]; + if field_slots.is_empty() { + if data.fieldless_len != Some(len) { + vortex_bail!( + InvalidArgument: "Fieldless StructArray length {:?} does not match outer length {}", + data.fieldless_len, + len + ); + } + return Ok(()); + } + + if data.fieldless_len.is_some() { + vortex_bail!("StructArray cannot have fieldless length and field slots"); + } + + for (idx, (slot, field_dtype)) in field_slots.iter().zip(struct_dtype.fields()).enumerate() { + let field = slot + .as_ref() + .ok_or_else(|| vortex_error::vortex_err!("StructArray missing field slot {idx}"))?; + if field.len() != len { + vortex_bail!( + InvalidArgument: "StructArray field {idx} has length {} but expected {}", + field.len(), + len + ); + } + if field.dtype() != &field_dtype { + vortex_bail!( + InvalidArgument: "StructArray field {idx} has dtype {} but expected {}", + field.dtype(), + field_dtype + ); + } + } + Ok(()) } @@ -109,7 +159,7 @@ impl VTable for Struct { _buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { if !metadata.is_empty() { vortex_bail!( "StructArray expects empty metadata, got {} bytes", @@ -143,11 +193,9 @@ impl VTable for Struct { }) .try_collect()?; - StructData::try_new_with_dtype(field_children, struct_dtype.clone(), len, validity) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + let slots = StructData::make_slots(&field_children, &validity, len); + let data = StructData::try_new_with_dtype(field_children, struct_dtype.clone(), len, validity)?; + Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { diff --git a/vortex-array/src/arrays/struct_/vtable/validity.rs b/vortex-array/src/arrays/struct_/vtable/validity.rs index 53c31b1994e..55cba385ab9 100644 --- a/vortex-array/src/arrays/struct_/vtable/validity.rs +++ b/vortex-array/src/arrays/struct_/vtable/validity.rs @@ -10,6 +10,6 @@ use crate::validity::Validity; impl ValidityVTable for Struct { fn validity(array: ArrayView<'_, Struct>) -> VortexResult { - Ok(array.data().validity()) + Ok(array.struct_validity()) } } diff --git a/vortex-array/src/arrays/varbin/array.rs b/vortex-array/src/arrays/varbin/array.rs index 329cf3da04c..a87a834d570 100644 --- a/vortex-array/src/arrays/varbin/array.rs +++ b/vortex-array/src/arrays/varbin/array.rs @@ -14,6 +14,7 @@ use crate::ArrayRef; use crate::ToCanonical; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::VarBin; @@ -37,7 +38,13 @@ pub struct VarBinData { pub(super) is_utf8: bool, pub(super) nullability: Nullability, pub(super) bytes: BufferHandle, - pub(super) slots: Vec>, +} + +pub struct VarBinDataParts { + pub dtype: DType, + pub bytes: BufferHandle, + pub offsets: ArrayRef, + pub validity: Validity, } impl VarBinData { @@ -82,6 +89,14 @@ impl VarBinData { Self::try_new_from_handle(offset, bytes, dtype, validity).vortex_expect("VarBinArray new") } + pub(crate) fn make_slots( + offsets: ArrayRef, + validity: &Validity, + len: usize, + ) -> Vec> { + vec![Some(offsets), validity_to_child(validity, len)] + } + /// Constructs a new `VarBinArray`. /// /// See `VarBinArray::new_unchecked` for more information. @@ -182,7 +197,6 @@ impl VarBinData { .vortex_expect("[Debug Assertion]: Invalid `VarBinArray` parameters"); let len = offsets.len().saturating_sub(1); - let validity_slot = validity_to_child(&validity, len); let (is_utf8, nullability) = Self::dtype_parts(&dtype).vortex_expect("VarBinArray dtype must be utf8 or binary"); @@ -190,7 +204,6 @@ impl VarBinData { is_utf8, nullability, bytes, - slots: vec![Some(offsets), validity_slot], } } @@ -289,38 +302,10 @@ impl VarBinData { } /// Returns the length of this array. - pub fn len(&self) -> usize { - self.offsets().len().saturating_sub(1) - } - - /// Returns the [`DType`] of this array. pub fn dtype(&self) -> DType { Self::make_dtype(self.is_utf8, self.nullability) } - /// Returns `true` if this array is empty. - pub fn is_empty(&self) -> bool { - self.len() == 0 - } - - /// Returns the [`Validity`] of this array. - #[allow(clippy::same_name_method)] - pub fn validity(&self) -> Validity { - child_to_validity(&self.slots[VALIDITY_SLOT], self.nullability) - } - - /// Returns the validity as a [`Mask`]. - pub fn validity_mask(&self) -> Mask { - self.validity().to_mask(self.len()) - } - - #[inline] - pub fn offsets(&self) -> &ArrayRef { - self.slots[OFFSETS_SLOT] - .as_ref() - .vortex_expect("VarBinArray offsets slot") - } - /// Access the value bytes child buffer /// /// # Note @@ -338,16 +323,86 @@ impl VarBinData { pub fn bytes_handle(&self) -> &BufferHandle { &self.bytes } +} - /// Access value bytes child array limited to values that are logically present in - /// the array unlike [bytes][Self::bytes]. - pub fn sliced_bytes(&self) -> ByteBuffer { +pub trait VarBinArrayExt { + fn varbin_data(&self) -> &VarBinData; + fn as_slots(&self) -> &[Option]; + + fn offsets(&self) -> &ArrayRef { + self.as_slots()[OFFSETS_SLOT] + .as_ref() + .vortex_expect("VarBinArray offsets slot") + } + + fn validity_child(&self) -> Option<&ArrayRef> { + self.as_slots()[VALIDITY_SLOT].as_ref() + } + + fn varbin_validity(&self) -> Validity { + child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.varbin_data().nullability) + } + + fn varbin_validity_mask(&self) -> Mask { + self.varbin_validity().to_mask(self.len()) + } + + fn len(&self) -> usize; + + fn offset_at(&self, index: usize) -> usize { + assert!(index <= self.len(), "Index {index} out of bounds 0..={}", self.len()); + + (&self + .offsets() + .scalar_at(index) + .vortex_expect("offsets must support scalar_at")) + .try_into() + .vortex_expect("Failed to convert offset to usize") + } + + fn bytes_at(&self, index: usize) -> ByteBuffer { + let start = self.offset_at(index); + let end = self.offset_at(index + 1); + self.varbin_data().bytes().slice(start..end) + } + + fn sliced_bytes(&self) -> ByteBuffer { let first_offset: usize = self.offset_at(0); let last_offset = self.offset_at(self.len()); + self.varbin_data().bytes().slice(first_offset..last_offset) + } +} + +impl VarBinArrayExt for Array { + fn varbin_data(&self) -> &VarBinData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } + + fn len(&self) -> usize { + Array::len(self) + } +} - self.bytes().slice(first_offset..last_offset) +impl VarBinArrayExt for ArrayView<'_, VarBin> { + fn varbin_data(&self) -> &VarBinData { + self.data() } + fn as_slots(&self) -> &[Option] { + self.slots() + } + + fn len(&self) -> usize { + ArrayView::len(self) + } +} + +/// Forwarding constructors for `VarBinArray` (= `Array`). +impl Array { pub fn from_vec>(vec: Vec, dtype: DType) -> Self { let size: usize = vec.iter().map(|v| v.as_ref().len()).sum(); if size < u32::MAX as usize { @@ -357,18 +412,6 @@ impl VarBinData { } } - fn from_vec_sized(vec: Vec, dtype: DType) -> Self - where - O: IntegerPType, - T: AsRef<[u8]>, - { - let mut builder = VarBinBuilder::::with_capacity(vec.len()); - for v in vec { - builder.append_value(v.as_ref()); - } - builder.finish(dtype).into_data() - } - #[expect( clippy::same_name_method, reason = "intentionally named from_iter like Iterator::from_iter" @@ -382,7 +425,7 @@ impl VarBinData { for v in iter { builder.append(v.as_ref().map(|o| o.as_ref())); } - builder.finish(dtype).into_data() + builder.finish(dtype) } pub fn from_iter_nonnull, I: IntoIterator>( @@ -394,39 +437,19 @@ impl VarBinData { for v in iter { builder.append_value(v); } - builder.finish(dtype).into_data() - } -} - -/// Forwarding constructors for `VarBinArray` (= `Array`). -impl Array { - #[inline] - fn from_prevalidated_data(data: VarBinData) -> Self { - let dtype = data.dtype(); - let len = data.len(); - unsafe { Array::from_parts_unchecked(ArrayParts::new(VarBin, dtype, len, data)) } - } - - pub fn from_vec>(vec: Vec, dtype: DType) -> Self { - Self::from_prevalidated_data(VarBinData::from_vec(vec, dtype)) - } - - #[expect( - clippy::same_name_method, - reason = "intentionally named from_iter like Iterator::from_iter" - )] - pub fn from_iter, I: IntoIterator>>( - iter: I, - dtype: DType, - ) -> Self { - Self::from_prevalidated_data(VarBinData::from_iter(iter, dtype)) + builder.finish(dtype) } - pub fn from_iter_nonnull, I: IntoIterator>( - iter: I, - dtype: DType, - ) -> Self { - Self::from_prevalidated_data(VarBinData::from_iter_nonnull(iter, dtype)) + fn from_vec_sized(vec: Vec, dtype: DType) -> Self + where + O: IntegerPType, + T: AsRef<[u8]>, + { + let mut builder = VarBinBuilder::::with_capacity(vec.len()); + for v in vec { + builder.append_value(v.as_ref()); + } + builder.finish(dtype) } /// Create from a vector of string slices. @@ -448,54 +471,83 @@ impl Array { pub fn from_nullable_bytes(value: Vec>) -> Self { Self::from_iter(value, DType::Binary(Nullability::Nullable)) } -} -impl VarBinData { - /// Get value offset at a given index - /// - /// Note: There's 1 more offsets than the elements in the array, thus last offset is at array length index - /// - /// Panics if index is out of bounds + #[inline] + pub fn offsets(&self) -> &ArrayRef { + VarBinArrayExt::offsets(self) + } + pub fn offset_at(&self, index: usize) -> usize { - assert!( - index <= self.len(), - "Index {index} out of bounds 0..={}", - self.len() - ); + VarBinArrayExt::offset_at(self, index) + } - (&self - .offsets() - .scalar_at(index) - .vortex_expect("offsets must support scalar_at")) - .try_into() - .vortex_expect("Failed to convert offset to usize") + pub fn bytes_at(&self, index: usize) -> ByteBuffer { + VarBinArrayExt::bytes_at(self, index) + } + + pub fn sliced_bytes(&self) -> ByteBuffer { + VarBinArrayExt::sliced_bytes(self) + } + + pub fn into_data_parts(self) -> VarBinDataParts { + let parts = self.into_parts(); + let dtype = parts.dtype; + let validity = child_to_validity(&parts.slots[VALIDITY_SLOT], dtype.nullability()); + VarBinDataParts { + dtype, + bytes: parts.data.bytes, + offsets: parts.slots[OFFSETS_SLOT] + .clone() + .vortex_expect("VarBinArray offsets slot"), + validity, + } + } +} + +impl ArrayView<'_, VarBin> { + #[inline] + pub fn offsets(&self) -> &ArrayRef { + VarBinArrayExt::offsets(self) + } + + pub fn offset_at(&self, index: usize) -> usize { + VarBinArrayExt::offset_at(self, index) } - /// Access value bytes at a given index - /// - /// Will return buffer referencing underlying data without performing a copy pub fn bytes_at(&self, index: usize) -> ByteBuffer { - let start = self.offset_at(index); - let end = self.offset_at(index + 1); + VarBinArrayExt::bytes_at(self, index) + } - self.bytes().slice(start..end) + pub fn sliced_bytes(&self) -> ByteBuffer { + VarBinArrayExt::sliced_bytes(self) + } + + pub fn varbin_validity(&self) -> Validity { + VarBinArrayExt::varbin_validity(self) } - /// Consumes self, returning a tuple containing the `DType`, the `bytes` array, - /// the `offsets` array, and the `validity`. - pub fn into_parts(mut self) -> (DType, BufferHandle, ArrayRef, Validity) { - let validity = self.validity(); - let offsets = self.slots[OFFSETS_SLOT] - .take() - .vortex_expect("VarBinArray offsets slot"); - (self.dtype(), self.bytes, offsets, validity) + pub fn varbin_validity_mask(&self) -> Mask { + VarBinArrayExt::varbin_validity_mask(self) } } impl Array { /// Creates a new `VarBinArray`. pub fn new(offsets: ArrayRef, bytes: ByteBuffer, dtype: DType, validity: Validity) -> Self { - Self::from_prevalidated_data(VarBinData::new(offsets, bytes, dtype, validity)) + let len = offsets.len().saturating_sub(1); + let slots = VarBinData::make_slots(offsets, &validity, len); + let data = VarBinData::new( + slots[OFFSETS_SLOT] + .as_ref() + .vortex_expect("VarBinArray offsets slot") + .clone(), + bytes, + dtype.clone(), + validity, + ); + unsafe { + Array::from_parts_unchecked(ArrayParts::new(VarBin, dtype, len, data).with_slots(slots)) + } } /// Creates a new `VarBinArray` without validation. @@ -509,9 +561,22 @@ impl Array { dtype: DType, validity: Validity, ) -> Self { - Self::from_prevalidated_data(unsafe { - VarBinData::new_unchecked(offsets, bytes, dtype, validity) - }) + let len = offsets.len().saturating_sub(1); + let slots = VarBinData::make_slots(offsets, &validity, len); + let data = unsafe { + VarBinData::new_unchecked( + slots[OFFSETS_SLOT] + .as_ref() + .vortex_expect("VarBinArray offsets slot") + .clone(), + bytes, + dtype.clone(), + validity, + ) + }; + unsafe { + Array::from_parts_unchecked(ArrayParts::new(VarBin, dtype, len, data).with_slots(slots)) + } } /// Creates a new `VarBinArray` without validation from a [`BufferHandle`]. @@ -525,9 +590,22 @@ impl Array { dtype: DType, validity: Validity, ) -> Self { - Self::from_prevalidated_data(unsafe { - VarBinData::new_unchecked_from_handle(offsets, bytes, dtype, validity) - }) + let len = offsets.len().saturating_sub(1); + let slots = VarBinData::make_slots(offsets, &validity, len); + let data = unsafe { + VarBinData::new_unchecked_from_handle( + slots[OFFSETS_SLOT] + .as_ref() + .vortex_expect("VarBinArray offsets slot") + .clone(), + bytes, + dtype.clone(), + validity, + ) + }; + unsafe { + Array::from_parts_unchecked(ArrayParts::new(VarBin, dtype, len, data).with_slots(slots)) + } } /// Constructs a new `VarBinArray`. @@ -537,154 +615,91 @@ impl Array { dtype: DType, validity: Validity, ) -> VortexResult { - Ok(Self::from_prevalidated_data(VarBinData::try_new( - offsets, bytes, dtype, validity, - )?)) - } -} - -impl From> for VarBinData { - fn from(value: Vec<&[u8]>) -> Self { - Self::from_vec(value, DType::Binary(Nullability::NonNullable)) - } -} - -impl From>> for VarBinData { - fn from(value: Vec>) -> Self { - Self::from_vec(value, DType::Binary(Nullability::NonNullable)) - } -} - -impl From> for VarBinData { - fn from(value: Vec) -> Self { - Self::from_vec(value, DType::Utf8(Nullability::NonNullable)) - } -} - -impl From> for VarBinData { - fn from(value: Vec<&str>) -> Self { - Self::from_vec(value, DType::Utf8(Nullability::NonNullable)) - } -} - -impl From>> for VarBinData { - fn from(value: Vec>) -> Self { - Self::from_iter(value, DType::Binary(Nullability::Nullable)) - } -} - -impl From>>> for VarBinData { - fn from(value: Vec>>) -> Self { - Self::from_iter(value, DType::Binary(Nullability::Nullable)) - } -} - -impl From>> for VarBinData { - fn from(value: Vec>) -> Self { - Self::from_iter(value, DType::Utf8(Nullability::Nullable)) - } -} - -impl From>> for VarBinData { - fn from(value: Vec>) -> Self { - Self::from_iter(value, DType::Utf8(Nullability::Nullable)) - } -} - -impl<'a> FromIterator> for VarBinData { - fn from_iter>>(iter: T) -> Self { - Self::from_iter(iter, DType::Binary(Nullability::Nullable)) - } -} - -impl FromIterator>> for VarBinData { - fn from_iter>>>(iter: T) -> Self { - Self::from_iter(iter, DType::Binary(Nullability::Nullable)) - } -} - -impl FromIterator> for VarBinData { - fn from_iter>>(iter: T) -> Self { - Self::from_iter(iter, DType::Utf8(Nullability::Nullable)) - } -} - -impl<'a> FromIterator> for VarBinData { - fn from_iter>>(iter: T) -> Self { - Self::from_iter(iter, DType::Utf8(Nullability::Nullable)) + let len = offsets.len().saturating_sub(1); + let slots = VarBinData::make_slots(offsets, &validity, len); + let data = VarBinData::try_new( + slots[OFFSETS_SLOT] + .as_ref() + .vortex_expect("VarBinArray offsets slot") + .clone(), + bytes, + dtype.clone(), + validity, + )?; + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(VarBin, dtype, len, data).with_slots(slots)) + }) } } -// --- From and FromIterator forwarding for Array --- - impl From> for Array { fn from(value: Vec<&[u8]>) -> Self { - Self::from_prevalidated_data(VarBinData::from(value)) + Self::from_vec(value, DType::Binary(Nullability::NonNullable)) } } impl From>> for Array { fn from(value: Vec>) -> Self { - Self::from_prevalidated_data(VarBinData::from(value)) + Self::from_vec(value, DType::Binary(Nullability::NonNullable)) } } impl From> for Array { fn from(value: Vec) -> Self { - Self::from_prevalidated_data(VarBinData::from(value)) + Self::from_vec(value, DType::Utf8(Nullability::NonNullable)) } } impl From> for Array { fn from(value: Vec<&str>) -> Self { - Self::from_prevalidated_data(VarBinData::from(value)) + Self::from_vec(value, DType::Utf8(Nullability::NonNullable)) } } impl From>> for Array { fn from(value: Vec>) -> Self { - Self::from_prevalidated_data(VarBinData::from(value)) + Self::from_iter(value, DType::Binary(Nullability::Nullable)) } } impl From>>> for Array { fn from(value: Vec>>) -> Self { - Self::from_prevalidated_data(VarBinData::from(value)) + Self::from_iter(value, DType::Binary(Nullability::Nullable)) } } impl From>> for Array { fn from(value: Vec>) -> Self { - Self::from_prevalidated_data(VarBinData::from(value)) + Self::from_iter(value, DType::Utf8(Nullability::Nullable)) } } impl From>> for Array { fn from(value: Vec>) -> Self { - Self::from_prevalidated_data(VarBinData::from(value)) + Self::from_iter(value, DType::Utf8(Nullability::Nullable)) } } impl<'a> FromIterator> for Array { fn from_iter>>(iter: T) -> Self { - Self::from_prevalidated_data(>::from_iter(iter)) + Self::from_iter(iter, DType::Binary(Nullability::Nullable)) } } impl FromIterator>> for Array { fn from_iter>>>(iter: T) -> Self { - Self::from_prevalidated_data(>::from_iter(iter)) + Self::from_iter(iter, DType::Binary(Nullability::Nullable)) } } impl FromIterator> for Array { fn from_iter>>(iter: T) -> Self { - Self::from_prevalidated_data(>::from_iter(iter)) + Self::from_iter(iter, DType::Utf8(Nullability::Nullable)) } } impl<'a> FromIterator> for Array { fn from_iter>>(iter: T) -> Self { - Self::from_prevalidated_data(>::from_iter(iter)) + Self::from_iter(iter, DType::Utf8(Nullability::Nullable)) } } diff --git a/vortex-array/src/arrays/varbin/compute/filter.rs b/vortex-array/src/arrays/varbin/compute/filter.rs index b1117b35bd9..025bbd00b84 100644 --- a/vortex-array/src/arrays/varbin/compute/filter.rs +++ b/vortex-array/src/arrays/varbin/compute/filter.rs @@ -67,7 +67,7 @@ fn filter_select_var_bin_by_slice( offsets.as_slice::(), values.bytes().as_slice(), mask_slices, - values.validity_mask(), + values.varbin_validity_mask(), selection_count, ) }) diff --git a/vortex-array/src/arrays/varbin/compute/take.rs b/vortex-array/src/arrays/varbin/compute/take.rs index d742b4cda51..848c9eacbd0 100644 --- a/vortex-array/src/arrays/varbin/compute/take.rs +++ b/vortex-array/src/arrays/varbin/compute/take.rs @@ -36,7 +36,7 @@ impl TakeExecute for VarBin { .dtype() .clone() .union_nullability(indices.dtype().nullability()); - let array_validity = array.validity_mask(); + let array_validity = array.varbin_validity_mask(); let indices_validity = indices.validity_mask()?; let array = match_each_integer_ptype!(indices.ptype(), |I| { diff --git a/vortex-array/src/arrays/varbin/mod.rs b/vortex-array/src/arrays/varbin/mod.rs index dc3fa89f746..6a0a6848096 100644 --- a/vortex-array/src/arrays/varbin/mod.rs +++ b/vortex-array/src/arrays/varbin/mod.rs @@ -3,6 +3,8 @@ mod array; pub use array::VarBinData; +pub use array::VarBinArrayExt; +pub use array::VarBinDataParts; pub use vtable::VarBinArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/varbin/vtable/canonical.rs b/vortex-array/src/arrays/varbin/vtable/canonical.rs index b7ee968c90c..726bbfd8dcd 100644 --- a/vortex-array/src/arrays/varbin/vtable/canonical.rs +++ b/vortex-array/src/arrays/varbin/vtable/canonical.rs @@ -23,21 +23,23 @@ pub(crate) fn varbin_to_canonical( array: ArrayView<'_, VarBin>, ctx: &mut ExecutionCtx, ) -> VortexResult { - let (dtype, bytes, offsets, validity) = array.into_owned().into_data().into_parts(); + let parts = array.into_owned().into_data_parts(); - let offsets = offsets.execute::(ctx)?; + let offsets = parts.offsets.execute::(ctx)?; match_each_integer_ptype!(offsets.ptype(), |P| { let offsets_slice = offsets.as_slice::

(); let first: usize = offsets_slice[0].as_(); let last: usize = offsets_slice[offsets_slice.len() - 1].as_(); - let bytes = bytes.unwrap_host().slice(first..last).into_mut(); + let bytes = parts.bytes.unwrap_host().slice(first..last).into_mut(); let lens = offsets_to_lengths(offsets_slice); let (buffers, views) = build_views(0, MAX_BUFFER_LEN, bytes, lens.as_slice()); // SAFETY: views are correctly computed from valid offsets - Ok(unsafe { VarBinViewArray::new_unchecked(views, Arc::from(buffers), dtype, validity) }) + Ok(unsafe { + VarBinViewArray::new_unchecked(views, Arc::from(buffers), parts.dtype, parts.validity) + }) }) } diff --git a/vortex-array/src/arrays/varbin/vtable/mod.rs b/vortex-array/src/arrays/varbin/vtable/mod.rs index 681b4979b80..98118694252 100644 --- a/vortex-array/src/arrays/varbin/vtable/mod.rs +++ b/vortex-array/src/arrays/varbin/vtable/mod.rs @@ -61,13 +61,13 @@ impl VTable for VarBin { fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { array.bytes().array_hash(state, precision); array.offsets().array_hash(state, precision); - array.data().validity().array_hash(state, precision); + array.varbin_validity().array_hash(state, precision); } fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.bytes().array_eq(other.bytes(), precision) && array.offsets().array_eq(other.offsets(), precision) - && array.data().validity().array_eq(&other.data().validity(), precision) + && array.varbin_validity().array_eq(&other.varbin_validity(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -75,10 +75,14 @@ impl VTable for VarBin { } fn validate(&self, data: &VarBinData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + vortex_ensure!(slots.len() == NUM_SLOTS, "VarBinArray expected {NUM_SLOTS} slots, found {}", slots.len()); + let offsets = slots[crate::arrays::varbin::array::OFFSETS_SLOT] + .as_ref() + .vortex_expect("VarBinArray offsets slot"); vortex_ensure!( - data.len() == len, + offsets.len().saturating_sub(1) == len, "VarBinArray length {} does not match outer length {}", - data.len(), + offsets.len().saturating_sub(1), len ); vortex_ensure!( @@ -123,7 +127,7 @@ impl VTable for VarBin { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { let metadata = VarBinMetadata::decode(metadata)?; let validity = if children.len() == 1 { Validity::from(dtype.nullability()) @@ -145,11 +149,9 @@ impl VTable for VarBin { } let bytes = buffers[0].clone().try_to_host_sync()?; - VarBinData::try_new(offsets, bytes, dtype.clone(), validity) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + let data = VarBinData::try_new(offsets.clone(), bytes, dtype.clone(), validity.clone())?; + let slots = VarBinData::make_slots(offsets, &validity, len); + Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { diff --git a/vortex-array/src/arrays/varbin/vtable/validity.rs b/vortex-array/src/arrays/varbin/vtable/validity.rs index 0102cc3b73e..c6383f4c498 100644 --- a/vortex-array/src/arrays/varbin/vtable/validity.rs +++ b/vortex-array/src/arrays/varbin/vtable/validity.rs @@ -10,6 +10,6 @@ use crate::validity::Validity; impl ValidityVTable for VarBin { fn validity(array: ArrayView<'_, VarBin>) -> VortexResult { - Ok(array.data().validity()) + Ok(array.varbin_validity()) } } diff --git a/vortex-array/src/arrays/varbinview/array.rs b/vortex-array/src/arrays/varbinview/array.rs index fd61c204feb..8cf3191f16c 100644 --- a/vortex-array/src/arrays/varbinview/array.rs +++ b/vortex-array/src/arrays/varbinview/array.rs @@ -18,6 +18,7 @@ use vortex_mask::Mask; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::VarBinView; @@ -95,7 +96,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["validity"]; /// ``` #[derive(Clone, Debug)] pub struct VarBinViewData { - pub(super) slots: Vec>, pub(super) is_utf8: bool, pub(super) nullability: Nullability, pub(super) buffers: Arc<[BufferHandle]>, @@ -277,12 +277,9 @@ impl VarBinViewData { dtype: DType, validity: Validity, ) -> Self { - let len = views.len() / size_of::(); - let slots = Self::make_slots(&validity, len); let (is_utf8, nullability) = Self::dtype_parts(&dtype).vortex_expect("VarBinViewArray dtype must be utf8 or binary"); Self { - slots, is_utf8, nullability, buffers, @@ -394,28 +391,6 @@ impl VarBinViewData { self.len() == 0 } - /// Returns the [`Validity`] of this array. - #[allow(clippy::same_name_method)] - pub fn validity(&self) -> Validity { - child_to_validity(&self.slots[VALIDITY_SLOT], self.nullability) - } - - /// Returns the validity as a [`Mask`]. - pub fn validity_mask(&self) -> Mask { - self.validity().to_mask(self.len()) - } - - /// Splits the array into owned parts - pub fn into_parts(self) -> VarBinViewDataParts { - let validity = self.validity(); - VarBinViewDataParts { - dtype: self.dtype(), - buffers: self.buffers, - views: self.views, - validity, - } - } - /// Access to the primitive views buffer. /// /// Variable-sized binary view buffer contain a "view" child array, with 16-byte entries that @@ -569,12 +544,51 @@ impl VarBinViewData { } } +pub trait VarBinViewArrayExt { + fn varbinview_data(&self) -> &VarBinViewData; + fn as_slots(&self) -> &[Option]; + + fn varbinview_validity(&self) -> Validity { + child_to_validity( + &self.as_slots()[VALIDITY_SLOT], + self.varbinview_data().nullability, + ) + } + + fn varbinview_validity_mask(&self) -> Mask { + self.varbinview_validity() + .to_mask(self.varbinview_data().len()) + } +} + +impl VarBinViewArrayExt for Array { + fn varbinview_data(&self) -> &VarBinViewData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + +impl VarBinViewArrayExt for ArrayView<'_, VarBinView> { + fn varbinview_data(&self) -> &VarBinViewData { + self.data() + } + + fn as_slots(&self) -> &[Option] { + self.slots() + } +} + impl Array { #[inline] - fn from_prevalidated_data(data: VarBinViewData) -> Self { + fn from_prevalidated_data(data: VarBinViewData, slots: Vec>) -> Self { let dtype = data.dtype(); let len = data.len(); - unsafe { Array::from_parts_unchecked(ArrayParts::new(VarBinView, dtype, len, data)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(VarBinView, dtype, len, data).with_slots(slots)) + } } /// Construct a `VarBinViewArray` from an iterator of optional byte slices. @@ -586,27 +600,52 @@ impl Array { iter: I, dtype: DType, ) -> Self { - Self::from_prevalidated_data(VarBinViewData::from_iter(iter, dtype)) + let array = VarBinViewData::from_iter(iter, dtype); + let slots = VarBinViewData::make_slots( + &Validity::from(array.nullability), + array.len(), + ); + Self::from_prevalidated_data(array, slots) } pub fn from_iter_str, I: IntoIterator>(iter: I) -> Self { - Self::from_prevalidated_data(VarBinViewData::from_iter_str(iter)) + let array = VarBinViewData::from_iter_str(iter); + let slots = VarBinViewData::make_slots( + &Validity::from(array.nullability), + array.len(), + ); + Self::from_prevalidated_data(array, slots) } pub fn from_iter_nullable_str, I: IntoIterator>>( iter: I, ) -> Self { - Self::from_prevalidated_data(VarBinViewData::from_iter_nullable_str(iter)) + let array = VarBinViewData::from_iter_nullable_str(iter); + let slots = VarBinViewData::make_slots( + &Validity::from(array.nullability), + array.len(), + ); + Self::from_prevalidated_data(array, slots) } pub fn from_iter_bin, I: IntoIterator>(iter: I) -> Self { - Self::from_prevalidated_data(VarBinViewData::from_iter_bin(iter)) + let array = VarBinViewData::from_iter_bin(iter); + let slots = VarBinViewData::make_slots( + &Validity::from(array.nullability), + array.len(), + ); + Self::from_prevalidated_data(array, slots) } pub fn from_iter_nullable_bin, I: IntoIterator>>( iter: I, ) -> Self { - Self::from_prevalidated_data(VarBinViewData::from_iter_nullable_bin(iter)) + let array = VarBinViewData::from_iter_nullable_bin(iter); + let slots = VarBinViewData::make_slots( + &Validity::from(array.nullability), + array.len(), + ); + Self::from_prevalidated_data(array, slots) } /// Creates a new `VarBinViewArray`. @@ -616,9 +655,9 @@ impl Array { dtype: DType, validity: Validity, ) -> VortexResult { - Ok(Self::from_prevalidated_data(VarBinViewData::try_new( - views, buffers, dtype, validity, - )?)) + let data = VarBinViewData::try_new(views, buffers, dtype, validity.clone())?; + let slots = VarBinViewData::make_slots(&validity, data.len()); + Ok(Self::from_prevalidated_data(data, slots)) } /// Creates a new `VarBinViewArray` without validation. @@ -632,9 +671,9 @@ impl Array { dtype: DType, validity: Validity, ) -> Self { - Self::from_prevalidated_data(unsafe { - VarBinViewData::new_unchecked(views, buffers, dtype, validity) - }) + let data = unsafe { VarBinViewData::new_unchecked(views, buffers, dtype, validity.clone()) }; + let slots = VarBinViewData::make_slots(&validity, data.len()); + Self::from_prevalidated_data(data, slots) } /// Creates a new `VarBinViewArray` with device or host memory. @@ -644,7 +683,9 @@ impl Array { dtype: DType, validity: Validity, ) -> Self { - Self::from_prevalidated_data(VarBinViewData::new_handle(views, buffers, dtype, validity)) + let data = VarBinViewData::new_handle(views, buffers, dtype, validity.clone()); + let slots = VarBinViewData::make_slots(&validity, data.len()); + Self::from_prevalidated_data(data, slots) } /// Construct a new array from `BufferHandle`s without validation. @@ -658,9 +699,38 @@ impl Array { dtype: DType, validity: Validity, ) -> Self { - Self::from_prevalidated_data(unsafe { - VarBinViewData::new_handle_unchecked(views, buffers, dtype, validity) - }) + let data = + unsafe { VarBinViewData::new_handle_unchecked(views, buffers, dtype, validity.clone()) }; + let slots = VarBinViewData::make_slots(&validity, data.len()); + Self::from_prevalidated_data(data, slots) + } + + pub fn varbinview_validity(&self) -> Validity { + VarBinViewArrayExt::varbinview_validity(self) + } + + pub fn varbinview_validity_mask(&self) -> Mask { + VarBinViewArrayExt::varbinview_validity_mask(self) + } + + pub fn into_data_parts(self) -> VarBinViewDataParts { + let parts = self.into_parts(); + VarBinViewDataParts { + dtype: parts.dtype, + buffers: parts.data.buffers, + views: parts.data.views, + validity: child_to_validity(&parts.slots[VALIDITY_SLOT], parts.data.nullability), + } + } +} + +impl ArrayView<'_, VarBinView> { + pub fn varbinview_validity(&self) -> Validity { + VarBinViewArrayExt::varbinview_validity(self) + } + + pub fn varbinview_validity_mask(&self) -> Mask { + VarBinViewArrayExt::varbinview_validity_mask(self) } } @@ -692,24 +762,24 @@ impl<'a> FromIterator> for VarBinViewData { impl<'a> FromIterator> for Array { fn from_iter>>(iter: T) -> Self { - Self::from_prevalidated_data(>::from_iter(iter)) + Self::from_iter(iter, DType::Binary(Nullability::Nullable)) } } impl FromIterator>> for Array { fn from_iter>>>(iter: T) -> Self { - Self::from_prevalidated_data(>::from_iter(iter)) + Self::from_iter(iter, DType::Binary(Nullability::Nullable)) } } impl FromIterator> for Array { fn from_iter>>(iter: T) -> Self { - Self::from_prevalidated_data(>::from_iter(iter)) + Self::from_iter_nullable_str(iter) } } impl<'a> FromIterator> for Array { fn from_iter>>(iter: T) -> Self { - Self::from_prevalidated_data(>::from_iter(iter)) + Self::from_iter_nullable_str(iter) } } diff --git a/vortex-array/src/arrays/varbinview/compute/zip.rs b/vortex-array/src/arrays/varbinview/compute/zip.rs index 559d796088e..8938769e1e0 100644 --- a/vortex-array/src/arrays/varbinview/compute/zip.rs +++ b/vortex-array/src/arrays/varbinview/compute/zip.rs @@ -15,6 +15,7 @@ use crate::IntoArray; use crate::array::ArrayView; use crate::arrays::VarBinView; use crate::arrays::VarBinViewArray; +use crate::arrays::varbinview::VarBinViewArrayExt; use crate::arrays::varbinview::BinaryView; use crate::builders::DeduplicatedBuffers; use crate::builders::LazyBitBufferBuilder; @@ -53,8 +54,8 @@ impl ZipKernel for VarBinView { let mut views_builder = BufferMut::::with_capacity(len); let mut validity_builder = LazyBitBufferBuilder::new(len); - let true_validity = if_true.validity_mask(); - let false_validity = if_false.validity_mask(); + let true_validity = if_true.varbinview_validity_mask(); + let false_validity = if_false.varbinview_validity_mask(); let mask = mask.try_to_mask_fill_null_false(ctx)?; let if_false_view = if_false; diff --git a/vortex-array/src/arrays/varbinview/mod.rs b/vortex-array/src/arrays/varbinview/mod.rs index d2d0041424d..932eef96d88 100644 --- a/vortex-array/src/arrays/varbinview/mod.rs +++ b/vortex-array/src/arrays/varbinview/mod.rs @@ -4,6 +4,7 @@ mod array; pub use array::VarBinViewData; pub use array::VarBinViewDataParts; +pub use array::VarBinViewArrayExt; pub use vtable::VarBinViewArray; mod accessor; diff --git a/vortex-array/src/arrays/varbinview/vtable/mod.rs b/vortex-array/src/arrays/varbinview/vtable/mod.rs index bcab2ab7f36..bd9c030e8ed 100644 --- a/vortex-array/src/arrays/varbinview/vtable/mod.rs +++ b/vortex-array/src/arrays/varbinview/vtable/mod.rs @@ -21,6 +21,7 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; +use crate::arrays::varbinview::VarBinViewArrayExt; use crate::arrays::varbinview::BinaryView; use crate::arrays::varbinview::VarBinViewData; use crate::arrays::varbinview::array::NUM_SLOTS; @@ -64,18 +65,20 @@ impl VTable for VarBinView { buffer.array_hash(state, precision); } array.views.array_hash(state, precision); - array.data().validity().array_hash(state, precision); + array.varbinview_validity().array_hash(state, precision); } fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { array.buffers.len() == other.buffers.len() && array - .buffers - .iter() - .zip(other.buffers.iter()) - .all(|(a, b)| a.array_eq(b, precision)) + .buffers + .iter() + .zip(other.buffers.iter()) + .all(|(a, b)| a.array_eq(b, precision)) && array.views.array_eq(&other.views, precision) - && array.data().validity().array_eq(&other.data().validity(), precision) + && array + .varbinview_validity() + .array_eq(&other.varbinview_validity(), precision) } fn nbuffers(array: ArrayView<'_, Self>) -> usize { @@ -83,6 +86,7 @@ impl VTable for VarBinView { } fn validate(&self, data: &VarBinViewData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + vortex_ensure!(slots.len() == NUM_SLOTS, "VarBinViewArray expected {NUM_SLOTS} slots, found {}", slots.len()); vortex_ensure!( data.len() == len, "VarBinViewArray length {} does not match outer length {}", @@ -133,7 +137,7 @@ impl VTable for VarBinView { buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { if !metadata.is_empty() { vortex_bail!( "VarBinViewArray expects empty metadata, got {} bytes", @@ -167,11 +171,16 @@ impl VTable for VarBinView { // If any buffer is on device, skip host validation and use try_new_handle. if buffers.iter().any(|b| b.is_on_device()) { - return VarBinViewData::try_new_handle( + let data = VarBinViewData::try_new_handle( views_handle.clone(), Arc::from(data_handles.to_vec()), dtype.clone(), - validity, + validity.clone(), + )?; + let slots = VarBinViewData::make_slots(&validity, len); + return Ok( + crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data) + .with_slots(slots), ); } @@ -181,11 +190,9 @@ impl VTable for VarBinView { .collect::>(); let views = Buffer::::from_byte_buffer(views_handle.clone().as_host().clone()); - VarBinViewData::try_new(views, Arc::from(data_buffers), dtype.clone(), validity) - } - - fn infer_slots(data: &Self::ArrayData) -> Vec> { - data.slots.clone() + let data = VarBinViewData::try_new(views, Arc::from(data_buffers), dtype.clone(), validity.clone())?; + let slots = VarBinViewData::make_slots(&validity, len); + Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } fn slots(array: ArrayView<'_, Self>) -> &[Option] { diff --git a/vortex-array/src/arrays/varbinview/vtable/validity.rs b/vortex-array/src/arrays/varbinview/vtable/validity.rs index 93e4ff4b09f..f9dfbf64def 100644 --- a/vortex-array/src/arrays/varbinview/vtable/validity.rs +++ b/vortex-array/src/arrays/varbinview/vtable/validity.rs @@ -5,11 +5,12 @@ use vortex_error::VortexResult; use crate::array::ArrayView; use crate::array::ValidityVTable; +use crate::arrays::varbinview::VarBinViewArrayExt; use crate::arrays::varbinview::vtable::VarBinView; use crate::validity::Validity; impl ValidityVTable for VarBinView { fn validity(array: ArrayView<'_, VarBinView>) -> VortexResult { - Ok(array.data().validity()) + Ok(array.varbinview_validity()) } } diff --git a/vortex-array/src/arrays/variant/vtable/mod.rs b/vortex-array/src/arrays/variant/vtable/mod.rs index 27baad0e11d..22123dc9eaa 100644 --- a/vortex-array/src/arrays/variant/vtable/mod.rs +++ b/vortex-array/src/arrays/variant/vtable/mod.rs @@ -116,7 +116,7 @@ impl VTable for Variant { _buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &vortex_session::VortexSession, - ) -> VortexResult { + ) -> VortexResult> { vortex_ensure!( metadata.is_empty(), "VariantArray expects empty metadata, got {} bytes", @@ -129,8 +129,11 @@ impl VTable for Variant { children.len() ); // The child carries the nullability for the whole VariantArray. - children.get(0, dtype, len)?; - Ok(VariantData) + let child = children.get(0, dtype, len)?; + Ok( + crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, VariantData) + .with_slots(vec![Some(child)]), + ) } fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { diff --git a/vortex-array/src/arrow/executor/dictionary.rs b/vortex-array/src/arrow/executor/dictionary.rs index 23cc71e65dd..2c36c9f9672 100644 --- a/vortex-array/src/arrow/executor/dictionary.rs +++ b/vortex-array/src/arrow/executor/dictionary.rs @@ -21,7 +21,7 @@ use crate::arrays::Constant; use crate::arrays::ConstantArray; use crate::arrays::Dict; use crate::arrays::DictArray; -use crate::arrays::dict::DictDataParts; +use crate::arrays::dict::DictArrayExt; use crate::arrow::ArrowArrayExecutor; pub(super) fn to_arrow_dictionary( @@ -78,9 +78,8 @@ fn dict_to_dict( values_type: &DataType, ctx: &mut ExecutionCtx, ) -> VortexResult { - let DictDataParts { codes, values, .. } = array.into_data().into_parts(); - let codes = codes.execute_arrow(Some(codes_type), ctx)?; - let values = values.execute_arrow(Some(values_type), ctx)?; + let codes = array.codes().clone().execute_arrow(Some(codes_type), ctx)?; + let values = array.values().clone().execute_arrow(Some(values_type), ctx)?; make_dict_array(codes_type, codes, values) } diff --git a/vortex-array/src/arrow/executor/list.rs b/vortex-array/src/arrow/executor/list.rs index e8742bcf5ab..ffa33c44fb3 100644 --- a/vortex-array/src/arrow/executor/list.rs +++ b/vortex-array/src/arrow/executor/list.rs @@ -139,7 +139,7 @@ fn list_view_zctl( sizes, validity, .. - } = array.into_data().into_parts(); + } = array.into_data_parts(); // For ZCTL, we know that we only care about the final size. assert!(!sizes.is_empty()); diff --git a/vortex-array/src/arrow/executor/list_view.rs b/vortex-array/src/arrow/executor/list_view.rs index 614ea6e7c93..8a1d527ab12 100644 --- a/vortex-array/src/arrow/executor/list_view.rs +++ b/vortex-array/src/arrow/executor/list_view.rs @@ -49,7 +49,7 @@ fn list_view_to_list_view( sizes, validity, .. - } = array.into_data().into_parts(); + } = array.into_data_parts(); let elements = elements.execute_arrow(Some(elements_field.data_type()), ctx)?; vortex_ensure!( diff --git a/vortex-array/src/arrow/executor/struct_.rs b/vortex-array/src/arrow/executor/struct_.rs index 7edd1b05e35..57935c0bca6 100644 --- a/vortex-array/src/arrow/executor/struct_.rs +++ b/vortex-array/src/arrow/executor/struct_.rs @@ -49,14 +49,12 @@ pub(super) fn to_arrow_struct( // Attempt to short-circuit if the array is already a Struct: let array = match array.try_into::() { Ok(array) => { - let parts = array.into_parts(); - let len = parts.len; let StructDataParts { validity, fields, struct_fields, .. - } = parts.data.into_parts(); + } = array.into_data_parts(); let validity = to_arrow_null_buffer(validity, len, ctx)?; return create_from_fields( target_fields.ok_or_else(|| struct_fields.names().clone()), @@ -98,14 +96,12 @@ pub(super) fn to_arrow_struct( }; let struct_array = array.execute::(ctx)?; - let parts = struct_array.into_parts(); - let len = parts.len; let StructDataParts { validity, fields, struct_fields, .. - } = parts.data.into_parts(); + } = struct_array.into_data_parts(); let validity = to_arrow_null_buffer(validity, len, ctx)?; create_from_fields( diff --git a/vortex-array/src/canonical.rs b/vortex-array/src/canonical.rs index 13768e77eaa..bdfceed9064 100644 --- a/vortex-array/src/canonical.rs +++ b/vortex-array/src/canonical.rs @@ -16,6 +16,7 @@ use crate::ArrayRef; use crate::Executable; use crate::ExecutionCtx; use crate::IntoArray; +use crate::array::child_to_validity; use crate::array::ArrayView; use crate::arrays::Bool; use crate::arrays::BoolArray; @@ -550,8 +551,8 @@ impl Executable for CanonicalValidity { bits, offset, len, - validity, } = b.data.into_parts(); + let validity = child_to_validity(&b.slots[0], b.dtype.nullability()); Ok(CanonicalValidity(Canonical::Bool( BoolArray::try_new_from_handle(bits, offset, len, validity.execute(ctx)?)?, ))) @@ -561,7 +562,7 @@ impl Executable for CanonicalValidity { ptype, buffer, validity, - } = p.into_data().into_parts(); + } = p.into_data_parts(); Ok(CanonicalValidity(Canonical::Primitive(unsafe { PrimitiveArray::new_unchecked_from_handle(buffer, ptype, validity.execute(ctx)?) }))) @@ -572,7 +573,7 @@ impl Executable for CanonicalValidity { values, values_type, validity, - } = d.into_data().into_parts(); + } = d.into_data_parts(); Ok(CanonicalValidity(Canonical::Decimal(unsafe { DecimalArray::new_unchecked_handle( values, @@ -588,7 +589,7 @@ impl Executable for CanonicalValidity { buffers, views, validity, - } = vbv.into_data().into_parts(); + } = vbv.into_data_parts(); Ok(CanonicalValidity(Canonical::VarBinView(unsafe { VarBinViewArray::new_handle_unchecked( views, @@ -606,7 +607,7 @@ impl Executable for CanonicalValidity { sizes, validity, .. - } = l.into_data().into_parts(); + } = l.into_data_parts(); Ok(CanonicalValidity(Canonical::List(unsafe { ListViewArray::new_unchecked(elements, offsets, sizes, validity.execute(ctx)?) .with_zero_copy_to_list(zctl) @@ -615,19 +616,20 @@ impl Executable for CanonicalValidity { Canonical::FixedSizeList(fsl) => { let list_size = fsl.list_size(); let len = fsl.len(); - let (elements, validity, _) = fsl.into_data().into_parts(); + let parts = fsl.into_data_parts(); + let elements = parts.elements; + let validity = parts.validity; Ok(CanonicalValidity(Canonical::FixedSizeList( FixedSizeListArray::new(elements, list_size, validity.execute(ctx)?, len), ))) } Canonical::Struct(st) => { - let parts = st.into_parts(); - let len = parts.len; + let len = st.len(); let StructDataParts { struct_fields, fields, validity, - } = parts.data.into_parts(); + } = st.into_data_parts(); Ok(CanonicalValidity(Canonical::Struct(unsafe { StructArray::new_unchecked(fields, struct_fields, len, validity.execute(ctx)?) }))) @@ -672,8 +674,8 @@ impl Executable for RecursiveCanonical { bits, offset, len, - validity, } = b.data.into_parts(); + let validity = child_to_validity(&b.slots[0], b.dtype.nullability()); Ok(RecursiveCanonical(Canonical::Bool( BoolArray::try_new_from_handle(bits, offset, len, validity.execute(ctx)?)?, ))) @@ -683,7 +685,7 @@ impl Executable for RecursiveCanonical { ptype, buffer, validity, - } = p.into_data().into_parts(); + } = p.into_data_parts(); Ok(RecursiveCanonical(Canonical::Primitive(unsafe { PrimitiveArray::new_unchecked_from_handle(buffer, ptype, validity.execute(ctx)?) }))) @@ -694,7 +696,7 @@ impl Executable for RecursiveCanonical { values, values_type, validity, - } = d.into_data().into_parts(); + } = d.into_data_parts(); Ok(RecursiveCanonical(Canonical::Decimal(unsafe { DecimalArray::new_unchecked_handle( values, @@ -710,7 +712,7 @@ impl Executable for RecursiveCanonical { buffers, views, validity, - } = vbv.into_data().into_parts(); + } = vbv.into_data_parts(); Ok(RecursiveCanonical(Canonical::VarBinView(unsafe { VarBinViewArray::new_handle_unchecked( views, @@ -728,7 +730,7 @@ impl Executable for RecursiveCanonical { sizes, validity, .. - } = l.into_data().into_parts(); + } = l.into_data_parts(); Ok(RecursiveCanonical(Canonical::List(unsafe { ListViewArray::new_unchecked( elements.execute::(ctx)?.0.into_array(), @@ -742,7 +744,9 @@ impl Executable for RecursiveCanonical { Canonical::FixedSizeList(fsl) => { let list_size = fsl.list_size(); let len = fsl.len(); - let (elements, validity, _) = fsl.into_data().into_parts(); + let parts = fsl.into_data_parts(); + let elements = parts.elements; + let validity = parts.validity; Ok(RecursiveCanonical(Canonical::FixedSizeList( FixedSizeListArray::new( elements.execute::(ctx)?.0.into_array(), @@ -753,13 +757,12 @@ impl Executable for RecursiveCanonical { ))) } Canonical::Struct(st) => { - let parts = st.into_parts(); - let len = parts.len; + let len = st.len(); let StructDataParts { struct_fields, fields, validity, - } = parts.data.into_parts(); + } = st.into_data_parts(); let executed_fields = fields .iter() .map(|f| Ok(f.clone().execute::(ctx)?.0.into_array())) diff --git a/vortex-btrblocks/src/schemes/float.rs b/vortex-btrblocks/src/schemes/float.rs index 3ed6a883c44..e5702d72fbd 100644 --- a/vortex-btrblocks/src/schemes/float.rs +++ b/vortex-btrblocks/src/schemes/float.rs @@ -4,6 +4,9 @@ //! Float compression schemes. use vortex_alp::ALP; +use vortex_alp::ALPArrayExt; +use vortex_alp::ALPRDArrayExt; +use vortex_alp::ALPRDArrayOwnedExt; use vortex_alp::RDEncoder; use vortex_alp::alp_encode; use vortex_array::ArrayRef; @@ -148,14 +151,8 @@ impl Scheme for ALPRDScheme { let alp_rd = encoder.encode(stats.source()); let dtype = alp_rd.dtype().clone(); let right_bit_width = alp_rd.right_bit_width(); - let mut alp_rd_data = alp_rd.into_data(); - - let patches = alp_rd_data - .left_parts_patches() - .map(compress_patches) - .transpose()?; - alp_rd_data.replace_left_parts_patches(patches); - let parts = alp_rd_data.into_parts(); + let mut parts = ALPRDArrayOwnedExt::into_data_parts(alp_rd); + parts.left_parts_patches = parts.left_parts_patches.map(compress_patches).transpose()?; Ok(vortex_alp::ALPRD::try_new( dtype, diff --git a/vortex-btrblocks/src/schemes/integer.rs b/vortex-btrblocks/src/schemes/integer.rs index f0211d5b7da..f39be87189c 100644 --- a/vortex-btrblocks/src/schemes/integer.rs +++ b/vortex-btrblocks/src/schemes/integer.rs @@ -19,6 +19,8 @@ use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_err; use vortex_fastlanes::FoR; +use vortex_fastlanes::FoRArrayExt; +use vortex_fastlanes::BitPackedArrayExt; use vortex_fastlanes::bitpack_compress::bit_width_histogram; use vortex_fastlanes::bitpack_compress::bitpack_encode; use vortex_fastlanes::bitpack_compress::find_best_bit_width; @@ -27,6 +29,7 @@ use vortex_runend::compress::runend_encode; use vortex_sequence::sequence_encode; use vortex_sparse::Sparse; use vortex_zigzag::ZigZag; +use vortex_zigzag::ZigZagArrayExt; use vortex_zigzag::zigzag_encode; use crate::ArrayAndStats; @@ -339,11 +342,9 @@ impl Scheme for BitPackingScheme { let ptype = packed.dtype().as_ptype(); let len = packed.len(); let nullability = packed.dtype().nullability(); - let mut packed_data = packed.into_data(); - - let patches = packed_data.patches(len).map(compress_patches).transpose()?; - packed_data.replace_patches(patches); - let parts = packed_data.into_parts(len, nullability); + let patches = packed.patches().map(compress_patches).transpose()?; + let mut parts = packed.into_data().into_parts(len, nullability); + parts.patches = patches; Ok(vortex_fastlanes::BitPacked::try_new( parts.packed, diff --git a/vortex-btrblocks/src/schemes/rle.rs b/vortex-btrblocks/src/schemes/rle.rs index 42fd4295bb7..c3631231274 100644 --- a/vortex-btrblocks/src/schemes/rle.rs +++ b/vortex-btrblocks/src/schemes/rle.rs @@ -24,6 +24,7 @@ use vortex_error::VortexResult; #[cfg(feature = "unstable_encodings")] use vortex_fastlanes::Delta; use vortex_fastlanes::RLE; +use vortex_fastlanes::RLEArrayExt; use crate::ArrayAndStats; use crate::CascadingCompressor; diff --git a/vortex-btrblocks/src/schemes/string.rs b/vortex-btrblocks/src/schemes/string.rs index b4e15b6c76b..0f7bd59f629 100644 --- a/vortex-btrblocks/src/schemes/string.rs +++ b/vortex-btrblocks/src/schemes/string.rs @@ -12,6 +12,7 @@ use vortex_compressor::scheme::ChildSelection; use vortex_compressor::scheme::DescendantExclusion; use vortex_error::VortexResult; use vortex_fsst::FSST; +use vortex_fsst::FSSTArrayExt; use vortex_fsst::fsst_compress; use vortex_fsst::fsst_train_compressor; use vortex_sparse::Sparse; diff --git a/vortex-compressor/src/compressor.rs b/vortex-compressor/src/compressor.rs index a7594feac4a..5ed9ba82a20 100644 --- a/vortex-compressor/src/compressor.rs +++ b/vortex-compressor/src/compressor.rs @@ -418,7 +418,7 @@ impl CascadingCompressor { )?; Ok( - ListArray::try_new(compressed_elems, compressed_offsets, list_array.validity())? + ListArray::try_new(compressed_elems, compressed_offsets, list_array.validity()?)? .into_array(), ) } diff --git a/vortex-cuda/src/arrow/canonical.rs b/vortex-cuda/src/arrow/canonical.rs index 4e38efe939e..16901f6a038 100644 --- a/vortex-cuda/src/arrow/canonical.rs +++ b/vortex-cuda/src/arrow/canonical.rs @@ -68,7 +68,7 @@ fn export_canonical( let len = primitive.len(); let PrimitiveDataParts { buffer, validity, .. - } = primitive.into_data().into_parts(); + } = primitive.into_data_parts(); check_validity_empty(&validity)?; @@ -95,7 +95,7 @@ fn export_canonical( values_type, validity, .. - } = decimal.into_data().into_parts(); + } = decimal.into_data_parts(); // verify that there is no null buffer check_validity_empty(&validity)?; @@ -120,7 +120,7 @@ fn export_canonical( let PrimitiveDataParts { buffer, validity, .. - } = values.into_data().into_parts(); + } = values.into_data_parts(); check_validity_empty(&validity)?; @@ -128,11 +128,11 @@ fn export_canonical( export_fixed_size(buffer, len, 0, ctx) } Canonical::Bool(bool_array) => { + let validity = bool_array.validity()?; let BoolDataParts { bits, offset, len, - validity, .. } = bool_array.into_data().into_parts(); @@ -184,7 +184,7 @@ async fn export_struct( let len = array.len(); let StructDataParts { validity, fields, .. - } = array.into_data().into_parts(); + } = array.into_data_parts(); check_validity_empty(&validity)?; diff --git a/vortex-cuda/src/arrow/varbinview.rs b/vortex-cuda/src/arrow/varbinview.rs index 72ea96437dd..c000d44908c 100644 --- a/vortex-cuda/src/arrow/varbinview.rs +++ b/vortex-cuda/src/arrow/varbinview.rs @@ -38,7 +38,7 @@ pub(crate) async fn copy_varbinview_to_varbin( buffers, validity, .. - } = array.into_data().into_parts(); + } = array.into_data_parts(); // TODO(aduffy): handle nulls check_validity_empty(&validity)?; diff --git a/vortex-cuda/src/canonical.rs b/vortex-cuda/src/canonical.rs index da87deb9f89..0e6392cbcdd 100644 --- a/vortex-cuda/src/canonical.rs +++ b/vortex-cuda/src/canonical.rs @@ -45,7 +45,7 @@ impl CanonicalCudaExt for Canonical { struct_fields, validity, .. - } = struct_array.into_data().into_parts(); + } = struct_array.into_data_parts(); let mut host_fields = vec![]; for field in fields.iter() { @@ -63,9 +63,9 @@ impl CanonicalCudaExt for Canonical { Canonical::Bool(bool) => { // NOTE: update to copy to host when adding buffer handle. // Also update other method to copy validity to host. + let validity = bool.validity()?; let BoolDataParts { bits, - validity, offset, len, .. @@ -80,7 +80,7 @@ impl CanonicalCudaExt for Canonical { buffer, validity, .. - } = prim.into_data().into_parts(); + } = prim.into_data_parts(); Ok(Canonical::Primitive(PrimitiveArray::from_byte_buffer( buffer.try_into_host()?.await?, ptype, @@ -94,7 +94,7 @@ impl CanonicalCudaExt for Canonical { values_type, validity, .. - } = decimal.into_data().into_parts(); + } = decimal.into_data_parts(); Ok(Canonical::Decimal(unsafe { DecimalArray::new_unchecked_handle( BufferHandle::new_host(values.try_into_host()?.await?), @@ -110,7 +110,7 @@ impl CanonicalCudaExt for Canonical { buffers, validity, dtype, - } = varbinview.into_data().into_parts(); + } = varbinview.into_data_parts(); // Copy all device views to host let host_views = views.try_into_host()?.await?; diff --git a/vortex-cuda/src/dynamic_dispatch/plan_builder.rs b/vortex-cuda/src/dynamic_dispatch/plan_builder.rs index f4362e6e412..364365a1fb8 100644 --- a/vortex-cuda/src/dynamic_dispatch/plan_builder.rs +++ b/vortex-cuda/src/dynamic_dispatch/plan_builder.rs @@ -16,12 +16,17 @@ use vortex::array::arrays::slice::SliceArrayExt; use vortex::array::buffer::BufferHandle; use vortex::dtype::PType; use vortex::encodings::alp::ALP; +use vortex::encodings::alp::ALPArrayExt; use vortex::encodings::alp::ALPFloat; use vortex::encodings::fastlanes::BitPacked; +use vortex::encodings::fastlanes::BitPackedArrayExt; use vortex::encodings::fastlanes::FoR; +use vortex::encodings::fastlanes::FoRArrayExt; use vortex::encodings::runend::RunEnd; +use vortex::encodings::runend::RunEndArrayExt; use vortex::encodings::sequence::Sequence; use vortex::encodings::zigzag::ZigZag; +use vortex::encodings::zigzag::ZigZagArrayExt; use vortex::error::VortexResult; use vortex::error::vortex_bail; use vortex::error::vortex_err; @@ -52,7 +57,7 @@ fn is_dyn_dispatch_compatible(array: &ArrayRef) -> bool { return arr.patches().is_none() && arr.dtype().as_ptype() == PType::F32; } if id == BitPacked::ID { - return array.as_::().patches(array.len()).is_none(); + return array.as_::().patches().is_none(); } if id == Dict::ID { let arr = array.as_::(); @@ -413,7 +418,7 @@ impl FusedPlan { fn walk_bitpacked(&mut self, array: ArrayRef) -> VortexResult { let bp = array.as_::(); - if bp.patches(array.len()).is_some() { + if bp.patches().is_some() { vortex_bail!("Dynamic dispatch does not support BitPackedArray with patches"); } diff --git a/vortex-cuda/src/executor.rs b/vortex-cuda/src/executor.rs index 4a14be98968..b20a3060773 100644 --- a/vortex-cuda/src/executor.rs +++ b/vortex-cuda/src/executor.rs @@ -365,7 +365,7 @@ impl CudaArrayExt for ArrayRef { struct_fields, validity, .. - } = self.try_into::().unwrap().into_data().into_parts(); + } = self.try_into::().unwrap().into_data_parts(); let mut cuda_fields = Vec::with_capacity(fields.len()); for field in fields.iter() { diff --git a/vortex-cuda/src/kernel/arrays/dict.rs b/vortex-cuda/src/kernel/arrays/dict.rs index c13d8196294..8722f19b326 100644 --- a/vortex-cuda/src/kernel/arrays/dict.rs +++ b/vortex-cuda/src/kernel/arrays/dict.rs @@ -16,7 +16,6 @@ use vortex::array::arrays::DictArray; use vortex::array::arrays::PrimitiveArray; use vortex::array::arrays::VarBinViewArray; use vortex::array::arrays::decimal::DecimalDataParts; -use vortex::array::arrays::dict::DictDataParts; use vortex::array::arrays::primitive::PrimitiveDataParts; use vortex::array::arrays::varbinview::VarBinViewDataParts; use vortex::array::buffer::BufferHandle; @@ -65,7 +64,8 @@ impl CudaExecute for DictExecutor { #[expect(clippy::cognitive_complexity)] async fn execute_dict_prim(dict: DictArray, ctx: &mut CudaExecutionCtx) -> VortexResult { - let DictDataParts { values, codes, .. } = dict.into_data().into_parts(); + let values = dict.values().clone(); + let codes = dict.codes().clone(); // Execute both children to get them as primitives on the device let values_canonical = values.execute_cuda(ctx).await?; @@ -144,7 +144,8 @@ async fn execute_dict_decimal( ctx: &mut CudaExecutionCtx, ) -> VortexResult { let dtype = dict.dtype().clone(); - let DictDataParts { values, codes, .. } = dict.into_data().into_parts(); + let values = dict.values().clone(); + let codes = dict.codes().clone(); // Execute codes to get them as primitives on the device let codes_prim = codes.execute_cuda(ctx).await?.into_primitive(); @@ -231,7 +232,8 @@ async fn execute_dict_varbinview( ctx: &mut CudaExecutionCtx, ) -> VortexResult { let dtype = dict.dtype().clone(); - let DictDataParts { values, codes, .. } = dict.into_data().into_parts(); + let values = dict.values().clone(); + let codes = dict.codes().clone(); let codes_prim = codes.execute_cuda(ctx).await?.into_primitive(); let codes_ptype = codes_prim.ptype(); @@ -243,7 +245,7 @@ async fn execute_dict_varbinview( buffers: values_data_buffers, validity: values_validity, .. - } = values_vbv.into_data().into_parts(); + } = values_vbv.into_data_parts(); let output_validity = values_validity.take(&codes_prim.clone().into_array())?; let PrimitiveDataParts { diff --git a/vortex-cuda/src/kernel/encodings/alp.rs b/vortex-cuda/src/kernel/encodings/alp.rs index 1635927a42e..aae16ffcb75 100644 --- a/vortex-cuda/src/kernel/encodings/alp.rs +++ b/vortex-cuda/src/kernel/encodings/alp.rs @@ -17,6 +17,7 @@ use vortex::array::match_each_unsigned_integer_ptype; use vortex::dtype::NativePType; use vortex::encodings::alp::ALP; use vortex::encodings::alp::ALPArray; +use vortex::encodings::alp::ALPArrayExt; use vortex::encodings::alp::ALPFloat; use vortex::encodings::alp::match_each_alp_float_ptype; use vortex::error::VortexResult; diff --git a/vortex-cuda/src/kernel/encodings/date_time_parts.rs b/vortex-cuda/src/kernel/encodings/date_time_parts.rs index a0c4a446567..0a96e225a51 100644 --- a/vortex-cuda/src/kernel/encodings/date_time_parts.rs +++ b/vortex-cuda/src/kernel/encodings/date_time_parts.rs @@ -22,6 +22,7 @@ use vortex::dtype::NativePType; use vortex::dtype::Nullability; use vortex::dtype::PType; use vortex::encodings::datetime_parts::DateTimeParts; +use vortex::encodings::datetime_parts::DateTimePartsArrayExt; use vortex::error::VortexResult; use vortex::error::vortex_bail; use vortex::error::vortex_err; diff --git a/vortex-cuda/src/kernel/encodings/decimal_byte_parts.rs b/vortex-cuda/src/kernel/encodings/decimal_byte_parts.rs index b5aa921a9b6..027355c61e5 100644 --- a/vortex-cuda/src/kernel/encodings/decimal_byte_parts.rs +++ b/vortex-cuda/src/kernel/encodings/decimal_byte_parts.rs @@ -10,7 +10,7 @@ use vortex::array::Canonical; use vortex::array::arrays::DecimalArray; use vortex::array::arrays::primitive::PrimitiveDataParts; use vortex::encodings::decimal_byte_parts::DecimalByteParts; -use vortex::encodings::decimal_byte_parts::DecimalBytePartsDataParts; +use vortex::encodings::decimal_byte_parts::DecimalBytePartsArrayExt; use vortex::error::VortexExpect; use vortex::error::VortexResult; use vortex::error::vortex_bail; @@ -39,7 +39,7 @@ impl CudaExecute for DecimalBytePartsExecutor { .dtype() .as_decimal_opt() .vortex_expect("DecimalBytePartsArray dtype must be decimal"); - let DecimalBytePartsDataParts { msp, .. } = array.into_data().into_parts(); + let msp = array.msp().clone(); let PrimitiveDataParts { buffer, ptype, diff --git a/vortex-cuda/src/kernel/encodings/for_.rs b/vortex-cuda/src/kernel/encodings/for_.rs index 761a5e56f94..9374b458459 100644 --- a/vortex-cuda/src/kernel/encodings/for_.rs +++ b/vortex-cuda/src/kernel/encodings/for_.rs @@ -20,6 +20,7 @@ use vortex::dtype::NativePType; use vortex::encodings::fastlanes::BitPacked; use vortex::encodings::fastlanes::FoR; use vortex::encodings::fastlanes::FoRArray; +use vortex::encodings::fastlanes::FoRArrayExt; use vortex::error::VortexExpect; use vortex::error::VortexResult; use vortex::error::vortex_ensure; diff --git a/vortex-cuda/src/kernel/encodings/runend.rs b/vortex-cuda/src/kernel/encodings/runend.rs index 88b64393a5e..1740de82d52 100644 --- a/vortex-cuda/src/kernel/encodings/runend.rs +++ b/vortex-cuda/src/kernel/encodings/runend.rs @@ -21,7 +21,7 @@ use vortex::dtype::NativePType; use vortex::dtype::PType; use vortex::encodings::runend::RunEnd; use vortex::encodings::runend::RunEndArray; -use vortex::encodings::runend::RunEndDataParts; +use vortex::encodings::runend::RunEndArrayExt; use vortex::error::VortexResult; use vortex::error::vortex_bail; use vortex::error::vortex_ensure; @@ -61,7 +61,8 @@ impl CudaExecute for RunEndExecutor { let offset = array.offset(); let output_len = array.len(); - let RunEndDataParts { ends, values, .. } = array.into_data().into_parts(); + let ends = array.ends().clone(); + let values = array.values().clone(); let values_ptype = PType::try_from(values.dtype())?; let ends_ptype = PType::try_from(ends.dtype())?; diff --git a/vortex-cuda/src/kernel/encodings/zigzag.rs b/vortex-cuda/src/kernel/encodings/zigzag.rs index e7cf89b2181..04de4a9304f 100644 --- a/vortex-cuda/src/kernel/encodings/zigzag.rs +++ b/vortex-cuda/src/kernel/encodings/zigzag.rs @@ -16,6 +16,7 @@ use vortex::dtype::NativePType; use vortex::dtype::PType; use vortex::encodings::zigzag::ZigZag; use vortex::encodings::zigzag::ZigZagArray; +use vortex::encodings::zigzag::ZigZagArrayExt; use vortex::error::VortexResult; use vortex::error::vortex_ensure; use vortex::error::vortex_err; diff --git a/vortex-cuda/src/kernel/filter/primitive.rs b/vortex-cuda/src/kernel/filter/primitive.rs index f45fe3f2994..c74c56e5b06 100644 --- a/vortex-cuda/src/kernel/filter/primitive.rs +++ b/vortex-cuda/src/kernel/filter/primitive.rs @@ -24,7 +24,7 @@ where { let PrimitiveDataParts { buffer, validity, .. - } = array.into_data().into_parts(); + } = array.into_data_parts(); let filtered_validity = validity.filter(&mask)?; let filtered_values = filter_sized::(buffer, mask, ctx).await?; diff --git a/vortex-cuda/src/kernel/filter/varbinview.rs b/vortex-cuda/src/kernel/filter/varbinview.rs index 8d673180d58..84632f5cca8 100644 --- a/vortex-cuda/src/kernel/filter/varbinview.rs +++ b/vortex-cuda/src/kernel/filter/varbinview.rs @@ -20,7 +20,7 @@ pub(super) async fn filter_varbinview( buffers, validity, dtype, - } = array.into_data().into_parts(); + } = array.into_data_parts(); let filtered_validity = validity.filter(&mask)?; diff --git a/vortex-duckdb/src/exporter/fixed_size_list.rs b/vortex-duckdb/src/exporter/fixed_size_list.rs index 9e57bf18085..b519ce8f991 100644 --- a/vortex-duckdb/src/exporter/fixed_size_list.rs +++ b/vortex-duckdb/src/exporter/fixed_size_list.rs @@ -38,7 +38,10 @@ pub(crate) fn new_exporter( ) -> VortexResult> { let list_size = array.list_size(); let len = array.len(); - let (elements, validity, dtype) = array.into_data().into_parts(); + let parts = array.into_data_parts(); + let elements = parts.elements; + let validity = parts.validity; + let dtype = parts.dtype; let mask = validity.to_array(len).execute::(ctx)?; let elements_exporter = new_array_exporter_with_flatten(elements, cache, ctx, true)?; diff --git a/vortex-duckdb/src/exporter/list.rs b/vortex-duckdb/src/exporter/list.rs index f2945123a13..7c807a7d6ef 100644 --- a/vortex-duckdb/src/exporter/list.rs +++ b/vortex-duckdb/src/exporter/list.rs @@ -50,7 +50,7 @@ pub(crate) fn new_exporter( offsets, validity, dtype, - } = array.into_data().into_parts(); + } = array.into_data_parts(); let num_elements = elements.len(); let validity = validity.to_array(array_len).execute::(ctx)?; diff --git a/vortex-duckdb/src/exporter/list_view.rs b/vortex-duckdb/src/exporter/list_view.rs index 226f399c92f..5bdd9fe5ab7 100644 --- a/vortex-duckdb/src/exporter/list_view.rs +++ b/vortex-duckdb/src/exporter/list_view.rs @@ -53,7 +53,7 @@ pub(crate) fn new_exporter( offsets, sizes, validity, - } = array.into_data().into_parts(); + } = array.into_data_parts(); // Cache an `elements` vector up front so that future exports can reference it. let num_elements = elements.len(); let nullability = validity.nullability(); diff --git a/vortex-duckdb/src/exporter/run_end.rs b/vortex-duckdb/src/exporter/run_end.rs index af21438130d..fa62388cf57 100644 --- a/vortex-duckdb/src/exporter/run_end.rs +++ b/vortex-duckdb/src/exporter/run_end.rs @@ -11,7 +11,7 @@ use vortex::array::search_sorted::SearchSorted; use vortex::array::search_sorted::SearchSortedSide; use vortex::dtype::IntegerPType; use vortex::encodings::runend::RunEndArray; -use vortex::encodings::runend::RunEndDataParts; +use vortex::encodings::runend::RunEndArrayExt; use vortex::error::VortexExpect; use vortex::error::VortexResult; @@ -38,7 +38,8 @@ pub(crate) fn new_exporter( ctx: &mut ExecutionCtx, ) -> VortexResult> { let offset = array.offset(); - let RunEndDataParts { ends, values, .. } = array.into_data().into_parts(); + let ends = array.ends().clone(); + let values = array.values().clone(); let ends = ends.execute::(ctx)?; let values_exporter = new_array_exporter(values.clone(), cache, ctx)?; diff --git a/vortex-duckdb/src/exporter/struct_.rs b/vortex-duckdb/src/exporter/struct_.rs index 19ac59c69d9..e343f2f26f6 100644 --- a/vortex-duckdb/src/exporter/struct_.rs +++ b/vortex-duckdb/src/exporter/struct_.rs @@ -32,7 +32,7 @@ pub(crate) fn new_exporter( struct_fields, fields, .. - } = array.into_data().into_parts(); + } = array.into_data_parts(); let validity = validity.to_array(len).execute::(ctx)?; if validity.to_bit_buffer().true_count() == 0 { diff --git a/vortex-duckdb/src/exporter/varbinview.rs b/vortex-duckdb/src/exporter/varbinview.rs index 23142b5c4cb..8067b08a856 100644 --- a/vortex-duckdb/src/exporter/varbinview.rs +++ b/vortex-duckdb/src/exporter/varbinview.rs @@ -37,7 +37,7 @@ pub(crate) fn new_exporter( dtype, views, buffers, - } = array.into_data().into_parts(); + } = array.into_data_parts(); let validity = validity.to_array(len).execute::(ctx)?; if validity.all_false() { let ltype = LogicalType::try_from(dtype)?; diff --git a/vortex-python/src/arrays/builtins/chunked.rs b/vortex-python/src/arrays/builtins/chunked.rs index 293932c21c2..5ca1aafd67f 100644 --- a/vortex-python/src/arrays/builtins/chunked.rs +++ b/vortex-python/src/arrays/builtins/chunked.rs @@ -5,9 +5,9 @@ use pyo3::PyRef; use pyo3::pyclass; use pyo3::pymethods; use vortex::array::arrays::Chunked; +use vortex::array::arrays::chunked::ChunkedArrayExt; use crate::arrays::PyArrayRef; -use crate::arrays::native::AsArrayRef; use crate::arrays::native::EncodingSubclass; use crate::arrays::native::PyNativeArray; @@ -23,7 +23,9 @@ impl EncodingSubclass for PyChunkedArray { impl PyChunkedArray { pub fn chunks(self_: PyRef<'_, Self>) -> Vec { self_ - .as_array_ref() + .as_super() + .inner() + .as_::() .iter_chunks() .map(|chunk| PyArrayRef::from(chunk.clone())) .collect() diff --git a/vortex-python/src/arrays/builtins/struct_.rs b/vortex-python/src/arrays/builtins/struct_.rs index 0fe52aa0402..1c9151650fc 100644 --- a/vortex-python/src/arrays/builtins/struct_.rs +++ b/vortex-python/src/arrays/builtins/struct_.rs @@ -6,6 +6,7 @@ use pyo3::PyRef; use pyo3::PyResult; use pyo3::pyclass; use pyo3::pymethods; +use vortex::error::VortexExpect; use vortex::array::arrays::Struct; use crate::arrays::PyArrayRef; @@ -26,14 +27,23 @@ impl EncodingSubclass for PyStructArray { impl PyStructArray { /// Returns the given field of the struct array. pub fn field(self_: PyRef<'_, Self>, name: &str) -> PyVortexResult { - let field = self_.as_array_ref().unmasked_field_by_name(name)?.clone(); + let field = self_ + .as_super() + .inner() + .as_opt::() + .vortex_expect("Failed to downcast array") + .unmasked_field_by_name(name)? + .clone(); Ok(PyArrayRef::from(field)) } /// Get an ordered list of field names for the struct fields. pub fn names(self_: PyRef<'_, Self>) -> PyResult> { Ok(self_ - .as_array_ref() + .as_super() + .inner() + .as_opt::() + .vortex_expect("Failed to downcast array") .struct_fields() .names() .iter() diff --git a/vortex-python/src/arrays/py/vtable.rs b/vortex-python/src/arrays/py/vtable.rs index e84ec1e3fb7..f9a80a569eb 100644 --- a/vortex-python/src/arrays/py/vtable.rs +++ b/vortex-python/src/arrays/py/vtable.rs @@ -6,6 +6,7 @@ use std::sync::Arc; use vortex::array::Array; use vortex::array::ArrayId; +use vortex::array::ArrayParts; use vortex::array::ArrayRef; use vortex::array::ArrayView; use vortex::array::ExecutionCtx; @@ -110,7 +111,7 @@ impl VTable for PythonVTable { _buffers: &[BufferHandle], _children: &dyn vortex::array::serde::ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { _ = bytes; vortex_bail!("PythonArray deserialization is not supported"); } diff --git a/vortex-tensor/src/scalar_fns/inner_product.rs b/vortex-tensor/src/scalar_fns/inner_product.rs index d142649600d..0bac39d4668 100644 --- a/vortex-tensor/src/scalar_fns/inner_product.rs +++ b/vortex-tensor/src/scalar_fns/inner_product.rs @@ -157,8 +157,8 @@ impl ScalarFnVTable for InnerProduct { // Extract the storage array from each extension input. We pass the storage (FSL) rather // than the extension array to avoid canonicalizing the extension wrapper. - let lhs_storage = lhs.data().storage_array(); - let rhs_storage = rhs.data().storage_array(); + let lhs_storage = lhs.storage_array(); + let rhs_storage = rhs.storage_array(); let lhs_flat = extract_flat_elements(lhs_storage, list_size, ctx)?; let rhs_flat = extract_flat_elements(rhs_storage, list_size, ctx)?; diff --git a/vortex-tensor/src/scalar_fns/l2_norm.rs b/vortex-tensor/src/scalar_fns/l2_norm.rs index ed29cc776b7..fdc6f787d73 100644 --- a/vortex-tensor/src/scalar_fns/l2_norm.rs +++ b/vortex-tensor/src/scalar_fns/l2_norm.rs @@ -132,7 +132,7 @@ impl ScalarFnVTable for L2Norm { let ext = input.dtype().as_extension(); let list_size = extension_list_size(ext)? as usize; - let storage = input.data().storage_array(); + let storage = input.storage_array(); let flat = extract_flat_elements(storage, list_size, ctx)?; match_each_float_ptype!(flat.ptype(), |T| { From ae68a60ada5329d6988eb2a6612f6fdfea95daac Mon Sep 17 00:00:00 2001 From: Nicholas Gates Date: Sat, 4 Apr 2026 08:59:43 -0400 Subject: [PATCH 03/10] Engine Signed-off-by: Nicholas Gates --- vortex-array/src/arrays/bool/vtable/mod.rs | 1 - vortex-array/src/arrays/decimal/array.rs | 113 ++++++++++++---- vortex-array/src/arrays/decimal/vtable/mod.rs | 14 +- .../src/arrays/fixed_size_list/vtable/mod.rs | 1 - vortex-array/src/arrays/list/vtable/mod.rs | 1 - .../src/arrays/listview/vtable/mod.rs | 1 - .../src/arrays/primitive/array/cast.rs | 7 +- .../src/arrays/primitive/array/mod.rs | 126 ++++++++++-------- .../src/arrays/primitive/vtable/mod.rs | 14 +- vortex-array/src/arrays/varbin/array.rs | 47 ++++--- vortex-array/src/arrays/varbin/vtable/mod.rs | 9 +- vortex-array/src/arrays/varbinview/array.rs | 122 ++++++++--------- .../src/arrays/varbinview/vtable/mod.rs | 7 +- 13 files changed, 258 insertions(+), 205 deletions(-) diff --git a/vortex-array/src/arrays/bool/vtable/mod.rs b/vortex-array/src/arrays/bool/vtable/mod.rs index 6912f4e5c03..48323a3a597 100644 --- a/vortex-array/src/arrays/bool/vtable/mod.rs +++ b/vortex-array/src/arrays/bool/vtable/mod.rs @@ -20,7 +20,6 @@ use crate::array::ArrayView; use crate::array::VTable; use crate::arrays::bool::array::BoolArrayExt; use crate::arrays::bool::BoolData; -use crate::arrays::bool::array::NUM_SLOTS; use crate::arrays::bool::array::SLOT_NAMES; use crate::buffer::BufferHandle; use crate::dtype::DType; diff --git a/vortex-array/src/arrays/decimal/array.rs b/vortex-array/src/arrays/decimal/array.rs index d80c9d00da9..6c693755c13 100644 --- a/vortex-array/src/arrays/decimal/array.rs +++ b/vortex-array/src/arrays/decimal/array.rs @@ -100,7 +100,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["validity"]; #[derive(Clone, Debug)] pub struct DecimalData { pub(super) decimal_dtype: DecimalDType, - pub(super) nullability: Nullability, pub(super) values: BufferHandle, pub(super) values_type: DecimalType, } @@ -115,13 +114,28 @@ pub struct DecimalDataParts { pub trait DecimalArrayExt { fn decimal_data(&self) -> &DecimalData; fn as_slots(&self) -> &[Option]; + fn dtype(&self) -> &DType; + + fn decimal_dtype(&self) -> DecimalDType { + match self.dtype() { + DType::Decimal(decimal_dtype, _) => *decimal_dtype, + _ => unreachable!("DecimalArrayExt requires a decimal dtype"), + } + } + + fn nullability(&self) -> Nullability { + match self.dtype() { + DType::Decimal(_, nullability) => *nullability, + _ => unreachable!("DecimalArrayExt requires a decimal dtype"), + } + } fn validity_child(&self) -> Option<&ArrayRef> { self.as_slots()[VALIDITY_SLOT].as_ref() } fn validity(&self) -> Validity { - child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.decimal_data().nullability) + child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.nullability()) } } @@ -133,6 +147,10 @@ impl DecimalArrayExt for Array { fn as_slots(&self) -> &[Option] { self.slots() } + + fn dtype(&self) -> &DType { + Array::dtype(self) + } } impl DecimalArrayExt for ArrayView<'_, Decimal> { @@ -143,6 +161,10 @@ impl DecimalArrayExt for ArrayView<'_, Decimal> { fn as_slots(&self) -> &[Option] { self.slots() } + + fn dtype(&self) -> &DType { + ArrayView::dtype(self) + } } impl DecimalData { @@ -271,12 +293,10 @@ impl DecimalData { .vortex_expect("[Debug Assertion]: Invalid `DecimalArray` parameters"); } - let len = values.len() / values_type.byte_width(); Self { + decimal_dtype, values, values_type, - decimal_dtype, - nullability: validity.nullability(), } } @@ -332,23 +352,13 @@ impl DecimalData { self.values.len() / self.values_type.byte_width() } - /// Returns the [`DType`] of this array. - pub fn dtype(&self) -> DType { - DType::Decimal(self.decimal_dtype, self.nullability) - } - /// Returns `true` if this array is empty. pub fn is_empty(&self) -> bool { self.len() == 0 } pub fn into_parts(self) -> DecimalDataParts { - DecimalDataParts { - decimal_dtype: self.decimal_dtype, - values: self.values, - values_type: self.values_type, - validity: Validity::from(self.nullability), - } + vortex_panic!("DecimalData::into_parts requires outer dtype; use Array::into_data_parts") } /// Returns the underlying [`ByteBuffer`] of the array. @@ -367,22 +377,22 @@ impl DecimalData { Buffer::::from_byte_buffer(self.values.as_host().clone()) } - /// Returns the decimal type information - pub fn decimal_dtype(&self) -> DecimalDType { - self.decimal_dtype - } - /// Return the `DecimalType` used to represent the values in the array. pub fn values_type(&self) -> DecimalType { self.values_type } + /// Returns the decimal type information. + pub fn decimal_dtype(&self) -> DecimalDType { + self.decimal_dtype + } + pub fn precision(&self) -> u8 { - self.decimal_dtype().precision() + self.decimal_dtype.precision() } pub fn scale(&self) -> i8 { - self.decimal_dtype().scale() + self.decimal_dtype.scale() } pub fn from_iter>( @@ -429,9 +439,10 @@ impl DecimalData { impl Array { pub fn into_data_parts(self) -> DecimalDataParts { let validity = DecimalArrayExt::validity(&self); + let decimal_dtype = DecimalArrayExt::decimal_dtype(&self); let data = self.into_data(); DecimalDataParts { - decimal_dtype: data.decimal_dtype, + decimal_dtype, values: data.values, values_type: data.values_type, validity, @@ -499,7 +510,7 @@ impl Array { decimal_dtype: DecimalDType, ) -> Self { let data = DecimalData::from_iter(iter, decimal_dtype); - let dtype = data.dtype(); + let dtype = DType::Decimal(decimal_dtype, Nullability::NonNullable); let len = data.len(); let slots = DecimalData::make_slots(&Validity::from(dtype.nullability()), len); unsafe { @@ -513,7 +524,7 @@ impl Array { decimal_dtype: DecimalDType, ) -> Self { let data = DecimalData::from_option_iter(iter, decimal_dtype); - let dtype = data.dtype(); + let dtype = DType::Decimal(decimal_dtype, Nullability::Nullable); let len = data.len(); let slots = DecimalData::make_slots(&Validity::from(dtype.nullability()), len); unsafe { @@ -599,6 +610,56 @@ impl Array { Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) }) } + + pub fn decimal_dtype(&self) -> DecimalDType { + DecimalArrayExt::decimal_dtype(self) + } + + pub fn values_type(&self) -> DecimalType { + self.data().values_type + } + + pub fn precision(&self) -> u8 { + self.decimal_dtype().precision() + } + + pub fn scale(&self) -> i8 { + self.decimal_dtype().scale() + } + + pub fn buffer_handle(&self) -> &BufferHandle { + &self.data().values + } + + pub fn buffer(&self) -> Buffer { + self.data().buffer::() + } +} + +impl ArrayView<'_, Decimal> { + pub fn decimal_dtype(&self) -> DecimalDType { + DecimalArrayExt::decimal_dtype(self) + } + + pub fn values_type(&self) -> DecimalType { + self.data().values_type + } + + pub fn precision(&self) -> u8 { + self.decimal_dtype().precision() + } + + pub fn scale(&self) -> i8 { + self.decimal_dtype().scale() + } + + pub fn buffer_handle(&self) -> &BufferHandle { + &self.data().values + } + + pub fn buffer(&self) -> Buffer { + self.data().buffer::() + } } fn patch_typed( diff --git a/vortex-array/src/arrays/decimal/vtable/mod.rs b/vortex-array/src/arrays/decimal/vtable/mod.rs index a3c0de45f04..6dee4674ad7 100644 --- a/vortex-array/src/arrays/decimal/vtable/mod.rs +++ b/vortex-array/src/arrays/decimal/vtable/mod.rs @@ -34,7 +34,6 @@ use std::hash::Hash; use crate::Precision; use crate::array::ArrayId; -use crate::arrays::decimal::array::NUM_SLOTS; use crate::arrays::decimal::array::SLOT_NAMES; use crate::arrays::decimal::compute::rules::RULES; use crate::hash::ArrayEq; @@ -99,21 +98,16 @@ impl VTable for Decimal { } fn validate(&self, data: &DecimalData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + let DType::Decimal(_, nullability) = dtype else { + vortex_bail!("Expected decimal dtype, got {dtype:?}"); + }; vortex_ensure!( data.len() == len, "DecimalArray length {} does not match outer length {}", data.len(), len ); - - let actual_dtype = data.dtype(); - vortex_ensure!( - &actual_dtype == dtype, - "DecimalArray dtype {} does not match outer dtype {}", - actual_dtype, - dtype - ); - let validity = crate::array::child_to_validity(&slots[0], data.nullability); + let validity = crate::array::child_to_validity(&slots[0], *nullability); if let Some(validity_len) = validity.maybe_len() { vortex_ensure!( validity_len == 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 9b346a1152d..c21887fdde1 100644 --- a/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs +++ b/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs @@ -19,7 +19,6 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; -use crate::arrays::fixed_size_list::FixedSizeListArrayExt; use crate::arrays::fixed_size_list::FixedSizeListData; use crate::arrays::fixed_size_list::array::NUM_SLOTS; use crate::arrays::fixed_size_list::array::SLOT_NAMES; diff --git a/vortex-array/src/arrays/list/vtable/mod.rs b/vortex-array/src/arrays/list/vtable/mod.rs index 5be7503226c..f5131605b6a 100644 --- a/vortex-array/src/arrays/list/vtable/mod.rs +++ b/vortex-array/src/arrays/list/vtable/mod.rs @@ -20,7 +20,6 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; -use crate::arrays::list::ListArrayExt; use crate::arrays::list::ListData; use crate::arrays::list::array::NUM_SLOTS; use crate::arrays::list::array::SLOT_NAMES; diff --git a/vortex-array/src/arrays/listview/vtable/mod.rs b/vortex-array/src/arrays/listview/vtable/mod.rs index 3a6d403b60d..7b3f131f27c 100644 --- a/vortex-array/src/arrays/listview/vtable/mod.rs +++ b/vortex-array/src/arrays/listview/vtable/mod.rs @@ -19,7 +19,6 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; -use crate::arrays::listview::ListViewArrayExt; use crate::arrays::listview::ListViewData; use crate::arrays::listview::array::NUM_SLOTS; use crate::arrays::listview::array::SLOT_NAMES; diff --git a/vortex-array/src/arrays/primitive/array/cast.rs b/vortex-array/src/arrays/primitive/array/cast.rs index fd1dccbcf1c..e5f85b37a2d 100644 --- a/vortex-array/src/arrays/primitive/array/cast.rs +++ b/vortex-array/src/arrays/primitive/array/cast.rs @@ -17,7 +17,6 @@ use crate::builtins::ArrayBuiltins; use crate::dtype::DType; use crate::dtype::NativePType; use crate::dtype::PType; -use crate::validity::Validity; impl PrimitiveData { /// Return a slice of the array's buffer. @@ -57,10 +56,8 @@ impl PrimitiveData { "can't reinterpret cast between integers of two different widths" ); - PrimitiveData::from_buffer_handle( - self.buffer_handle().clone(), - ptype, - Validity::from(self.nullability), + vortex_panic!( + "PrimitiveData::reinterpret_cast requires outer validity; use PrimitiveArray::reinterpret_cast" ) } } diff --git a/vortex-array/src/arrays/primitive/array/mod.rs b/vortex-array/src/arrays/primitive/array/mod.rs index 8550cb16bb4..7e65d599087 100644 --- a/vortex-array/src/arrays/primitive/array/mod.rs +++ b/vortex-array/src/arrays/primitive/array/mod.rs @@ -78,7 +78,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["validity"]; #[derive(Clone, Debug)] pub struct PrimitiveData { pub(super) ptype: PType, - pub(super) nullability: Nullability, pub(super) buffer: BufferHandle, } @@ -91,17 +90,33 @@ pub struct PrimitiveDataParts { pub trait PrimitiveArrayExt { fn primitive_data(&self) -> &PrimitiveData; fn as_slots(&self) -> &[Option]; + fn dtype(&self) -> &DType; + fn len(&self) -> usize; + + fn ptype(&self) -> PType { + match self.dtype() { + DType::Primitive(ptype, _) => *ptype, + _ => unreachable!("PrimitiveArrayExt requires a primitive dtype"), + } + } + + fn nullability(&self) -> Nullability { + match self.dtype() { + DType::Primitive(_, nullability) => *nullability, + _ => unreachable!("PrimitiveArrayExt requires a primitive dtype"), + } + } fn validity_child(&self) -> Option<&ArrayRef> { self.as_slots()[VALIDITY_SLOT].as_ref() } fn validity(&self) -> Validity { - child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.primitive_data().nullability) + child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.nullability()) } fn validity_mask(&self) -> vortex_mask::Mask { - self.validity().to_mask(self.primitive_data().len()) + self.validity().to_mask(self.len()) } } @@ -113,6 +128,14 @@ impl PrimitiveArrayExt for Array { fn as_slots(&self) -> &[Option] { self.slots() } + + fn dtype(&self) -> &DType { + Array::dtype(self) + } + + fn len(&self) -> usize { + Array::len(self) + } } impl PrimitiveArrayExt for ArrayView<'_, Primitive> { @@ -123,6 +146,14 @@ impl PrimitiveArrayExt for ArrayView<'_, Primitive> { fn as_slots(&self) -> &[Option] { self.slots() } + + fn dtype(&self) -> &DType { + ArrayView::dtype(self) + } + + fn len(&self) -> usize { + ArrayView::len(self) + } } // TODO(connor): There are a lot of places where we could be using `new_unchecked` in the codebase. @@ -141,13 +172,11 @@ impl PrimitiveData { pub unsafe fn new_unchecked_from_handle( handle: BufferHandle, ptype: PType, - validity: Validity, + _validity: Validity, ) -> Self { - let len = handle.len() / ptype.byte_width(); Self { - buffer: handle, ptype, - nullability: validity.nullability(), + buffer: handle, } } @@ -196,10 +225,9 @@ impl PrimitiveData { Self::validate(&buffer, &validity) .vortex_expect("[Debug Assertion]: Invalid `PrimitiveArray` parameters"); - let len = buffer.len(); + drop(validity); Self { ptype: T::PTYPE, - nullability: validity.nullability(), buffer: BufferHandle::new_host(buffer.into_byte_buffer()), } } @@ -344,9 +372,10 @@ impl Array { pub fn into_data_parts(self) -> PrimitiveDataParts { let validity = PrimitiveArrayExt::validity(&self); + let ptype = PrimitiveArrayExt::ptype(&self); let data = self.into_data(); PrimitiveDataParts { - ptype: data.ptype(), + ptype, buffer: data.buffer, validity, } @@ -381,28 +410,18 @@ impl Array { impl PrimitiveData { /// Consume the primitive array and returns its component parts. pub fn into_parts(self) -> PrimitiveDataParts { - PrimitiveDataParts { - ptype: self.ptype(), - buffer: self.buffer, - validity: Validity::from(self.nullability), - } + vortex_panic!("PrimitiveData::into_parts requires outer dtype; use Array::into_data_parts") } } impl PrimitiveData { - /// Returns the dtype of the array. - pub fn dtype(&self) -> DType { - DType::Primitive(self.ptype, self.nullability) - } - - /// Returns the length of the array. pub fn len(&self) -> usize { - self.buffer.len() / self.ptype().byte_width() + self.buffer.len() / self.ptype.byte_width() } /// Returns `true` if the array is empty. pub fn is_empty(&self) -> bool { - self.len() == 0 + self.buffer.is_empty() } pub fn ptype(&self) -> PType { @@ -415,11 +434,10 @@ impl PrimitiveData { } pub fn from_buffer_handle(handle: BufferHandle, ptype: PType, validity: Validity) -> Self { - let len = handle.len() / ptype.byte_width(); + drop(validity); Self { - buffer: handle, ptype, - nullability: validity.nullability(), + buffer: handle, } } @@ -482,41 +500,19 @@ impl PrimitiveData { R: NativePType, F: FnMut(T) -> R, { - let validity = Validity::from(self.nullability); - let buffer = match self.try_into_buffer_mut() { - Ok(buffer_mut) => buffer_mut.map_each_in_place(f), - Err(buffer) => BufferMut::from_iter(buffer.iter().copied().map(f)), - }; - PrimitiveData::new(buffer.freeze(), validity) + let _f = f; + vortex_panic!("PrimitiveData::map_each requires outer dtype; use Array helpers") } - /// Map each element in the array to a new value. - /// - /// This doesn't ignore validity and maps over all maybe-null elements, with a bool true if - /// valid and false otherwise. - pub fn map_each_with_validity(self, f: F) -> VortexResult + pub fn map_each_with_validity(self, _f: F) -> VortexResult where T: NativePType, R: NativePType, F: FnMut((T, bool)) -> R, { - let validity = Validity::from(self.nullability); - - let buf_iter = self.to_buffer::().into_iter(); - - let buffer = match &validity { - Validity::NonNullable | Validity::AllValid => { - BufferMut::::from_iter(buf_iter.zip(iter::repeat(true)).map(f)) - } - Validity::AllInvalid => { - BufferMut::::from_iter(buf_iter.zip(iter::repeat(false)).map(f)) - } - Validity::Array(val) => { - let val = val.to_bool().into_bit_buffer(); - BufferMut::::from_iter(buf_iter.zip(val.iter()).map(f)) - } - }; - Ok(PrimitiveData::new(buffer.freeze(), validity)) + vortex_panic!( + "PrimitiveData::map_each_with_validity requires outer dtype; use Array helpers" + ) } /// Consume the array and get a host Buffer containing the data values. @@ -551,3 +547,25 @@ impl PrimitiveData { buffer.try_into_mut() } } + +impl Array { + pub fn ptype(&self) -> PType { + PrimitiveArrayExt::ptype(self) + } + + pub fn buffer_handle(&self) -> &BufferHandle { + &self.data().buffer + } + +} + +impl ArrayView<'_, Primitive> { + pub fn ptype(&self) -> PType { + PrimitiveArrayExt::ptype(self) + } + + pub fn buffer_handle(&self) -> &BufferHandle { + &self.data().buffer + } + +} diff --git a/vortex-array/src/arrays/primitive/vtable/mod.rs b/vortex-array/src/arrays/primitive/vtable/mod.rs index 1d4f64c344a..14d5d47a22b 100644 --- a/vortex-array/src/arrays/primitive/vtable/mod.rs +++ b/vortex-array/src/arrays/primitive/vtable/mod.rs @@ -32,7 +32,6 @@ use vortex_session::VortexSession; use crate::Precision; use crate::array::ArrayId; -use crate::arrays::primitive::array::NUM_SLOTS; use crate::arrays::primitive::array::SLOT_NAMES; use crate::arrays::primitive::compute::rules::RULES; use crate::hash::ArrayEq; @@ -84,21 +83,16 @@ impl VTable for Primitive { } fn validate(&self, data: &PrimitiveData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + let DType::Primitive(_, nullability) = dtype else { + vortex_bail!("Expected primitive dtype, got {dtype:?}"); + }; vortex_ensure!( data.len() == len, "PrimitiveArray length {} does not match outer length {}", data.len(), len ); - - let actual_dtype = data.dtype(); - vortex_ensure!( - &actual_dtype == dtype, - "PrimitiveArray dtype {} does not match outer dtype {}", - actual_dtype, - dtype - ); - let validity = crate::array::child_to_validity(&slots[0], data.nullability); + let validity = crate::array::child_to_validity(&slots[0], *nullability); if let Some(validity_len) = validity.maybe_len() { vortex_ensure!( validity_len == len, diff --git a/vortex-array/src/arrays/varbin/array.rs b/vortex-array/src/arrays/varbin/array.rs index a87a834d570..a56df5fdf6f 100644 --- a/vortex-array/src/arrays/varbin/array.rs +++ b/vortex-array/src/arrays/varbin/array.rs @@ -35,8 +35,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["offsets", "validity"]; #[derive(Clone, Debug)] pub struct VarBinData { - pub(super) is_utf8: bool, - pub(super) nullability: Nullability, pub(super) bytes: BufferHandle, } @@ -56,14 +54,6 @@ impl VarBinData { } } - fn make_dtype(is_utf8: bool, nullability: Nullability) -> DType { - if is_utf8 { - DType::Utf8(nullability) - } else { - DType::Binary(nullability) - } - } - /// Creates a new `VarBinArray`. /// /// # Panics @@ -196,13 +186,10 @@ impl VarBinData { Self::validate(&offsets, &bytes, &dtype, &validity) .vortex_expect("[Debug Assertion]: Invalid `VarBinArray` parameters"); - let len = offsets.len().saturating_sub(1); - let (is_utf8, nullability) = + let _ = Self::dtype_parts(&dtype).vortex_expect("VarBinArray dtype must be utf8 or binary"); Self { - is_utf8, - nullability, bytes, } } @@ -301,11 +288,6 @@ impl VarBinData { Ok(()) } - /// Returns the length of this array. - pub fn dtype(&self) -> DType { - Self::make_dtype(self.is_utf8, self.nullability) - } - /// Access the value bytes child buffer /// /// # Note @@ -328,6 +310,7 @@ impl VarBinData { pub trait VarBinArrayExt { fn varbin_data(&self) -> &VarBinData; fn as_slots(&self) -> &[Option]; + fn dtype(&self) -> &DType; fn offsets(&self) -> &ArrayRef { self.as_slots()[OFFSETS_SLOT] @@ -339,8 +322,24 @@ pub trait VarBinArrayExt { self.as_slots()[VALIDITY_SLOT].as_ref() } + fn dtype_parts(&self) -> (bool, Nullability) { + match self.dtype() { + DType::Utf8(nullability) => (true, *nullability), + DType::Binary(nullability) => (false, *nullability), + _ => unreachable!("VarBinArrayExt requires a utf8 or binary dtype"), + } + } + + fn is_utf8(&self) -> bool { + self.dtype_parts().0 + } + + fn nullability(&self) -> Nullability { + self.dtype_parts().1 + } + fn varbin_validity(&self) -> Validity { - child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.varbin_data().nullability) + child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.nullability()) } fn varbin_validity_mask(&self) -> Mask { @@ -385,6 +384,10 @@ impl VarBinArrayExt for Array { fn len(&self) -> usize { Array::len(self) } + + fn dtype(&self) -> &DType { + Array::dtype(self) + } } impl VarBinArrayExt for ArrayView<'_, VarBin> { @@ -399,6 +402,10 @@ impl VarBinArrayExt for ArrayView<'_, VarBin> { fn len(&self) -> usize { ArrayView::len(self) } + + fn dtype(&self) -> &DType { + ArrayView::dtype(self) + } } /// Forwarding constructors for `VarBinArray` (= `Array`). diff --git a/vortex-array/src/arrays/varbin/vtable/mod.rs b/vortex-array/src/arrays/varbin/vtable/mod.rs index 98118694252..2bbea1bf603 100644 --- a/vortex-array/src/arrays/varbin/vtable/mod.rs +++ b/vortex-array/src/arrays/varbin/vtable/mod.rs @@ -74,7 +74,7 @@ impl VTable for VarBin { 1 } - fn validate(&self, data: &VarBinData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + fn validate(&self, _data: &VarBinData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { vortex_ensure!(slots.len() == NUM_SLOTS, "VarBinArray expected {NUM_SLOTS} slots, found {}", slots.len()); let offsets = slots[crate::arrays::varbin::array::OFFSETS_SLOT] .as_ref() @@ -85,12 +85,7 @@ impl VTable for VarBin { offsets.len().saturating_sub(1), len ); - vortex_ensure!( - data.dtype() == *dtype, - "VarBinArray dtype {} does not match outer dtype {}", - data.dtype(), - dtype - ); + vortex_ensure!(matches!(dtype, DType::Binary(_) | DType::Utf8(_)), "VarBinArray dtype must be binary or utf8, got {dtype}"); Ok(()) } diff --git a/vortex-array/src/arrays/varbinview/array.rs b/vortex-array/src/arrays/varbinview/array.rs index 8cf3191f16c..ef86b5a4888 100644 --- a/vortex-array/src/arrays/varbinview/array.rs +++ b/vortex-array/src/arrays/varbinview/array.rs @@ -96,8 +96,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["validity"]; /// ``` #[derive(Clone, Debug)] pub struct VarBinViewData { - pub(super) is_utf8: bool, - pub(super) nullability: Nullability, pub(super) buffers: Arc<[BufferHandle]>, pub(super) views: BufferHandle, } @@ -118,14 +116,6 @@ impl VarBinViewData { } } - fn make_dtype(is_utf8: bool, nullability: Nullability) -> DType { - if is_utf8 { - DType::Utf8(nullability) - } else { - DType::Binary(nullability) - } - } - /// Build the slots vector for this array. pub(super) fn make_slots(validity: &Validity, len: usize) -> Vec> { vec![validity_to_child(validity, len)] @@ -275,13 +265,11 @@ impl VarBinViewData { views: BufferHandle, buffers: Arc<[BufferHandle]>, dtype: DType, - validity: Validity, + _validity: Validity, ) -> Self { - let (is_utf8, nullability) = + let _ = Self::dtype_parts(&dtype).vortex_expect("VarBinViewArray dtype must be utf8 or binary"); Self { - is_utf8, - nullability, buffers, views, } @@ -381,11 +369,6 @@ impl VarBinViewData { self.views.len() / size_of::() } - /// Returns the [`DType`] of this array. - pub fn dtype(&self) -> DType { - Self::make_dtype(self.is_utf8, self.nullability) - } - /// Returns `true` if this array is empty. pub fn is_empty(&self) -> bool { self.len() == 0 @@ -547,17 +530,23 @@ impl VarBinViewData { pub trait VarBinViewArrayExt { fn varbinview_data(&self) -> &VarBinViewData; fn as_slots(&self) -> &[Option]; + fn dtype(&self) -> &DType; + fn len(&self) -> usize; + + fn dtype_parts(&self) -> (bool, Nullability) { + match self.dtype() { + DType::Utf8(nullability) => (true, *nullability), + DType::Binary(nullability) => (false, *nullability), + _ => unreachable!("VarBinViewArrayExt requires a utf8 or binary dtype"), + } + } fn varbinview_validity(&self) -> Validity { - child_to_validity( - &self.as_slots()[VALIDITY_SLOT], - self.varbinview_data().nullability, - ) + child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.dtype_parts().1) } fn varbinview_validity_mask(&self) -> Mask { - self.varbinview_validity() - .to_mask(self.varbinview_data().len()) + self.varbinview_validity().to_mask(self.len()) } } @@ -569,6 +558,14 @@ impl VarBinViewArrayExt for Array { fn as_slots(&self) -> &[Option] { self.slots() } + + fn dtype(&self) -> &DType { + Array::dtype(self) + } + + fn len(&self) -> usize { + Array::len(self) + } } impl VarBinViewArrayExt for ArrayView<'_, VarBinView> { @@ -579,12 +576,19 @@ impl VarBinViewArrayExt for ArrayView<'_, VarBinView> { fn as_slots(&self) -> &[Option] { self.slots() } + + fn dtype(&self) -> &DType { + ArrayView::dtype(self) + } + + fn len(&self) -> usize { + ArrayView::len(self) + } } impl Array { #[inline] - fn from_prevalidated_data(data: VarBinViewData, slots: Vec>) -> Self { - let dtype = data.dtype(); + fn from_prevalidated_data(dtype: DType, data: VarBinViewData, slots: Vec>) -> Self { let len = data.len(); unsafe { Array::from_parts_unchecked(ArrayParts::new(VarBinView, dtype, len, data).with_slots(slots)) @@ -600,52 +604,41 @@ impl Array { iter: I, dtype: DType, ) -> Self { - let array = VarBinViewData::from_iter(iter, dtype); - let slots = VarBinViewData::make_slots( - &Validity::from(array.nullability), - array.len(), - ); - Self::from_prevalidated_data(array, slots) + let array = VarBinViewData::from_iter(iter, dtype.clone()); + let slots = VarBinViewData::make_slots(&Validity::from(dtype.nullability()), array.len()); + Self::from_prevalidated_data(dtype, array, slots) } pub fn from_iter_str, I: IntoIterator>(iter: I) -> Self { + let dtype = DType::Utf8(Nullability::NonNullable); let array = VarBinViewData::from_iter_str(iter); - let slots = VarBinViewData::make_slots( - &Validity::from(array.nullability), - array.len(), - ); - Self::from_prevalidated_data(array, slots) + let slots = VarBinViewData::make_slots(&Validity::NonNullable, array.len()); + Self::from_prevalidated_data(dtype, array, slots) } pub fn from_iter_nullable_str, I: IntoIterator>>( iter: I, ) -> Self { + let dtype = DType::Utf8(Nullability::Nullable); let array = VarBinViewData::from_iter_nullable_str(iter); - let slots = VarBinViewData::make_slots( - &Validity::from(array.nullability), - array.len(), - ); - Self::from_prevalidated_data(array, slots) + let slots = VarBinViewData::make_slots(&Validity::AllValid, array.len()); + Self::from_prevalidated_data(dtype, array, slots) } pub fn from_iter_bin, I: IntoIterator>(iter: I) -> Self { + let dtype = DType::Binary(Nullability::NonNullable); let array = VarBinViewData::from_iter_bin(iter); - let slots = VarBinViewData::make_slots( - &Validity::from(array.nullability), - array.len(), - ); - Self::from_prevalidated_data(array, slots) + let slots = VarBinViewData::make_slots(&Validity::NonNullable, array.len()); + Self::from_prevalidated_data(dtype, array, slots) } pub fn from_iter_nullable_bin, I: IntoIterator>>( iter: I, ) -> Self { + let dtype = DType::Binary(Nullability::Nullable); let array = VarBinViewData::from_iter_nullable_bin(iter); - let slots = VarBinViewData::make_slots( - &Validity::from(array.nullability), - array.len(), - ); - Self::from_prevalidated_data(array, slots) + let slots = VarBinViewData::make_slots(&Validity::AllValid, array.len()); + Self::from_prevalidated_data(dtype, array, slots) } /// Creates a new `VarBinViewArray`. @@ -655,9 +648,9 @@ impl Array { dtype: DType, validity: Validity, ) -> VortexResult { - let data = VarBinViewData::try_new(views, buffers, dtype, validity.clone())?; + let data = VarBinViewData::try_new(views, buffers, dtype.clone(), validity.clone())?; let slots = VarBinViewData::make_slots(&validity, data.len()); - Ok(Self::from_prevalidated_data(data, slots)) + Ok(Self::from_prevalidated_data(dtype, data, slots)) } /// Creates a new `VarBinViewArray` without validation. @@ -671,9 +664,10 @@ impl Array { dtype: DType, validity: Validity, ) -> Self { - let data = unsafe { VarBinViewData::new_unchecked(views, buffers, dtype, validity.clone()) }; + let data = + unsafe { VarBinViewData::new_unchecked(views, buffers, dtype.clone(), validity.clone()) }; let slots = VarBinViewData::make_slots(&validity, data.len()); - Self::from_prevalidated_data(data, slots) + Self::from_prevalidated_data(dtype, data, slots) } /// Creates a new `VarBinViewArray` with device or host memory. @@ -683,9 +677,9 @@ impl Array { dtype: DType, validity: Validity, ) -> Self { - let data = VarBinViewData::new_handle(views, buffers, dtype, validity.clone()); + let data = VarBinViewData::new_handle(views, buffers, dtype.clone(), validity.clone()); let slots = VarBinViewData::make_slots(&validity, data.len()); - Self::from_prevalidated_data(data, slots) + Self::from_prevalidated_data(dtype, data, slots) } /// Construct a new array from `BufferHandle`s without validation. @@ -700,9 +694,9 @@ impl Array { validity: Validity, ) -> Self { let data = - unsafe { VarBinViewData::new_handle_unchecked(views, buffers, dtype, validity.clone()) }; + unsafe { VarBinViewData::new_handle_unchecked(views, buffers, dtype.clone(), validity.clone()) }; let slots = VarBinViewData::make_slots(&validity, data.len()); - Self::from_prevalidated_data(data, slots) + Self::from_prevalidated_data(dtype, data, slots) } pub fn varbinview_validity(&self) -> Validity { @@ -715,11 +709,13 @@ impl Array { pub fn into_data_parts(self) -> VarBinViewDataParts { let parts = self.into_parts(); + let dtype = parts.dtype; + let validity = child_to_validity(&parts.slots[VALIDITY_SLOT], dtype.nullability()); VarBinViewDataParts { - dtype: parts.dtype, + dtype, buffers: parts.data.buffers, views: parts.data.views, - validity: child_to_validity(&parts.slots[VALIDITY_SLOT], parts.data.nullability), + validity, } } } diff --git a/vortex-array/src/arrays/varbinview/vtable/mod.rs b/vortex-array/src/arrays/varbinview/vtable/mod.rs index bd9c030e8ed..101fd233c28 100644 --- a/vortex-array/src/arrays/varbinview/vtable/mod.rs +++ b/vortex-array/src/arrays/varbinview/vtable/mod.rs @@ -93,12 +93,7 @@ impl VTable for VarBinView { data.len(), len ); - vortex_ensure!( - data.dtype() == *dtype, - "VarBinViewArray dtype {} does not match outer dtype {}", - data.dtype(), - dtype - ); + vortex_ensure!(matches!(dtype, DType::Binary(_) | DType::Utf8(_)), "VarBinViewArray dtype must be binary or utf8, got {dtype}"); Ok(()) } From 0631946161591682797d76f3a09cbc6a746ade6f Mon Sep 17 00:00:00 2001 From: Nicholas Gates Date: Sat, 4 Apr 2026 09:15:03 -0400 Subject: [PATCH 04/10] Engine Signed-off-by: Nicholas Gates --- encodings/alp/src/alp/array.rs | 24 ++---- encodings/alp/src/alp_rd/array.rs | 31 +++---- encodings/bytebool/src/array.rs | 19 +---- encodings/datetime-parts/src/array.rs | 19 ++--- .../src/decimal_byte_parts/mod.rs | 15 ++-- .../fastlanes/src/bitpacking/vtable/mod.rs | 80 +++---------------- encodings/fastlanes/src/delta/vtable/mod.rs | 20 +---- encodings/fastlanes/src/for/vtable/mod.rs | 18 +---- encodings/fastlanes/src/rle/vtable/mod.rs | 24 +----- encodings/fsst/src/array.rs | 28 ++----- encodings/parquet-variant/src/vtable.rs | 50 ++---------- encodings/pco/src/array.rs | 42 ++++------ encodings/runend/src/array.rs | 20 +---- encodings/sequence/src/array.rs | 18 ++--- encodings/sparse/src/lib.rs | 18 ++--- encodings/zigzag/src/array.rs | 15 ++-- encodings/zstd/src/array.rs | 40 ++++------ encodings/zstd/src/zstd_buffers.rs | 40 +++------- vortex-array/src/array/mod.rs | 23 +++--- vortex-array/src/array/vtable/mod.rs | 6 +- vortex-array/src/arrays/bool/vtable/mod.rs | 12 +-- vortex-array/src/arrays/chunked/vtable/mod.rs | 15 +--- .../src/arrays/constant/vtable/mod.rs | 10 +-- vortex-array/src/arrays/decimal/vtable/mod.rs | 14 ++-- vortex-array/src/arrays/dict/vtable/mod.rs | 9 +-- .../src/arrays/extension/vtable/mod.rs | 13 ++- vortex-array/src/arrays/filter/vtable.rs | 10 +-- .../src/arrays/fixed_size_list/vtable/mod.rs | 22 +---- vortex-array/src/arrays/list/vtable/mod.rs | 11 +-- .../src/arrays/listview/vtable/mod.rs | 17 ++-- vortex-array/src/arrays/masked/vtable/mod.rs | 11 +-- vortex-array/src/arrays/null/mod.rs | 8 +- vortex-array/src/arrays/patched/vtable/mod.rs | 25 ++---- .../src/arrays/primitive/vtable/mod.rs | 11 +-- .../src/arrays/scalar_fn/vtable/mod.rs | 19 +---- vortex-array/src/arrays/shared/vtable.rs | 10 +-- vortex-array/src/arrays/slice/vtable.rs | 11 ++- vortex-array/src/arrays/struct_/vtable/mod.rs | 15 +--- vortex-array/src/arrays/varbin/vtable/mod.rs | 12 +-- .../src/arrays/varbinview/vtable/mod.rs | 22 ++--- vortex-array/src/arrays/variant/vtable/mod.rs | 7 +- vortex-python/src/arrays/py/vtable.rs | 20 ++--- 42 files changed, 244 insertions(+), 610 deletions(-) diff --git a/encodings/alp/src/alp/array.rs b/encodings/alp/src/alp/array.rs index c82ff88565f..4addc5be1ba 100644 --- a/encodings/alp/src/alp/array.rs +++ b/encodings/alp/src/alp/array.rs @@ -76,24 +76,16 @@ impl VTable for ALP { ) } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, - ) { - array.encoded().array_hash(state, precision); - array.exponents.hash(state); - array.patches().array_hash(state, precision); + fn array_hash(data: &ALPData, state: &mut H, precision: Precision) { + data.exponents.hash(state); + data.patch_offset.hash(state); + data.patch_offset_within_chunk.hash(state); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - array.encoded().array_eq(other.encoded(), precision) - && array.exponents == other.exponents - && array.patches().array_eq(&other.patches(), precision) + fn array_eq(data: &ALPData, other: &ALPData, _precision: Precision) -> bool { + data.exponents == other.exponents + && data.patch_offset == other.patch_offset + && data.patch_offset_within_chunk == other.patch_offset_within_chunk } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/alp/src/alp_rd/array.rs b/encodings/alp/src/alp_rd/array.rs index 5bd3c9cdd2e..508522a5e9e 100644 --- a/encodings/alp/src/alp_rd/array.rs +++ b/encodings/alp/src/alp_rd/array.rs @@ -82,30 +82,17 @@ impl VTable for ALPRD { data.validate_against_outer(dtype, len, slots) } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: 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_bit_width.hash(state); - array.left_parts_patches.array_hash(state, precision); + fn array_hash(data: &ALPRDData, state: &mut H, precision: Precision) { + data.left_parts_dictionary.array_hash(state, precision); + data.right_bit_width.hash(state); + data.left_parts_patches.array_hash(state, precision); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - 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_bit_width == other.right_bit_width - && array + fn array_eq(data: &ALPRDData, other: &ALPRDData, precision: Precision) -> bool { + data.left_parts_dictionary + .array_eq(&other.left_parts_dictionary, precision) + && data.right_bit_width == other.right_bit_width + && data .left_parts_patches .array_eq(&other.left_parts_patches, precision) } diff --git a/encodings/bytebool/src/array.rs b/encodings/bytebool/src/array.rs index 351cecddcdc..75468cb23af 100644 --- a/encodings/bytebool/src/array.rs +++ b/encodings/bytebool/src/array.rs @@ -60,23 +60,12 @@ impl VTable for ByteBool { ByteBoolData::validate(data.buffer(), &validity, dtype, len) } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, - ) { - array.buffer.array_hash(state, precision); - ByteBoolArrayExt::validity(&array).array_hash(state, precision); + fn array_hash(data: &ByteBoolData, state: &mut H, precision: Precision) { + data.buffer.array_hash(state, precision); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - array.buffer.array_eq(&other.buffer, precision) - && ByteBoolArrayExt::validity(&array) - .array_eq(&ByteBoolArrayExt::validity(&other), precision) + fn array_eq(data: &ByteBoolData, other: &ByteBoolData, precision: Precision) -> bool { + data.buffer.array_eq(&other.buffer, precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/datetime-parts/src/array.rs b/encodings/datetime-parts/src/array.rs index 2c8d2539f48..1d5b1a251f5 100644 --- a/encodings/datetime-parts/src/array.rs +++ b/encodings/datetime-parts/src/array.rs @@ -99,23 +99,18 @@ impl VTable for DateTimeParts { } fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, + _data: &DateTimePartsData, + _state: &mut H, + _precision: Precision, ) { - array.days().array_hash(state, precision); - array.seconds().array_hash(state, precision); - array.subseconds().array_hash(state, precision); } fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, + _data: &DateTimePartsData, + _other: &DateTimePartsData, + _precision: Precision, ) -> bool { - array.days().array_eq(other.days(), precision) - && array.seconds().array_eq(other.seconds(), precision) - && array.subseconds().array_eq(other.subseconds(), precision) + true } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 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 ea7d730dcf1..14ae0dca505 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs @@ -80,19 +80,18 @@ impl VTable for DecimalByteParts { } fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, + _data: &DecimalBytePartsData, + _state: &mut H, + _precision: Precision, ) { - array.msp().array_hash(state, precision); } fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, + _data: &DecimalBytePartsData, + _other: &DecimalBytePartsData, + _precision: Precision, ) -> bool { - array.msp().array_eq(other.msp(), precision) + true } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/fastlanes/src/bitpacking/vtable/mod.rs b/encodings/fastlanes/src/bitpacking/vtable/mod.rs index 001c6e0ce93..1a85a80e497 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/mod.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/mod.rs @@ -106,76 +106,20 @@ impl VTable for BitPacked { data.validate_against_slots(dtype, len, &validity, patches.as_ref()) } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, - ) { - array.offset.hash(state); - array.bit_width.hash(state); - array.packed.array_hash(state, precision); - match array.patch_indices() { - Some(indices) => { - true.hash(state); - indices.array_hash(state, precision); - } - None => false.hash(state), - } - match array.patch_values() { - Some(values) => { - true.hash(state); - values.array_hash(state, precision); - } - None => false.hash(state), - } - match array.patch_chunk_offsets() { - Some(offsets) => { - true.hash(state); - offsets.array_hash(state, precision); - } - None => false.hash(state), - } - match array.validity_child() { - Some(validity) => { - true.hash(state); - validity.array_hash(state, precision); - } - None => false.hash(state), - } - array.patch_offset.hash(state); - array.patch_offset_within_chunk.hash(state); + fn array_hash(data: &BitPackedData, state: &mut H, precision: Precision) { + data.offset.hash(state); + data.bit_width.hash(state); + data.packed.array_hash(state, precision); + data.patch_offset.hash(state); + data.patch_offset_within_chunk.hash(state); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - array.offset == other.offset - && array.bit_width == other.bit_width - && array.packed.array_eq(&other.packed, precision) - && match (array.patch_indices(), other.patch_indices()) { - (Some(lhs), Some(rhs)) => lhs.array_eq(rhs, precision), - (None, None) => true, - _ => false, - } - && match (array.patch_values(), other.patch_values()) { - (Some(lhs), Some(rhs)) => lhs.array_eq(rhs, precision), - (None, None) => true, - _ => false, - } - && match (array.patch_chunk_offsets(), other.patch_chunk_offsets()) { - (Some(lhs), Some(rhs)) => lhs.array_eq(rhs, precision), - (None, None) => true, - _ => false, - } - && match (array.validity_child(), other.validity_child()) { - (Some(lhs), Some(rhs)) => lhs.array_eq(rhs, precision), - (None, None) => true, - _ => false, - } - && array.patch_offset == other.patch_offset - && array.patch_offset_within_chunk == other.patch_offset_within_chunk + fn array_eq(data: &BitPackedData, other: &BitPackedData, precision: Precision) -> bool { + data.offset == other.offset + && data.bit_width == other.bit_width + && data.packed.array_eq(&other.packed, precision) + && data.patch_offset == other.patch_offset + && data.patch_offset_within_chunk == other.patch_offset_within_chunk } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/fastlanes/src/delta/vtable/mod.rs b/encodings/fastlanes/src/delta/vtable/mod.rs index 409774e31cf..ef81bfed2e4 100644 --- a/encodings/fastlanes/src/delta/vtable/mod.rs +++ b/encodings/fastlanes/src/delta/vtable/mod.rs @@ -81,24 +81,12 @@ impl VTable for Delta { ) } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, - ) { - array.offset().hash(state); - array.bases().array_hash(state, precision); - array.deltas().array_hash(state, precision); + fn array_hash(data: &DeltaData, state: &mut H, _precision: Precision) { + data.offset.hash(state); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - array.offset() == other.offset() - && array.bases().array_eq(other.bases(), precision) - && array.deltas().array_eq(other.deltas(), precision) + fn array_eq(data: &DeltaData, other: &DeltaData, _precision: Precision) -> bool { + data.offset == other.offset } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/fastlanes/src/for/vtable/mod.rs b/encodings/fastlanes/src/for/vtable/mod.rs index 51daada877b..e1a02f42c98 100644 --- a/encodings/fastlanes/src/for/vtable/mod.rs +++ b/encodings/fastlanes/src/for/vtable/mod.rs @@ -68,22 +68,12 @@ impl VTable for FoR { FoRData::validate_parts(encoded, &data.reference, dtype, len) } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, - ) { - array.encoded().array_hash(state, precision); - array.reference_scalar().hash(state); + fn array_hash(data: &FoRData, state: &mut H, _precision: Precision) { + data.reference.hash(state); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - array.encoded().array_eq(other.encoded(), precision) - && array.reference_scalar() == other.reference_scalar() + fn array_eq(data: &FoRData, other: &FoRData, _precision: Precision) -> bool { + data.reference == other.reference } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/fastlanes/src/rle/vtable/mod.rs b/encodings/fastlanes/src/rle/vtable/mod.rs index 663ab109aed..21b564a92d8 100644 --- a/encodings/fastlanes/src/rle/vtable/mod.rs +++ b/encodings/fastlanes/src/rle/vtable/mod.rs @@ -92,28 +92,12 @@ impl VTable for RLE { ) } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, - ) { - array.values().array_hash(state, precision); - array.indices().array_hash(state, precision); - array.values_idx_offsets().array_hash(state, precision); - array.offset().hash(state); + fn array_hash(data: &RLEData, state: &mut H, _precision: Precision) { + data.offset.hash(state); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - array.values().array_eq(other.values(), precision) - && array.indices().array_eq(other.indices(), precision) - && array - .values_idx_offsets() - .array_eq(other.values_idx_offsets(), precision) - && array.offset() == other.offset() + fn array_eq(data: &RLEData, other: &RLEData, _precision: Precision) -> bool { + data.offset == other.offset } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/fsst/src/array.rs b/encodings/fsst/src/array.rs index e1437f5ba0e..52bd08efcb5 100644 --- a/encodings/fsst/src/array.rs +++ b/encodings/fsst/src/array.rs @@ -89,38 +89,26 @@ impl VTable for FSST { data.validate(dtype, len, slots) } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, - ) { - array.symbols.array_hash(state, precision); - array.symbol_lengths.array_hash(state, precision); - array + fn array_hash(data: &FSSTData, state: &mut H, precision: Precision) { + data.symbols.array_hash(state, precision); + data.symbol_lengths.array_hash(state, precision); + data .codes .clone() .into_array() .array_hash(state, precision); - array.uncompressed_lengths().array_hash(state, precision); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - array.symbols.array_eq(&other.symbols, precision) - && array + fn array_eq(data: &FSSTData, other: &FSSTData, precision: Precision) -> bool { + data.symbols.array_eq(&other.symbols, precision) + && data .symbol_lengths .array_eq(&other.symbol_lengths, precision) - && array + && data .codes .clone() .into_array() .array_eq(&other.codes.clone().into_array(), precision) - && array - .uncompressed_lengths() - .array_eq(other.uncompressed_lengths(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/parquet-variant/src/vtable.rs b/encodings/parquet-variant/src/vtable.rs index 29e7c17b084..e45926f7c3d 100644 --- a/encodings/parquet-variant/src/vtable.rs +++ b/encodings/parquet-variant/src/vtable.rs @@ -80,55 +80,15 @@ impl VTable for ParquetVariant { ParquetVariantData::validate_slots(dtype, len, slots) } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - ParquetVariantArrayExt::validity(&array).array_hash(state, precision); - ParquetVariantArrayExt::metadata_array(&array).array_hash(state, precision); - // Hash discriminators so that (value=Some, typed_value=None) and - // (value=None, typed_value=Some) produce different hashes. - ParquetVariantArrayExt::value_array(&array).is_some().hash(state); - if let Some(value) = ParquetVariantArrayExt::value_array(&array) { - value.array_hash(state, precision); - } - ParquetVariantArrayExt::typed_value_array(&array) - .is_some() - .hash(state); - if let Some(typed_value) = ParquetVariantArrayExt::typed_value_array(&array) { - typed_value.array_hash(state, precision); - } + fn array_hash(_data: &ParquetVariantData, _state: &mut H, _precision: Precision) { } fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, + _data: &ParquetVariantData, + _other: &ParquetVariantData, + _precision: Precision, ) -> bool { - if !ParquetVariantArrayExt::validity(&array) - .array_eq(&ParquetVariantArrayExt::validity(&other), precision) - || !ParquetVariantArrayExt::metadata_array(&array) - .array_eq(ParquetVariantArrayExt::metadata_array(&other), precision) - { - return false; - } - match ( - ParquetVariantArrayExt::value_array(&array), - ParquetVariantArrayExt::value_array(&other), - ) { - (Some(a), Some(b)) => { - if !a.array_eq(b, precision) { - return false; - } - } - (None, None) => {} - _ => return false, - } - match ( - ParquetVariantArrayExt::typed_value_array(&array), - ParquetVariantArrayExt::typed_value_array(&other), - ) { - (Some(a), Some(b)) => a.array_eq(b, precision), - (None, None) => true, - _ => false, - } + true } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/pco/src/array.rs b/encodings/pco/src/array.rs index f0ef6182c5d..a742d0e687c 100644 --- a/encodings/pco/src/array.rs +++ b/encodings/pco/src/array.rs @@ -100,46 +100,36 @@ impl VTable for Pco { data.validate(dtype, len) } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, - ) { - array.unsliced_validity.array_hash(state, precision); - array.unsliced_n_rows.hash(state); - array.slice_start.hash(state); - array.slice_stop.hash(state); + fn array_hash(data: &PcoData, state: &mut H, precision: Precision) { + data.unsliced_validity.array_hash(state, precision); + data.unsliced_n_rows.hash(state); + data.slice_start.hash(state); + data.slice_stop.hash(state); // Hash chunk_metas and pages using pointer-based hashing - for chunk_meta in &array.chunk_metas { + for chunk_meta in &data.chunk_metas { chunk_meta.array_hash(state, precision); } - for page in &array.pages { + for page in &data.pages { page.array_hash(state, precision); } } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - if !array - .unsliced_validity - .array_eq(&other.unsliced_validity, precision) - || array.unsliced_n_rows != other.unsliced_n_rows - || array.slice_start != other.slice_start - || array.slice_stop != other.slice_stop - || array.chunk_metas.len() != other.chunk_metas.len() - || array.pages.len() != other.pages.len() + fn array_eq(data: &PcoData, other: &PcoData, precision: Precision) -> bool { + if !data.unsliced_validity.array_eq(&other.unsliced_validity, precision) + || data.unsliced_n_rows != other.unsliced_n_rows + || data.slice_start != other.slice_start + || data.slice_stop != other.slice_stop + || data.chunk_metas.len() != other.chunk_metas.len() + || data.pages.len() != other.pages.len() { return false; } - for (a, b) in array.chunk_metas.iter().zip(&other.chunk_metas) { + for (a, b) in data.chunk_metas.iter().zip(&other.chunk_metas) { if !a.array_eq(b, precision) { return false; } } - for (a, b) in array.pages.iter().zip(&other.pages) { + for (a, b) in data.pages.iter().zip(&other.pages) { if !a.array_eq(b, precision) { return false; } diff --git a/encodings/runend/src/array.rs b/encodings/runend/src/array.rs index c5b81f7b066..81976c3220a 100644 --- a/encodings/runend/src/array.rs +++ b/encodings/runend/src/array.rs @@ -89,24 +89,12 @@ impl VTable for RunEnd { Ok(()) } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, - ) { - array.ends().array_hash(state, precision); - array.values().array_hash(state, precision); - array.offset.hash(state); + fn array_hash(data: &RunEndData, state: &mut H, _precision: Precision) { + data.offset.hash(state); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - array.ends().array_eq(other.ends(), precision) - && array.values().array_eq(other.values(), precision) - && array.offset == other.offset + fn array_eq(data: &RunEndData, other: &RunEndData, _precision: Precision) -> bool { + data.offset == other.offset } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/sequence/src/array.rs b/encodings/sequence/src/array.rs index 3ea0e718480..a1777601dcb 100644 --- a/encodings/sequence/src/array.rs +++ b/encodings/sequence/src/array.rs @@ -220,21 +220,13 @@ impl VTable for Sequence { SequenceData::validate(data.base, data.multiplier, dtype, len) } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - _precision: Precision, - ) { - array.base.hash(state); - array.multiplier.hash(state); + fn array_hash(data: &SequenceData, state: &mut H, _precision: Precision) { + data.base.hash(state); + data.multiplier.hash(state); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - _precision: Precision, - ) -> bool { - array.base == other.base && array.multiplier == other.multiplier + fn array_eq(data: &SequenceData, other: &SequenceData, _precision: Precision) -> bool { + data.base == other.base && data.multiplier == other.multiplier } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/sparse/src/lib.rs b/encodings/sparse/src/lib.rs index 68b9461829a..a3aac04fc7f 100644 --- a/encodings/sparse/src/lib.rs +++ b/encodings/sparse/src/lib.rs @@ -84,21 +84,13 @@ impl VTable for Sparse { SparseData::validate(data.patches(), data.fill_scalar(), dtype, len) } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, - ) { - array.patches.array_hash(state, precision); - array.fill_value.hash(state); + fn array_hash(data: &SparseData, state: &mut H, precision: Precision) { + data.patches.array_hash(state, precision); + data.fill_value.hash(state); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - array.patches.array_eq(&other.patches, precision) && array.fill_value == other.fill_value + fn array_eq(data: &SparseData, other: &SparseData, precision: Precision) -> bool { + data.patches.array_eq(&other.patches, precision) && data.fill_value == other.fill_value } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/zigzag/src/array.rs b/encodings/zigzag/src/array.rs index 9193de33b1c..09d4091f39a 100644 --- a/encodings/zigzag/src/array.rs +++ b/encodings/zigzag/src/array.rs @@ -72,19 +72,14 @@ impl VTable for ZigZag { } fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, + _data: &ZigZagData, + _state: &mut H, + _precision: Precision, ) { - array.encoded().array_hash(state, precision); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - array.encoded().array_eq(other.encoded(), precision) + fn array_eq(_data: &ZigZagData, _other: &ZigZagData, _precision: Precision) -> bool { + true } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/zstd/src/array.rs b/encodings/zstd/src/array.rs index d6a5070fd17..8614d4969ba 100644 --- a/encodings/zstd/src/array.rs +++ b/encodings/zstd/src/array.rs @@ -101,12 +101,8 @@ impl VTable for Zstd { data.validate(dtype, len) } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, - ) { - match &array.dictionary { + fn array_hash(data: &ZstdData, state: &mut H, precision: Precision) { + match &data.dictionary { Some(dict) => { true.hash(state); dict.array_hash(state, precision); @@ -115,41 +111,35 @@ impl VTable for Zstd { false.hash(state); } } - for frame in &array.frames { + for frame in &data.frames { frame.array_hash(state, precision); } - array.unsliced_validity.array_hash(state, precision); - array.unsliced_n_rows.hash(state); - array.slice_start.hash(state); - array.slice_stop.hash(state); + data.unsliced_validity.array_hash(state, precision); + data.unsliced_n_rows.hash(state); + data.slice_start.hash(state); + data.slice_stop.hash(state); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - if !match (&array.dictionary, &other.dictionary) { + fn array_eq(data: &ZstdData, other: &ZstdData, precision: Precision) -> bool { + if !match (&data.dictionary, &other.dictionary) { (Some(d1), Some(d2)) => d1.array_eq(d2, precision), (None, None) => true, _ => false, } { return false; } - if array.frames.len() != other.frames.len() { + if data.frames.len() != other.frames.len() { return false; } - for (a, b) in array.frames.iter().zip(&other.frames) { + for (a, b) in data.frames.iter().zip(&other.frames) { if !a.array_eq(b, precision) { return false; } } - array - .unsliced_validity - .array_eq(&other.unsliced_validity, precision) - && array.unsliced_n_rows == other.unsliced_n_rows - && array.slice_start == other.slice_start - && array.slice_stop == other.slice_stop + data.unsliced_validity.array_eq(&other.unsliced_validity, precision) + && data.unsliced_n_rows == other.unsliced_n_rows + && data.slice_start == other.slice_start + && data.slice_stop == other.slice_stop } fn nbuffers(array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/zstd/src/zstd_buffers.rs b/encodings/zstd/src/zstd_buffers.rs index a74670c1ac2..6887b927fff 100644 --- a/encodings/zstd/src/zstd_buffers.rs +++ b/encodings/zstd/src/zstd_buffers.rs @@ -341,44 +341,30 @@ impl VTable for ZstdBuffers { } fn array_hash( - array: ArrayView<'_, Self>, + data: &ZstdBuffersData, state: &mut H, precision: Precision, ) { - array.inner_encoding_id.hash(state); - array.inner_metadata.hash(state); - for buf in &array.compressed_buffers { + data.inner_encoding_id.hash(state); + data.inner_metadata.hash(state); + for buf in &data.compressed_buffers { buf.array_hash(state, precision); } - array.uncompressed_sizes.hash(state); - array.buffer_alignments.hash(state); - for child in array.slots().iter().flatten() { - child.array_hash(state, precision); - } + data.uncompressed_sizes.hash(state); + data.buffer_alignments.hash(state); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - array.inner_encoding_id == other.inner_encoding_id - && array.inner_metadata == other.inner_metadata - && array.compressed_buffers.len() == other.compressed_buffers.len() - && array + fn array_eq(data: &ZstdBuffersData, other: &ZstdBuffersData, precision: Precision) -> bool { + data.inner_encoding_id == other.inner_encoding_id + && data.inner_metadata == other.inner_metadata + && data.compressed_buffers.len() == other.compressed_buffers.len() + && data .compressed_buffers .iter() .zip(&other.compressed_buffers) .all(|(a, b)| a.array_eq(b, precision)) - && array.uncompressed_sizes == other.uncompressed_sizes - && array.buffer_alignments == other.buffer_alignments - && array.slots().len() == other.slots().len() - && array - .slots() - .iter() - .flatten() - .zip(other.slots().iter().flatten()) - .all(|(a, b)| a.array_eq(b, precision)) + && data.uncompressed_sizes == other.uncompressed_sizes + && data.buffer_alignments == other.buffer_alignments } fn nbuffers(array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/array/mod.rs b/vortex-array/src/array/mod.rs index 2cfd5325c2e..0d38f20e965 100644 --- a/vortex-array/src/array/mod.rs +++ b/vortex-array/src/array/mod.rs @@ -35,6 +35,8 @@ pub use vtable::*; mod view; pub use view::*; +use crate::hash::ArrayEq; +use crate::hash::ArrayHash; /// The public API trait for all Vortex arrays. /// @@ -316,8 +318,11 @@ impl DynArray for ArrayInner { self.len.hash(&mut wrapper); self.dtype.hash(&mut wrapper); self.vtable.id().hash(&mut wrapper); - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; - V::array_hash(view, &mut wrapper, precision); + self.slots.len().hash(&mut wrapper); + for slot in &self.slots { + slot.array_hash(&mut wrapper, precision); + } + V::array_hash(&self.data, &mut wrapper, precision); } fn dyn_array_eq(&self, this: &ArrayRef, other: &ArrayRef, precision: crate::Precision) -> bool { @@ -325,13 +330,13 @@ impl DynArray for ArrayInner { self.len == other.len() && self.dtype == *other.dtype() && self.vtable.id() == other.encoding_id() - && { - let this = unsafe { ArrayView::new_unchecked(this, &self.data) }; - let other = unsafe { - ArrayView::new_unchecked(other, &other_inner.data) - }; - V::array_eq(this, other, precision) - } + && self.slots.len() == other_inner.slots.len() + && self + .slots + .iter() + .zip(other_inner.slots.iter()) + .all(|(slot, other_slot)| slot.array_eq(other_slot, precision)) + && V::array_eq(&self.data, &other_inner.data, precision) }) } } diff --git a/vortex-array/src/array/vtable/mod.rs b/vortex-array/src/array/vtable/mod.rs index c48fb26389f..79eed22585b 100644 --- a/vortex-array/src/array/vtable/mod.rs +++ b/vortex-array/src/array/vtable/mod.rs @@ -70,12 +70,12 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { ) -> VortexResult<()>; /// Hashes the array contents. - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision); + fn array_hash(data: &Self::ArrayData, state: &mut H, precision: Precision); /// Compares two arrays of the same type for equality. fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, + data: &Self::ArrayData, + other: &Self::ArrayData, precision: Precision, ) -> bool; diff --git a/vortex-array/src/arrays/bool/vtable/mod.rs b/vortex-array/src/arrays/bool/vtable/mod.rs index 48323a3a597..08ea0079c80 100644 --- a/vortex-array/src/arrays/bool/vtable/mod.rs +++ b/vortex-array/src/arrays/bool/vtable/mod.rs @@ -56,16 +56,12 @@ impl VTable for Bool { Self::ID } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.to_bit_buffer().array_hash(state, precision); - BoolArrayExt::validity(&array).array_hash(state, precision); + fn array_hash(data: &BoolData, state: &mut H, precision: Precision) { + data.to_bit_buffer().array_hash(state, precision); } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array - .to_bit_buffer() - .array_eq(&other.to_bit_buffer(), precision) - && BoolArrayExt::validity(&array).array_eq(&BoolArrayExt::validity(&other), precision) + fn array_eq(data: &BoolData, other: &BoolData, precision: Precision) -> bool { + data.to_bit_buffer().array_eq(&other.to_bit_buffer(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/chunked/vtable/mod.rs b/vortex-array/src/arrays/chunked/vtable/mod.rs index 983db6bb2d5..280a2fcf135 100644 --- a/vortex-array/src/arrays/chunked/vtable/mod.rs +++ b/vortex-array/src/arrays/chunked/vtable/mod.rs @@ -60,20 +60,11 @@ impl VTable for Chunked { Self::ID } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.chunk_offsets_array().array_hash(state, precision); - for chunk in array.iter_chunks() { - chunk.array_hash(state, precision); - } + fn array_hash(_data: &ChunkedData, _state: &mut H, _precision: Precision) { } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.chunk_offsets_array().array_eq(other.chunk_offsets_array(), precision) - && array.nchunks() == other.nchunks() - && array - .iter_chunks() - .zip(other.iter_chunks()) - .all(|(a, b)| a.array_eq(b, precision)) + fn array_eq(_data: &ChunkedData, _other: &ChunkedData, _precision: Precision) -> bool { + true } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/constant/vtable/mod.rs b/vortex-array/src/arrays/constant/vtable/mod.rs index c02153fe712..bba8f65c1e1 100644 --- a/vortex-array/src/arrays/constant/vtable/mod.rs +++ b/vortex-array/src/arrays/constant/vtable/mod.rs @@ -78,19 +78,19 @@ impl VTable for Constant { } fn array_hash( - array: ArrayView<'_, Self>, + data: &ConstantData, state: &mut H, _precision: Precision, ) { - array.scalar.hash(state); + data.scalar.hash(state); } fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, + data: &ConstantData, + other: &ConstantData, _precision: Precision, ) -> bool { - array.scalar == other.scalar + data.scalar == other.scalar } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/decimal/vtable/mod.rs b/vortex-array/src/arrays/decimal/vtable/mod.rs index 6dee4674ad7..65f0684207f 100644 --- a/vortex-array/src/arrays/decimal/vtable/mod.rs +++ b/vortex-array/src/arrays/decimal/vtable/mod.rs @@ -57,17 +57,13 @@ impl VTable for Decimal { Self::ID } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.values.array_hash(state, precision); - std::mem::discriminant(&array.values_type).hash(state); - DecimalArrayExt::validity(&array).array_hash(state, precision); + fn array_hash(data: &DecimalData, state: &mut H, precision: Precision) { + data.values.array_hash(state, precision); + std::mem::discriminant(&data.values_type).hash(state); } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.values.array_eq(&other.values, precision) - && array.values_type == other.values_type - && DecimalArrayExt::validity(&array) - .array_eq(&DecimalArrayExt::validity(&other), precision) + fn array_eq(data: &DecimalData, other: &DecimalData, precision: Precision) -> bool { + data.values.array_eq(&other.values, precision) && data.values_type == other.values_type } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/dict/vtable/mod.rs b/vortex-array/src/arrays/dict/vtable/mod.rs index 4a3ecee7b57..2f178b4bf49 100644 --- a/vortex-array/src/arrays/dict/vtable/mod.rs +++ b/vortex-array/src/arrays/dict/vtable/mod.rs @@ -78,14 +78,11 @@ impl VTable for Dict { Ok(()) } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.codes().array_hash(state, precision); - array.values().array_hash(state, precision); + fn array_hash(_data: &DictData, _state: &mut H, _precision: Precision) { } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.codes().array_eq(other.codes(), precision) - && array.values().array_eq(other.values(), precision) + fn array_eq(_data: &DictData, _other: &DictData, _precision: Precision) -> bool { + true } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/extension/vtable/mod.rs b/vortex-array/src/arrays/extension/vtable/mod.rs index 131b257a4f6..d67ecbc843e 100644 --- a/vortex-array/src/arrays/extension/vtable/mod.rs +++ b/vortex-array/src/arrays/extension/vtable/mod.rs @@ -47,17 +47,14 @@ impl VTable for Extension { } fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, + _data: &ExtensionData, + _state: &mut H, + _precision: Precision, ) { - array.storage_array().array_hash(state, precision); } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array - .storage_array() - .array_eq(other.storage_array(), precision) + fn array_eq(_data: &ExtensionData, _other: &ExtensionData, _precision: Precision) -> bool { + true } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/filter/vtable.rs b/vortex-array/src/arrays/filter/vtable.rs index b9a13a7e37a..ee3ff009825 100644 --- a/vortex-array/src/arrays/filter/vtable.rs +++ b/vortex-array/src/arrays/filter/vtable.rs @@ -87,14 +87,12 @@ impl VTable for Filter { Ok(()) } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.child().array_hash(state, precision); - array.mask.array_hash(state, precision); + fn array_hash(data: &FilterData, state: &mut H, precision: Precision) { + data.mask.array_hash(state, precision); } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.child().array_eq(other.child(), precision) - && array.mask.array_eq(&other.mask, precision) + fn array_eq(data: &FilterData, other: &FilterData, precision: Precision) -> bool { + data.mask.array_eq(&other.mask, precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 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 c21887fdde1..40b769242d3 100644 --- a/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs +++ b/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs @@ -53,26 +53,12 @@ impl VTable for FixedSizeList { Self::ID } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, - ) { - array.elements().array_hash(state, precision); - array.list_size().hash(state); - array.fixed_size_list_validity().array_hash(state, precision); + fn array_hash(data: &FixedSizeListData, state: &mut H, _precision: Precision) { + data.degenerate_len.hash(state); } - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - precision: Precision, - ) -> bool { - array.elements().array_eq(other.elements(), precision) - && array.list_size() == other.list_size() - && array - .fixed_size_list_validity() - .array_eq(&other.fixed_size_list_validity(), precision) + fn array_eq(data: &FixedSizeListData, other: &FixedSizeListData, _precision: Precision) -> bool { + data.degenerate_len == other.degenerate_len } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/list/vtable/mod.rs b/vortex-array/src/arrays/list/vtable/mod.rs index f5131605b6a..d2c1257cbcf 100644 --- a/vortex-array/src/arrays/list/vtable/mod.rs +++ b/vortex-array/src/arrays/list/vtable/mod.rs @@ -57,16 +57,11 @@ impl VTable for List { Self::ID } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.elements().array_hash(state, precision); - array.offsets().array_hash(state, precision); - array.list_validity().array_hash(state, precision); + fn array_hash(_data: &ListData, _state: &mut H, _precision: Precision) { } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.elements().array_eq(other.elements(), precision) - && array.offsets().array_eq(other.offsets(), precision) - && array.list_validity().array_eq(&other.list_validity(), precision) + fn array_eq(_data: &ListData, _other: &ListData, _precision: Precision) -> bool { + true } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/listview/vtable/mod.rs b/vortex-array/src/arrays/listview/vtable/mod.rs index 7b3f131f27c..3f517ca45db 100644 --- a/vortex-array/src/arrays/listview/vtable/mod.rs +++ b/vortex-array/src/arrays/listview/vtable/mod.rs @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::hash::Hash; use std::sync::Arc; use prost::Message; @@ -63,20 +64,12 @@ impl VTable for ListView { Self::ID } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.elements().array_hash(state, precision); - array.offsets().array_hash(state, precision); - array.sizes().array_hash(state, precision); - array.listview_validity().array_hash(state, precision); + fn array_hash(data: &ListViewData, state: &mut H, _precision: Precision) { + data.is_zero_copy_to_list().hash(state); } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.elements().array_eq(other.elements(), precision) - && array.offsets().array_eq(other.offsets(), precision) - && array.sizes().array_eq(other.sizes(), precision) - && array - .listview_validity() - .array_eq(&other.listview_validity(), precision) + fn array_eq(data: &ListViewData, other: &ListViewData, _precision: Precision) -> bool { + data.is_zero_copy_to_list() == other.is_zero_copy_to_list() } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/masked/vtable/mod.rs b/vortex-array/src/arrays/masked/vtable/mod.rs index 1621d2973d8..e7c172eb6f6 100644 --- a/vortex-array/src/arrays/masked/vtable/mod.rs +++ b/vortex-array/src/arrays/masked/vtable/mod.rs @@ -76,16 +76,11 @@ impl VTable for Masked { Ok(()) } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.child().array_hash(state, precision); - array.masked_validity().array_hash(state, precision); + fn array_hash(_data: &MaskedData, _state: &mut H, _precision: Precision) { } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.child().array_eq(other.child(), precision) - && array - .masked_validity() - .array_eq(&other.masked_validity(), precision) + fn array_eq(_data: &MaskedData, _other: &MaskedData, _precision: Precision) -> bool { + true } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/null/mod.rs b/vortex-array/src/arrays/null/mod.rs index e6c30e37c69..5f595ee4862 100644 --- a/vortex-array/src/arrays/null/mod.rs +++ b/vortex-array/src/arrays/null/mod.rs @@ -53,7 +53,7 @@ impl VTable for Null { } fn array_hash( - _array: ArrayView<'_, Self>, + _data: &NullData, _state: &mut H, _precision: Precision, ) { @@ -61,11 +61,11 @@ impl VTable for Null { } fn array_eq( - _array: ArrayView<'_, Self>, - _other: ArrayView<'_, Self>, + _data: &NullData, + _other: &NullData, _precision: Precision, ) -> bool { - // len and dtype are compared by ArrayInner; NullData has no additional fields. + // len, dtype, and slots are compared by ArrayInner; NullData has no additional fields. true } diff --git a/vortex-array/src/arrays/patched/vtable/mod.rs b/vortex-array/src/arrays/patched/vtable/mod.rs index e0e6e60b5cf..43e55351558 100644 --- a/vortex-array/src/arrays/patched/vtable/mod.rs +++ b/vortex-array/src/arrays/patched/vtable/mod.rs @@ -84,28 +84,13 @@ impl VTable for Patched { ArrayId::new_ref("vortex.patched") } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.offset().hash(state); - array.n_lanes().hash(state); - array.base_array().array_hash(state, precision); - array.lane_offsets().array_hash(state, precision); - array.patch_indices().array_hash(state, precision); - array.patch_values().array_hash(state, precision); + fn array_hash(data: &PatchedData, state: &mut H, _precision: Precision) { + data.offset.hash(state); + data.n_lanes.hash(state); } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.offset() == other.offset() - && array.n_lanes() == other.n_lanes() - && array.base_array().array_eq(other.base_array(), precision) - && array - .lane_offsets() - .array_eq(other.lane_offsets(), precision) - && array - .patch_indices() - .array_eq(other.patch_indices(), precision) - && array - .patch_values() - .array_eq(other.patch_values(), precision) + fn array_eq(data: &PatchedData, other: &PatchedData, _precision: Precision) -> bool { + data.offset == other.offset && data.n_lanes == other.n_lanes } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/primitive/vtable/mod.rs b/vortex-array/src/arrays/primitive/vtable/mod.rs index 14d5d47a22b..cb5d2b31e3d 100644 --- a/vortex-array/src/arrays/primitive/vtable/mod.rs +++ b/vortex-array/src/arrays/primitive/vtable/mod.rs @@ -49,15 +49,12 @@ impl VTable for Primitive { Self::ID } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.buffer.array_hash(state, precision); - PrimitiveArrayExt::validity(&array).array_hash(state, precision); + fn array_hash(data: &PrimitiveData, state: &mut H, precision: Precision) { + data.buffer.array_hash(state, precision); } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.buffer.array_eq(&other.buffer, precision) - && PrimitiveArrayExt::validity(&array) - .array_eq(&PrimitiveArrayExt::validity(&other), precision) + fn array_eq(data: &PrimitiveData, other: &PrimitiveData, precision: Precision) -> bool { + data.buffer.array_eq(&other.buffer, precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs index bf118094144..89340418e6f 100644 --- a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs +++ b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs @@ -88,23 +88,12 @@ impl VTable for ScalarFnVTable { Ok(()) } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.scalar_fn().hash(state); - for child in array.iter_children() { - child.array_hash(state, precision); - } + fn array_hash(data: &ScalarFnData, state: &mut H, _precision: Precision) { + data.scalar_fn().hash(state); } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - if array.scalar_fn() != other.scalar_fn() { - return false; - } - for (child, other_child) in array.iter_children().zip(other.iter_children()) { - if !child.array_eq(other_child, precision) { - return false; - } - } - true + fn array_eq(data: &ScalarFnData, other: &ScalarFnData, _precision: Precision) -> bool { + data.scalar_fn() == other.scalar_fn() } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/shared/vtable.rs b/vortex-array/src/arrays/shared/vtable.rs index cd3931f41c0..5101b5bb02a 100644 --- a/vortex-array/src/arrays/shared/vtable.rs +++ b/vortex-array/src/arrays/shared/vtable.rs @@ -63,15 +63,11 @@ impl VTable for Shared { Ok(()) } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - let current = array.current_array_ref(); - current.array_hash(state, precision); + fn array_hash(_data: &SharedData, _state: &mut H, _precision: Precision) { } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - let current = array.current_array_ref(); - let other_current = other.current_array_ref(); - current.array_eq(other_current, precision) + fn array_eq(_data: &SharedData, _other: &SharedData, _precision: Precision) -> bool { + true } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/slice/vtable.rs b/vortex-array/src/arrays/slice/vtable.rs index c29b07bc1aa..0397ac54c17 100644 --- a/vortex-array/src/arrays/slice/vtable.rs +++ b/vortex-array/src/arrays/slice/vtable.rs @@ -89,14 +89,13 @@ impl VTable for Slice { Ok(()) } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.child().array_hash(state, precision); - array.range.start.hash(state); - array.range.end.hash(state); + fn array_hash(data: &SliceData, state: &mut H, _precision: Precision) { + data.range.start.hash(state); + data.range.end.hash(state); } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.child().array_eq(other.child(), precision) && array.range == other.range + fn array_eq(data: &SliceData, other: &SliceData, _precision: Precision) -> bool { + data.range == other.range } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/struct_/vtable/mod.rs b/vortex-array/src/arrays/struct_/vtable/mod.rs index 347666b343b..6bcf40ba530 100644 --- a/vortex-array/src/arrays/struct_/vtable/mod.rs +++ b/vortex-array/src/arrays/struct_/vtable/mod.rs @@ -46,20 +46,11 @@ impl VTable for Struct { Self::ID } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - for field in array.iter_unmasked_fields() { - field.array_hash(state, precision); - } - array.struct_validity().array_hash(state, precision); + fn array_hash(_data: &StructData, _state: &mut H, _precision: Precision) { } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.slots().len() == other.slots().len() - && array - .iter_unmasked_fields() - .zip(other.iter_unmasked_fields()) - .all(|(a, b)| a.array_eq(b, precision)) - && array.struct_validity().array_eq(&other.struct_validity(), precision) + fn array_eq(_data: &StructData, _other: &StructData, _precision: Precision) -> bool { + true } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/varbin/vtable/mod.rs b/vortex-array/src/arrays/varbin/vtable/mod.rs index 2bbea1bf603..c4c4e05995e 100644 --- a/vortex-array/src/arrays/varbin/vtable/mod.rs +++ b/vortex-array/src/arrays/varbin/vtable/mod.rs @@ -58,16 +58,12 @@ impl VTable for VarBin { Self::ID } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.bytes().array_hash(state, precision); - array.offsets().array_hash(state, precision); - array.varbin_validity().array_hash(state, precision); + fn array_hash(data: &VarBinData, state: &mut H, precision: Precision) { + data.bytes().array_hash(state, precision); } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.bytes().array_eq(other.bytes(), precision) - && array.offsets().array_eq(other.offsets(), precision) - && array.varbin_validity().array_eq(&other.varbin_validity(), precision) + fn array_eq(data: &VarBinData, other: &VarBinData, precision: Precision) -> bool { + data.bytes().array_eq(other.bytes(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/varbinview/vtable/mod.rs b/vortex-array/src/arrays/varbinview/vtable/mod.rs index 101fd233c28..f2f1d65bae1 100644 --- a/vortex-array/src/arrays/varbinview/vtable/mod.rs +++ b/vortex-array/src/arrays/varbinview/vtable/mod.rs @@ -56,29 +56,21 @@ impl VTable for VarBinView { Self::ID } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - precision: Precision, - ) { - for buffer in array.buffers.iter() { + fn array_hash(data: &VarBinViewData, state: &mut H, precision: Precision) { + for buffer in data.buffers.iter() { buffer.array_hash(state, precision); } - array.views.array_hash(state, precision); - array.varbinview_validity().array_hash(state, precision); + data.views.array_hash(state, precision); } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.buffers.len() == other.buffers.len() - && array + fn array_eq(data: &VarBinViewData, other: &VarBinViewData, precision: Precision) -> bool { + data.buffers.len() == other.buffers.len() + && data .buffers .iter() .zip(other.buffers.iter()) .all(|(a, b)| a.array_eq(b, precision)) - && array.views.array_eq(&other.views, precision) - && array - .varbinview_validity() - .array_eq(&other.varbinview_validity(), precision) + && data.views.array_eq(&other.views, precision) } fn nbuffers(array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/variant/vtable/mod.rs b/vortex-array/src/arrays/variant/vtable/mod.rs index 22123dc9eaa..4f04085f567 100644 --- a/vortex-array/src/arrays/variant/vtable/mod.rs +++ b/vortex-array/src/arrays/variant/vtable/mod.rs @@ -83,12 +83,11 @@ impl VTable for Variant { Ok(()) } - fn array_hash(array: ArrayView<'_, Self>, state: &mut H, precision: Precision) { - array.child().array_hash(state, precision); + fn array_hash(_data: &VariantData, _state: &mut H, _precision: Precision) { } - fn array_eq(array: ArrayView<'_, Self>, other: ArrayView<'_, Self>, precision: Precision) -> bool { - array.child().array_eq(other.child(), precision) + fn array_eq(_data: &VariantData, _other: &VariantData, _precision: Precision) -> bool { + true } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-python/src/arrays/py/vtable.rs b/vortex-python/src/arrays/py/vtable.rs index f9a80a569eb..b7daf0529d0 100644 --- a/vortex-python/src/arrays/py/vtable.rs +++ b/vortex-python/src/arrays/py/vtable.rs @@ -59,20 +59,12 @@ impl VTable for PythonVTable { Ok(()) } - fn array_hash( - array: ArrayView<'_, Self>, - state: &mut H, - _precision: Precision, - ) { - Arc::as_ptr(&array.object).hash(state); - } - - fn array_eq( - array: ArrayView<'_, Self>, - other: ArrayView<'_, Self>, - _precision: Precision, - ) -> bool { - Arc::ptr_eq(&array.object, &other.object) + fn array_hash(data: &PythonArray, state: &mut H, _precision: Precision) { + Arc::as_ptr(&data.object).hash(state); + } + + fn array_eq(data: &PythonArray, other: &PythonArray, _precision: Precision) -> bool { + Arc::ptr_eq(&data.object, &other.object) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { From 73d7102986d05c698db2b9427c1f4ee539ab168e Mon Sep 17 00:00:00 2001 From: Nicholas Gates Date: Sat, 4 Apr 2026 20:47:23 -0400 Subject: [PATCH 05/10] Engine Signed-off-by: Nicholas Gates --- encodings/alp/public-api.lock | 82 +- encodings/alp/src/alp/array.rs | 65 +- encodings/alp/src/alp/compress.rs | 1 + encodings/alp/src/alp/compute/between.rs | 3 +- encodings/alp/src/alp/compute/cast.rs | 1 + encodings/alp/src/alp/compute/mask.rs | 1 + encodings/alp/src/alp_rd/array.rs | 133 +- encodings/alp/src/alp_rd/compute/filter.rs | 1 + encodings/alp/src/alp_rd/compute/take.rs | 1 + encodings/alp/src/alp_rd/ops.rs | 1 + encodings/bytebool/public-api.lock | 36 +- encodings/bytebool/src/array.rs | 72 +- encodings/datetime-parts/public-api.lock | 28 +- encodings/datetime-parts/src/array.rs | 61 +- encodings/datetime-parts/src/compute/rules.rs | 2 +- encodings/decimal-byte-parts/public-api.lock | 20 +- .../src/decimal_byte_parts/mod.rs | 31 +- .../fastlanes/benches/bitpacking_take.rs | 13 +- .../fastlanes/benches/compute_between.rs | 1 + encodings/fastlanes/public-api.lock | 158 +- .../src/bitpacking/array/bitpack_compress.rs | 1 + .../fastlanes/src/bitpacking/array/mod.rs | 78 +- .../src/bitpacking/compute/filter.rs | 1 + .../fastlanes/src/bitpacking/compute/take.rs | 1 + .../fastlanes/src/bitpacking/vtable/mod.rs | 8 +- .../src/bitpacking/vtable/operations.rs | 2 + encodings/fastlanes/src/delta/array/mod.rs | 34 +- encodings/fastlanes/src/delta/vtable/mod.rs | 10 +- .../fastlanes/src/for/array/for_compress.rs | 1 + encodings/fastlanes/src/for/array/mod.rs | 32 +- .../fastlanes/src/for/compute/is_sorted.rs | 1 + encodings/fastlanes/src/for/vtable/mod.rs | 9 +- .../fastlanes/src/for/vtable/validity.rs | 1 - encodings/fastlanes/src/rle/array/mod.rs | 37 +- .../fastlanes/src/rle/array/rle_compress.rs | 1 + encodings/fastlanes/src/rle/vtable/mod.rs | 16 +- encodings/fsst/public-api.lock | 24 +- encodings/fsst/src/array.rs | 48 +- encodings/parquet-variant/src/array.rs | 43 +- encodings/parquet-variant/src/operations.rs | 1 + encodings/parquet-variant/src/vtable.rs | 13 +- encodings/pco/public-api.lock | 4 +- encodings/pco/src/array.rs | 16 +- encodings/runend/public-api.lock | 42 +- encodings/runend/src/array.rs | 43 +- encodings/runend/src/arrow.rs | 46 +- encodings/runend/src/compute/take_from.rs | 1 + encodings/sequence/public-api.lock | 4 +- encodings/sequence/src/array.rs | 6 +- encodings/sparse/public-api.lock | 4 +- encodings/sparse/src/canonical.rs | 5 - encodings/sparse/src/lib.rs | 22 +- encodings/zigzag/public-api.lock | 26 +- encodings/zigzag/src/array.rs | 31 +- encodings/zstd/public-api.lock | 4 +- encodings/zstd/src/array.rs | 15 +- encodings/zstd/src/zstd_buffers.rs | 21 +- vortex-array/public-api.lock | 1924 +++++------------ vortex-array/src/array/erased.rs | 15 +- vortex-array/src/array/mod.rs | 74 +- vortex-array/src/array/typed.rs | 63 +- vortex-array/src/array/view.rs | 14 +- vortex-array/src/array/vtable/mod.rs | 31 +- vortex-array/src/arrays/bool/array.rs | 55 +- vortex-array/src/arrays/bool/vtable/mod.rs | 17 +- vortex-array/src/arrays/chunked/array.rs | 68 +- .../src/arrays/chunked/paired_chunks.rs | 5 +- vortex-array/src/arrays/chunked/vtable/mod.rs | 4 +- vortex-array/src/arrays/constant/array.rs | 2 - .../src/arrays/constant/vtable/mod.rs | 1 - vortex-array/src/arrays/decimal/array.rs | 115 +- vortex-array/src/arrays/decimal/vtable/mod.rs | 14 +- vortex-array/src/arrays/dict/array.rs | 60 +- vortex-array/src/arrays/dict/execute.rs | 1 - vortex-array/src/arrays/dict/vtable/mod.rs | 41 +- vortex-array/src/arrays/extension/array.rs | 29 +- .../src/arrays/extension/vtable/mod.rs | 32 +- .../src/arrays/extension/vtable/validity.rs | 1 - vortex-array/src/arrays/filter/array.rs | 52 +- vortex-array/src/arrays/filter/execute/mod.rs | 1 - .../src/arrays/fixed_size_list/array.rs | 68 +- .../src/arrays/fixed_size_list/vtable/mod.rs | 40 +- .../arrays/fixed_size_list/vtable/validity.rs | 1 - vortex-array/src/arrays/list/array.rs | 90 +- vortex-array/src/arrays/list/tests.rs | 18 +- vortex-array/src/arrays/list/vtable/mod.rs | 24 +- vortex-array/src/arrays/listview/array.rs | 106 +- .../src/arrays/listview/conversion.rs | 3 - .../src/arrays/listview/vtable/mod.rs | 28 +- .../src/arrays/listview/vtable/validity.rs | 1 - vortex-array/src/arrays/masked/array.rs | 63 +- vortex-array/src/arrays/masked/execute.rs | 1 - vortex-array/src/arrays/masked/vtable/mod.rs | 4 +- vortex-array/src/arrays/null/mod.rs | 2 - vortex-array/src/arrays/patched/array.rs | 63 +- .../src/arrays/patched/compute/compare.rs | 5 +- vortex-array/src/arrays/patched/vtable/mod.rs | 32 +- .../src/arrays/primitive/array/mod.rs | 55 +- .../src/arrays/primitive/vtable/mod.rs | 14 +- vortex-array/src/arrays/scalar_fn/array.rs | 37 +- .../src/arrays/scalar_fn/vtable/mod.rs | 37 +- vortex-array/src/arrays/shared/array.rs | 71 +- vortex-array/src/arrays/shared/vtable.rs | 2 - vortex-array/src/arrays/slice/array.rs | 42 +- vortex-array/src/arrays/slice/vtable.rs | 2 - vortex-array/src/arrays/struct_/array.rs | 64 +- vortex-array/src/arrays/struct_/vtable/mod.rs | 21 +- vortex-array/src/arrays/varbin/array.rs | 81 +- vortex-array/src/arrays/varbin/vtable/mod.rs | 24 +- vortex-array/src/arrays/varbinview/array.rs | 123 +- .../src/arrays/varbinview/compute/zip.rs | 1 - .../src/arrays/varbinview/vtable/mod.rs | 46 +- .../src/arrays/varbinview/vtable/validity.rs | 1 - vortex-array/src/arrays/variant/mod.rs | 60 +- vortex-array/src/arrays/variant/vtable/mod.rs | 6 +- .../src/arrays/variant/vtable/operations.rs | 1 - .../src/arrays/variant/vtable/validity.rs | 1 - vortex-array/src/arrow/executor/dictionary.rs | 1 - vortex-array/src/canonical.rs | 11 +- vortex-array/src/optimizer/mod.rs | 2 +- vortex-cuda/benches/dynamic_dispatch_cuda.rs | 2 + vortex-cuda/src/dynamic_dispatch/mod.rs | 2 + vortex-cuda/src/kernel/encodings/bitpacked.rs | 5 +- vortex-duckdb/src/exporter/decimal.rs | 2 +- vortex-layout/src/layouts/repartition.rs | 1 + vortex-python/src/arrays/builtins/chunked.rs | 1 - vortex-python/src/arrays/builtins/struct_.rs | 1 - vortex-python/src/arrays/py/vtable.rs | 4 - .../common_encoding_tree_throughput.rs | 4 + 129 files changed, 1650 insertions(+), 3606 deletions(-) diff --git a/encodings/alp/public-api.lock b/encodings/alp/public-api.lock index ddd44dcfe97..2afab0178de 100644 --- a/encodings/alp/public-api.lock +++ b/encodings/alp/public-api.lock @@ -32,9 +32,9 @@ pub type vortex_alp::ALP::OperationsVTable = vortex_alp::ALP pub type vortex_alp::ALP::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_alp::ALP::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_alp::ALP::array_eq(data: &vortex_alp::ALPData, other: &vortex_alp::ALPData, _precision: vortex_array::hash::Precision) -> bool -pub fn vortex_alp::ALP::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_alp::ALP::array_hash(data: &vortex_alp::ALPData, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_alp::ALP::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -166,9 +166,9 @@ pub type vortex_alp::ALPRD::OperationsVTable = vortex_alp::ALPRD pub type vortex_alp::ALPRD::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_alp::ALPRD::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_alp::ALPRD::array_eq(data: &vortex_alp::ALPRDData, other: &vortex_alp::ALPRDData, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_alp::ALPRD::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_alp::ALPRD::array_hash(data: &vortex_alp::ALPRDData, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_alp::ALPRD::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -330,13 +330,7 @@ pub fn vortex_alp::RDEncoder::from_parts(right_bit_width: u8, codes: alloc::vec: pub fn vortex_alp::RDEncoder::new(sample: &[T]) -> Self where T: vortex_alp::ALPRDFloat + vortex_array::dtype::ptype::NativePType, ::UINT: vortex_array::dtype::ptype::NativePType -pub trait vortex_alp::ALPArrayExt - -pub fn vortex_alp::ALPArrayExt::alp_data(&self) -> &vortex_alp::ALPData - -pub fn vortex_alp::ALPArrayExt::alp_len(&self) -> usize - -pub fn vortex_alp::ALPArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_alp::ALPArrayExt: vortex_array::array::typed::TypedArrayRef pub fn vortex_alp::ALPArrayExt::encoded(&self) -> &vortex_array::array::erased::ArrayRef @@ -344,33 +338,13 @@ pub fn vortex_alp::ALPArrayExt::exponents(&self) -> vortex_alp::Exponents pub fn vortex_alp::ALPArrayExt::patches(&self) -> core::option::Option -impl vortex_alp::ALPArrayExt for vortex_array::array::typed::Array - -pub fn vortex_array::array::typed::Array::alp_data(&self) -> &vortex_alp::ALPData - -pub fn vortex_array::array::typed::Array::alp_len(&self) -> usize - -pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::typed::Array::encoded(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_array::array::typed::Array::exponents(&self) -> vortex_alp::Exponents - -pub fn vortex_array::array::typed::Array::patches(&self) -> core::option::Option - -impl vortex_alp::ALPArrayExt for vortex_array::array::view::ArrayView<'_, vortex_alp::ALP> - -pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALP>::alp_data(&self) -> &vortex_alp::ALPData - -pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALP>::alp_len(&self) -> usize - -pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALP>::as_slots(&self) -> &[core::option::Option] +impl> vortex_alp::ALPArrayExt for T -pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALP>::encoded(&self) -> &vortex_array::array::erased::ArrayRef +pub fn T::encoded(&self) -> &vortex_array::array::erased::ArrayRef -pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALP>::exponents(&self) -> vortex_alp::Exponents +pub fn T::exponents(&self) -> vortex_alp::Exponents -pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALP>::patches(&self) -> core::option::Option +pub fn T::patches(&self) -> core::option::Option pub trait vortex_alp::ALPArrayOwnedExt @@ -512,11 +486,7 @@ pub fn f64::find_best_exponents(values: &[Self]) -> vortex_alp::Exponents pub fn f64::from_int(n: Self::ALPInt) -> Self -pub trait vortex_alp::ALPRDArrayExt - -pub fn vortex_alp::ALPRDArrayExt::alprd_data(&self) -> &vortex_alp::ALPRDData - -pub fn vortex_alp::ALPRDArrayExt::alprd_slots(&self) -> &[core::option::Option] +pub trait vortex_alp::ALPRDArrayExt: vortex_array::array::typed::TypedArrayRef pub fn vortex_alp::ALPRDArrayExt::left_parts(&self) -> &vortex_array::array::erased::ArrayRef @@ -528,37 +498,17 @@ pub fn vortex_alp::ALPRDArrayExt::right_bit_width(&self) -> u8 pub fn vortex_alp::ALPRDArrayExt::right_parts(&self) -> &vortex_array::array::erased::ArrayRef -impl vortex_alp::ALPRDArrayExt for vortex_array::array::typed::Array - -pub fn vortex_array::array::typed::Array::alprd_data(&self) -> &vortex_alp::ALPRDData - -pub fn vortex_array::array::typed::Array::alprd_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::typed::Array::left_parts(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_array::array::typed::Array::left_parts_dictionary(&self) -> &vortex_buffer::buffer::Buffer - -pub fn vortex_array::array::typed::Array::left_parts_patches(&self) -> core::option::Option - -pub fn vortex_array::array::typed::Array::right_bit_width(&self) -> u8 - -pub fn vortex_array::array::typed::Array::right_parts(&self) -> &vortex_array::array::erased::ArrayRef - -impl vortex_alp::ALPRDArrayExt for vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD> - -pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>::alprd_data(&self) -> &vortex_alp::ALPRDData - -pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>::alprd_slots(&self) -> &[core::option::Option] +impl> vortex_alp::ALPRDArrayExt for T -pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>::left_parts(&self) -> &vortex_array::array::erased::ArrayRef +pub fn T::left_parts(&self) -> &vortex_array::array::erased::ArrayRef -pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>::left_parts_dictionary(&self) -> &vortex_buffer::buffer::Buffer +pub fn T::left_parts_dictionary(&self) -> &vortex_buffer::buffer::Buffer -pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>::left_parts_patches(&self) -> core::option::Option +pub fn T::left_parts_patches(&self) -> core::option::Option -pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>::right_bit_width(&self) -> u8 +pub fn T::right_bit_width(&self) -> u8 -pub fn vortex_array::array::view::ArrayView<'_, vortex_alp::ALPRD>::right_parts(&self) -> &vortex_array::array::erased::ArrayRef +pub fn T::right_parts(&self) -> &vortex_array::array::erased::ArrayRef pub trait vortex_alp::ALPRDArrayOwnedExt diff --git a/encodings/alp/src/alp/array.rs b/encodings/alp/src/alp/array.rs index 4addc5be1ba..b04d35476bc 100644 --- a/encodings/alp/src/alp/array.rs +++ b/encodings/alp/src/alp/array.rs @@ -6,8 +6,6 @@ use std::hash::Hash; use prost::Message; use vortex_array::Array; -use vortex_array::ArrayEq; -use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -16,6 +14,7 @@ use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; use vortex_array::Precision; +use vortex_array::TypedArrayRef; use vortex_array::arrays::Primitive; use vortex_array::buffer::BufferHandle; use vortex_array::dtype::DType; @@ -76,7 +75,7 @@ impl VTable for ALP { ) } - fn array_hash(data: &ALPData, state: &mut H, precision: Precision) { + fn array_hash(data: &ALPData, state: &mut H, _precision: Precision) { data.exponents.hash(state); data.patch_offset.hash(state); data.patch_offset_within_chunk.hash(state); @@ -158,10 +157,6 @@ impl VTable for ALP { Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -457,12 +452,10 @@ impl ALP { let len = encoded.len(); let slots = ALPData::make_slots(&encoded, &patches); unsafe { - Array::from_parts_unchecked(ArrayParts::new( - ALP, - dtype, - len, - ALPData::new(encoded, exponents, patches), - ).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(ALP, dtype, len, ALPData::new(encoded, exponents, patches)) + .with_slots(slots), + ) } } @@ -521,27 +514,23 @@ impl ALPData { } } -pub trait ALPArrayExt { - fn alp_data(&self) -> &ALPData; - fn as_slots(&self) -> &[Option]; - fn alp_len(&self) -> usize; - +pub trait ALPArrayExt: TypedArrayRef { fn encoded(&self) -> &ArrayRef { - self.as_slots()[ENCODED_SLOT] + self.slots_ref()[ENCODED_SLOT] .as_ref() .vortex_expect("ALPArray encoded slot") } fn exponents(&self) -> Exponents { - self.alp_data().exponents + self.exponents } fn patches(&self) -> Option { patches_from_slots( - self.as_slots(), - self.alp_data().patch_offset, - self.alp_data().patch_offset_within_chunk, - self.alp_len(), + self.slots_ref(), + self.patch_offset, + self.patch_offset_within_chunk, + self.as_ref().len(), ) } } @@ -570,33 +559,7 @@ fn patches_from_slots( } } -impl ALPArrayExt for Array { - fn alp_data(&self) -> &ALPData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn alp_len(&self) -> usize { - self.len() - } -} - -impl ALPArrayExt for ArrayView<'_, ALP> { - fn alp_data(&self) -> &ALPData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn alp_len(&self) -> usize { - self.len() - } -} +impl> ALPArrayExt for T {} pub trait ALPArrayOwnedExt { fn into_parts(self) -> (ArrayRef, Exponents, Option); diff --git a/encodings/alp/src/alp/compress.rs b/encodings/alp/src/alp/compress.rs index 7fda471bbda..ec4af466cc9 100644 --- a/encodings/alp/src/alp/compress.rs +++ b/encodings/alp/src/alp/compress.rs @@ -133,6 +133,7 @@ mod tests { use vortex_buffer::Buffer; use vortex_buffer::buffer; + use crate::alp::array::ALPArrayExt; use super::*; use crate::decompress_into_array; diff --git a/encodings/alp/src/alp/compute/between.rs b/encodings/alp/src/alp/compute/between.rs index 907816560cd..aac162dc030 100644 --- a/encodings/alp/src/alp/compute/between.rs +++ b/encodings/alp/src/alp/compute/between.rs @@ -18,7 +18,7 @@ use vortex_array::scalar_fn::fns::between::StrictComparison; use vortex_error::VortexResult; use crate::ALP; -use crate::ALPArrayExt; +use crate::alp::array::ALPArrayExt; use crate::ALPFloat; use crate::match_each_alp_float_ptype; @@ -102,6 +102,7 @@ mod tests { use vortex_array::scalar_fn::fns::between::StrictComparison; use crate::ALPArray; + use crate::alp::array::ALPArrayExt; use crate::alp::compute::between::between_impl; use crate::alp_encode; diff --git a/encodings/alp/src/alp/compute/cast.rs b/encodings/alp/src/alp/compute/cast.rs index 6f4b5b29027..26cc5c55fbe 100644 --- a/encodings/alp/src/alp/compute/cast.rs +++ b/encodings/alp/src/alp/compute/cast.rs @@ -71,6 +71,7 @@ mod tests { use vortex_error::VortexExpect; use vortex_error::VortexResult; + use crate::alp::array::ALPArrayExt; use crate::alp_encode; #[test] diff --git a/encodings/alp/src/alp/compute/mask.rs b/encodings/alp/src/alp/compute/mask.rs index ffe081d2847..f040508b048 100644 --- a/encodings/alp/src/alp/compute/mask.rs +++ b/encodings/alp/src/alp/compute/mask.rs @@ -55,6 +55,7 @@ mod test { use vortex_array::compute::conformance::mask::test_mask_conformance; use vortex_buffer::buffer; + use crate::alp::array::ALPArrayExt; use crate::alp_encode; #[rstest] diff --git a/encodings/alp/src/alp_rd/array.rs b/encodings/alp/src/alp_rd/array.rs index 508522a5e9e..aeb395c9bf8 100644 --- a/encodings/alp/src/alp_rd/array.rs +++ b/encodings/alp/src/alp_rd/array.rs @@ -17,6 +17,7 @@ use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; use vortex_array::Precision; +use vortex_array::TypedArrayRef; use vortex_array::arrays::Primitive; use vortex_array::arrays::PrimitiveArray; use vortex_array::buffer::BufferHandle; @@ -85,16 +86,16 @@ impl VTable for ALPRD { fn array_hash(data: &ALPRDData, state: &mut H, precision: Precision) { data.left_parts_dictionary.array_hash(state, precision); data.right_bit_width.hash(state); - data.left_parts_patches.array_hash(state, precision); + data.patch_offset.hash(state); + data.patch_offset_within_chunk.hash(state); } fn array_eq(data: &ALPRDData, other: &ALPRDData, precision: Precision) -> bool { data.left_parts_dictionary .array_eq(&other.left_parts_dictionary, precision) && data.right_bit_width == other.right_bit_width - && data - .left_parts_patches - .array_eq(&other.left_parts_patches, precision) + && data.patch_offset == other.patch_offset + && data.patch_offset_within_chunk == other.patch_offset_within_chunk } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -124,7 +125,7 @@ impl VTable for ALPRD { 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())) + .map(|p| p.to_metadata(array.len(), p.dtype())) .transpose()?, } .encode_to_vec(), @@ -174,7 +175,7 @@ impl VTable for ALPRD { .patches .map(|p| { let indices = children.get(2, &p.indices_dtype()?, p.len()?)?; - let values = children.get(3, &left_parts_dtype, p.len()?)?; + let values = children.get(3, &left_parts_dtype.as_nonnullable(), p.len()?)?; Patches::new( len, @@ -204,10 +205,6 @@ impl VTable for ALPRD { Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -314,7 +311,8 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = [ #[derive(Clone, Debug)] pub struct ALPRDData { - left_parts_patches: Option, + patch_offset: Option, + patch_offset_within_chunk: Option, left_parts_dictionary: Buffer, right_bit_width: u8, } @@ -448,7 +446,7 @@ impl ALPRDData { patches.array_len(), ); vortex_ensure!( - patches.dtype() == left_parts.dtype(), + patches.dtype().eq_ignore_nullability(left_parts.dtype()), "patches dtype {} does not match left_parts dtype {}", patches.dtype(), left_parts.dtype(), @@ -474,7 +472,13 @@ impl ALPRDData { len, left_parts_from_slots(slots), right_parts_from_slots(slots), - self.left_parts_patches.as_ref(), + patches_from_slots( + slots, + self.patch_offset, + self.patch_offset_within_chunk, + len, + ) + .as_ref(), ) } @@ -495,13 +499,17 @@ impl ALPRDData { } // TODO(ngates): assert the DType, don't cast it. // TODO(joe): assert the DType, don't cast it in the next PR. - let mut patches = patches.cast_values(left_parts.dtype())?; + let mut patches = patches.cast_values(&left_parts.dtype().as_nonnullable())?; // Force execution of the lazy cast so patch values are materialized // before serialization. *patches.values_mut() = patches.values().to_canonical()?.into_array(); Ok(patches) }) .transpose()?; + let (patch_offset, patch_offset_within_chunk) = match &left_parts_patches { + Some(patches) => (Some(patches.offset()), patches.offset_within_chunk()), + None => (None, None), + }; Self::validate_parts( &dtype, @@ -512,7 +520,8 @@ impl ALPRDData { )?; Ok(Self { - left_parts_patches, + patch_offset, + patch_offset_within_chunk, left_parts_dictionary, right_bit_width, }) @@ -531,7 +540,10 @@ impl ALPRDData { drop(left_parts); drop(right_parts); Self { - left_parts_patches, + patch_offset: left_parts_patches.as_ref().map(Patches::offset), + patch_offset_within_chunk: left_parts_patches + .as_ref() + .and_then(Patches::offset_within_chunk), left_parts_dictionary, right_bit_width, } @@ -563,7 +575,7 @@ impl ALPRDData { pub fn into_parts(self, left_parts: ArrayRef, right_parts: ArrayRef) -> ALPRDDataParts { ALPRDDataParts { left_parts, - left_parts_patches: self.left_parts_patches, + left_parts_patches: None, left_parts_dictionary: self.left_parts_dictionary, right_parts, } @@ -574,11 +586,6 @@ impl ALPRDData { self.right_bit_width } - /// Patches of left-most bits. - pub fn left_parts_patches(&self) -> Option { - self.left_parts_patches.clone() - } - /// The dictionary that maps the codes in `left_parts` into bit patterns. #[inline] pub fn left_parts_dictionary(&self) -> &Buffer { @@ -598,50 +605,57 @@ fn right_parts_from_slots(slots: &[Option]) -> &ArrayRef { .vortex_expect("ALPRDArray right_parts slot") } -pub trait ALPRDArrayExt { - fn alprd_data(&self) -> &ALPRDData; - fn alprd_slots(&self) -> &[Option]; +fn patches_from_slots( + slots: &[Option], + patch_offset: Option, + patch_offset_within_chunk: Option, + len: usize, +) -> Option { + match (&slots[LP_PATCH_INDICES_SLOT], &slots[LP_PATCH_VALUES_SLOT]) { + (Some(indices), Some(values)) => { + let patch_offset = patch_offset.vortex_expect("ALPRDArray patch slots without offset"); + Some(unsafe { + Patches::new_unchecked( + len, + patch_offset, + indices.clone(), + values.clone(), + slots[LP_PATCH_CHUNK_OFFSETS_SLOT].clone(), + patch_offset_within_chunk, + ) + }) + } + _ => None, + } +} +pub trait ALPRDArrayExt: TypedArrayRef { fn left_parts(&self) -> &ArrayRef { - left_parts_from_slots(self.alprd_slots()) + left_parts_from_slots(self.slots_ref()) } fn right_parts(&self) -> &ArrayRef { - right_parts_from_slots(self.alprd_slots()) + right_parts_from_slots(self.slots_ref()) } fn right_bit_width(&self) -> u8 { - self.alprd_data().right_bit_width() + ALPRDData::right_bit_width(self) } fn left_parts_patches(&self) -> Option { - self.alprd_data().left_parts_patches() + patches_from_slots( + self.slots_ref(), + self.patch_offset, + self.patch_offset_within_chunk, + self.as_ref().len(), + ) } fn left_parts_dictionary(&self) -> &Buffer { - self.alprd_data().left_parts_dictionary() - } -} - -impl ALPRDArrayExt for Array { - fn alprd_data(&self) -> &ALPRDData { - self.data() - } - - fn alprd_slots(&self) -> &[Option] { - self.slots() - } -} - -impl ALPRDArrayExt for ArrayView<'_, ALPRD> { - fn alprd_data(&self) -> &ALPRDData { - self.data() - } - - fn alprd_slots(&self) -> &[Option] { - self.slots() + ALPRDData::left_parts_dictionary(self) } } +impl> ALPRDArrayExt for T {} pub trait ALPRDArrayOwnedExt { fn into_data_parts(self) -> ALPRDDataParts; @@ -649,14 +663,17 @@ pub trait ALPRDArrayOwnedExt { impl ALPRDArrayOwnedExt for Array { fn into_data_parts(self) -> ALPRDDataParts { - let mut parts = self.into_parts(); - let left_parts = parts.slots[LEFT_PARTS_SLOT] - .take() - .vortex_expect("ALPRDArray left_parts slot"); - let right_parts = parts.slots[RIGHT_PARTS_SLOT] - .take() - .vortex_expect("ALPRDArray right_parts slot"); - parts.data.into_parts(left_parts, right_parts) + let left_parts_patches = self.left_parts_patches(); + let left_parts = self.left_parts().clone(); + let right_parts = self.right_parts().clone(); + let mut parts = ALPRDDataParts { + left_parts, + left_parts_patches: None, + left_parts_dictionary: self.left_parts_dictionary().clone(), + right_parts, + }; + parts.left_parts_patches = left_parts_patches; + parts } } diff --git a/encodings/alp/src/alp_rd/compute/filter.rs b/encodings/alp/src/alp_rd/compute/filter.rs index fe7df4a5b7e..8815a049dc6 100644 --- a/encodings/alp/src/alp_rd/compute/filter.rs +++ b/encodings/alp/src/alp_rd/compute/filter.rs @@ -49,6 +49,7 @@ mod test { use vortex_buffer::buffer; use vortex_mask::Mask; + use crate::ALPRDArrayExt; use crate::ALPRDFloat; use crate::RDEncoder; diff --git a/encodings/alp/src/alp_rd/compute/take.rs b/encodings/alp/src/alp_rd/compute/take.rs index cad39cbc1ff..fe12255f063 100644 --- a/encodings/alp/src/alp_rd/compute/take.rs +++ b/encodings/alp/src/alp_rd/compute/take.rs @@ -63,6 +63,7 @@ mod test { use vortex_array::assert_arrays_eq; use vortex_array::compute::conformance::take::test_take_conformance; + use crate::ALPRDArrayExt; use crate::ALPRDFloat; use crate::RDEncoder; diff --git a/encodings/alp/src/alp_rd/ops.rs b/encodings/alp/src/alp_rd/ops.rs index 0d5f811a590..ed4dcba2dfd 100644 --- a/encodings/alp/src/alp_rd/ops.rs +++ b/encodings/alp/src/alp_rd/ops.rs @@ -70,6 +70,7 @@ mod test { use vortex_array::assert_arrays_eq; use vortex_array::scalar::Scalar; + use crate::ALPRDArrayExt; use crate::ALPRDFloat; use crate::RDEncoder; diff --git a/encodings/bytebool/public-api.lock b/encodings/bytebool/public-api.lock index 535634aef7b..86963b1b487 100644 --- a/encodings/bytebool/public-api.lock +++ b/encodings/bytebool/public-api.lock @@ -28,9 +28,9 @@ pub type vortex_bytebool::ByteBool::OperationsVTable = vortex_bytebool::ByteBool pub type vortex_bytebool::ByteBool::ValidityVTable = vortex_bytebool::ByteBool -pub fn vortex_bytebool::ByteBool::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_bytebool::ByteBool::array_eq(data: &vortex_bytebool::ByteBoolData, other: &vortex_bytebool::ByteBoolData, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_bytebool::ByteBool::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_bytebool::ByteBool::array_hash(data: &vortex_bytebool::ByteBoolData, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_bytebool::ByteBool::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -114,40 +114,16 @@ impl core::fmt::Debug for vortex_bytebool::ByteBoolData pub fn vortex_bytebool::ByteBoolData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub trait vortex_bytebool::ByteBoolArrayExt - -pub fn vortex_bytebool::ByteBoolArrayExt::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_bytebool::ByteBoolArrayExt::byte_bool_data(&self) -> &vortex_bytebool::ByteBoolData - -pub fn vortex_bytebool::ByteBoolArrayExt::len(&self) -> usize +pub trait vortex_bytebool::ByteBoolArrayExt: vortex_array::array::typed::TypedArrayRef pub fn vortex_bytebool::ByteBoolArrayExt::validity(&self) -> vortex_array::validity::Validity pub fn vortex_bytebool::ByteBoolArrayExt::validity_mask(&self) -> vortex_mask::Mask -impl vortex_bytebool::ByteBoolArrayExt for vortex_array::array::typed::Array - -pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::typed::Array::byte_bool_data(&self) -> &vortex_bytebool::ByteBoolData - -pub fn vortex_array::array::typed::Array::len(&self) -> usize - -pub fn vortex_array::array::typed::Array::validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::array::typed::Array::validity_mask(&self) -> vortex_mask::Mask - -impl vortex_bytebool::ByteBoolArrayExt for vortex_array::array::view::ArrayView<'_, vortex_bytebool::ByteBool> - -pub fn vortex_array::array::view::ArrayView<'_, vortex_bytebool::ByteBool>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::view::ArrayView<'_, vortex_bytebool::ByteBool>::byte_bool_data(&self) -> &vortex_bytebool::ByteBoolData - -pub fn vortex_array::array::view::ArrayView<'_, vortex_bytebool::ByteBool>::len(&self) -> usize +impl> vortex_bytebool::ByteBoolArrayExt for T -pub fn vortex_array::array::view::ArrayView<'_, vortex_bytebool::ByteBool>::validity(&self) -> vortex_array::validity::Validity +pub fn T::validity(&self) -> vortex_array::validity::Validity -pub fn vortex_array::array::view::ArrayView<'_, vortex_bytebool::ByteBool>::validity_mask(&self) -> vortex_mask::Mask +pub fn T::validity_mask(&self) -> vortex_mask::Mask pub type vortex_bytebool::ByteBoolArray = vortex_array::array::typed::Array diff --git a/encodings/bytebool/src/array.rs b/encodings/bytebool/src/array.rs index 75468cb23af..e304419e18b 100644 --- a/encodings/bytebool/src/array.rs +++ b/encodings/bytebool/src/array.rs @@ -14,6 +14,7 @@ use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; use vortex_array::Precision; +use vortex_array::TypedArrayRef; use vortex_array::arrays::BoolArray; use vortex_array::buffer::BufferHandle; use vortex_array::dtype::DType; @@ -124,10 +125,6 @@ impl VTable for ByteBool { Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -168,56 +165,20 @@ pub struct ByteBoolData { buffer: BufferHandle, } -pub trait ByteBoolArrayExt { - fn byte_bool_data(&self) -> &ByteBoolData; - fn as_slots(&self) -> &[Option]; - fn len(&self) -> usize; - fn dtype(&self) -> &DType; - +pub trait ByteBoolArrayExt: TypedArrayRef { fn validity(&self) -> Validity { - child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.dtype().nullability()) + child_to_validity( + &self.slots_ref()[VALIDITY_SLOT], + self.as_ref().dtype().nullability(), + ) } fn validity_mask(&self) -> Mask { - self.validity().to_mask(self.len()) - } -} - -impl ByteBoolArrayExt for Array { - fn byte_bool_data(&self) -> &ByteBoolData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn len(&self) -> usize { - Array::len(self) - } - - fn dtype(&self) -> &DType { - Array::dtype(self) + self.validity().to_mask(self.as_ref().len()) } } -impl ByteBoolArrayExt for ArrayView<'_, ByteBool> { - fn byte_bool_data(&self) -> &ByteBoolData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn len(&self) -> usize { - ArrayView::len(self) - } - - fn dtype(&self) -> &DType { - ArrayView::dtype(self) - } -} +impl> ByteBoolArrayExt for T {} #[derive(Clone, Debug)] pub struct ByteBool; @@ -231,7 +192,9 @@ impl ByteBool { let data = ByteBoolData::new(buffer, validity); let len = data.len(); unsafe { - Array::from_parts_unchecked(ArrayParts::new(ByteBool, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(ByteBool, dtype, len, data).with_slots(slots), + ) } } @@ -243,7 +206,9 @@ impl ByteBool { let len = data.len(); let slots = ByteBoolData::make_slots(&validity, len); unsafe { - Array::from_parts_unchecked(ArrayParts::new(ByteBool, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(ByteBool, dtype, len, data).with_slots(slots), + ) } } @@ -255,7 +220,9 @@ impl ByteBool { let len = data.len(); let slots = ByteBoolData::make_slots(&validity, len); unsafe { - Array::from_parts_unchecked(ArrayParts::new(ByteBool, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(ByteBool, dtype, len, data).with_slots(slots), + ) } } } @@ -298,9 +265,7 @@ impl ByteBoolData { vlen ); } - Self { - buffer, - } + Self { buffer } } /// Returns the number of elements in the array. @@ -331,7 +296,6 @@ impl ByteBoolData { } } - impl ValidityVTable for ByteBool { fn validity(array: ArrayView<'_, ByteBool>) -> VortexResult { Ok(ByteBoolArrayExt::validity(&array)) diff --git a/encodings/datetime-parts/public-api.lock b/encodings/datetime-parts/public-api.lock index 99bb5a4a6a0..30cd25dbcc2 100644 --- a/encodings/datetime-parts/public-api.lock +++ b/encodings/datetime-parts/public-api.lock @@ -26,9 +26,9 @@ pub type vortex_datetime_parts::DateTimeParts::OperationsVTable = vortex_datetim pub type vortex_datetime_parts::DateTimeParts::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_datetime_parts::DateTimeParts::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_datetime_parts::DateTimeParts::array_eq(_data: &vortex_datetime_parts::DateTimePartsData, _other: &vortex_datetime_parts::DateTimePartsData, _precision: vortex_array::hash::Precision) -> bool -pub fn vortex_datetime_parts::DateTimeParts::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_datetime_parts::DateTimeParts::array_hash(_data: &vortex_datetime_parts::DateTimePartsData, _state: &mut H, _precision: vortex_array::hash::Precision) pub fn vortex_datetime_parts::DateTimeParts::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -162,9 +162,7 @@ pub vortex_datetime_parts::TemporalParts::seconds: vortex_array::array::erased:: pub vortex_datetime_parts::TemporalParts::subseconds: vortex_array::array::erased::ArrayRef -pub trait vortex_datetime_parts::DateTimePartsArrayExt - -pub fn vortex_datetime_parts::DateTimePartsArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_datetime_parts::DateTimePartsArrayExt: vortex_array::array::typed::TypedArrayRef pub fn vortex_datetime_parts::DateTimePartsArrayExt::days(&self) -> &vortex_array::array::erased::ArrayRef @@ -172,25 +170,13 @@ pub fn vortex_datetime_parts::DateTimePartsArrayExt::seconds(&self) -> &vortex_a pub fn vortex_datetime_parts::DateTimePartsArrayExt::subseconds(&self) -> &vortex_array::array::erased::ArrayRef -impl vortex_datetime_parts::DateTimePartsArrayExt for vortex_array::array::typed::Array - -pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::typed::Array::days(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_array::array::typed::Array::seconds(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_array::array::typed::Array::subseconds(&self) -> &vortex_array::array::erased::ArrayRef - -impl vortex_datetime_parts::DateTimePartsArrayExt for vortex_array::array::view::ArrayView<'_, vortex_datetime_parts::DateTimeParts> - -pub fn vortex_array::array::view::ArrayView<'_, vortex_datetime_parts::DateTimeParts>::as_slots(&self) -> &[core::option::Option] +impl> vortex_datetime_parts::DateTimePartsArrayExt for T -pub fn vortex_array::array::view::ArrayView<'_, vortex_datetime_parts::DateTimeParts>::days(&self) -> &vortex_array::array::erased::ArrayRef +pub fn T::days(&self) -> &vortex_array::array::erased::ArrayRef -pub fn vortex_array::array::view::ArrayView<'_, vortex_datetime_parts::DateTimeParts>::seconds(&self) -> &vortex_array::array::erased::ArrayRef +pub fn T::seconds(&self) -> &vortex_array::array::erased::ArrayRef -pub fn vortex_array::array::view::ArrayView<'_, vortex_datetime_parts::DateTimeParts>::subseconds(&self) -> &vortex_array::array::erased::ArrayRef +pub fn T::subseconds(&self) -> &vortex_array::array::erased::ArrayRef pub fn vortex_datetime_parts::initialize(session: &vortex_session::VortexSession) diff --git a/encodings/datetime-parts/src/array.rs b/encodings/datetime-parts/src/array.rs index 1d5b1a251f5..4fe10ede53a 100644 --- a/encodings/datetime-parts/src/array.rs +++ b/encodings/datetime-parts/src/array.rs @@ -5,8 +5,6 @@ use std::fmt::Debug; use prost::Message; use vortex_array::Array; -use vortex_array::ArrayEq; -use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -15,6 +13,7 @@ use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; use vortex_array::Precision; +use vortex_array::TypedArrayRef; use vortex_array::arrays::TemporalArray; use vortex_array::buffer::BufferHandle; use vortex_array::dtype::DType; @@ -36,6 +35,8 @@ use vortex_session::VortexSession; use crate::canonical::decode_to_temporal; use crate::compute::kernel::PARENT_KERNELS; use crate::compute::rules::PARENT_RULES; +use crate::split_temporal; +use crate::TemporalParts; vtable!(DateTimeParts, DateTimeParts, DateTimePartsData); @@ -81,7 +82,7 @@ impl VTable for DateTimeParts { fn validate( &self, - data: &Self::ArrayData, + _data: &Self::ArrayData, dtype: &DType, len: usize, slots: &[Option], @@ -178,10 +179,6 @@ impl VTable for DateTimeParts { Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -220,42 +217,29 @@ pub(super) const NUM_SLOTS: usize = 3; pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["days", "seconds", "subseconds"]; #[derive(Clone, Debug)] -pub struct DateTimePartsData { -} - -pub trait DateTimePartsArrayExt { - fn as_slots(&self) -> &[Option]; +pub struct DateTimePartsData {} +pub trait DateTimePartsArrayExt: TypedArrayRef { fn days(&self) -> &ArrayRef { - self.as_slots()[DAYS_SLOT] + self.slots_ref()[DAYS_SLOT] .as_ref() .vortex_expect("DateTimePartsArray days slot") } fn seconds(&self) -> &ArrayRef { - self.as_slots()[SECONDS_SLOT] + self.slots_ref()[SECONDS_SLOT] .as_ref() .vortex_expect("DateTimePartsArray seconds slot") } fn subseconds(&self) -> &ArrayRef { - self.as_slots()[SUBSECONDS_SLOT] + self.slots_ref()[SUBSECONDS_SLOT] .as_ref() .vortex_expect("DateTimePartsArray subseconds slot") } } -impl DateTimePartsArrayExt for Array { - fn as_slots(&self) -> &[Option] { - self.slots() - } -} - -impl DateTimePartsArrayExt for ArrayView<'_, DateTimeParts> { - fn as_slots(&self) -> &[Option] { - self.slots() - } -} +impl> DateTimePartsArrayExt for T {} #[derive(Clone, Debug)] pub struct DateTimeParts; @@ -277,25 +261,22 @@ impl DateTimeParts { Some(subseconds.clone()), ]; let data = DateTimePartsData::try_new(dtype.clone(), days, seconds, subseconds)?; - Ok( - unsafe { - Array::from_parts_unchecked( - ArrayParts::new(DateTimeParts, dtype, len, data).with_slots(slots), - ) - }, - ) + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(DateTimeParts, dtype, len, data).with_slots(slots), + ) + }) } /// Construct a [`DateTimePartsArray`] from a [`TemporalArray`]. pub fn try_from_temporal(temporal: TemporalArray) -> VortexResult { let dtype = temporal.dtype().clone(); - let len = temporal.temporal_values().len(); - let data = DateTimePartsData::try_from(temporal)?; - Ok( - unsafe { - Array::from_parts_unchecked(ArrayParts::new(DateTimeParts, dtype, len, data)) - }, - ) + let TemporalParts { + days, + seconds, + subseconds, + } = split_temporal(temporal)?; + Self::try_new(dtype, days, seconds, subseconds) } } diff --git a/encodings/datetime-parts/src/compute/rules.rs b/encodings/datetime-parts/src/compute/rules.rs index e2c9cbaa774..7bf5e874e1e 100644 --- a/encodings/datetime-parts/src/compute/rules.rs +++ b/encodings/datetime-parts/src/compute/rules.rs @@ -25,6 +25,7 @@ use vortex_array::scalar_fn::fns::mask::MaskReduceAdaptor; use vortex_error::VortexExpect; use vortex_error::VortexResult; +use crate::array::DateTimePartsArrayExt; use crate::DateTimeParts; use crate::timestamp; pub(crate) const PARENT_RULES: ParentRuleSet = ParentRuleSet::new(&[ @@ -363,4 +364,3 @@ mod tests { assert_eq!(optimized.as_bool_typed().true_count().unwrap(), 1); } } -use crate::array::DateTimePartsArrayExt; diff --git a/encodings/decimal-byte-parts/public-api.lock b/encodings/decimal-byte-parts/public-api.lock index 5dd5101f0b7..5a6cb6ddc47 100644 --- a/encodings/decimal-byte-parts/public-api.lock +++ b/encodings/decimal-byte-parts/public-api.lock @@ -24,9 +24,9 @@ pub type vortex_decimal_byte_parts::DecimalByteParts::OperationsVTable = vortex_ pub type vortex_decimal_byte_parts::DecimalByteParts::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_decimal_byte_parts::DecimalByteParts::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_decimal_byte_parts::DecimalByteParts::array_eq(_data: &vortex_decimal_byte_parts::DecimalBytePartsData, _other: &vortex_decimal_byte_parts::DecimalBytePartsData, _precision: vortex_array::hash::Precision) -> bool -pub fn vortex_decimal_byte_parts::DecimalByteParts::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_decimal_byte_parts::DecimalByteParts::array_hash(_data: &vortex_decimal_byte_parts::DecimalBytePartsData, _state: &mut H, _precision: vortex_array::hash::Precision) pub fn vortex_decimal_byte_parts::DecimalByteParts::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -128,23 +128,13 @@ pub fn vortex_decimal_byte_parts::DecimalBytesPartsMetadata::clear(&mut self) pub fn vortex_decimal_byte_parts::DecimalBytesPartsMetadata::encoded_len(&self) -> usize -pub trait vortex_decimal_byte_parts::DecimalBytePartsArrayExt - -pub fn vortex_decimal_byte_parts::DecimalBytePartsArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_decimal_byte_parts::DecimalBytePartsArrayExt: vortex_array::array::typed::TypedArrayRef pub fn vortex_decimal_byte_parts::DecimalBytePartsArrayExt::msp(&self) -> &vortex_array::array::erased::ArrayRef -impl vortex_decimal_byte_parts::DecimalBytePartsArrayExt for vortex_array::array::typed::Array - -pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::typed::Array::msp(&self) -> &vortex_array::array::erased::ArrayRef - -impl vortex_decimal_byte_parts::DecimalBytePartsArrayExt for vortex_array::array::view::ArrayView<'_, vortex_decimal_byte_parts::DecimalByteParts> - -pub fn vortex_array::array::view::ArrayView<'_, vortex_decimal_byte_parts::DecimalByteParts>::as_slots(&self) -> &[core::option::Option] +impl> vortex_decimal_byte_parts::DecimalBytePartsArrayExt for T -pub fn vortex_array::array::view::ArrayView<'_, vortex_decimal_byte_parts::DecimalByteParts>::msp(&self) -> &vortex_array::array::erased::ArrayRef +pub fn T::msp(&self) -> &vortex_array::array::erased::ArrayRef pub fn vortex_decimal_byte_parts::initialize(session: &vortex_session::VortexSession) 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 14ae0dca505..0ea4d5d5d3f 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs @@ -9,14 +9,13 @@ mod rules; mod slice; use prost::Message as _; -use vortex_array::ArrayEq; -use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayRef; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; use vortex_array::Precision; +use vortex_array::TypedArrayRef; use vortex_array::arrays::DecimalArray; use vortex_array::arrays::PrimitiveArray; use vortex_array::buffer::BufferHandle; @@ -65,7 +64,7 @@ impl VTable for DecimalByteParts { fn validate( &self, - data: &Self::ArrayData, + _data: &Self::ArrayData, dtype: &DType, len: usize, slots: &[Option], @@ -144,10 +143,6 @@ impl VTable for DecimalByteParts { Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -196,27 +191,15 @@ pub struct DecimalBytePartsDataParts { pub msp: ArrayRef, } -pub trait DecimalBytePartsArrayExt { - fn as_slots(&self) -> &[Option]; - +pub trait DecimalBytePartsArrayExt: TypedArrayRef { fn msp(&self) -> &ArrayRef { - self.as_slots()[MSP_SLOT] + self.slots_ref()[MSP_SLOT] .as_ref() .vortex_expect("DecimalBytePartsArray msp slot") } } -impl DecimalBytePartsArrayExt for Array { - fn as_slots(&self) -> &[Option] { - self.slots() - } -} - -impl DecimalBytePartsArrayExt for ArrayView<'_, DecimalByteParts> { - fn as_slots(&self) -> &[Option] { - self.slots() - } -} +impl> DecimalBytePartsArrayExt for T {} impl DecimalBytePartsData { pub fn validate( @@ -241,7 +224,9 @@ impl DecimalBytePartsData { pub(crate) fn try_new(msp: ArrayRef, decimal_dtype: DecimalDType) -> VortexResult { let dtype = DType::Decimal(decimal_dtype, msp.dtype().nullability()); Self::validate(&msp, decimal_dtype, &dtype, msp.len())?; - Ok(Self { _lower_parts: Vec::new() }) + Ok(Self { + _lower_parts: Vec::new(), + }) } } diff --git a/encodings/fastlanes/benches/bitpacking_take.rs b/encodings/fastlanes/benches/bitpacking_take.rs index 6129f479d47..61bd234c0f1 100644 --- a/encodings/fastlanes/benches/bitpacking_take.rs +++ b/encodings/fastlanes/benches/bitpacking_take.rs @@ -17,6 +17,7 @@ use vortex_array::arrays::PrimitiveArray; use vortex_array::validity::Validity; use vortex_buffer::Buffer; use vortex_buffer::buffer; +use vortex_fastlanes::BitPackedArrayExt; use vortex_fastlanes::bitpack_compress::bitpack_to_best_bit_width; fn main() { @@ -160,9 +161,9 @@ fn patched_take_10_stratified(bencher: Bencher) { let uncompressed = PrimitiveArray::new(values, Validity::NonNullable); let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); - assert!(packed.patches(packed.len()).is_some()); + assert!(packed.patches().is_some()); assert_eq!( - packed.patches(packed.len()).unwrap().num_patches(), + packed.patches().unwrap().num_patches(), NUM_EXCEPTIONS as usize ); @@ -185,9 +186,9 @@ fn patched_take_10_contiguous(bencher: Bencher) { let uncompressed = PrimitiveArray::new(values, Validity::NonNullable); let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); - assert!(packed.patches(packed.len()).is_some()); + assert!(packed.patches().is_some()); assert_eq!( - packed.patches(packed.len()).unwrap().num_patches(), + packed.patches().unwrap().num_patches(), NUM_EXCEPTIONS as usize ); @@ -249,9 +250,9 @@ fn patched_take_10k_contiguous_patches(bencher: Bencher) { let uncompressed = PrimitiveArray::new(values, Validity::NonNullable); let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); - assert!(packed.patches(packed.len()).is_some()); + assert!(packed.patches().is_some()); assert_eq!( - packed.patches(packed.len()).unwrap().num_patches(), + packed.patches().unwrap().num_patches(), NUM_EXCEPTIONS as usize ); diff --git a/encodings/fastlanes/benches/compute_between.rs b/encodings/fastlanes/benches/compute_between.rs index 799e6d081fc..440bcafddf8 100644 --- a/encodings/fastlanes/benches/compute_between.rs +++ b/encodings/fastlanes/benches/compute_between.rs @@ -6,6 +6,7 @@ use num_traits::NumCast; use rand::RngExt; use rand::rngs::StdRng; use vortex_alp::ALP; +use vortex_alp::ALPArrayExt; use vortex_alp::alp_encode; use vortex_array::ArrayRef; use vortex_array::IntoArray; diff --git a/encodings/fastlanes/public-api.lock b/encodings/fastlanes/public-api.lock index 488abace4bd..26e0269bcc1 100644 --- a/encodings/fastlanes/public-api.lock +++ b/encodings/fastlanes/public-api.lock @@ -146,9 +146,9 @@ pub type vortex_fastlanes::BitPacked::ValidityVTable = vortex_fastlanes::BitPack pub fn vortex_fastlanes::BitPacked::append_to_builder(array: vortex_array::array::view::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_fastlanes::BitPacked::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fastlanes::BitPacked::array_eq(data: &vortex_fastlanes::BitPackedData, other: &vortex_fastlanes::BitPackedData, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fastlanes::BitPacked::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fastlanes::BitPacked::array_hash(data: &vortex_fastlanes::BitPackedData, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_fastlanes::BitPacked::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -270,9 +270,9 @@ pub type vortex_fastlanes::Delta::OperationsVTable = vortex_fastlanes::Delta pub type vortex_fastlanes::Delta::ValidityVTable = vortex_fastlanes::Delta -pub fn vortex_fastlanes::Delta::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fastlanes::Delta::array_eq(data: &vortex_fastlanes::DeltaData, other: &vortex_fastlanes::DeltaData, _precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fastlanes::Delta::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fastlanes::Delta::array_hash(data: &vortex_fastlanes::DeltaData, state: &mut H, _precision: vortex_array::hash::Precision) pub fn vortex_fastlanes::Delta::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -352,9 +352,9 @@ pub type vortex_fastlanes::FoR::OperationsVTable = vortex_fastlanes::FoR pub type vortex_fastlanes::FoR::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_fastlanes::FoR::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fastlanes::FoR::array_eq(data: &vortex_fastlanes::FoRData, other: &vortex_fastlanes::FoRData, _precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fastlanes::FoR::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fastlanes::FoR::array_hash(data: &vortex_fastlanes::FoRData, state: &mut H, _precision: vortex_array::hash::Precision) pub fn vortex_fastlanes::FoR::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -454,9 +454,9 @@ pub type vortex_fastlanes::RLE::OperationsVTable = vortex_fastlanes::RLE pub type vortex_fastlanes::RLE::ValidityVTable = vortex_fastlanes::RLE -pub fn vortex_fastlanes::RLE::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fastlanes::RLE::array_eq(data: &vortex_fastlanes::RLEData, other: &vortex_fastlanes::RLEData, _precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fastlanes::RLE::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fastlanes::RLE::array_hash(data: &vortex_fastlanes::RLEData, state: &mut H, _precision: vortex_array::hash::Precision) pub fn vortex_fastlanes::RLE::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -520,18 +520,10 @@ impl core::fmt::Debug for vortex_fastlanes::RLEData pub fn vortex_fastlanes::RLEData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub trait vortex_fastlanes::BitPackedArrayExt - -pub fn vortex_fastlanes::BitPackedArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_fastlanes::BitPackedArrayExt: vortex_array::array::typed::TypedArrayRef pub fn vortex_fastlanes::BitPackedArrayExt::bit_width(&self) -> u8 -pub fn vortex_fastlanes::BitPackedArrayExt::bitpacked_data(&self) -> &vortex_fastlanes::BitPackedData - -pub fn vortex_fastlanes::BitPackedArrayExt::bitpacked_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_fastlanes::BitPackedArrayExt::bitpacked_len(&self) -> usize - pub fn vortex_fastlanes::BitPackedArrayExt::offset(&self) -> u16 pub fn vortex_fastlanes::BitPackedArrayExt::packed(&self) -> &vortex_array::buffer::BufferHandle @@ -554,151 +546,67 @@ pub fn vortex_fastlanes::BitPackedArrayExt::validity_child(&self) -> core::optio pub fn vortex_fastlanes::BitPackedArrayExt::validity_mask(&self) -> vortex_mask::Mask -impl vortex_fastlanes::BitPackedArrayExt for vortex_array::array::typed::Array - -pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::typed::Array::bit_width(&self) -> u8 - -pub fn vortex_array::array::typed::Array::bitpacked_data(&self) -> &vortex_fastlanes::BitPackedData - -pub fn vortex_array::array::typed::Array::bitpacked_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::array::typed::Array::bitpacked_len(&self) -> usize - -pub fn vortex_array::array::typed::Array::offset(&self) -> u16 - -pub fn vortex_array::array::typed::Array::packed(&self) -> &vortex_array::buffer::BufferHandle - -pub fn vortex_array::array::typed::Array::packed_slice(&self) -> &[T] - -pub fn vortex_array::array::typed::Array::patch_chunk_offsets(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> - -pub fn vortex_array::array::typed::Array::patch_indices(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> - -pub fn vortex_array::array::typed::Array::patch_values(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> - -pub fn vortex_array::array::typed::Array::patches(&self) -> core::option::Option - -pub fn vortex_array::array::typed::Array::unpacked_chunks(&self) -> vortex_error::VortexResult> - -pub fn vortex_array::array::typed::Array::validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::array::typed::Array::validity_child(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> - -pub fn vortex_array::array::typed::Array::validity_mask(&self) -> vortex_mask::Mask - -impl vortex_fastlanes::BitPackedArrayExt for vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked> - -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::bit_width(&self) -> u8 +impl> vortex_fastlanes::BitPackedArrayExt for T -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::bitpacked_data(&self) -> &vortex_fastlanes::BitPackedData +pub fn T::bit_width(&self) -> u8 -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::bitpacked_dtype(&self) -> &vortex_array::dtype::DType +pub fn T::offset(&self) -> u16 -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::bitpacked_len(&self) -> usize +pub fn T::packed(&self) -> &vortex_array::buffer::BufferHandle -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::offset(&self) -> u16 +pub fn T::packed_slice(&self) -> &[T] -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::packed(&self) -> &vortex_array::buffer::BufferHandle +pub fn T::patch_chunk_offsets(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::packed_slice(&self) -> &[T] +pub fn T::patch_indices(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::patch_chunk_offsets(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> +pub fn T::patch_values(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::patch_indices(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> +pub fn T::patches(&self) -> core::option::Option -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::patch_values(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> +pub fn T::unpacked_chunks(&self) -> vortex_error::VortexResult> -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::patches(&self) -> core::option::Option +pub fn T::validity(&self) -> vortex_array::validity::Validity -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::unpacked_chunks(&self) -> vortex_error::VortexResult> +pub fn T::validity_child(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::validity(&self) -> vortex_array::validity::Validity +pub fn T::validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::validity_child(&self) -> core::option::Option<&vortex_array::array::erased::ArrayRef> - -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::BitPacked>::validity_mask(&self) -> vortex_mask::Mask - -pub trait vortex_fastlanes::FoRArrayExt - -pub fn vortex_fastlanes::FoRArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_fastlanes::FoRArrayExt: vortex_array::array::typed::TypedArrayRef pub fn vortex_fastlanes::FoRArrayExt::encoded(&self) -> &vortex_array::array::erased::ArrayRef -pub fn vortex_fastlanes::FoRArrayExt::for_data(&self) -> &vortex_fastlanes::FoRData - pub fn vortex_fastlanes::FoRArrayExt::reference_scalar(&self) -> &vortex_array::scalar::Scalar -impl vortex_fastlanes::FoRArrayExt for vortex_array::array::typed::Array - -pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::typed::Array::encoded(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_array::array::typed::Array::for_data(&self) -> &vortex_fastlanes::FoRData - -pub fn vortex_array::array::typed::Array::reference_scalar(&self) -> &vortex_array::scalar::Scalar - -impl vortex_fastlanes::FoRArrayExt for vortex_array::array::view::ArrayView<'_, vortex_fastlanes::FoR> - -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::FoR>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::FoR>::encoded(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::FoR>::for_data(&self) -> &vortex_fastlanes::FoRData +impl> vortex_fastlanes::FoRArrayExt for T -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::FoR>::reference_scalar(&self) -> &vortex_array::scalar::Scalar +pub fn T::encoded(&self) -> &vortex_array::array::erased::ArrayRef -pub trait vortex_fastlanes::RLEArrayExt +pub fn T::reference_scalar(&self) -> &vortex_array::scalar::Scalar -pub fn vortex_fastlanes::RLEArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_fastlanes::RLEArrayExt: vortex_array::array::typed::TypedArrayRef pub fn vortex_fastlanes::RLEArrayExt::indices(&self) -> &vortex_array::array::erased::ArrayRef pub fn vortex_fastlanes::RLEArrayExt::offset(&self) -> usize -pub fn vortex_fastlanes::RLEArrayExt::rle_data(&self) -> &vortex_fastlanes::RLEData - pub fn vortex_fastlanes::RLEArrayExt::values(&self) -> &vortex_array::array::erased::ArrayRef pub fn vortex_fastlanes::RLEArrayExt::values_idx_offset(&self, chunk_idx: usize) -> usize pub fn vortex_fastlanes::RLEArrayExt::values_idx_offsets(&self) -> &vortex_array::array::erased::ArrayRef -impl vortex_fastlanes::RLEArrayExt for vortex_array::array::typed::Array - -pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::typed::Array::indices(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_array::array::typed::Array::offset(&self) -> usize - -pub fn vortex_array::array::typed::Array::rle_data(&self) -> &vortex_fastlanes::RLEData - -pub fn vortex_array::array::typed::Array::values(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_array::array::typed::Array::values_idx_offset(&self, chunk_idx: usize) -> usize - -pub fn vortex_array::array::typed::Array::values_idx_offsets(&self) -> &vortex_array::array::erased::ArrayRef - -impl vortex_fastlanes::RLEArrayExt for vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE> - -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE>::indices(&self) -> &vortex_array::array::erased::ArrayRef +impl> vortex_fastlanes::RLEArrayExt for T -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE>::offset(&self) -> usize +pub fn T::indices(&self) -> &vortex_array::array::erased::ArrayRef -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE>::rle_data(&self) -> &vortex_fastlanes::RLEData +pub fn T::offset(&self) -> usize -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE>::values(&self) -> &vortex_array::array::erased::ArrayRef +pub fn T::values(&self) -> &vortex_array::array::erased::ArrayRef -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE>::values_idx_offset(&self, chunk_idx: usize) -> usize +pub fn T::values_idx_offset(&self, chunk_idx: usize) -> usize -pub fn vortex_array::array::view::ArrayView<'_, vortex_fastlanes::RLE>::values_idx_offsets(&self) -> &vortex_array::array::erased::ArrayRef +pub fn T::values_idx_offsets(&self) -> &vortex_array::array::erased::ArrayRef pub fn vortex_fastlanes::delta_compress(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<(vortex_array::arrays::primitive::vtable::PrimitiveArray, vortex_array::arrays::primitive::vtable::PrimitiveArray)> diff --git a/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs b/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs index 0a3751769e3..ced79774660 100644 --- a/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs +++ b/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs @@ -422,6 +422,7 @@ mod test { use vortex_error::VortexError; use vortex_session::VortexSession; + use crate::bitpacking::array::BitPackedArrayExt; use super::*; use crate::BitPackedData; use crate::bitpack_compress::test_harness::make_array; diff --git a/encodings/fastlanes/src/bitpacking/array/mod.rs b/encodings/fastlanes/src/bitpacking/array/mod.rs index 7e35c12b902..5e034e98d39 100644 --- a/encodings/fastlanes/src/bitpacking/array/mod.rs +++ b/encodings/fastlanes/src/bitpacking/array/mod.rs @@ -2,9 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use fastlanes::BitPacking; -use vortex_array::Array; use vortex_array::ArrayRef; -use vortex_array::ArrayView; +use vortex_array::TypedArrayRef; use vortex_array::arrays::Primitive; use vortex_array::arrays::PrimitiveArray; use vortex_array::buffer::BufferHandle; @@ -326,45 +325,40 @@ impl BitPackedData { } } -pub trait BitPackedArrayExt { - fn bitpacked_data(&self) -> &BitPackedData; - fn bitpacked_dtype(&self) -> &DType; - fn bitpacked_len(&self) -> usize; - fn as_slots(&self) -> &[Option]; - +pub trait BitPackedArrayExt: TypedArrayRef { #[inline] fn packed(&self) -> &BufferHandle { - self.bitpacked_data().packed() + BitPackedData::packed(self) } #[inline] fn bit_width(&self) -> u8 { - self.bitpacked_data().bit_width() + BitPackedData::bit_width(self) } #[inline] fn offset(&self) -> u16 { - self.bitpacked_data().offset() + BitPackedData::offset(self) } #[inline] fn patch_indices(&self) -> Option<&ArrayRef> { - self.as_slots()[PATCH_INDICES_SLOT].as_ref() + self.slots_ref()[PATCH_INDICES_SLOT].as_ref() } #[inline] fn patch_values(&self) -> Option<&ArrayRef> { - self.as_slots()[PATCH_VALUES_SLOT].as_ref() + self.slots_ref()[PATCH_VALUES_SLOT].as_ref() } #[inline] fn patch_chunk_offsets(&self) -> Option<&ArrayRef> { - self.as_slots()[PATCH_CHUNK_OFFSETS_SLOT].as_ref() + self.slots_ref()[PATCH_CHUNK_OFFSETS_SLOT].as_ref() } #[inline] fn validity_child(&self) -> Option<&ArrayRef> { - self.as_slots()[VALIDITY_SLOT].as_ref() + self.slots_ref()[VALIDITY_SLOT].as_ref() } #[inline] @@ -372,17 +366,16 @@ pub trait BitPackedArrayExt { match (self.patch_indices(), self.patch_values()) { (Some(indices), Some(values)) => { let patch_offset = self - .bitpacked_data() .patch_offset .vortex_expect("has patch slots but no patch_offset"); Some(unsafe { Patches::new_unchecked( - self.bitpacked_len(), + self.as_ref().len(), patch_offset, indices.clone(), values.clone(), self.patch_chunk_offsets().cloned(), - self.bitpacked_data().patch_offset_within_chunk, + self.patch_offset_within_chunk, ) }) } @@ -392,61 +385,29 @@ pub trait BitPackedArrayExt { #[inline] fn validity(&self) -> Validity { - child_to_validity(&self.validity_child().cloned(), self.bitpacked_dtype().nullability()) + child_to_validity( + &self.validity_child().cloned(), + self.as_ref().dtype().nullability(), + ) } #[inline] fn validity_mask(&self) -> vortex_mask::Mask { - self.validity().to_mask(self.bitpacked_len()) + self.validity().to_mask(self.as_ref().len()) } #[inline] fn packed_slice(&self) -> &[T] { - self.bitpacked_data().packed_slice::() + BitPackedData::packed_slice::(self) } #[inline] fn unpacked_chunks(&self) -> VortexResult> { - self.bitpacked_data() - .unpacked_chunks::(self.bitpacked_dtype(), self.bitpacked_len()) + BitPackedData::unpacked_chunks::(self, self.as_ref().dtype(), self.as_ref().len()) } } -impl BitPackedArrayExt for Array { - fn bitpacked_data(&self) -> &BitPackedData { - self.data() - } - - fn bitpacked_dtype(&self) -> &DType { - self.dtype() - } - - fn bitpacked_len(&self) -> usize { - self.len() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} - -impl BitPackedArrayExt for ArrayView<'_, crate::BitPacked> { - fn bitpacked_data(&self) -> &BitPackedData { - self.data() - } - - fn bitpacked_dtype(&self) -> &DType { - self.dtype() - } - - fn bitpacked_len(&self) -> usize { - self.len() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} +impl> BitPackedArrayExt for T {} #[cfg(test)] mod test { @@ -456,6 +417,7 @@ mod test { use vortex_array::assert_arrays_eq; use vortex_buffer::Buffer; + use crate::bitpacking::array::BitPackedArrayExt; use crate::BitPackedData; #[test] diff --git a/encodings/fastlanes/src/bitpacking/compute/filter.rs b/encodings/fastlanes/src/bitpacking/compute/filter.rs index f6cdc0c80c2..18b489e5f5b 100644 --- a/encodings/fastlanes/src/bitpacking/compute/filter.rs +++ b/encodings/fastlanes/src/bitpacking/compute/filter.rs @@ -185,6 +185,7 @@ mod test { use vortex_buffer::buffer; use vortex_mask::Mask; + use crate::bitpacking::array::BitPackedArrayExt; use crate::BitPackedData; #[test] diff --git a/encodings/fastlanes/src/bitpacking/compute/take.rs b/encodings/fastlanes/src/bitpacking/compute/take.rs index 198bfda1a77..d4983de0d3f 100644 --- a/encodings/fastlanes/src/bitpacking/compute/take.rs +++ b/encodings/fastlanes/src/bitpacking/compute/take.rs @@ -174,6 +174,7 @@ mod test { use vortex_buffer::Buffer; use vortex_buffer::buffer; + use crate::bitpacking::array::BitPackedArrayExt; use crate::BitPackedArray; use crate::BitPackedData; use crate::bitpacking::compute::take::take_primitive; diff --git a/encodings/fastlanes/src/bitpacking/vtable/mod.rs b/encodings/fastlanes/src/bitpacking/vtable/mod.rs index 1a85a80e497..9a25cb85770 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/mod.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/mod.rs @@ -148,10 +148,6 @@ impl VTable for BitPacked { RULES.evaluate(array, parent, child_idx) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -335,7 +331,9 @@ impl BitPacked { let data = BitPackedData::try_new(packed, ptype, validity, patches, bit_width, len, offset)?; Ok(unsafe { - Array::from_parts_unchecked(ArrayParts::new(BitPacked, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(BitPacked, dtype, len, data).with_slots(slots), + ) }) } diff --git a/encodings/fastlanes/src/bitpacking/vtable/operations.rs b/encodings/fastlanes/src/bitpacking/vtable/operations.rs index a22c8e1fc8d..00611d502b6 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/operations.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/operations.rs @@ -46,6 +46,8 @@ mod test { use vortex_array::scalar::Scalar; use vortex_array::validity::Validity; use vortex_buffer::Alignment; + + use crate::bitpacking::array::BitPackedArrayExt; use vortex_buffer::Buffer; use vortex_buffer::ByteBuffer; use vortex_buffer::buffer; diff --git a/encodings/fastlanes/src/delta/array/mod.rs b/encodings/fastlanes/src/delta/array/mod.rs index a2ef1eb847d..374d642423a 100644 --- a/encodings/fastlanes/src/delta/array/mod.rs +++ b/encodings/fastlanes/src/delta/array/mod.rs @@ -2,9 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use fastlanes::FastLanes; -use vortex_array::Array; use vortex_array::ArrayRef; -use vortex_array::ArrayView; +use vortex_array::TypedArrayRef; use vortex_array::dtype::DType; use vortex_array::dtype::PType; use vortex_array::match_each_unsigned_integer_ptype; @@ -66,46 +65,25 @@ pub struct DeltaData { pub(super) offset: usize, } -pub trait DeltaArrayExt { - fn delta_data(&self) -> &DeltaData; - fn as_slots(&self) -> &[Option]; - +pub trait DeltaArrayExt: TypedArrayRef { fn bases(&self) -> &ArrayRef { - self.as_slots()[BASES_SLOT] + self.slots_ref()[BASES_SLOT] .as_ref() .vortex_expect("DeltaArray bases slot") } fn deltas(&self) -> &ArrayRef { - self.as_slots()[DELTAS_SLOT] + self.slots_ref()[DELTAS_SLOT] .as_ref() .vortex_expect("DeltaArray deltas slot") } fn offset(&self) -> usize { - self.delta_data().offset - } -} - -impl DeltaArrayExt for Array { - fn delta_data(&self) -> &DeltaData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() + self.offset } } -impl DeltaArrayExt for ArrayView<'_, crate::Delta> { - fn delta_data(&self) -> &DeltaData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} +impl> DeltaArrayExt for T {} impl DeltaData { /// Create a DeltaArray from the given `bases` and `deltas` arrays diff --git a/encodings/fastlanes/src/delta/vtable/mod.rs b/encodings/fastlanes/src/delta/vtable/mod.rs index ef81bfed2e4..189a64a0bae 100644 --- a/encodings/fastlanes/src/delta/vtable/mod.rs +++ b/encodings/fastlanes/src/delta/vtable/mod.rs @@ -6,8 +6,6 @@ use std::hash::Hash; use fastlanes::FastLanes; use prost::Message; use vortex_array::Array; -use vortex_array::ArrayEq; -use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -72,7 +70,9 @@ impl VTable for Delta { slots: &[Option], ) -> VortexResult<()> { data.validate_against_slots( - slots[BASES_SLOT].as_ref().vortex_expect("DeltaArray bases slot"), + slots[BASES_SLOT] + .as_ref() + .vortex_expect("DeltaArray bases slot"), slots[DELTAS_SLOT] .as_ref() .vortex_expect("DeltaArray deltas slot"), @@ -109,10 +109,6 @@ impl VTable for Delta { rules::RULES.evaluate(array, parent, child_idx) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } diff --git a/encodings/fastlanes/src/for/array/for_compress.rs b/encodings/fastlanes/src/for/array/for_compress.rs index 5f0c831fd16..de5286db4b4 100644 --- a/encodings/fastlanes/src/for/array/for_compress.rs +++ b/encodings/fastlanes/src/for/array/for_compress.rs @@ -62,6 +62,7 @@ mod test { use vortex_buffer::buffer; use vortex_session::VortexSession; + use crate::r#for::array::FoRArrayExt; use super::*; use crate::BitPackedData; use crate::r#for::array::for_decompress::decompress; diff --git a/encodings/fastlanes/src/for/array/mod.rs b/encodings/fastlanes/src/for/array/mod.rs index 5718b5eabd1..9ae406f372b 100644 --- a/encodings/fastlanes/src/for/array/mod.rs +++ b/encodings/fastlanes/src/for/array/mod.rs @@ -1,9 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use vortex_array::Array; use vortex_array::ArrayRef; -use vortex_array::ArrayView; +use vortex_array::TypedArrayRef; use vortex_array::dtype::DType; use vortex_array::dtype::PType; use vortex_array::scalar::Scalar; @@ -28,40 +27,19 @@ pub struct FoRData { pub(super) reference: Scalar, } -pub trait FoRArrayExt { - fn for_data(&self) -> &FoRData; - fn as_slots(&self) -> &[Option]; - +pub trait FoRArrayExt: TypedArrayRef { fn encoded(&self) -> &ArrayRef { - self.as_slots()[ENCODED_SLOT] + self.slots_ref()[ENCODED_SLOT] .as_ref() .vortex_expect("FoRArray encoded slot") } fn reference_scalar(&self) -> &Scalar { - &self.for_data().reference - } -} - -impl FoRArrayExt for Array { - fn for_data(&self) -> &FoRData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() + &self.reference } } -impl FoRArrayExt for ArrayView<'_, crate::FoR> { - fn for_data(&self) -> &FoRData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} +impl> FoRArrayExt for T {} impl FoRData { pub(crate) fn try_new(encoded: ArrayRef, reference: Scalar) -> VortexResult { diff --git a/encodings/fastlanes/src/for/compute/is_sorted.rs b/encodings/fastlanes/src/for/compute/is_sorted.rs index 22e5959a9e0..06d3ce7d220 100644 --- a/encodings/fastlanes/src/for/compute/is_sorted.rs +++ b/encodings/fastlanes/src/for/compute/is_sorted.rs @@ -63,6 +63,7 @@ mod test { use vortex_array::validity::Validity; use vortex_buffer::buffer; + use crate::r#for::array::FoRArrayExt; use crate::FoRData; #[test] diff --git a/encodings/fastlanes/src/for/vtable/mod.rs b/encodings/fastlanes/src/for/vtable/mod.rs index e1a02f42c98..d2e880b175c 100644 --- a/encodings/fastlanes/src/for/vtable/mod.rs +++ b/encodings/fastlanes/src/for/vtable/mod.rs @@ -5,8 +5,6 @@ use std::fmt::Debug; use std::hash::Hash; use vortex_array::Array; -use vortex_array::ArrayEq; -use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -24,8 +22,8 @@ use vortex_array::serde::ArrayChildren; use vortex_array::vtable; use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityVTableFromChild; -use vortex_error::VortexResult; use vortex_error::VortexExpect; +use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; use vortex_error::vortex_panic; @@ -33,7 +31,6 @@ use vortex_session::VortexSession; use crate::FoRData; use crate::r#for::array::FoRArrayExt; -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; @@ -88,10 +85,6 @@ impl VTable for FoR { None } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } diff --git a/encodings/fastlanes/src/for/vtable/validity.rs b/encodings/fastlanes/src/for/vtable/validity.rs index f286ac539b5..dd2d28802ae 100644 --- a/encodings/fastlanes/src/for/vtable/validity.rs +++ b/encodings/fastlanes/src/for/vtable/validity.rs @@ -6,7 +6,6 @@ use vortex_array::ArrayView; use vortex_array::vtable::ValidityChild; use super::FoR; -use crate::FoRData; use crate::r#for::array::FoRArrayExt; impl ValidityChild for FoR { diff --git a/encodings/fastlanes/src/rle/array/mod.rs b/encodings/fastlanes/src/rle/array/mod.rs index 42c2efd711e..3635faa0a0d 100644 --- a/encodings/fastlanes/src/rle/array/mod.rs +++ b/encodings/fastlanes/src/rle/array/mod.rs @@ -2,8 +2,7 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use vortex_array::ArrayRef; -use vortex_array::Array; -use vortex_array::ArrayView; +use vortex_array::TypedArrayRef; use vortex_array::dtype::DType; use vortex_array::dtype::Nullability; use vortex_array::dtype::PType; @@ -173,27 +172,24 @@ impl RLEData { } } -pub trait RLEArrayExt { - fn rle_data(&self) -> &RLEData; - fn as_slots(&self) -> &[Option]; - +pub trait RLEArrayExt: TypedArrayRef { #[inline] fn values(&self) -> &ArrayRef { - self.as_slots()[VALUES_SLOT] + self.slots_ref()[VALUES_SLOT] .as_ref() .vortex_expect("RLEArray values slot must be populated") } #[inline] fn indices(&self) -> &ArrayRef { - self.as_slots()[INDICES_SLOT] + self.slots_ref()[INDICES_SLOT] .as_ref() .vortex_expect("RLEArray indices slot must be populated") } #[inline] fn values_idx_offsets(&self) -> &ArrayRef { - self.as_slots()[VALUES_IDX_OFFSETS_SLOT] + self.slots_ref()[VALUES_IDX_OFFSETS_SLOT] .as_ref() .vortex_expect("RLEArray values_idx_offsets slot must be populated") } @@ -226,29 +222,11 @@ pub trait RLEArrayExt { /// Index offset into the array #[inline] fn offset(&self) -> usize { - self.rle_data().offset - } -} - -impl RLEArrayExt for Array { - fn rle_data(&self) -> &RLEData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() + self.offset } } -impl RLEArrayExt for ArrayView<'_, crate::RLE> { - fn rle_data(&self) -> &RLEData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} +impl> RLEArrayExt for T {} #[cfg(test)] mod tests { @@ -271,6 +249,7 @@ mod tests { use vortex_error::VortexResult; use vortex_session::registry::ReadContext; + use crate::rle::array::RLEArrayExt; use crate::FL_CHUNK_SIZE; use crate::RLE; use crate::RLEData; diff --git a/encodings/fastlanes/src/rle/array/rle_compress.rs b/encodings/fastlanes/src/rle/array/rle_compress.rs index 4663f13d182..9c9c6419124 100644 --- a/encodings/fastlanes/src/rle/array/rle_compress.rs +++ b/encodings/fastlanes/src/rle/array/rle_compress.rs @@ -148,6 +148,7 @@ mod tests { use vortex_buffer::buffer; use vortex_error::VortexExpect; + use crate::rle::array::RLEArrayExt; use super::*; #[test] diff --git a/encodings/fastlanes/src/rle/vtable/mod.rs b/encodings/fastlanes/src/rle/vtable/mod.rs index 21b564a92d8..19dd286dfb1 100644 --- a/encodings/fastlanes/src/rle/vtable/mod.rs +++ b/encodings/fastlanes/src/rle/vtable/mod.rs @@ -5,8 +5,6 @@ use std::hash::Hash; use prost::Message; use vortex_array::Array; -use vortex_array::ArrayEq; -use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -23,8 +21,8 @@ use vortex_array::dtype::PType; use vortex_array::serde::ArrayChildren; use vortex_array::vtable; use vortex_array::vtable::VTable; -use vortex_error::VortexResult; use vortex_error::VortexExpect; +use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; @@ -120,10 +118,6 @@ impl VTable for RLE { RULES.evaluate(array, parent, child_idx) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { crate::rle::array::SLOT_NAMES[idx].to_string() } @@ -184,7 +178,13 @@ impl VTable for RLE { Some(indices.clone()), Some(values_idx_offsets.clone()), ]; - let data = RLEData::try_new(values, indices, values_idx_offsets, metadata.offset as usize, len)?; + let data = RLEData::try_new( + values, + indices, + values_idx_offsets, + metadata.offset as usize, + len, + )?; Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } diff --git a/encodings/fsst/public-api.lock b/encodings/fsst/public-api.lock index 9a51d88d464..362797f114d 100644 --- a/encodings/fsst/public-api.lock +++ b/encodings/fsst/public-api.lock @@ -26,9 +26,9 @@ pub type vortex_fsst::FSST::ValidityVTable = vortex_array::array::vtable::validi pub fn vortex_fsst::FSST::append_to_builder(array: vortex_array::array::view::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_fsst::FSST::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fsst::FSST::array_eq(data: &vortex_fsst::FSSTData, other: &vortex_fsst::FSSTData, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fsst::FSST::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fsst::FSST::array_hash(data: &vortex_fsst::FSSTData, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_fsst::FSST::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -152,29 +152,17 @@ pub fn vortex_fsst::FSSTMetadata::clear(&mut self) pub fn vortex_fsst::FSSTMetadata::encoded_len(&self) -> usize -pub trait vortex_fsst::FSSTArrayExt - -pub fn vortex_fsst::FSSTArrayExt::fsst_slots(&self) -> &[core::option::Option] +pub trait vortex_fsst::FSSTArrayExt: vortex_array::array::typed::TypedArrayRef pub fn vortex_fsst::FSSTArrayExt::uncompressed_lengths(&self) -> &vortex_array::array::erased::ArrayRef pub fn vortex_fsst::FSSTArrayExt::uncompressed_lengths_dtype(&self) -> &vortex_array::dtype::DType -impl vortex_fsst::FSSTArrayExt for vortex_array::array::typed::Array - -pub fn vortex_array::array::typed::Array::fsst_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::typed::Array::uncompressed_lengths(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_array::array::typed::Array::uncompressed_lengths_dtype(&self) -> &vortex_array::dtype::DType - -impl vortex_fsst::FSSTArrayExt for vortex_array::array::view::ArrayView<'_, vortex_fsst::FSST> - -pub fn vortex_array::array::view::ArrayView<'_, vortex_fsst::FSST>::fsst_slots(&self) -> &[core::option::Option] +impl> vortex_fsst::FSSTArrayExt for T -pub fn vortex_array::array::view::ArrayView<'_, vortex_fsst::FSST>::uncompressed_lengths(&self) -> &vortex_array::array::erased::ArrayRef +pub fn T::uncompressed_lengths(&self) -> &vortex_array::array::erased::ArrayRef -pub fn vortex_array::array::view::ArrayView<'_, vortex_fsst::FSST>::uncompressed_lengths_dtype(&self) -> &vortex_array::dtype::DType +pub fn T::uncompressed_lengths_dtype(&self) -> &vortex_array::dtype::DType pub fn vortex_fsst::fsst_compress>(strings: A, len: usize, dtype: &vortex_array::dtype::DType, compressor: &fsst::Compressor) -> vortex_fsst::FSSTArray diff --git a/encodings/fsst/src/array.rs b/encodings/fsst/src/array.rs index 52bd08efcb5..6d2ca344a1c 100644 --- a/encodings/fsst/src/array.rs +++ b/encodings/fsst/src/array.rs @@ -22,6 +22,7 @@ use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; use vortex_array::Precision; +use vortex_array::TypedArrayRef; use vortex_array::arrays::VarBin; use vortex_array::arrays::VarBinArray; use vortex_array::buffer::BufferHandle; @@ -92,11 +93,7 @@ impl VTable for FSST { fn array_hash(data: &FSSTData, state: &mut H, precision: Precision) { data.symbols.array_hash(state, precision); data.symbol_lengths.array_hash(state, precision); - data - .codes - .clone() - .into_array() - .array_hash(state, precision); + data.codes.clone().into_array().array_hash(state, precision); } fn array_eq(data: &FSSTData, other: &FSSTData, precision: Precision) -> bool { @@ -181,11 +178,9 @@ impl VTable for FSST { )?; let slots = FSSTData::make_slots(&codes, &uncompressed_lengths); - let data = FSSTData::try_new(symbols, symbol_lengths, codes, uncompressed_lengths, dtype)?; - return Ok( - ArrayParts::new(self.clone(), dtype.clone(), len, data) - .with_slots(slots), - ); + let data = + FSSTData::try_new(symbols, symbol_lengths, codes, uncompressed_lengths, dtype)?; + return Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)); } // Check for the current deserialization path. @@ -227,11 +222,9 @@ impl VTable for FSST { )?; let slots = FSSTData::make_slots(&codes, &uncompressed_lengths); - let data = FSSTData::try_new(symbols, symbol_lengths, codes, uncompressed_lengths, dtype)?; - return Ok( - ArrayParts::new(self.clone(), dtype.clone(), len, data) - .with_slots(slots), - ); + let data = + FSSTData::try_new(symbols, symbol_lengths, codes, uncompressed_lengths, dtype)?; + return Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)); } vortex_bail!( @@ -240,10 +233,6 @@ impl VTable for FSST { ); } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -297,8 +286,10 @@ impl VTable for FSST { /// Lengths of the original values before compression, can be compressed. pub(crate) const UNCOMPRESSED_LENGTHS_SLOT: usize = 0; /// The offsets array for the FSST-compressed codes. +#[allow(dead_code, reason = "reserved for back-compat slot numbering")] pub(crate) const CODES_OFFSETS_SLOT: usize = 1; /// The validity bitmap for the compressed codes. +#[allow(dead_code, reason = "reserved for back-compat slot numbering")] pub(crate) const CODES_VALIDITY_SLOT: usize = 2; pub(crate) const NUM_SLOTS: usize = 3; pub(crate) const SLOT_NAMES: [&str; NUM_SLOTS] = @@ -567,11 +558,9 @@ fn uncompressed_lengths_from_slots(slots: &[Option]) -> &ArrayRef { .vortex_expect("FSSTArray uncompressed_lengths slot") } -pub trait FSSTArrayExt { - fn fsst_slots(&self) -> &[Option]; - +pub trait FSSTArrayExt: TypedArrayRef { fn uncompressed_lengths(&self) -> &ArrayRef { - uncompressed_lengths_from_slots(self.fsst_slots()) + uncompressed_lengths_from_slots(self.slots_ref()) } fn uncompressed_lengths_dtype(&self) -> &DType { @@ -579,17 +568,7 @@ pub trait FSSTArrayExt { } } -impl FSSTArrayExt for Array { - fn fsst_slots(&self) -> &[Option] { - self.slots() - } -} - -impl FSSTArrayExt for ArrayView<'_, FSST> { - fn fsst_slots(&self) -> &[Option] { - self.slots() - } -} +impl> FSSTArrayExt for T {} impl ValidityChild for FSST { fn validity_child(array: ArrayView<'_, FSST>) -> ArrayRef { @@ -617,6 +596,7 @@ mod test { use vortex_error::VortexError; use crate::FSST; + use crate::array::FSSTArrayExt; use crate::array::FSSTMetadata; use crate::fsst_compress_iter; diff --git a/encodings/parquet-variant/src/array.rs b/encodings/parquet-variant/src/array.rs index 3aca471c2cc..bddc6ce5f37 100644 --- a/encodings/parquet-variant/src/array.rs +++ b/encodings/parquet-variant/src/array.rs @@ -12,6 +12,7 @@ use vortex_array::ArrayParts; use vortex_array::ArrayRef; use vortex_array::ExecutionCtx; use vortex_array::IntoArray; +use vortex_array::TypedArrayRef; use vortex_array::arrays::VariantArray; use vortex_array::arrow::ArrowArrayExecutor; use vortex_array::arrow::FromArrowArray; @@ -223,26 +224,26 @@ impl ParquetVariantData { } } -pub trait ParquetVariantArrayExt { - fn parquet_variant_dtype(&self) -> &DType; - fn as_slots(&self) -> &[Option]; - +pub trait ParquetVariantArrayExt: TypedArrayRef { fn metadata_array(&self) -> &ArrayRef { - self.as_slots()[METADATA_SLOT] + self.slots_ref()[METADATA_SLOT] .as_ref() .vortex_expect("ParquetVariantArray metadata slot") } fn validity(&self) -> Validity { - child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.parquet_variant_dtype().nullability()) + child_to_validity( + &self.slots_ref()[VALIDITY_SLOT], + self.as_ref().dtype().nullability(), + ) } fn value_array(&self) -> Option<&ArrayRef> { - self.as_slots()[VALUE_SLOT].as_ref() + self.slots_ref()[VALUE_SLOT].as_ref() } fn typed_value_array(&self) -> Option<&ArrayRef> { - self.as_slots()[TYPED_VALUE_SLOT].as_ref() + self.slots_ref()[TYPED_VALUE_SLOT].as_ref() } fn to_arrow(&self, ctx: &mut ExecutionCtx) -> VortexResult { @@ -286,25 +287,7 @@ pub trait ParquetVariantArrayExt { } } -impl ParquetVariantArrayExt for Array { - fn parquet_variant_dtype(&self) -> &DType { - self.dtype() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} - -impl ParquetVariantArrayExt for vortex_array::ArrayView<'_, ParquetVariant> { - fn parquet_variant_dtype(&self) -> &DType { - self.dtype() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} +impl> ParquetVariantArrayExt for T {} #[cfg(test)] mod tests { @@ -335,6 +318,7 @@ mod tests { use crate::ParquetVariant; use crate::ParquetVariantData; + use crate::array::ParquetVariantArrayExt; fn assert_arrow_variant_storage_roundtrip(struct_array: StructArray) -> VortexResult<()> { let arrow_variant = ArrowVariantArray::try_new(&struct_array).unwrap(); @@ -440,8 +424,7 @@ mod tests { fn test_to_arrow_basic() -> VortexResult<()> { let metadata = VarBinViewArray::from_iter_bin([b"\x01\x00", b"\x01\x00"]).into_array(); let value = VarBinViewArray::from_iter_bin([b"\x10", b"\x11"]).into_array(); - let pv_array = - ParquetVariantData::try_new(Validity::NonNullable, metadata, Some(value), None)?; + let pv_array = ParquetVariant::try_new(Validity::NonNullable, metadata, Some(value), None)?; let mut ctx = LEGACY_SESSION.create_execution_ctx(); let variant_arr = pv_array.to_arrow(&mut ctx)?; @@ -458,7 +441,7 @@ mod tests { let metadata = VarBinViewArray::from_iter_bin([b"\x01\x00", b"\x01\x00"]).into_array(); let value = VarBinViewArray::from_iter_bin([b"\x10", b"\x11"]).into_array(); let typed_value = buffer![1i32, 2].into_array(); - let pv_array = ParquetVariantData::try_new( + let pv_array = ParquetVariant::try_new( Validity::NonNullable, metadata, Some(value), diff --git a/encodings/parquet-variant/src/operations.rs b/encodings/parquet-variant/src/operations.rs index eb95682738c..695ed00cd88 100644 --- a/encodings/parquet-variant/src/operations.rs +++ b/encodings/parquet-variant/src/operations.rs @@ -355,6 +355,7 @@ mod tests { use vortex_array::scalar::ScalarValue; use vortex_error::VortexResult; + use crate::ParquetVariantArrayExt; use crate::ParquetVariant; use crate::ParquetVariantData; use crate::operations::parquet_variant_to_scalar; diff --git a/encodings/parquet-variant/src/vtable.rs b/encodings/parquet-variant/src/vtable.rs index e45926f7c3d..8857b21dc6c 100644 --- a/encodings/parquet-variant/src/vtable.rs +++ b/encodings/parquet-variant/src/vtable.rs @@ -1,13 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use std::hash::Hash; use std::hash::Hasher; use prost::Message; use vortex_array::Array; -use vortex_array::ArrayEq; -use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -32,8 +29,8 @@ use vortex_error::vortex_panic; use vortex_proto::dtype as pb; use vortex_session::VortexSession; -use crate::array::ParquetVariantData; use crate::array::ParquetVariantArrayExt; +use crate::array::ParquetVariantData; use crate::array::SLOT_NAMES; use crate::kernel::PARENT_KERNELS; @@ -80,8 +77,7 @@ impl VTable for ParquetVariant { ParquetVariantData::validate_slots(dtype, len, slots) } - fn array_hash(_data: &ParquetVariantData, _state: &mut H, _precision: Precision) { - } + fn array_hash(_data: &ParquetVariantData, _state: &mut H, _precision: Precision) {} fn array_eq( _data: &ParquetVariantData, @@ -103,10 +99,6 @@ impl VTable for ParquetVariant { None } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -240,6 +232,7 @@ mod tests { use vortex_session::registry::ReadContext; use crate::ParquetVariant; + use crate::array::ParquetVariantArrayExt; fn roundtrip(array: ArrayRef) -> ArrayRef { let dtype = array.dtype().clone(); let len = array.len(); diff --git a/encodings/pco/public-api.lock b/encodings/pco/public-api.lock index 2f711de8db2..895705faa58 100644 --- a/encodings/pco/public-api.lock +++ b/encodings/pco/public-api.lock @@ -24,9 +24,9 @@ pub type vortex_pco::Pco::OperationsVTable = vortex_pco::Pco pub type vortex_pco::Pco::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromValiditySliceHelper -pub fn vortex_pco::Pco::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_pco::Pco::array_eq(data: &vortex_pco::PcoData, other: &vortex_pco::PcoData, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_pco::Pco::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_pco::Pco::array_hash(data: &vortex_pco::PcoData, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_pco::Pco::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle diff --git a/encodings/pco/src/array.rs b/encodings/pco/src/array.rs index a742d0e687c..757fabf088a 100644 --- a/encodings/pco/src/array.rs +++ b/encodings/pco/src/array.rs @@ -95,7 +95,7 @@ impl VTable for Pco { data: &PcoData, dtype: &DType, len: usize, - slots: &[Option], + _slots: &[Option], ) -> VortexResult<()> { data.validate(dtype, len) } @@ -115,7 +115,9 @@ impl VTable for Pco { } fn array_eq(data: &PcoData, other: &PcoData, precision: Precision) -> bool { - if !data.unsliced_validity.array_eq(&other.unsliced_validity, precision) + if !data + .unsliced_validity + .array_eq(&other.unsliced_validity, precision) || data.unsliced_n_rows != other.unsliced_n_rows || data.slice_start != other.slice_start || data.slice_stop != other.slice_stop @@ -210,10 +212,6 @@ impl VTable for Pco { Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -273,7 +271,10 @@ impl Pco { pub(crate) fn try_new(dtype: DType, data: PcoData) -> VortexResult { let len = data.len(); data.validate(&dtype, len)?; - let slots = vec![validity_to_child(&data.unsliced_validity, data.unsliced_n_rows)]; + let slots = vec![validity_to_child( + &data.unsliced_validity, + data.unsliced_n_rows, + )]; Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Pco, dtype, len, data).with_slots(slots)) }) @@ -292,7 +293,6 @@ impl Pco { } /// The validity bitmap indicating which elements are non-null. -pub(super) const VALIDITY_SLOT: usize = 0; pub(super) const NUM_SLOTS: usize = 1; pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["validity"]; diff --git a/encodings/runend/public-api.lock b/encodings/runend/public-api.lock index 32642d0a20c..a58f066d306 100644 --- a/encodings/runend/public-api.lock +++ b/encodings/runend/public-api.lock @@ -48,9 +48,9 @@ pub type vortex_runend::RunEnd::OperationsVTable = vortex_runend::RunEnd pub type vortex_runend::RunEnd::ValidityVTable = vortex_runend::RunEnd -pub fn vortex_runend::RunEnd::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_runend::RunEnd::array_eq(data: &vortex_runend::RunEndData, other: &vortex_runend::RunEndData, _precision: vortex_array::hash::Precision) -> bool -pub fn vortex_runend::RunEnd::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_runend::RunEnd::array_hash(data: &vortex_runend::RunEndData, state: &mut H, _precision: vortex_array::hash::Precision) pub fn vortex_runend::RunEnd::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -168,9 +168,7 @@ pub fn vortex_runend::RunEndMetadata::clear(&mut self) pub fn vortex_runend::RunEndMetadata::encoded_len(&self) -> usize -pub trait vortex_runend::RunEndArrayExt - -pub fn vortex_runend::RunEndArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_runend::RunEndArrayExt: vortex_array::array::typed::TypedArrayRef pub fn vortex_runend::RunEndArrayExt::dtype(&self) -> &vortex_array::dtype::DType @@ -180,41 +178,19 @@ pub fn vortex_runend::RunEndArrayExt::find_physical_index(&self, index: usize) - pub fn vortex_runend::RunEndArrayExt::offset(&self) -> usize -pub fn vortex_runend::RunEndArrayExt::run_end_data(&self) -> &vortex_runend::RunEndData - pub fn vortex_runend::RunEndArrayExt::values(&self) -> &vortex_array::array::erased::ArrayRef -impl vortex_runend::RunEndArrayExt for vortex_array::array::typed::Array - -pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::typed::Array::dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::array::typed::Array::ends(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_array::array::typed::Array::find_physical_index(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::array::typed::Array::offset(&self) -> usize - -pub fn vortex_array::array::typed::Array::run_end_data(&self) -> &vortex_runend::RunEndData - -pub fn vortex_array::array::typed::Array::values(&self) -> &vortex_array::array::erased::ArrayRef - -impl vortex_runend::RunEndArrayExt for vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd> - -pub fn vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd>::dtype(&self) -> &vortex_array::dtype::DType +impl> vortex_runend::RunEndArrayExt for T -pub fn vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd>::ends(&self) -> &vortex_array::array::erased::ArrayRef +pub fn T::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd>::find_physical_index(&self, index: usize) -> vortex_error::VortexResult +pub fn T::ends(&self) -> &vortex_array::array::erased::ArrayRef -pub fn vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd>::offset(&self) -> usize +pub fn T::find_physical_index(&self, index: usize) -> vortex_error::VortexResult -pub fn vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd>::run_end_data(&self) -> &vortex_runend::RunEndData +pub fn T::offset(&self) -> usize -pub fn vortex_array::array::view::ArrayView<'_, vortex_runend::RunEnd>::values(&self) -> &vortex_array::array::erased::ArrayRef +pub fn T::values(&self) -> &vortex_array::array::erased::ArrayRef pub fn vortex_runend::initialize(session: &vortex_session::VortexSession) diff --git a/encodings/runend/src/array.rs b/encodings/runend/src/array.rs index 81976c3220a..0e4860c36e7 100644 --- a/encodings/runend/src/array.rs +++ b/encodings/runend/src/array.rs @@ -6,8 +6,6 @@ use std::hash::Hash; use prost::Message; use vortex_array::Array; -use vortex_array::ArrayEq; -use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -16,6 +14,7 @@ use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; use vortex_array::Precision; +use vortex_array::TypedArrayRef; use vortex_array::arrays::Primitive; use vortex_array::arrays::VarBinViewArray; use vortex_array::buffer::BufferHandle; @@ -147,10 +146,6 @@ impl VTable for RunEnd { Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -195,22 +190,19 @@ pub struct RunEndDataParts { pub offset: usize, } -pub trait RunEndArrayExt { - fn run_end_data(&self) -> &RunEndData; - fn as_slots(&self) -> &[Option]; - +pub trait RunEndArrayExt: TypedArrayRef { fn offset(&self) -> usize { - self.run_end_data().offset + self.offset } fn ends(&self) -> &ArrayRef { - self.as_slots()[ENDS_SLOT] + self.slots_ref()[ENDS_SLOT] .as_ref() .vortex_expect("RunEndArray ends slot") } fn values(&self) -> &ArrayRef { - self.as_slots()[VALUES_SLOT] + self.slots_ref()[VALUES_SLOT] .as_ref() .vortex_expect("RunEndArray values slot") } @@ -230,26 +222,7 @@ pub trait RunEndArrayExt { .to_ends_index(self.ends().len())) } } - -impl RunEndArrayExt for Array { - fn run_end_data(&self) -> &RunEndData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} - -impl RunEndArrayExt for ArrayView<'_, RunEnd> { - fn run_end_data(&self) -> &RunEndData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} +impl> RunEndArrayExt for T {} #[derive(Clone, Debug)] pub struct RunEnd; @@ -271,7 +244,9 @@ impl RunEnd { let slots = vec![Some(ends.clone()), Some(values.clone())]; let data = unsafe { RunEndData::new_unchecked(ends, values, offset, length) }; unsafe { - Array::from_parts_unchecked(ArrayParts::new(RunEnd, dtype, length, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(RunEnd, dtype, length, data).with_slots(slots), + ) } } diff --git a/encodings/runend/src/arrow.rs b/encodings/runend/src/arrow.rs index 25c1ef197f7..34cd43208aa 100644 --- a/encodings/runend/src/arrow.rs +++ b/encodings/runend/src/arrow.rs @@ -72,6 +72,7 @@ mod tests { use arrow_schema::DataType; use arrow_schema::Field; use rstest::rstest; + use vortex_array::ArrayRef; use vortex_array::IntoArray as _; use vortex_array::VortexSessionExecute as _; use vortex_array::arrays::PrimitiveArray; @@ -82,13 +83,18 @@ mod tests { use vortex_array::dtype::NativePType; use vortex_array::dtype::Nullability; use vortex_array::dtype::PType; + use vortex_array::scalar::PValue; + use vortex_array::search_sorted::SearchSorted; + use vortex_array::search_sorted::SearchSortedSide; use vortex_array::session::ArraySession; + use vortex_array::validity::Validity; + use vortex_buffer::Buffer; use vortex_buffer::buffer; use vortex_error::VortexResult; use vortex_session::VortexSession; use crate::RunEnd; - use crate::RunEndData; + use crate::ops::find_slice_end_index; static SESSION: LazyLock = LazyLock::new(|| VortexSession::empty().with::()); @@ -100,11 +106,39 @@ mod tests { where R::Native: NativePType, { - let data = RunEndData::from_arrow(array, nullable)?; + let offset = array.run_ends().offset(); + let len = array.run_ends().len(); + let ends_buf = + Buffer::::from_arrow_scalar_buffer(array.run_ends().inner().clone()); + let ends = PrimitiveArray::new(ends_buf, Validity::NonNullable) + .reinterpret_cast(R::Native::PTYPE.to_unsigned()); + let values = ArrayRef::from_arrow(array.values().as_ref(), nullable)?; + + let ends_array = PrimitiveArray::from_buffer_handle( + ends.buffer_handle().clone(), + ends.ptype(), + ends.validity()?, + ) + .into_array(); + let (ends_slice, values_slice) = if offset == 0 && len == array.run_ends().max_value() { + (ends_array, values) + } else { + let slice_begin = ends_array + .as_primitive_typed() + .search_sorted(&PValue::from(offset), SearchSortedSide::Right)? + .to_ends_index(ends_array.len()); + let slice_end = find_slice_end_index(&ends_array, offset + len)?; + + ( + ends_array.slice(slice_begin..slice_end)?, + values.slice(slice_begin..slice_end)?, + ) + }; + RunEnd::try_new_offset_length( - data.ends().clone(), - data.values().clone(), - data.offset(), + ends_slice, + values_slice, + offset, array.len(), ) } @@ -253,7 +287,7 @@ mod tests { } fn execute( - array: vortex_array::ArrayRef, + array: ArrayRef, dt: &DataType, ) -> VortexResult { array.execute_arrow(Some(dt), &mut SESSION.create_execution_ctx()) diff --git a/encodings/runend/src/compute/take_from.rs b/encodings/runend/src/compute/take_from.rs index fb18d648a15..6f25e1c2f92 100644 --- a/encodings/runend/src/compute/take_from.rs +++ b/encodings/runend/src/compute/take_from.rs @@ -62,6 +62,7 @@ mod tests { use vortex_error::VortexResult; use vortex_session::VortexSession; + use crate::array::RunEndArrayExt; use crate::RunEnd; use crate::RunEndArray; use crate::compute::take_from::RunEndTakeFrom; diff --git a/encodings/sequence/public-api.lock b/encodings/sequence/public-api.lock index 87e7bf273a8..fea1b505915 100644 --- a/encodings/sequence/public-api.lock +++ b/encodings/sequence/public-api.lock @@ -26,9 +26,9 @@ pub type vortex_sequence::Sequence::OperationsVTable = vortex_sequence::Sequence pub type vortex_sequence::Sequence::ValidityVTable = vortex_sequence::Sequence -pub fn vortex_sequence::Sequence::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, _precision: vortex_array::hash::Precision) -> bool +pub fn vortex_sequence::Sequence::array_eq(data: &vortex_sequence::SequenceData, other: &vortex_sequence::SequenceData, _precision: vortex_array::hash::Precision) -> bool -pub fn vortex_sequence::Sequence::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, _precision: vortex_array::hash::Precision) +pub fn vortex_sequence::Sequence::array_hash(data: &vortex_sequence::SequenceData, state: &mut H, _precision: vortex_array::hash::Precision) pub fn vortex_sequence::Sequence::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle diff --git a/encodings/sequence/src/array.rs b/encodings/sequence/src/array.rs index a1777601dcb..ed67129a0cd 100644 --- a/encodings/sequence/src/array.rs +++ b/encodings/sequence/src/array.rs @@ -215,7 +215,7 @@ impl VTable for Sequence { data: &Self::ArrayData, dtype: &DType, len: usize, - slots: &[Option], + _slots: &[Option], ) -> VortexResult<()> { SequenceData::validate(data.base, data.multiplier, dtype, len) } @@ -302,10 +302,6 @@ impl VTable for Sequence { Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } diff --git a/encodings/sparse/public-api.lock b/encodings/sparse/public-api.lock index c61614fa848..ab48148d9bc 100644 --- a/encodings/sparse/public-api.lock +++ b/encodings/sparse/public-api.lock @@ -28,9 +28,9 @@ pub type vortex_sparse::Sparse::OperationsVTable = vortex_sparse::Sparse pub type vortex_sparse::Sparse::ValidityVTable = vortex_sparse::Sparse -pub fn vortex_sparse::Sparse::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_sparse::Sparse::array_eq(data: &vortex_sparse::SparseData, other: &vortex_sparse::SparseData, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_sparse::Sparse::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_sparse::Sparse::array_hash(data: &vortex_sparse::SparseData, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_sparse::Sparse::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle diff --git a/encodings/sparse/src/canonical.rs b/encodings/sparse/src/canonical.rs index b153d7ea45a..3487c0f3df9 100644 --- a/encodings/sparse/src/canonical.rs +++ b/encodings/sparse/src/canonical.rs @@ -5,13 +5,10 @@ use std::sync::Arc; use itertools::Itertools; use num_traits::NumCast; -use vortex_array::Array; -use vortex_array::ArrayParts; use vortex_array::ArrayRef; use vortex_array::ExecutionCtx; use vortex_array::IntoArray; use vortex_array::arrays::BoolArray; -use vortex_array::arrays::Decimal; use vortex_array::arrays::FixedSizeListArray; use vortex_array::arrays::ListViewArray; use vortex_array::arrays::NullArray; @@ -478,8 +475,6 @@ fn execute_sparse_decimal( } } let filled_array = builder.finish_into_decimal(); - let dtype = filled_array.dtype().clone(); - let len = filled_array.len(); Ok(filled_array.patch(patches, ctx)?.into_array()) } diff --git a/encodings/sparse/src/lib.rs b/encodings/sparse/src/lib.rs index a3aac04fc7f..97d4fb7ae28 100644 --- a/encodings/sparse/src/lib.rs +++ b/encodings/sparse/src/lib.rs @@ -79,7 +79,7 @@ impl VTable for Sparse { data: &Self::ArrayData, dtype: &DType, len: usize, - slots: &[Option], + _slots: &[Option], ) -> VortexResult<()> { SparseData::validate(data.patches(), data.fill_scalar(), dtype, len) } @@ -170,10 +170,6 @@ impl VTable for Sparse { Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -200,12 +196,6 @@ impl VTable for Sparse { } } -/// The indices of non-fill values in the sparse array. -pub(crate) const PATCH_INDICES_SLOT: usize = 0; -/// The non-fill values at the corresponding patch indices. -pub(crate) const PATCH_VALUES_SLOT: usize = 1; -/// Chunk offsets for the patch indices/values. -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"]; @@ -384,11 +374,17 @@ impl SparseData { /// Build a new SparseArray from an existing set of patches. pub fn try_new_from_patches(patches: Patches, fill_value: Scalar) -> VortexResult { let patches = Self::normalize_patches_dtype(patches, &fill_value)?; - Ok(Self { patches, fill_value }) + Ok(Self { + patches, + fill_value, + }) } pub(crate) unsafe fn new_unchecked(patches: Patches, fill_value: Scalar) -> Self { - Self { patches, fill_value } + Self { + patches, + fill_value, + } } /// Returns the length of the array. diff --git a/encodings/zigzag/public-api.lock b/encodings/zigzag/public-api.lock index 517b698e1c3..96695ef486c 100644 --- a/encodings/zigzag/public-api.lock +++ b/encodings/zigzag/public-api.lock @@ -24,9 +24,9 @@ pub type vortex_zigzag::ZigZag::OperationsVTable = vortex_zigzag::ZigZag pub type vortex_zigzag::ZigZag::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_zigzag::ZigZag::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_zigzag::ZigZag::array_eq(_data: &vortex_zigzag::ZigZagData, _other: &vortex_zigzag::ZigZagData, _precision: vortex_array::hash::Precision) -> bool -pub fn vortex_zigzag::ZigZag::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_zigzag::ZigZag::array_hash(_data: &vortex_zigzag::ZigZagData, _state: &mut H, _precision: vortex_array::hash::Precision) pub fn vortex_zigzag::ZigZag::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -50,7 +50,7 @@ pub fn vortex_zigzag::ZigZag::slot_name(_array: vortex_array::array::view::Array pub fn vortex_zigzag::ZigZag::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_zigzag::ZigZag::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_zigzag::ZigZag::validate(&self, _data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_zigzag::ZigZag @@ -96,29 +96,17 @@ impl core::fmt::Debug for vortex_zigzag::ZigZagData pub fn vortex_zigzag::ZigZagData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub trait vortex_zigzag::ZigZagArrayExt - -pub fn vortex_zigzag::ZigZagArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_zigzag::ZigZagArrayExt: vortex_array::array::typed::TypedArrayRef pub fn vortex_zigzag::ZigZagArrayExt::encoded(&self) -> &vortex_array::array::erased::ArrayRef pub fn vortex_zigzag::ZigZagArrayExt::ptype(&self) -> vortex_array::dtype::ptype::PType -impl vortex_zigzag::ZigZagArrayExt for vortex_array::array::typed::Array - -pub fn vortex_array::array::typed::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::array::typed::Array::encoded(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_array::array::typed::Array::ptype(&self) -> vortex_array::dtype::ptype::PType - -impl vortex_zigzag::ZigZagArrayExt for vortex_array::array::view::ArrayView<'_, vortex_zigzag::ZigZag> - -pub fn vortex_array::array::view::ArrayView<'_, vortex_zigzag::ZigZag>::as_slots(&self) -> &[core::option::Option] +impl> vortex_zigzag::ZigZagArrayExt for T -pub fn vortex_array::array::view::ArrayView<'_, vortex_zigzag::ZigZag>::encoded(&self) -> &vortex_array::array::erased::ArrayRef +pub fn T::encoded(&self) -> &vortex_array::array::erased::ArrayRef -pub fn vortex_array::array::view::ArrayView<'_, vortex_zigzag::ZigZag>::ptype(&self) -> vortex_array::dtype::ptype::PType +pub fn T::ptype(&self) -> vortex_array::dtype::ptype::PType pub fn vortex_zigzag::zigzag_decode(parray: vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_array::arrays::primitive::vtable::PrimitiveArray diff --git a/encodings/zigzag/src/array.rs b/encodings/zigzag/src/array.rs index 09d4091f39a..064a1f4f6c1 100644 --- a/encodings/zigzag/src/array.rs +++ b/encodings/zigzag/src/array.rs @@ -2,8 +2,6 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use vortex_array::Array; -use vortex_array::ArrayEq; -use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -12,6 +10,7 @@ use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; use vortex_array::Precision; +use vortex_array::TypedArrayRef; use vortex_array::buffer::BufferHandle; use vortex_array::dtype::DType; use vortex_array::dtype::PType; @@ -71,11 +70,7 @@ impl VTable for ZigZag { Ok(()) } - fn array_hash( - _data: &ZigZagData, - _state: &mut H, - _precision: Precision, - ) { + fn array_hash(_data: &ZigZagData, _state: &mut H, _precision: Precision) { } fn array_eq(_data: &ZigZagData, _other: &ZigZagData, _precision: Precision) -> bool { @@ -126,10 +121,6 @@ impl VTable for ZigZag { Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -166,11 +157,9 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["encoded"]; #[derive(Clone, Debug)] pub struct ZigZagData {} -pub trait ZigZagArrayExt { - fn as_slots(&self) -> &[Option]; - +pub trait ZigZagArrayExt: TypedArrayRef { fn encoded(&self) -> &ArrayRef { - self.as_slots()[ENCODED_SLOT] + self.slots_ref()[ENCODED_SLOT] .as_ref() .vortex_expect("ZigZagArray encoded slot") } @@ -182,17 +171,7 @@ pub trait ZigZagArrayExt { } } -impl ZigZagArrayExt for Array { - fn as_slots(&self) -> &[Option] { - self.slots() - } -} - -impl ZigZagArrayExt for ArrayView<'_, ZigZag> { - fn as_slots(&self) -> &[Option] { - self.slots() - } -} +impl> ZigZagArrayExt for T {} #[derive(Clone, Debug)] pub struct ZigZag; diff --git a/encodings/zstd/public-api.lock b/encodings/zstd/public-api.lock index c253f0b18cb..ea802a3c299 100644 --- a/encodings/zstd/public-api.lock +++ b/encodings/zstd/public-api.lock @@ -32,9 +32,9 @@ pub type vortex_zstd::Zstd::OperationsVTable = vortex_zstd::Zstd pub type vortex_zstd::Zstd::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromValiditySliceHelper -pub fn vortex_zstd::Zstd::array_eq(array: vortex_array::array::view::ArrayView<'_, Self>, other: vortex_array::array::view::ArrayView<'_, Self>, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_zstd::Zstd::array_eq(data: &vortex_zstd::ZstdData, other: &vortex_zstd::ZstdData, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_zstd::Zstd::array_hash(array: vortex_array::array::view::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_zstd::Zstd::array_hash(data: &vortex_zstd::ZstdData, state: &mut H, precision: vortex_array::hash::Precision) pub fn vortex_zstd::Zstd::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle diff --git a/encodings/zstd/src/array.rs b/encodings/zstd/src/array.rs index 8614d4969ba..13c1bb2301b 100644 --- a/encodings/zstd/src/array.rs +++ b/encodings/zstd/src/array.rs @@ -96,7 +96,7 @@ impl VTable for Zstd { data: &Self::ArrayData, dtype: &DType, len: usize, - slots: &[Option], + _slots: &[Option], ) -> VortexResult<()> { data.validate(dtype, len) } @@ -136,7 +136,8 @@ impl VTable for Zstd { return false; } } - data.unsliced_validity.array_eq(&other.unsliced_validity, precision) + data.unsliced_validity + .array_eq(&other.unsliced_validity, precision) && data.unsliced_n_rows == other.unsliced_n_rows && data.slice_start == other.slice_start && data.slice_stop == other.slice_stop @@ -223,10 +224,6 @@ impl VTable for Zstd { Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -255,7 +252,10 @@ impl Zstd { pub fn try_new(dtype: DType, data: ZstdData) -> VortexResult { let len = data.len(); data.validate(&dtype, len)?; - let slots = vec![validity_to_child(&data.unsliced_validity, data.unsliced_n_rows)]; + let slots = vec![validity_to_child( + &data.unsliced_validity, + data.unsliced_n_rows, + )]; Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Zstd, dtype, len, data).with_slots(slots)) }) @@ -303,7 +303,6 @@ impl Zstd { } /// The validity bitmap indicating which elements are non-null. -pub(super) const VALIDITY_SLOT: usize = 0; pub(super) const NUM_SLOTS: usize = 1; pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["validity"]; diff --git a/encodings/zstd/src/zstd_buffers.rs b/encodings/zstd/src/zstd_buffers.rs index 6887b927fff..e012a28df94 100644 --- a/encodings/zstd/src/zstd_buffers.rs +++ b/encodings/zstd/src/zstd_buffers.rs @@ -82,7 +82,8 @@ impl ZstdBuffers { }; let slots = children.into_iter().map(Some).collect(); let compressed = Array::try_from_parts( - ArrayParts::new(ZstdBuffers, array.dtype().clone(), array.len(), data).with_slots(slots), + ArrayParts::new(ZstdBuffers, array.dtype().clone(), array.len(), data) + .with_slots(slots), )?; compressed.statistics().inherit_from(array.statistics()); Ok(compressed) @@ -96,7 +97,9 @@ impl ZstdBuffers { let registry = session.arrays().registry().clone(); let inner_vtable = registry .find(&array.data().inner_encoding_id) - .ok_or_else(|| vortex_err!("Unknown inner encoding: {}", array.data().inner_encoding_id))?; + .ok_or_else(|| { + vortex_err!("Unknown inner encoding: {}", array.data().inner_encoding_id) + })?; let children: Vec = array.slots().iter().flatten().cloned().collect(); inner_vtable.build( @@ -379,10 +382,6 @@ impl VTable for ZstdBuffers { Some(format!("compressed_{idx}")) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { format!("child_{idx}") } @@ -447,7 +446,10 @@ impl OperationsVTable for ZstdBuffers { // TODO(os): maybe we should not support scalar_at, it is really slow, and adding a cache // layer here is weird. Valid use of zstd buffers array would be by executing it first into // canonical - let inner_array = ZstdBuffers::decompress_and_build_inner(&array.into_owned(), &vortex_array::LEGACY_SESSION)?; + let inner_array = ZstdBuffers::decompress_and_build_inner( + &array.into_owned(), + &vortex_array::LEGACY_SESSION, + )?; inner_array.scalar_at(index) } } @@ -460,7 +462,10 @@ impl ValidityVTable for ZstdBuffers { return Ok(vortex_array::validity::Validity::NonNullable); } - let inner_array = ZstdBuffers::decompress_and_build_inner(&array.into_owned(), &vortex_array::LEGACY_SESSION)?; + let inner_array = ZstdBuffers::decompress_and_build_inner( + &array.into_owned(), + &vortex_array::LEGACY_SESSION, + )?; inner_array.validity() } } diff --git a/vortex-array/public-api.lock b/vortex-array/public-api.lock index 04f02e6937b..dd8cbdb42fe 100644 --- a/vortex-array/public-api.lock +++ b/vortex-array/public-api.lock @@ -870,9 +870,9 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(data: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(data: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -946,8 +946,6 @@ pub struct vortex_array::arrays::bool::BoolData impl vortex_array::arrays::bool::BoolData -pub fn vortex_array::arrays::bool::BoolData::dtype(&self) -> vortex_array::dtype::DType - pub fn vortex_array::arrays::bool::BoolData::into_bit_buffer(self) -> vortex_buffer::bit::buf::BitBuffer pub fn vortex_array::arrays::bool::BoolData::into_parts(self) -> vortex_array::arrays::bool::BoolDataParts @@ -1022,9 +1020,9 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(_data: &vortex_array::arrays::chunked::ChunkedData, _other: &vortex_array::arrays::chunked::ChunkedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(_data: &vortex_array::arrays::chunked::ChunkedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -1110,26 +1108,18 @@ impl core::fmt::Debug for vortex_array::arrays::chunked::ChunkedData pub fn vortex_array::arrays::chunked::ChunkedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub trait vortex_array::arrays::chunked::ChunkedArrayExt +pub trait vortex_array::arrays::chunked::ChunkedArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::chunked::ChunkedArrayExt::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ pub fn vortex_array::arrays::chunked::ChunkedArrayExt::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ -pub fn vortex_array::arrays::chunked::ChunkedArrayExt::as_slots(&self) -> &[core::option::Option] - pub fn vortex_array::arrays::chunked::ChunkedArrayExt::chunk(&self, idx: usize) -> &vortex_array::ArrayRef pub fn vortex_array::arrays::chunked::ChunkedArrayExt::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer pub fn vortex_array::arrays::chunked::ChunkedArrayExt::chunk_offsets_array(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::chunked::ChunkedArrayExt::chunked_data(&self) -> &vortex_array::arrays::chunked::ChunkedData - -pub fn vortex_array::arrays::chunked::ChunkedArrayExt::chunked_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::arrays::chunked::ChunkedArrayExt::chunked_len(&self) -> usize - pub fn vortex_array::arrays::chunked::ChunkedArrayExt::chunks(&self) -> alloc::vec::Vec pub fn vortex_array::arrays::chunked::ChunkedArrayExt::find_chunk_idx(&self, index: usize) -> vortex_error::VortexResult<(usize, usize)> @@ -1140,65 +1130,27 @@ pub fn vortex_array::arrays::chunked::ChunkedArrayExt::nchunks(&self) -> usize pub fn vortex_array::arrays::chunked::ChunkedArrayExt::non_empty_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> -impl vortex_array::arrays::chunked::ChunkedArrayExt for vortex_array::Array - -pub fn vortex_array::Array::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ - -pub fn vortex_array::Array::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::chunk(&self, idx: usize) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer - -pub fn vortex_array::Array::chunk_offsets_array(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::chunked_data(&self) -> &vortex_array::arrays::chunked::ChunkedData - -pub fn vortex_array::Array::chunked_dtype(&self) -> &vortex_array::dtype::DType +impl> vortex_array::arrays::chunked::ChunkedArrayExt for T -pub fn vortex_array::Array::chunked_len(&self) -> usize +pub fn T::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ -pub fn vortex_array::Array::chunks(&self) -> alloc::vec::Vec - -pub fn vortex_array::Array::find_chunk_idx(&self, index: usize) -> vortex_error::VortexResult<(usize, usize)> - -pub fn vortex_array::Array::iter_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> - -pub fn vortex_array::Array::nchunks(&self) -> usize - -pub fn vortex_array::Array::non_empty_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> - -impl vortex_array::arrays::chunked::ChunkedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Chunked> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk(&self, idx: usize) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk_offsets_array(&self) -> &vortex_array::ArrayRef +pub fn T::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunked_data(&self) -> &vortex_array::arrays::chunked::ChunkedData +pub fn T::chunk(&self, idx: usize) -> &vortex_array::ArrayRef -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunked_dtype(&self) -> &vortex_array::dtype::DType +pub fn T::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunked_len(&self) -> usize +pub fn T::chunk_offsets_array(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunks(&self) -> alloc::vec::Vec +pub fn T::chunks(&self) -> alloc::vec::Vec -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::find_chunk_idx(&self, index: usize) -> vortex_error::VortexResult<(usize, usize)> +pub fn T::find_chunk_idx(&self, index: usize) -> vortex_error::VortexResult<(usize, usize)> -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::iter_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> +pub fn T::iter_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::nchunks(&self) -> usize +pub fn T::nchunks(&self) -> usize -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::non_empty_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> +pub fn T::non_empty_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> pub type vortex_array::arrays::chunked::ChunkedArray = vortex_array::Array @@ -1236,9 +1188,9 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(data: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(data: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -1416,9 +1368,9 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(data: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(data: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -1498,8 +1450,6 @@ pub fn vortex_array::arrays::decimal::DecimalData::buffer_handle(&self) -> &vort pub fn vortex_array::arrays::decimal::DecimalData::decimal_dtype(&self) -> vortex_array::dtype::DecimalDType -pub fn vortex_array::arrays::decimal::DecimalData::dtype(&self) -> vortex_array::dtype::DType - pub fn vortex_array::arrays::decimal::DecimalData::from_iter>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self pub fn vortex_array::arrays::decimal::DecimalData::from_option_iter>>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self @@ -1564,35 +1514,25 @@ pub type vortex_array::arrays::decimal::DecimalMaskedValidityRule::Parent = vort pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent(&self, array: vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>, parent: vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, _child_idx: usize) -> vortex_error::VortexResult> -pub trait vortex_array::arrays::decimal::DecimalArrayExt +pub trait vortex_array::arrays::decimal::DecimalArrayExt: vortex_array::TypedArrayRef -pub fn vortex_array::arrays::decimal::DecimalArrayExt::as_slots(&self) -> &[core::option::Option] +pub fn vortex_array::arrays::decimal::DecimalArrayExt::decimal_dtype(&self) -> vortex_array::dtype::DecimalDType -pub fn vortex_array::arrays::decimal::DecimalArrayExt::decimal_data(&self) -> &vortex_array::arrays::decimal::DecimalData +pub fn vortex_array::arrays::decimal::DecimalArrayExt::nullability(&self) -> vortex_array::dtype::Nullability pub fn vortex_array::arrays::decimal::DecimalArrayExt::validity(&self) -> vortex_array::validity::Validity pub fn vortex_array::arrays::decimal::DecimalArrayExt::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> -impl vortex_array::arrays::decimal::DecimalArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::decimal_data(&self) -> &vortex_array::arrays::decimal::DecimalData - -pub fn vortex_array::Array::validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> - -impl vortex_array::arrays::decimal::DecimalArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Decimal> +impl> vortex_array::arrays::decimal::DecimalArrayExt for T -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::as_slots(&self) -> &[core::option::Option] +pub fn T::decimal_dtype(&self) -> vortex_array::dtype::DecimalDType -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::decimal_data(&self) -> &vortex_array::arrays::decimal::DecimalData +pub fn T::nullability(&self) -> vortex_array::dtype::Nullability -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::validity(&self) -> vortex_array::validity::Validity +pub fn T::validity(&self) -> vortex_array::validity::Validity -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> +pub fn T::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> pub fn vortex_array::arrays::decimal::narrowed_decimal(decimal_array: vortex_array::arrays::DecimalArray) -> vortex_array::arrays::DecimalArray @@ -1630,9 +1570,9 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(_data: &vortex_array::arrays::dict::DictData, _other: &vortex_array::arrays::dict::DictData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(_data: &vortex_array::arrays::dict::DictData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -1734,9 +1674,9 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(_data: &vortex_array::arrays::dict::DictData, _other: &vortex_array::arrays::dict::DictData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(_data: &vortex_array::arrays::dict::DictData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -1888,47 +1828,29 @@ pub type vortex_array::arrays::dict::TakeReduceAdaptor::Parent = vortex_array pub fn vortex_array::arrays::dict::TakeReduceAdaptor::reduce_parent(&self, array: vortex_array::ArrayView<'_, V>, parent: vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>, child_idx: usize) -> vortex_error::VortexResult> -pub trait vortex_array::arrays::dict::DictArrayExt +pub trait vortex_array::arrays::dict::DictArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::dict::DictArrayExt::codes(&self) -> &vortex_array::ArrayRef pub fn vortex_array::arrays::dict::DictArrayExt::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::DictArrayExt::dict_data(&self) -> &vortex_array::arrays::dict::DictData - pub fn vortex_array::arrays::dict::DictArrayExt::has_all_values_referenced(&self) -> bool pub fn vortex_array::arrays::dict::DictArrayExt::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> pub fn vortex_array::arrays::dict::DictArrayExt::values(&self) -> &vortex_array::ArrayRef -impl vortex_array::arrays::dict::DictArrayExt for vortex_array::Array - -pub fn vortex_array::Array::codes(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult - -pub fn vortex_array::Array::dict_data(&self) -> &vortex_array::arrays::dict::DictData - -pub fn vortex_array::Array::has_all_values_referenced(&self) -> bool - -pub fn vortex_array::Array::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> - -pub fn vortex_array::Array::values(&self) -> &vortex_array::ArrayRef - -impl vortex_array::arrays::dict::DictArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::codes(&self) -> &vortex_array::ArrayRef +impl> vortex_array::arrays::dict::DictArrayExt for T -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult +pub fn T::codes(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::dict_data(&self) -> &vortex_array::arrays::dict::DictData +pub fn T::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::has_all_values_referenced(&self) -> bool +pub fn T::has_all_values_referenced(&self) -> bool -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> +pub fn T::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::values(&self) -> &vortex_array::ArrayRef +pub fn T::values(&self) -> &vortex_array::ArrayRef pub trait vortex_array::arrays::dict::TakeExecute: vortex_array::VTable @@ -2036,9 +1958,9 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(_data: &vortex_array::arrays::extension::ExtensionData, _other: &vortex_array::arrays::extension::ExtensionData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(_data: &vortex_array::arrays::extension::ExtensionData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -2122,23 +2044,13 @@ impl core::fmt::Debug for vortex_array::arrays::extension::ExtensionData pub fn vortex_array::arrays::extension::ExtensionData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub trait vortex_array::arrays::extension::ExtensionArrayExt - -pub fn vortex_array::arrays::extension::ExtensionArrayExt::extension_data(&self) -> &vortex_array::arrays::extension::ExtensionData +pub trait vortex_array::arrays::extension::ExtensionArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::extension::ExtensionArrayExt::storage_array(&self) -> &vortex_array::ArrayRef -impl vortex_array::arrays::extension::ExtensionArrayExt for vortex_array::Array - -pub fn vortex_array::Array::extension_data(&self) -> &vortex_array::arrays::extension::ExtensionData - -pub fn vortex_array::Array::storage_array(&self) -> &vortex_array::ArrayRef - -impl vortex_array::arrays::extension::ExtensionArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Extension> +impl> vortex_array::arrays::extension::ExtensionArrayExt for T -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Extension>::extension_data(&self) -> &vortex_array::arrays::extension::ExtensionData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Extension>::storage_array(&self) -> &vortex_array::ArrayRef +pub fn T::storage_array(&self) -> &vortex_array::ArrayRef pub type vortex_array::arrays::extension::ExtensionArray = vortex_array::Array @@ -2172,9 +2084,9 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(data: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(data: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -2272,41 +2184,13 @@ pub type vortex_array::arrays::filter::FilterReduceAdaptor::Parent = vortex_a pub fn vortex_array::arrays::filter::FilterReduceAdaptor::reduce_parent(&self, array: vortex_array::ArrayView<'_, V>, parent: vortex_array::ArrayView<'_, vortex_array::arrays::Filter>, child_idx: usize) -> vortex_error::VortexResult> -pub trait vortex_array::arrays::filter::FilterArrayExt - -pub fn vortex_array::arrays::filter::FilterArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_array::arrays::filter::FilterArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::filter::FilterArrayExt::child(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::filter::FilterArrayExt::filter_data(&self) -> &vortex_array::arrays::filter::FilterData - -pub fn vortex_array::arrays::filter::FilterArrayExt::filter_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::arrays::filter::FilterArrayExt::filter_len(&self) -> usize - -impl vortex_array::arrays::filter::FilterArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::filter_data(&self) -> &vortex_array::arrays::filter::FilterData - -pub fn vortex_array::Array::filter_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::Array::filter_len(&self) -> usize - -impl vortex_array::arrays::filter::FilterArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Filter> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::filter_data(&self) -> &vortex_array::arrays::filter::FilterData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::filter_dtype(&self) -> &vortex_array::dtype::DType +impl> vortex_array::arrays::filter::FilterArrayExt for T -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::filter_len(&self) -> usize +pub fn T::child(&self) -> &vortex_array::ArrayRef pub trait vortex_array::arrays::filter::FilterKernel: vortex_array::VTable @@ -2388,9 +2272,9 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -2450,8 +2334,6 @@ pub struct vortex_array::arrays::fixed_size_list::FixedSizeListData impl vortex_array::arrays::fixed_size_list::FixedSizeListData -pub const fn vortex_array::arrays::fixed_size_list::FixedSizeListData::list_size(&self) -> u32 - pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self pub unsafe fn vortex_array::arrays::fixed_size_list::FixedSizeListData::new_unchecked(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self @@ -2474,47 +2356,29 @@ pub vortex_array::arrays::fixed_size_list::FixedSizeListDataParts::elements: vor pub vortex_array::arrays::fixed_size_list::FixedSizeListDataParts::validity: vortex_array::validity::Validity -pub trait vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt +pub trait vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt: vortex_array::TypedArrayRef -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt::as_slots(&self) -> &[core::option::Option] +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt::dtype_parts(&self) -> (&vortex_array::dtype::DType, u32, vortex_array::dtype::Nullability) pub fn vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt::elements(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt::fixed_size_list_data(&self) -> &vortex_array::arrays::fixed_size_list::FixedSizeListData - pub fn vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt::fixed_size_list_validity(&self) -> vortex_array::validity::Validity pub fn vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt::fixed_size_list_validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt::len(&self) -> usize - -impl vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::fixed_size_list_data(&self) -> &vortex_array::arrays::fixed_size_list::FixedSizeListData - -pub fn vortex_array::Array::fixed_size_list_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::fixed_size_list_validity_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::Array::len(&self) -> usize +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt::list_size(&self) -> u32 -impl vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList> +impl> vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt for T -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::as_slots(&self) -> &[core::option::Option] +pub fn T::dtype_parts(&self) -> (&vortex_array::dtype::DType, u32, vortex_array::dtype::Nullability) -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::elements(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_data(&self) -> &vortex_array::arrays::fixed_size_list::FixedSizeListData +pub fn T::elements(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_validity(&self) -> vortex_array::validity::Validity +pub fn T::fixed_size_list_validity(&self) -> vortex_array::validity::Validity -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_validity_mask(&self) -> vortex_mask::Mask +pub fn T::fixed_size_list_validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::len(&self) -> usize +pub fn T::list_size(&self) -> u32 pub type vortex_array::arrays::fixed_size_list::FixedSizeListArray = vortex_array::Array @@ -2548,9 +2412,9 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(_data: &vortex_array::arrays::list::ListData, _other: &vortex_array::arrays::list::ListData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(_data: &vortex_array::arrays::list::ListData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -2584,7 +2448,7 @@ pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::validate(&self, _data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::List @@ -2624,6 +2488,10 @@ impl core::clone::Clone for vortex_array::arrays::list::ListData pub fn vortex_array::arrays::list::ListData::clone(&self) -> vortex_array::arrays::list::ListData +impl core::default::Default for vortex_array::arrays::list::ListData + +pub fn vortex_array::arrays::list::ListData::default() -> vortex_array::arrays::list::ListData + impl core::fmt::Debug for vortex_array::arrays::list::ListData pub fn vortex_array::arrays::list::ListData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result @@ -2638,71 +2506,41 @@ pub vortex_array::arrays::list::ListDataParts::offsets: vortex_array::ArrayRef pub vortex_array::arrays::list::ListDataParts::validity: vortex_array::validity::Validity -pub trait vortex_array::arrays::list::ListArrayExt - -pub fn vortex_array::arrays::list::ListArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_array::arrays::list::ListArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::list::ListArrayExt::elements(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::list::ListArrayExt::len(&self) -> usize - -pub fn vortex_array::arrays::list::ListArrayExt::list_data(&self) -> &vortex_array::arrays::list::ListData - pub fn vortex_array::arrays::list::ListArrayExt::list_elements_at(&self, index: usize) -> vortex_error::VortexResult pub fn vortex_array::arrays::list::ListArrayExt::list_validity(&self) -> vortex_array::validity::Validity pub fn vortex_array::arrays::list::ListArrayExt::list_validity_mask(&self) -> vortex_mask::Mask +pub fn vortex_array::arrays::list::ListArrayExt::nullability(&self) -> vortex_array::dtype::Nullability + pub fn vortex_array::arrays::list::ListArrayExt::offset_at(&self, index: usize) -> vortex_error::VortexResult pub fn vortex_array::arrays::list::ListArrayExt::offsets(&self) -> &vortex_array::ArrayRef pub fn vortex_array::arrays::list::ListArrayExt::sliced_elements(&self) -> vortex_error::VortexResult -impl vortex_array::arrays::list::ListArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::len(&self) -> usize - -pub fn vortex_array::Array::list_data(&self) -> &vortex_array::arrays::list::ListData - -pub fn vortex_array::Array::list_elements_at(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::Array::list_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::list_validity_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::Array::offset_at(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::sliced_elements(&self) -> vortex_error::VortexResult - -impl vortex_array::arrays::list::ListArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::List> +impl> vortex_array::arrays::list::ListArrayExt for T -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::as_slots(&self) -> &[core::option::Option] +pub fn T::elements(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::elements(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::len(&self) -> usize +pub fn T::list_elements_at(&self, index: usize) -> vortex_error::VortexResult -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_data(&self) -> &vortex_array::arrays::list::ListData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_elements_at(&self, index: usize) -> vortex_error::VortexResult +pub fn T::list_validity(&self) -> vortex_array::validity::Validity -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_validity(&self) -> vortex_array::validity::Validity +pub fn T::list_validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_validity_mask(&self) -> vortex_mask::Mask +pub fn T::nullability(&self) -> vortex_array::dtype::Nullability -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::offset_at(&self, index: usize) -> vortex_error::VortexResult +pub fn T::offset_at(&self, index: usize) -> vortex_error::VortexResult -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::offsets(&self) -> &vortex_array::ArrayRef +pub fn T::offsets(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::sliced_elements(&self) -> vortex_error::VortexResult +pub fn T::sliced_elements(&self) -> vortex_error::VortexResult pub type vortex_array::arrays::list::ListArray = vortex_array::Array @@ -2746,9 +2584,9 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(data: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(data: &vortex_array::arrays::listview::ListViewData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -2782,7 +2620,7 @@ pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::validate(&self, _data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::ListView @@ -2840,22 +2678,18 @@ pub vortex_array::arrays::listview::ListViewDataParts::sizes: vortex_array::Arra pub vortex_array::arrays::listview::ListViewDataParts::validity: vortex_array::validity::Validity -pub trait vortex_array::arrays::listview::ListViewArrayExt - -pub fn vortex_array::arrays::listview::ListViewArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_array::arrays::listview::ListViewArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::listview::ListViewArrayExt::elements(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::listview::ListViewArrayExt::len(&self) -> usize - pub fn vortex_array::arrays::listview::ListViewArrayExt::list_elements_at(&self, index: usize) -> vortex_error::VortexResult -pub fn vortex_array::arrays::listview::ListViewArrayExt::listview_data(&self) -> &vortex_array::arrays::listview::ListViewData - pub fn vortex_array::arrays::listview::ListViewArrayExt::listview_validity(&self) -> vortex_array::validity::Validity pub fn vortex_array::arrays::listview::ListViewArrayExt::listview_validity_mask(&self) -> vortex_mask::Mask +pub fn vortex_array::arrays::listview::ListViewArrayExt::nullability(&self) -> vortex_array::dtype::Nullability + pub fn vortex_array::arrays::listview::ListViewArrayExt::offset_at(&self, index: usize) -> usize pub fn vortex_array::arrays::listview::ListViewArrayExt::offsets(&self) -> &vortex_array::ArrayRef @@ -2864,53 +2698,25 @@ pub fn vortex_array::arrays::listview::ListViewArrayExt::size_at(&self, index: u pub fn vortex_array::arrays::listview::ListViewArrayExt::sizes(&self) -> &vortex_array::ArrayRef -impl vortex_array::arrays::listview::ListViewArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::len(&self) -> usize - -pub fn vortex_array::Array::list_elements_at(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::Array::listview_data(&self) -> &vortex_array::arrays::listview::ListViewData - -pub fn vortex_array::Array::listview_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::listview_validity_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::Array::offset_at(&self, index: usize) -> usize - -pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::size_at(&self, index: usize) -> usize - -pub fn vortex_array::Array::sizes(&self) -> &vortex_array::ArrayRef - -impl vortex_array::arrays::listview::ListViewArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::ListView> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::elements(&self) -> &vortex_array::ArrayRef +impl> vortex_array::arrays::listview::ListViewArrayExt for T -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::len(&self) -> usize +pub fn T::elements(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::list_elements_at(&self, index: usize) -> vortex_error::VortexResult +pub fn T::list_elements_at(&self, index: usize) -> vortex_error::VortexResult -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::listview_data(&self) -> &vortex_array::arrays::listview::ListViewData +pub fn T::listview_validity(&self) -> vortex_array::validity::Validity -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::listview_validity(&self) -> vortex_array::validity::Validity +pub fn T::listview_validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::listview_validity_mask(&self) -> vortex_mask::Mask +pub fn T::nullability(&self) -> vortex_array::dtype::Nullability -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::offset_at(&self, index: usize) -> usize +pub fn T::offset_at(&self, index: usize) -> usize -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::offsets(&self) -> &vortex_array::ArrayRef +pub fn T::offsets(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::size_at(&self, index: usize) -> usize +pub fn T::size_at(&self, index: usize) -> usize -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::sizes(&self) -> &vortex_array::ArrayRef +pub fn T::sizes(&self) -> &vortex_array::ArrayRef pub fn vortex_array::arrays::listview::list_from_list_view(list_view: vortex_array::arrays::ListViewArray) -> vortex_error::VortexResult @@ -2950,9 +2756,9 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(_data: &vortex_array::arrays::masked::MaskedData, _other: &vortex_array::arrays::masked::MaskedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(_data: &vortex_array::arrays::masked::MaskedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -3018,59 +2824,25 @@ impl core::fmt::Debug for vortex_array::arrays::masked::MaskedData pub fn vortex_array::arrays::masked::MaskedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub trait vortex_array::arrays::masked::MaskedArrayExt - -pub fn vortex_array::arrays::masked::MaskedArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_array::arrays::masked::MaskedArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::masked::MaskedArrayExt::child(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::masked::MaskedArrayExt::masked_data(&self) -> &vortex_array::arrays::masked::MaskedData - -pub fn vortex_array::arrays::masked::MaskedArrayExt::masked_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::arrays::masked::MaskedArrayExt::masked_len(&self) -> usize - pub fn vortex_array::arrays::masked::MaskedArrayExt::masked_validity(&self) -> vortex_array::validity::Validity pub fn vortex_array::arrays::masked::MaskedArrayExt::masked_validity_mask(&self) -> vortex_mask::Mask pub fn vortex_array::arrays::masked::MaskedArrayExt::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> -impl vortex_array::arrays::masked::MaskedArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::masked_data(&self) -> &vortex_array::arrays::masked::MaskedData - -pub fn vortex_array::Array::masked_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::Array::masked_len(&self) -> usize - -pub fn vortex_array::Array::masked_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::masked_validity_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> - -impl vortex_array::arrays::masked::MaskedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Masked> +impl> vortex_array::arrays::masked::MaskedArrayExt for T -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::as_slots(&self) -> &[core::option::Option] +pub fn T::child(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::child(&self) -> &vortex_array::ArrayRef +pub fn T::masked_validity(&self) -> vortex_array::validity::Validity -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_data(&self) -> &vortex_array::arrays::masked::MaskedData +pub fn T::masked_validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_len(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_validity_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> +pub fn T::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> 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 @@ -3110,9 +2882,9 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_array: vortex_array::ArrayView<'_, Self>, _other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(_data: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(_array: vortex_array::ArrayView<'_, Self>, _state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(_data: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -3218,9 +2990,9 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::patched::Patched::array_eq(data: &vortex_array::arrays::patched::PatchedData, other: &vortex_array::arrays::patched::PatchedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::patched::Patched::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::patched::Patched::array_hash(data: &vortex_array::arrays::patched::PatchedData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -3306,7 +3078,7 @@ pub fn vortex_array::arrays::patched::PatchedMetadata::clear(&mut self) pub fn vortex_array::arrays::patched::PatchedMetadata::encoded_len(&self) -> usize -pub trait vortex_array::arrays::patched::PatchedArrayExt +pub trait vortex_array::arrays::patched::PatchedArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::patched::PatchedArrayExt::base_array(&self) -> &vortex_array::ArrayRef @@ -3322,67 +3094,25 @@ pub fn vortex_array::arrays::patched::PatchedArrayExt::patch_indices(&self) -> & pub fn vortex_array::arrays::patched::PatchedArrayExt::patch_values(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::patched::PatchedArrayExt::patched_data(&self) -> &vortex_array::arrays::patched::PatchedData - -pub fn vortex_array::arrays::patched::PatchedArrayExt::patched_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::arrays::patched::PatchedArrayExt::patched_len(&self) -> usize - -pub fn vortex_array::arrays::patched::PatchedArrayExt::patched_slots(&self) -> &[core::option::Option] - pub fn vortex_array::arrays::patched::PatchedArrayExt::slice_chunks(&self, chunks: core::ops::range::Range) -> vortex_error::VortexResult> -impl vortex_array::arrays::patched::PatchedArrayExt for vortex_array::Array - -pub fn vortex_array::Array::base_array(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::lane_offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::lane_range(&self, chunk: usize, lane: usize) -> vortex_error::VortexResult> - -pub fn vortex_array::Array::n_lanes(&self) -> usize - -pub fn vortex_array::Array::offset(&self) -> usize - -pub fn vortex_array::Array::patch_indices(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::patch_values(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::patched_data(&self) -> &vortex_array::arrays::patched::PatchedData +impl> vortex_array::arrays::patched::PatchedArrayExt for T -pub fn vortex_array::Array::patched_dtype(&self) -> &vortex_array::dtype::DType +pub fn T::base_array(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::Array::patched_len(&self) -> usize +pub fn T::lane_offsets(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::Array::patched_slots(&self) -> &[core::option::Option] +pub fn T::lane_range(&self, chunk: usize, lane: usize) -> vortex_error::VortexResult> -pub fn vortex_array::Array::slice_chunks(&self, chunks: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn T::n_lanes(&self) -> usize -impl vortex_array::arrays::patched::PatchedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched> +pub fn T::offset(&self) -> usize -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::base_array(&self) -> &vortex_array::ArrayRef +pub fn T::patch_indices(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::lane_offsets(&self) -> &vortex_array::ArrayRef +pub fn T::patch_values(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::lane_range(&self, chunk: usize, lane: usize) -> vortex_error::VortexResult> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::n_lanes(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::offset(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patch_indices(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patch_values(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_data(&self) -> &vortex_array::arrays::patched::PatchedData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_len(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::slice_chunks(&self, chunks: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn T::slice_chunks(&self, chunks: core::ops::range::Range) -> vortex_error::VortexResult> pub type vortex_array::arrays::patched::PatchedArray = vortex_array::Array @@ -3482,9 +3212,9 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(data: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(data: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -3566,8 +3296,6 @@ impl vortex_array::arrays::primitive::PrimitiveData pub fn vortex_array::arrays::primitive::PrimitiveData::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::primitive::PrimitiveData::dtype(&self) -> vortex_array::dtype::DType - pub fn vortex_array::arrays::primitive::PrimitiveData::from_buffer_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self pub fn vortex_array::arrays::primitive::PrimitiveData::from_byte_buffer(buffer: vortex_buffer::ByteBuffer, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self @@ -3584,7 +3312,7 @@ pub fn vortex_array::arrays::primitive::PrimitiveData::len(&self) -> usize pub fn vortex_array::arrays::primitive::PrimitiveData::map_each(self, f: F) -> Self where T: vortex_array::dtype::NativePType, R: vortex_array::dtype::NativePType, F: core::ops::function::FnMut(T) -> R -pub fn vortex_array::arrays::primitive::PrimitiveData::map_each_with_validity(self, f: F) -> vortex_error::VortexResult where T: vortex_array::dtype::NativePType, R: vortex_array::dtype::NativePType, F: core::ops::function::FnMut((T, bool)) -> R +pub fn vortex_array::arrays::primitive::PrimitiveData::map_each_with_validity(self, _f: F) -> vortex_error::VortexResult where T: vortex_array::dtype::NativePType, R: vortex_array::dtype::NativePType, F: core::ops::function::FnMut((T, bool)) -> R pub fn vortex_array::arrays::primitive::PrimitiveData::ptype(&self) -> vortex_array::dtype::PType @@ -3600,7 +3328,7 @@ pub fn vortex_array::arrays::primitive::PrimitiveData::new(buffer: vortex_buffer::buffer::Buffer, validity: vortex_array::validity::Validity) -> Self -pub unsafe fn vortex_array::arrays::primitive::PrimitiveData::new_unchecked_from_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self +pub unsafe fn vortex_array::arrays::primitive::PrimitiveData::new_unchecked_from_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, _validity: vortex_array::validity::Validity) -> Self pub fn vortex_array::arrays::primitive::PrimitiveData::try_new(buffer: vortex_buffer::buffer::Buffer, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult @@ -3642,11 +3370,11 @@ pub type vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::Parent = pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_parent(&self, array: vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>, parent: vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, _child_idx: usize) -> vortex_error::VortexResult> -pub trait vortex_array::arrays::primitive::PrimitiveArrayExt +pub trait vortex_array::arrays::primitive::PrimitiveArrayExt: vortex_array::TypedArrayRef -pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::as_slots(&self) -> &[core::option::Option] +pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::nullability(&self) -> vortex_array::dtype::Nullability -pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::primitive_data(&self) -> &vortex_array::arrays::primitive::PrimitiveData +pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::ptype(&self) -> vortex_array::dtype::PType pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::validity(&self) -> vortex_array::validity::Validity @@ -3654,29 +3382,17 @@ pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::validity_child(&self) pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::validity_mask(&self) -> vortex_mask::Mask -impl vortex_array::arrays::primitive::PrimitiveArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::primitive_data(&self) -> &vortex_array::arrays::primitive::PrimitiveData - -pub fn vortex_array::Array::validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> - -pub fn vortex_array::Array::validity_mask(&self) -> vortex_mask::Mask - -impl vortex_array::arrays::primitive::PrimitiveArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Primitive> +impl> vortex_array::arrays::primitive::PrimitiveArrayExt for T -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::as_slots(&self) -> &[core::option::Option] +pub fn T::nullability(&self) -> vortex_array::dtype::Nullability -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::primitive_data(&self) -> &vortex_array::arrays::primitive::PrimitiveData +pub fn T::ptype(&self) -> vortex_array::dtype::PType -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::validity(&self) -> vortex_array::validity::Validity +pub fn T::validity(&self) -> vortex_array::validity::Validity -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> +pub fn T::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::validity_mask(&self) -> vortex_mask::Mask +pub fn T::validity_mask(&self) -> vortex_mask::Mask pub fn vortex_array::arrays::primitive::chunk_range(chunk_idx: usize, offset: usize, array_len: usize) -> core::ops::range::Range @@ -3770,9 +3486,9 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(data: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(data: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -3852,9 +3568,9 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(_data: &vortex_array::arrays::shared::SharedData, _other: &vortex_array::arrays::shared::SharedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(_data: &vortex_array::arrays::shared::SharedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -3908,9 +3624,7 @@ impl core::fmt::Debug for vortex_array::arrays::shared::SharedData pub fn vortex_array::arrays::shared::SharedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub trait vortex_array::arrays::shared::SharedArrayExt - -pub fn vortex_array::arrays::shared::SharedArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_array::arrays::shared::SharedArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::shared::SharedArrayExt::current_array_ref(&self) -> &vortex_array::ArrayRef @@ -3918,49 +3632,17 @@ pub fn vortex_array::arrays::shared::SharedArrayExt::get_or_compute(&self, f: im pub async fn vortex_array::arrays::shared::SharedArrayExt::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> -pub fn vortex_array::arrays::shared::SharedArrayExt::shared_data(&self) -> &vortex_array::arrays::shared::SharedData - -pub fn vortex_array::arrays::shared::SharedArrayExt::shared_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::arrays::shared::SharedArrayExt::shared_len(&self) -> usize - pub fn vortex_array::arrays::shared::SharedArrayExt::source(&self) -> &vortex_array::ArrayRef -impl vortex_array::arrays::shared::SharedArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::current_array_ref(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult - -pub async fn vortex_array::Array::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> - -pub fn vortex_array::Array::shared_data(&self) -> &vortex_array::arrays::shared::SharedData - -pub fn vortex_array::Array::shared_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::Array::shared_len(&self) -> usize - -pub fn vortex_array::Array::source(&self) -> &vortex_array::ArrayRef - -impl vortex_array::arrays::shared::SharedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Shared> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::current_array_ref(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult +impl> vortex_array::arrays::shared::SharedArrayExt for T -pub async fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> +pub fn T::current_array_ref(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::shared_data(&self) -> &vortex_array::arrays::shared::SharedData +pub fn T::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::shared_dtype(&self) -> &vortex_array::dtype::DType +pub async fn T::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::shared_len(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::source(&self) -> &vortex_array::ArrayRef +pub fn T::source(&self) -> &vortex_array::ArrayRef pub type vortex_array::arrays::shared::SharedArray = vortex_array::Array @@ -3994,9 +3676,9 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(data: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(data: &vortex_array::arrays::slice::SliceData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -4104,35 +3786,13 @@ pub type vortex_array::arrays::slice::SliceReduceAdaptor::Parent = vortex_arr pub fn vortex_array::arrays::slice::SliceReduceAdaptor::reduce_parent(&self, array: vortex_array::ArrayView<'_, V>, parent: ::Match, child_idx: usize) -> vortex_error::VortexResult> -pub trait vortex_array::arrays::slice::SliceArrayExt - -pub fn vortex_array::arrays::slice::SliceArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_array::arrays::slice::SliceArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::slice::SliceArrayExt::child(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::slice::SliceArrayExt::slice_data(&self) -> &vortex_array::arrays::slice::SliceData - -pub fn vortex_array::arrays::slice::SliceArrayExt::slice_len(&self) -> usize - -impl vortex_array::arrays::slice::SliceArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::slice_data(&self) -> &vortex_array::arrays::slice::SliceData - -pub fn vortex_array::Array::slice_len(&self) -> usize +impl> vortex_array::arrays::slice::SliceArrayExt for T -impl vortex_array::arrays::slice::SliceArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::slice_data(&self) -> &vortex_array::arrays::slice::SliceData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::slice_len(&self) -> usize +pub fn T::child(&self) -> &vortex_array::ArrayRef pub trait vortex_array::arrays::slice::SliceKernel: vortex_array::VTable @@ -4242,9 +3902,9 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(_data: &vortex_array::arrays::struct_::StructData, _other: &vortex_array::arrays::struct_::StructData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(_data: &vortex_array::arrays::struct_::StructData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -4334,15 +3994,13 @@ pub vortex_array::arrays::struct_::StructDataParts::struct_fields: vortex_array: pub vortex_array::arrays::struct_::StructDataParts::validity: vortex_array::validity::Validity -pub trait vortex_array::arrays::struct_::StructArrayExt - -pub fn vortex_array::arrays::struct_::StructArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_array::arrays::struct_::StructArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::struct_::StructArrayExt::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ pub fn vortex_array::arrays::struct_::StructArrayExt::names(&self) -> &vortex_array::dtype::FieldNames -pub fn vortex_array::arrays::struct_::StructArrayExt::struct_data(&self) -> &vortex_array::arrays::struct_::StructData +pub fn vortex_array::arrays::struct_::StructArrayExt::nullability(&self) -> vortex_array::dtype::Nullability pub fn vortex_array::arrays::struct_::StructArrayExt::struct_fields(&self) -> vortex_array::dtype::StructFields @@ -4356,65 +4014,41 @@ pub fn vortex_array::arrays::struct_::StructArrayExt::unmasked_field_by_name_opt pub fn vortex_array::arrays::struct_::StructArrayExt::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> -impl vortex_array::arrays::struct_::StructArrayExt for vortex_array::Array +impl> vortex_array::arrays::struct_::StructArrayExt for T -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] +pub fn T::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ -pub fn vortex_array::Array::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ +pub fn T::names(&self) -> &vortex_array::dtype::FieldNames -pub fn vortex_array::Array::names(&self) -> &vortex_array::dtype::FieldNames +pub fn T::nullability(&self) -> vortex_array::dtype::Nullability -pub fn vortex_array::Array::struct_data(&self) -> &vortex_array::arrays::struct_::StructData +pub fn T::struct_fields(&self) -> vortex_array::dtype::StructFields -pub fn vortex_array::Array::struct_fields(&self) -> vortex_array::dtype::StructFields +pub fn T::struct_validity(&self) -> vortex_array::validity::Validity -pub fn vortex_array::Array::struct_validity(&self) -> vortex_array::validity::Validity +pub fn T::unmasked_field(&self, idx: usize) -> &vortex_array::ArrayRef -pub fn vortex_array::Array::unmasked_field(&self, idx: usize) -> &vortex_array::ArrayRef +pub fn T::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> -pub fn vortex_array::Array::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> +pub fn T::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> -pub fn vortex_array::Array::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> +pub fn T::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> -pub fn vortex_array::Array::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> +pub type vortex_array::arrays::struct_::StructArray = vortex_array::Array -impl vortex_array::arrays::struct_::StructArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Struct> +pub mod vortex_array::arrays::varbin -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::as_slots(&self) -> &[core::option::Option] +pub mod vortex_array::arrays::varbin::builder -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ +pub struct vortex_array::arrays::varbin::builder::VarBinBuilder -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::names(&self) -> &vortex_array::dtype::FieldNames +impl vortex_array::arrays::varbin::builder::VarBinBuilder -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::struct_data(&self) -> &vortex_array::arrays::struct_::StructData +pub fn vortex_array::arrays::varbin::builder::VarBinBuilder::append(&mut self, value: core::option::Option<&[u8]>) -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::struct_fields(&self) -> vortex_array::dtype::StructFields +pub fn vortex_array::arrays::varbin::builder::VarBinBuilder::append_n_nulls(&mut self, n: usize) -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::struct_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field(&self, idx: usize) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> - -pub type vortex_array::arrays::struct_::StructArray = vortex_array::Array - -pub mod vortex_array::arrays::varbin - -pub mod vortex_array::arrays::varbin::builder - -pub struct vortex_array::arrays::varbin::builder::VarBinBuilder - -impl vortex_array::arrays::varbin::builder::VarBinBuilder - -pub fn vortex_array::arrays::varbin::builder::VarBinBuilder::append(&mut self, value: core::option::Option<&[u8]>) - -pub fn vortex_array::arrays::varbin::builder::VarBinBuilder::append_n_nulls(&mut self, n: usize) - -pub fn vortex_array::arrays::varbin::builder::VarBinBuilder::append_null(&mut self) +pub fn vortex_array::arrays::varbin::builder::VarBinBuilder::append_null(&mut self) pub fn vortex_array::arrays::varbin::builder::VarBinBuilder::append_value(&mut self, value: impl core::convert::AsRef<[u8]>) @@ -4462,9 +4096,9 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(data: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(data: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -4498,7 +4132,7 @@ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::validate(&self, _data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::VarBin @@ -4536,8 +4170,6 @@ pub fn vortex_array::arrays::varbin::VarBinData::bytes(&self) -> &vortex_buffer: pub fn vortex_array::arrays::varbin::VarBinData::bytes_handle(&self) -> &vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::varbin::VarBinData::dtype(&self) -> vortex_array::dtype::DType - pub fn vortex_array::arrays::varbin::VarBinData::new(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self pub fn vortex_array::arrays::varbin::VarBinData::new_from_handle(offset: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self @@ -4570,13 +4202,15 @@ pub vortex_array::arrays::varbin::VarBinDataParts::offsets: vortex_array::ArrayR pub vortex_array::arrays::varbin::VarBinDataParts::validity: vortex_array::validity::Validity -pub trait vortex_array::arrays::varbin::VarBinArrayExt - -pub fn vortex_array::arrays::varbin::VarBinArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_array::arrays::varbin::VarBinArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::varbin::VarBinArrayExt::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer -pub fn vortex_array::arrays::varbin::VarBinArrayExt::len(&self) -> usize +pub fn vortex_array::arrays::varbin::VarBinArrayExt::dtype_parts(&self) -> (bool, vortex_array::dtype::Nullability) + +pub fn vortex_array::arrays::varbin::VarBinArrayExt::is_utf8(&self) -> bool + +pub fn vortex_array::arrays::varbin::VarBinArrayExt::nullability(&self) -> vortex_array::dtype::Nullability pub fn vortex_array::arrays::varbin::VarBinArrayExt::offset_at(&self, index: usize) -> usize @@ -4586,55 +4220,31 @@ pub fn vortex_array::arrays::varbin::VarBinArrayExt::sliced_bytes(&self) -> vort pub fn vortex_array::arrays::varbin::VarBinArrayExt::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> -pub fn vortex_array::arrays::varbin::VarBinArrayExt::varbin_data(&self) -> &vortex_array::arrays::varbin::VarBinData - pub fn vortex_array::arrays::varbin::VarBinArrayExt::varbin_validity(&self) -> vortex_array::validity::Validity pub fn vortex_array::arrays::varbin::VarBinArrayExt::varbin_validity_mask(&self) -> vortex_mask::Mask -impl vortex_array::arrays::varbin::VarBinArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] +impl> vortex_array::arrays::varbin::VarBinArrayExt for T -pub fn vortex_array::Array::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer - -pub fn vortex_array::Array::len(&self) -> usize - -pub fn vortex_array::Array::offset_at(&self, index: usize) -> usize - -pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::sliced_bytes(&self) -> vortex_buffer::ByteBuffer +pub fn T::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer -pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> - -pub fn vortex_array::Array::varbin_data(&self) -> &vortex_array::arrays::varbin::VarBinData - -pub fn vortex_array::Array::varbin_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::varbin_validity_mask(&self) -> vortex_mask::Mask - -impl vortex_array::arrays::varbin::VarBinArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::VarBin> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer +pub fn T::dtype_parts(&self) -> (bool, vortex_array::dtype::Nullability) -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::len(&self) -> usize +pub fn T::is_utf8(&self) -> bool -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::offset_at(&self, index: usize) -> usize +pub fn T::nullability(&self) -> vortex_array::dtype::Nullability -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::offsets(&self) -> &vortex_array::ArrayRef +pub fn T::offset_at(&self, index: usize) -> usize -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::sliced_bytes(&self) -> vortex_buffer::ByteBuffer +pub fn T::offsets(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> +pub fn T::sliced_bytes(&self) -> vortex_buffer::ByteBuffer -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::varbin_data(&self) -> &vortex_array::arrays::varbin::VarBinData +pub fn T::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::varbin_validity(&self) -> vortex_array::validity::Validity +pub fn T::varbin_validity(&self) -> vortex_array::validity::Validity -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::varbin_validity_mask(&self) -> vortex_mask::Mask +pub fn T::varbin_validity_mask(&self) -> vortex_mask::Mask pub fn vortex_array::arrays::varbin::varbin_scalar(value: vortex_buffer::ByteBuffer, dtype: &vortex_array::dtype::DType) -> vortex_array::scalar::Scalar @@ -4852,9 +4462,9 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(data: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(data: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -4924,8 +4534,6 @@ pub fn vortex_array::arrays::varbinview::VarBinViewData::bytes_at(&self, index: pub fn vortex_array::arrays::varbinview::VarBinViewData::data_buffers(&self) -> &alloc::sync::Arc<[vortex_array::buffer::BufferHandle]> -pub fn vortex_array::arrays::varbinview::VarBinViewData::dtype(&self) -> vortex_array::dtype::DType - pub fn vortex_array::arrays::varbinview::VarBinViewData::from_iter, I: core::iter::traits::collect::IntoIterator>>(iter: I, dtype: vortex_array::dtype::DType) -> Self pub fn vortex_array::arrays::varbinview::VarBinViewData::from_iter_bin, I: core::iter::traits::collect::IntoIterator>(iter: I) -> Self @@ -4944,7 +4552,7 @@ pub fn vortex_array::arrays::varbinview::VarBinViewData::new(views: vortex_buffe pub fn vortex_array::arrays::varbinview::VarBinViewData::new_handle(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub unsafe fn vortex_array::arrays::varbinview::VarBinViewData::new_handle_unchecked(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub unsafe fn vortex_array::arrays::varbinview::VarBinViewData::new_handle_unchecked(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, _validity: vortex_array::validity::Validity) -> Self pub unsafe fn vortex_array::arrays::varbinview::VarBinViewData::new_unchecked(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self @@ -4992,35 +4600,21 @@ pub vortex_array::arrays::varbinview::VarBinViewDataParts::validity: vortex_arra pub vortex_array::arrays::varbinview::VarBinViewDataParts::views: vortex_array::buffer::BufferHandle -pub trait vortex_array::arrays::varbinview::VarBinViewArrayExt +pub trait vortex_array::arrays::varbinview::VarBinViewArrayExt: vortex_array::TypedArrayRef -pub fn vortex_array::arrays::varbinview::VarBinViewArrayExt::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::arrays::varbinview::VarBinViewArrayExt::varbinview_data(&self) -> &vortex_array::arrays::varbinview::VarBinViewData +pub fn vortex_array::arrays::varbinview::VarBinViewArrayExt::dtype_parts(&self) -> (bool, vortex_array::dtype::Nullability) pub fn vortex_array::arrays::varbinview::VarBinViewArrayExt::varbinview_validity(&self) -> vortex_array::validity::Validity pub fn vortex_array::arrays::varbinview::VarBinViewArrayExt::varbinview_validity_mask(&self) -> vortex_mask::Mask -impl vortex_array::arrays::varbinview::VarBinViewArrayExt for vortex_array::Array +impl> vortex_array::arrays::varbinview::VarBinViewArrayExt for T -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] +pub fn T::dtype_parts(&self) -> (bool, vortex_array::dtype::Nullability) -pub fn vortex_array::Array::varbinview_data(&self) -> &vortex_array::arrays::varbinview::VarBinViewData +pub fn T::varbinview_validity(&self) -> vortex_array::validity::Validity -pub fn vortex_array::Array::varbinview_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::varbinview_validity_mask(&self) -> vortex_mask::Mask - -impl vortex_array::arrays::varbinview::VarBinViewArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_data(&self) -> &vortex_array::arrays::varbinview::VarBinViewData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_validity_mask(&self) -> vortex_mask::Mask +pub fn T::varbinview_validity_mask(&self) -> vortex_mask::Mask pub type vortex_array::arrays::varbinview::VarBinViewArray = vortex_array::Array @@ -5054,9 +4648,9 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(_data: &vortex_array::arrays::variant::VariantData, _other: &vortex_array::arrays::variant::VariantData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(_data: &vortex_array::arrays::variant::VariantData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5106,41 +4700,13 @@ impl core::fmt::Debug for vortex_array::arrays::variant::VariantData pub fn vortex_array::arrays::variant::VariantData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub trait vortex_array::arrays::variant::VariantArrayExt - -pub fn vortex_array::arrays::variant::VariantArrayExt::as_slots(&self) -> &[core::option::Option] +pub trait vortex_array::arrays::variant::VariantArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::variant::VariantArrayExt::child(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::variant::VariantArrayExt::variant_data(&self) -> &vortex_array::arrays::variant::VariantData - -pub fn vortex_array::arrays::variant::VariantArrayExt::variant_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::arrays::variant::VariantArrayExt::variant_len(&self) -> usize - -impl vortex_array::arrays::variant::VariantArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::variant_data(&self) -> &vortex_array::arrays::variant::VariantData - -pub fn vortex_array::Array::variant_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::Array::variant_len(&self) -> usize - -impl vortex_array::arrays::variant::VariantArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Variant> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::variant_data(&self) -> &vortex_array::arrays::variant::VariantData +impl> vortex_array::arrays::variant::VariantArrayExt for T -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::variant_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::variant_len(&self) -> usize +pub fn T::child(&self) -> &vortex_array::ArrayRef pub type vortex_array::arrays::variant::VariantArray = vortex_array::Array @@ -5172,9 +4738,9 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(data: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(data: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5272,9 +4838,9 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(_data: &vortex_array::arrays::chunked::ChunkedData, _other: &vortex_array::arrays::chunked::ChunkedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(_data: &vortex_array::arrays::chunked::ChunkedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5374,9 +4940,9 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(data: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(data: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5472,9 +5038,9 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(data: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(data: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5572,9 +5138,9 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(_data: &vortex_array::arrays::dict::DictData, _other: &vortex_array::arrays::dict::DictData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(_data: &vortex_array::arrays::dict::DictData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5674,9 +5240,9 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(_data: &vortex_array::arrays::extension::ExtensionData, _other: &vortex_array::arrays::extension::ExtensionData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(_data: &vortex_array::arrays::extension::ExtensionData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5768,9 +5334,9 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(data: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(data: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -5838,9 +5404,9 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5924,9 +5490,9 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(_data: &vortex_array::arrays::list::ListData, _other: &vortex_array::arrays::list::ListData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(_data: &vortex_array::arrays::list::ListData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -5960,7 +5526,7 @@ pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::validate(&self, _data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::List @@ -6014,9 +5580,9 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(data: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(data: &vortex_array::arrays::listview::ListViewData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -6050,7 +5616,7 @@ pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::validate(&self, _data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::ListView @@ -6100,9 +5666,9 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(_data: &vortex_array::arrays::masked::MaskedData, _other: &vortex_array::arrays::masked::MaskedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(_data: &vortex_array::arrays::masked::MaskedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -6190,9 +5756,9 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_array: vortex_array::ArrayView<'_, Self>, _other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(_data: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(_array: vortex_array::ArrayView<'_, Self>, _state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(_data: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -6276,9 +5842,9 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::patched::Patched::array_eq(data: &vortex_array::arrays::patched::PatchedData, other: &vortex_array::arrays::patched::PatchedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::patched::Patched::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::patched::Patched::array_hash(data: &vortex_array::arrays::patched::PatchedData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -6362,9 +5928,9 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(data: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(data: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -6458,9 +6024,9 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(data: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(data: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -6528,9 +6094,9 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(_data: &vortex_array::arrays::shared::SharedData, _other: &vortex_array::arrays::shared::SharedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(_data: &vortex_array::arrays::shared::SharedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -6598,9 +6164,9 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(data: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(data: &vortex_array::arrays::slice::SliceData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -6672,9 +6238,9 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(_data: &vortex_array::arrays::struct_::StructData, _other: &vortex_array::arrays::struct_::StructData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(_data: &vortex_array::arrays::struct_::StructData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -6766,9 +6332,9 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(data: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(data: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -6802,7 +6368,7 @@ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::validate(&self, _data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::VarBin @@ -6860,9 +6426,9 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(data: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(data: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -6950,9 +6516,9 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(_data: &vortex_array::arrays::variant::VariantData, _other: &vortex_array::arrays::variant::VariantData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(_data: &vortex_array::arrays::variant::VariantData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19180,9 +18746,9 @@ pub type vortex_array::vtable::ArrayVTable::ValidityVTable: vortex_array::Validi pub fn vortex_array::vtable::ArrayVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::vtable::ArrayVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::vtable::ArrayVTable::array_eq(data: &Self::ArrayData, other: &Self::ArrayData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::vtable::ArrayVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::vtable::ArrayVTable::array_hash(data: &Self::ArrayData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::vtable::ArrayVTable::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19228,9 +18794,9 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(data: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(data: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19276,9 +18842,9 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(_data: &vortex_array::arrays::chunked::ChunkedData, _other: &vortex_array::arrays::chunked::ChunkedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(_data: &vortex_array::arrays::chunked::ChunkedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19324,9 +18890,9 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(data: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(data: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19372,9 +18938,9 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(data: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(data: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19420,9 +18986,9 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(_data: &vortex_array::arrays::extension::ExtensionData, _other: &vortex_array::arrays::extension::ExtensionData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(_data: &vortex_array::arrays::extension::ExtensionData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19468,9 +19034,9 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(data: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(data: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -19516,9 +19082,9 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19564,9 +19130,9 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(_data: &vortex_array::arrays::list::ListData, _other: &vortex_array::arrays::list::ListData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(_data: &vortex_array::arrays::list::ListData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19600,7 +19166,7 @@ pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::validate(&self, _data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::ListView @@ -19612,9 +19178,9 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(data: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(data: &vortex_array::arrays::listview::ListViewData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19648,7 +19214,7 @@ pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::validate(&self, _data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Masked @@ -19660,9 +19226,9 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(_data: &vortex_array::arrays::masked::MaskedData, _other: &vortex_array::arrays::masked::MaskedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(_data: &vortex_array::arrays::masked::MaskedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -19708,9 +19274,9 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(data: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(data: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19756,9 +19322,9 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(_data: &vortex_array::arrays::shared::SharedData, _other: &vortex_array::arrays::shared::SharedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(_data: &vortex_array::arrays::shared::SharedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -19804,9 +19370,9 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(_data: &vortex_array::arrays::struct_::StructData, _other: &vortex_array::arrays::struct_::StructData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(_data: &vortex_array::arrays::struct_::StructData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19852,9 +19418,9 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(data: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(data: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19888,7 +19454,7 @@ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::validate(&self, _data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBinView @@ -19900,9 +19466,9 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(data: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(data: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19948,9 +19514,9 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(_data: &vortex_array::arrays::variant::VariantData, _other: &vortex_array::arrays::variant::VariantData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(_data: &vortex_array::arrays::variant::VariantData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -19996,9 +19562,9 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(_data: &vortex_array::arrays::dict::DictData, _other: &vortex_array::arrays::dict::DictData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(_data: &vortex_array::arrays::dict::DictData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20044,9 +19610,9 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_array: vortex_array::ArrayView<'_, Self>, _other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(_data: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(_array: vortex_array::ArrayView<'_, Self>, _state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(_data: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20092,9 +19658,9 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::patched::Patched::array_eq(data: &vortex_array::arrays::patched::PatchedData, other: &vortex_array::arrays::patched::PatchedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::patched::Patched::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::patched::Patched::array_hash(data: &vortex_array::arrays::patched::PatchedData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20140,9 +19706,9 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(data: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(data: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20188,9 +19754,9 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(data: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(data: &vortex_array::arrays::slice::SliceData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -20360,9 +19926,9 @@ pub type vortex_array::vtable::VTable::ValidityVTable: vortex_array::ValidityVTa pub fn vortex_array::vtable::VTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::vtable::VTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::vtable::VTable::array_eq(data: &Self::ArrayData, other: &Self::ArrayData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::vtable::VTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::vtable::VTable::array_hash(data: &Self::ArrayData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::vtable::VTable::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20408,9 +19974,9 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(data: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(data: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20456,9 +20022,9 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(_data: &vortex_array::arrays::chunked::ChunkedData, _other: &vortex_array::arrays::chunked::ChunkedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(_data: &vortex_array::arrays::chunked::ChunkedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20504,9 +20070,9 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(data: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(data: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20552,9 +20118,9 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(data: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(data: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20600,9 +20166,9 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(_data: &vortex_array::arrays::extension::ExtensionData, _other: &vortex_array::arrays::extension::ExtensionData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(_data: &vortex_array::arrays::extension::ExtensionData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20648,9 +20214,9 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(data: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(data: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -20696,9 +20262,9 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20744,9 +20310,9 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(_data: &vortex_array::arrays::list::ListData, _other: &vortex_array::arrays::list::ListData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(_data: &vortex_array::arrays::list::ListData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20780,7 +20346,7 @@ pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::validate(&self, _data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::ListView @@ -20792,9 +20358,9 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(data: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(data: &vortex_array::arrays::listview::ListViewData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20828,7 +20394,7 @@ pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::validate(&self, _data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Masked @@ -20840,9 +20406,9 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(_data: &vortex_array::arrays::masked::MaskedData, _other: &vortex_array::arrays::masked::MaskedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(_data: &vortex_array::arrays::masked::MaskedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -20888,9 +20454,9 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(data: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(data: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -20936,9 +20502,9 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(_data: &vortex_array::arrays::shared::SharedData, _other: &vortex_array::arrays::shared::SharedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(_data: &vortex_array::arrays::shared::SharedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -20984,9 +20550,9 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(_data: &vortex_array::arrays::struct_::StructData, _other: &vortex_array::arrays::struct_::StructData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(_data: &vortex_array::arrays::struct_::StructData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -21032,9 +20598,9 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(data: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(data: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -21068,7 +20634,7 @@ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::validate(&self, _data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBinView @@ -21080,9 +20646,9 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(data: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(data: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -21128,9 +20694,9 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(_data: &vortex_array::arrays::variant::VariantData, _other: &vortex_array::arrays::variant::VariantData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(_data: &vortex_array::arrays::variant::VariantData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -21176,9 +20742,9 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(_data: &vortex_array::arrays::dict::DictData, _other: &vortex_array::arrays::dict::DictData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(_data: &vortex_array::arrays::dict::DictData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -21224,9 +20790,9 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_array: vortex_array::ArrayView<'_, Self>, _other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(_data: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(_array: vortex_array::ArrayView<'_, Self>, _state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(_data: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -21272,9 +20838,9 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::patched::Patched::array_eq(data: &vortex_array::arrays::patched::PatchedData, other: &vortex_array::arrays::patched::PatchedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::patched::Patched::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::patched::Patched::array_hash(data: &vortex_array::arrays::patched::PatchedData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -21320,9 +20886,9 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(data: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(data: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -21368,9 +20934,9 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(data: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(data: &vortex_array::arrays::slice::SliceData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -21842,6 +21408,12 @@ pub fn vortex_array::Array::new(scalar: S, le impl vortex_array::Array +pub fn vortex_array::Array::buffer(&self) -> vortex_buffer::buffer::Buffer + +pub fn vortex_array::Array::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle + +pub fn vortex_array::Array::decimal_dtype(&self) -> vortex_array::dtype::DecimalDType + pub fn vortex_array::Array::from_iter>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self pub fn vortex_array::Array::from_option_iter>>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self @@ -21856,8 +21428,14 @@ pub unsafe fn vortex_array::Array::new_unchecked_ pub fn vortex_array::Array::patch(self, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::Array::precision(&self) -> u8 + +pub fn vortex_array::Array::scale(&self) -> i8 + pub fn vortex_array::Array::try_new(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::Array::values_type(&self) -> vortex_array::dtype::DecimalType + impl vortex_array::Array pub fn vortex_array::Array::into_data_parts(self) -> vortex_array::arrays::decimal::DecimalDataParts @@ -21966,6 +21544,12 @@ pub fn vortex_array::Array::try_new(child: vortex_ impl vortex_array::Array +pub fn vortex_array::Array::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle + +pub fn vortex_array::Array::ptype(&self) -> vortex_array::dtype::PType + +impl vortex_array::Array + pub fn vortex_array::Array::empty(nullability: vortex_array::dtype::Nullability) -> Self pub fn vortex_array::Array::from_buffer_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self @@ -22310,288 +21894,6 @@ impl core::iter::traits::collect::FromIterator for vorte pub fn vortex_array::Array::from_iter>(iter: T) -> Self -impl vortex_array::arrays::chunked::ChunkedArrayExt for vortex_array::Array - -pub fn vortex_array::Array::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ - -pub fn vortex_array::Array::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::chunk(&self, idx: usize) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer - -pub fn vortex_array::Array::chunk_offsets_array(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::chunked_data(&self) -> &vortex_array::arrays::chunked::ChunkedData - -pub fn vortex_array::Array::chunked_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::Array::chunked_len(&self) -> usize - -pub fn vortex_array::Array::chunks(&self) -> alloc::vec::Vec - -pub fn vortex_array::Array::find_chunk_idx(&self, index: usize) -> vortex_error::VortexResult<(usize, usize)> - -pub fn vortex_array::Array::iter_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> - -pub fn vortex_array::Array::nchunks(&self) -> usize - -pub fn vortex_array::Array::non_empty_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> - -impl vortex_array::arrays::decimal::DecimalArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::decimal_data(&self) -> &vortex_array::arrays::decimal::DecimalData - -pub fn vortex_array::Array::validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> - -impl vortex_array::arrays::dict::DictArrayExt for vortex_array::Array - -pub fn vortex_array::Array::codes(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult - -pub fn vortex_array::Array::dict_data(&self) -> &vortex_array::arrays::dict::DictData - -pub fn vortex_array::Array::has_all_values_referenced(&self) -> bool - -pub fn vortex_array::Array::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> - -pub fn vortex_array::Array::values(&self) -> &vortex_array::ArrayRef - -impl vortex_array::arrays::extension::ExtensionArrayExt for vortex_array::Array - -pub fn vortex_array::Array::extension_data(&self) -> &vortex_array::arrays::extension::ExtensionData - -pub fn vortex_array::Array::storage_array(&self) -> &vortex_array::ArrayRef - -impl vortex_array::arrays::filter::FilterArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::filter_data(&self) -> &vortex_array::arrays::filter::FilterData - -pub fn vortex_array::Array::filter_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::Array::filter_len(&self) -> usize - -impl vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::fixed_size_list_data(&self) -> &vortex_array::arrays::fixed_size_list::FixedSizeListData - -pub fn vortex_array::Array::fixed_size_list_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::fixed_size_list_validity_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::Array::len(&self) -> usize - -impl vortex_array::arrays::list::ListArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::len(&self) -> usize - -pub fn vortex_array::Array::list_data(&self) -> &vortex_array::arrays::list::ListData - -pub fn vortex_array::Array::list_elements_at(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::Array::list_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::list_validity_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::Array::offset_at(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::sliced_elements(&self) -> vortex_error::VortexResult - -impl vortex_array::arrays::listview::ListViewArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::elements(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::len(&self) -> usize - -pub fn vortex_array::Array::list_elements_at(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::Array::listview_data(&self) -> &vortex_array::arrays::listview::ListViewData - -pub fn vortex_array::Array::listview_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::listview_validity_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::Array::offset_at(&self, index: usize) -> usize - -pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::size_at(&self, index: usize) -> usize - -pub fn vortex_array::Array::sizes(&self) -> &vortex_array::ArrayRef - -impl vortex_array::arrays::masked::MaskedArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::masked_data(&self) -> &vortex_array::arrays::masked::MaskedData - -pub fn vortex_array::Array::masked_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::Array::masked_len(&self) -> usize - -pub fn vortex_array::Array::masked_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::masked_validity_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> - -impl vortex_array::arrays::patched::PatchedArrayExt for vortex_array::Array - -pub fn vortex_array::Array::base_array(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::lane_offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::lane_range(&self, chunk: usize, lane: usize) -> vortex_error::VortexResult> - -pub fn vortex_array::Array::n_lanes(&self) -> usize - -pub fn vortex_array::Array::offset(&self) -> usize - -pub fn vortex_array::Array::patch_indices(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::patch_values(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::patched_data(&self) -> &vortex_array::arrays::patched::PatchedData - -pub fn vortex_array::Array::patched_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::Array::patched_len(&self) -> usize - -pub fn vortex_array::Array::patched_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::slice_chunks(&self, chunks: core::ops::range::Range) -> vortex_error::VortexResult> - -impl vortex_array::arrays::primitive::PrimitiveArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::primitive_data(&self) -> &vortex_array::arrays::primitive::PrimitiveData - -pub fn vortex_array::Array::validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> - -pub fn vortex_array::Array::validity_mask(&self) -> vortex_mask::Mask - -impl vortex_array::arrays::shared::SharedArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::current_array_ref(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult - -pub async fn vortex_array::Array::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> - -pub fn vortex_array::Array::shared_data(&self) -> &vortex_array::arrays::shared::SharedData - -pub fn vortex_array::Array::shared_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::Array::shared_len(&self) -> usize - -pub fn vortex_array::Array::source(&self) -> &vortex_array::ArrayRef - -impl vortex_array::arrays::slice::SliceArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::slice_data(&self) -> &vortex_array::arrays::slice::SliceData - -pub fn vortex_array::Array::slice_len(&self) -> usize - -impl vortex_array::arrays::struct_::StructArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ - -pub fn vortex_array::Array::names(&self) -> &vortex_array::dtype::FieldNames - -pub fn vortex_array::Array::struct_data(&self) -> &vortex_array::arrays::struct_::StructData - -pub fn vortex_array::Array::struct_fields(&self) -> vortex_array::dtype::StructFields - -pub fn vortex_array::Array::struct_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::unmasked_field(&self, idx: usize) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> - -pub fn vortex_array::Array::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> - -pub fn vortex_array::Array::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> - -impl vortex_array::arrays::varbin::VarBinArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer - -pub fn vortex_array::Array::len(&self) -> usize - -pub fn vortex_array::Array::offset_at(&self, index: usize) -> usize - -pub fn vortex_array::Array::offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::sliced_bytes(&self) -> vortex_buffer::ByteBuffer - -pub fn vortex_array::Array::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> - -pub fn vortex_array::Array::varbin_data(&self) -> &vortex_array::arrays::varbin::VarBinData - -pub fn vortex_array::Array::varbin_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::varbin_validity_mask(&self) -> vortex_mask::Mask - -impl vortex_array::arrays::varbinview::VarBinViewArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::varbinview_data(&self) -> &vortex_array::arrays::varbinview::VarBinViewData - -pub fn vortex_array::Array::varbinview_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::Array::varbinview_validity_mask(&self) -> vortex_mask::Mask - -impl vortex_array::arrays::variant::VariantArrayExt for vortex_array::Array - -pub fn vortex_array::Array::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::Array::variant_data(&self) -> &vortex_array::arrays::variant::VariantData - -pub fn vortex_array::Array::variant_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::Array::variant_len(&self) -> usize - impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::Array pub fn vortex_array::Array::from_iter>>(iter: T) -> Self @@ -22634,6 +21936,10 @@ impl vortex_array::IntoArray for vortex_array::Array pub fn vortex_array::Array::into_array(self) -> vortex_array::ArrayRef +impl vortex_array::TypedArrayRef for vortex_array::Array + +pub fn vortex_array::Array::slots_ref(&self) -> &[core::option::Option] + pub struct vortex_array::ArrayParts pub vortex_array::ArrayParts::data: ::ArrayData @@ -23134,6 +22440,20 @@ pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::nchunks(&self pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::non_empty_chunks(&self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + '_)> +impl vortex_array::ArrayView<'_, vortex_array::arrays::Decimal> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::buffer(&self) -> vortex_buffer::buffer::Buffer + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::decimal_dtype(&self) -> vortex_array::dtype::DecimalDType + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::precision(&self) -> u8 + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::scale(&self) -> i8 + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::values_type(&self) -> vortex_array::dtype::DecimalType + impl vortex_array::ArrayView<'_, vortex_array::arrays::Extension> pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Extension>::storage_array(&self) -> &vortex_array::ArrayRef @@ -23188,6 +22508,12 @@ pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::sizes(&self) pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::verify_is_zero_copy_to_list(&self) -> bool +impl vortex_array::ArrayView<'_, vortex_array::arrays::Primitive> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::ptype(&self) -> vortex_array::dtype::PType + impl vortex_array::ArrayView<'_, vortex_array::arrays::Struct> pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ @@ -23270,288 +22596,6 @@ pub fn vortex_array::ArrayView<'a, V>::statistics(&self) -> vortex_array::stats: pub fn vortex_array::ArrayView<'a, V>::validity(&self) -> vortex_error::VortexResult -impl vortex_array::arrays::chunked::ChunkedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Chunked> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk(&self, idx: usize) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk_offsets_array(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunked_data(&self) -> &vortex_array::arrays::chunked::ChunkedData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunked_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunked_len(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunks(&self) -> alloc::vec::Vec - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::find_chunk_idx(&self, index: usize) -> vortex_error::VortexResult<(usize, usize)> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::iter_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::nchunks(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::non_empty_chunks<'a>(&'a self) -> alloc::boxed::Box<(dyn core::iter::traits::iterator::Iterator + 'a)> - -impl vortex_array::arrays::decimal::DecimalArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Decimal> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::decimal_data(&self) -> &vortex_array::arrays::decimal::DecimalData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> - -impl vortex_array::arrays::dict::DictArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::codes(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::dict_data(&self) -> &vortex_array::arrays::dict::DictData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::has_all_values_referenced(&self) -> bool - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::values(&self) -> &vortex_array::ArrayRef - -impl vortex_array::arrays::extension::ExtensionArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Extension> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Extension>::extension_data(&self) -> &vortex_array::arrays::extension::ExtensionData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Extension>::storage_array(&self) -> &vortex_array::ArrayRef - -impl vortex_array::arrays::filter::FilterArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Filter> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::filter_data(&self) -> &vortex_array::arrays::filter::FilterData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::filter_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Filter>::filter_len(&self) -> usize - -impl vortex_array::arrays::fixed_size_list::FixedSizeListArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::elements(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_data(&self) -> &vortex_array::arrays::fixed_size_list::FixedSizeListData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::fixed_size_list_validity_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::FixedSizeList>::len(&self) -> usize - -impl vortex_array::arrays::list::ListArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::List> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::elements(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::len(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_data(&self) -> &vortex_array::arrays::list::ListData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_elements_at(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::list_validity_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::offset_at(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::sliced_elements(&self) -> vortex_error::VortexResult - -impl vortex_array::arrays::listview::ListViewArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::ListView> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::elements(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::len(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::list_elements_at(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::listview_data(&self) -> &vortex_array::arrays::listview::ListViewData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::listview_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::listview_validity_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::offset_at(&self, index: usize) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::size_at(&self, index: usize) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::ListView>::sizes(&self) -> &vortex_array::ArrayRef - -impl vortex_array::arrays::masked::MaskedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Masked> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_data(&self) -> &vortex_array::arrays::masked::MaskedData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_len(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::masked_validity_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Masked>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> - -impl vortex_array::arrays::patched::PatchedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::base_array(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::lane_offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::lane_range(&self, chunk: usize, lane: usize) -> vortex_error::VortexResult> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::n_lanes(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::offset(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patch_indices(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patch_values(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_data(&self) -> &vortex_array::arrays::patched::PatchedData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_len(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::patched_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::patched::Patched>::slice_chunks(&self, chunks: core::ops::range::Range) -> vortex_error::VortexResult> - -impl vortex_array::arrays::primitive::PrimitiveArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Primitive> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::primitive_data(&self) -> &vortex_array::arrays::primitive::PrimitiveData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>::validity_mask(&self) -> vortex_mask::Mask - -impl vortex_array::arrays::shared::SharedArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Shared> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::current_array_ref(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult - -pub async fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::shared_data(&self) -> &vortex_array::arrays::shared::SharedData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::shared_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::shared_len(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Shared>::source(&self) -> &vortex_array::ArrayRef - -impl vortex_array::arrays::slice::SliceArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::slice_data(&self) -> &vortex_array::arrays::slice::SliceData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::slice::Slice>::slice_len(&self) -> usize - -impl vortex_array::arrays::struct_::StructArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Struct> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::iter_unmasked_fields(&self) -> impl core::iter::traits::iterator::Iterator + '_ - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::names(&self) -> &vortex_array::dtype::FieldNames - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::struct_data(&self) -> &vortex_array::arrays::struct_::StructData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::struct_fields(&self) -> vortex_array::dtype::StructFields - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::struct_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field(&self, idx: usize) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Struct>::unmasked_fields(&self) -> alloc::sync::Arc<[vortex_array::ArrayRef]> - -impl vortex_array::arrays::varbin::VarBinArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::VarBin> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::len(&self) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::offset_at(&self, index: usize) -> usize - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::offsets(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::sliced_bytes(&self) -> vortex_buffer::ByteBuffer - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::varbin_data(&self) -> &vortex_array::arrays::varbin::VarBinData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::varbin_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBin>::varbin_validity_mask(&self) -> vortex_mask::Mask - -impl vortex_array::arrays::varbinview::VarBinViewArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_data(&self) -> &vortex_array::arrays::varbinview::VarBinViewData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_validity(&self) -> vortex_array::validity::Validity - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_validity_mask(&self) -> vortex_mask::Mask - -impl vortex_array::arrays::variant::VariantArrayExt for vortex_array::ArrayView<'_, vortex_array::arrays::Variant> - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::as_slots(&self) -> &[core::option::Option] - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::variant_data(&self) -> &vortex_array::arrays::variant::VariantData - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::variant_dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::variant_len(&self) -> usize - impl core::clone::Clone for vortex_array::ArrayView<'_, V> pub fn vortex_array::ArrayView<'_, V>::clone(&self) -> Self @@ -23572,6 +22616,10 @@ pub type vortex_array::ArrayView<'_, V>::Target = ::A pub fn vortex_array::ArrayView<'_, V>::deref(&self) -> &::ArrayData +impl vortex_array::TypedArrayRef for vortex_array::ArrayView<'_, V> + +pub fn vortex_array::ArrayView<'_, V>::slots_ref(&self) -> &[core::option::Option] + pub struct vortex_array::CanonicalValidity(pub vortex_array::Canonical) impl vortex_array::Executable for vortex_array::CanonicalValidity @@ -23826,9 +22874,9 @@ pub type vortex_array::ArrayVTable::ValidityVTable: vortex_array::ValidityVTable pub fn vortex_array::ArrayVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::ArrayVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::ArrayVTable::array_eq(data: &Self::ArrayData, other: &Self::ArrayData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::ArrayVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::ArrayVTable::array_hash(data: &Self::ArrayData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::ArrayVTable::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23874,9 +22922,9 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(data: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(data: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23922,9 +22970,9 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(_data: &vortex_array::arrays::chunked::ChunkedData, _other: &vortex_array::arrays::chunked::ChunkedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(_data: &vortex_array::arrays::chunked::ChunkedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -23970,9 +23018,9 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(data: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(data: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24018,9 +23066,9 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(data: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(data: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24066,9 +23114,9 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(_data: &vortex_array::arrays::extension::ExtensionData, _other: &vortex_array::arrays::extension::ExtensionData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(_data: &vortex_array::arrays::extension::ExtensionData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24114,9 +23162,9 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(data: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(data: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -24162,9 +23210,9 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24210,9 +23258,9 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(_data: &vortex_array::arrays::list::ListData, _other: &vortex_array::arrays::list::ListData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(_data: &vortex_array::arrays::list::ListData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24246,7 +23294,7 @@ pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::validate(&self, _data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::ListView @@ -24258,9 +23306,9 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(data: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(data: &vortex_array::arrays::listview::ListViewData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24294,7 +23342,7 @@ pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::validate(&self, _data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Masked @@ -24306,9 +23354,9 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(_data: &vortex_array::arrays::masked::MaskedData, _other: &vortex_array::arrays::masked::MaskedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(_data: &vortex_array::arrays::masked::MaskedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -24354,9 +23402,9 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(data: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(data: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24402,9 +23450,9 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(_data: &vortex_array::arrays::shared::SharedData, _other: &vortex_array::arrays::shared::SharedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(_data: &vortex_array::arrays::shared::SharedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -24450,9 +23498,9 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(_data: &vortex_array::arrays::struct_::StructData, _other: &vortex_array::arrays::struct_::StructData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(_data: &vortex_array::arrays::struct_::StructData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24498,9 +23546,9 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(data: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(data: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24534,7 +23582,7 @@ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::validate(&self, _data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBinView @@ -24546,9 +23594,9 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(data: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(data: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24594,9 +23642,9 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(_data: &vortex_array::arrays::variant::VariantData, _other: &vortex_array::arrays::variant::VariantData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(_data: &vortex_array::arrays::variant::VariantData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24642,9 +23690,9 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(_data: &vortex_array::arrays::dict::DictData, _other: &vortex_array::arrays::dict::DictData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(_data: &vortex_array::arrays::dict::DictData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24690,9 +23738,9 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_array: vortex_array::ArrayView<'_, Self>, _other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(_data: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(_array: vortex_array::ArrayView<'_, Self>, _state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(_data: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24738,9 +23786,9 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::patched::Patched::array_eq(data: &vortex_array::arrays::patched::PatchedData, other: &vortex_array::arrays::patched::PatchedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::patched::Patched::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::patched::Patched::array_hash(data: &vortex_array::arrays::patched::PatchedData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24786,9 +23834,9 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(data: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(data: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -24834,9 +23882,9 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(data: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(data: &vortex_array::arrays::slice::SliceData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -25232,6 +24280,18 @@ pub fn vortex_array::ArrayRef::to_struct(&self) -> vortex_array::arrays::StructA pub fn vortex_array::ArrayRef::to_varbinview(&self) -> vortex_array::arrays::VarBinViewArray +pub trait vortex_array::TypedArrayRef: core::convert::AsRef + core::ops::deref::Deref::ArrayData> + +pub fn vortex_array::TypedArrayRef::slots_ref(&self) -> &[core::option::Option] + +impl vortex_array::TypedArrayRef for vortex_array::Array + +pub fn vortex_array::Array::slots_ref(&self) -> &[core::option::Option] + +impl vortex_array::TypedArrayRef for vortex_array::ArrayView<'_, V> + +pub fn vortex_array::ArrayView<'_, V>::slots_ref(&self) -> &[core::option::Option] + pub trait vortex_array::VTable: 'static + core::clone::Clone + core::marker::Sized + core::marker::Send + core::marker::Sync + core::fmt::Debug pub type vortex_array::VTable::ArrayData: 'static + core::marker::Send + core::marker::Sync + core::clone::Clone + core::fmt::Debug @@ -25242,9 +24302,9 @@ pub type vortex_array::VTable::ValidityVTable: vortex_array::ValidityVTable, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::VTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::VTable::array_eq(data: &Self::ArrayData, other: &Self::ArrayData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::VTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::VTable::array_hash(data: &Self::ArrayData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::VTable::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25290,9 +24350,9 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(data: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(data: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25338,9 +24398,9 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(_data: &vortex_array::arrays::chunked::ChunkedData, _other: &vortex_array::arrays::chunked::ChunkedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(_data: &vortex_array::arrays::chunked::ChunkedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25386,9 +24446,9 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(data: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(data: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25434,9 +24494,9 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(data: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(data: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25482,9 +24542,9 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(_data: &vortex_array::arrays::extension::ExtensionData, _other: &vortex_array::arrays::extension::ExtensionData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(_data: &vortex_array::arrays::extension::ExtensionData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25530,9 +24590,9 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(data: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(data: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -25578,9 +24638,9 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25626,9 +24686,9 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(_data: &vortex_array::arrays::list::ListData, _other: &vortex_array::arrays::list::ListData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(_data: &vortex_array::arrays::list::ListData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25662,7 +24722,7 @@ pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::List::validate(&self, data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::validate(&self, _data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::ListView @@ -25674,9 +24734,9 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(data: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(data: &vortex_array::arrays::listview::ListViewData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25710,7 +24770,7 @@ pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::ListView::validate(&self, data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::validate(&self, _data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Masked @@ -25722,9 +24782,9 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(_data: &vortex_array::arrays::masked::MaskedData, _other: &vortex_array::arrays::masked::MaskedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(_data: &vortex_array::arrays::masked::MaskedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -25770,9 +24830,9 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(data: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(data: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25818,9 +24878,9 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(_data: &vortex_array::arrays::shared::SharedData, _other: &vortex_array::arrays::shared::SharedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(_data: &vortex_array::arrays::shared::SharedData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle @@ -25866,9 +24926,9 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(_data: &vortex_array::arrays::struct_::StructData, _other: &vortex_array::arrays::struct_::StructData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(_data: &vortex_array::arrays::struct_::StructData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25914,9 +24974,9 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(data: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(data: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -25950,7 +25010,7 @@ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] -pub fn vortex_array::arrays::VarBin::validate(&self, data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::validate(&self, _data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBinView @@ -25962,9 +25022,9 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(data: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(data: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -26010,9 +25070,9 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(_data: &vortex_array::arrays::variant::VariantData, _other: &vortex_array::arrays::variant::VariantData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(_data: &vortex_array::arrays::variant::VariantData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -26058,9 +25118,9 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(_data: &vortex_array::arrays::dict::DictData, _other: &vortex_array::arrays::dict::DictData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(_data: &vortex_array::arrays::dict::DictData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -26106,9 +25166,9 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_array: vortex_array::ArrayView<'_, Self>, _other: vortex_array::ArrayView<'_, Self>, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(_data: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(_array: vortex_array::ArrayView<'_, Self>, _state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(_data: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -26154,9 +25214,9 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::patched::Patched::array_eq(data: &vortex_array::arrays::patched::PatchedData, other: &vortex_array::arrays::patched::PatchedData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::patched::Patched::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::patched::Patched::array_hash(data: &vortex_array::arrays::patched::PatchedData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -26202,9 +25262,9 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(data: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(data: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -26250,9 +25310,9 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: vortex_array::ArrayView<'_, Self>, other: vortex_array::ArrayView<'_, Self>, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(data: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: vortex_array::ArrayView<'_, Self>, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(data: &vortex_array::arrays::slice::SliceData, state: &mut H, _precision: vortex_array::Precision) pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle diff --git a/vortex-array/src/array/erased.rs b/vortex-array/src/array/erased.rs index b59074a08c6..908fe13ee1a 100644 --- a/vortex-array/src/array/erased.rs +++ b/vortex-array/src/array/erased.rs @@ -93,6 +93,12 @@ impl ArrayRef { &self.0 } + /// Consumes the array reference, returning the owned backing allocation. + #[inline(always)] + pub(crate) fn into_inner(self) -> Arc { + self.0 + } + /// Returns true if the two ArrayRefs point to the same allocation. pub fn ptr_eq(this: &ArrayRef, other: &ArrayRef) -> bool { Arc::ptr_eq(&this.0, &other.0) @@ -107,7 +113,8 @@ impl Debug for ArrayRef { impl ArrayHash for ArrayRef { fn array_hash(&self, state: &mut H, precision: crate::Precision) { - self.0.dyn_array_hash(self, state as &mut dyn Hasher, precision); + self.0 + .dyn_array_hash(self, state as &mut dyn Hasher, precision); } } @@ -390,7 +397,7 @@ impl ArrayRef { /// /// Takes ownership to allow in-place mutation when the refcount is 1. pub fn with_slot(self, slot_idx: usize, replacement: ArrayRef) -> VortexResult { - let slots = self.slots(); + let slots = self.slots().to_vec(); let nslots = slots.len(); vortex_ensure!( slot_idx < nslots, @@ -474,8 +481,8 @@ impl ArrayRef { } /// Returns the slots of the array. - pub fn slots(&self) -> Vec> { - self.0.slots(self) + pub fn slots(&self) -> &[Option] { + self.0.slots() } /// Returns the name of the slot at the given index. diff --git a/vortex-array/src/array/mod.rs b/vortex-array/src/array/mod.rs index 0d38f20e965..39c89a08c67 100644 --- a/vortex-array/src/array/mod.rs +++ b/vortex-array/src/array/mod.rs @@ -35,6 +35,7 @@ pub use vtable::*; mod view; pub use view::*; + use crate::hash::ArrayEq; use crate::hash::ArrayHash; @@ -47,12 +48,18 @@ pub(crate) trait DynArray: 'static + private::Sealed + Send + Sync + Debug { /// Returns the array as a reference to a generic [`Any`] trait object. fn as_any(&self) -> &dyn Any; + /// Converts an owned array allocation into an owned [`Any`] allocation for downcasting. + fn into_any_arc(self: std::sync::Arc) -> std::sync::Arc; + /// Returns the length of the array. fn len(&self) -> usize; /// Returns the logical Vortex [`DType`] of the array. fn dtype(&self) -> &DType; + /// Returns the slots of the array. + fn slots(&self) -> &[Option]; + /// Returns the vtable of the array. fn vtable(&self) -> &dyn DynVTable; @@ -114,9 +121,6 @@ pub(crate) trait DynArray: 'static + private::Sealed + Send + Sync + Debug { /// Returns the number of buffers of the array. fn nbuffers(&self, this: &ArrayRef) -> usize; - /// Returns the slots of the array. - fn slots(&self, this: &ArrayRef) -> Vec>; - /// Returns the name of the slot at the given index. fn slot_name(&self, this: &ArrayRef, idx: usize) -> String; @@ -160,6 +164,10 @@ impl DynArray for ArrayInner { self } + fn into_any_arc(self: std::sync::Arc) -> std::sync::Arc { + self + } + fn len(&self) -> usize { self.len } @@ -168,6 +176,10 @@ impl DynArray for ArrayInner { &self.dtype } + fn slots(&self) -> &[Option] { + &self.slots + } + fn vtable(&self) -> &dyn DynVTable { &self.vtable } @@ -263,15 +275,6 @@ impl DynArray for ArrayInner { .collect() } - fn slots(&self, _this: &ArrayRef) -> Vec> { - self.slots.clone() - } - - fn slot_name(&self, this: &ArrayRef, idx: usize) -> String { - let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; - V::slot_name(view, idx) - } - fn buffers(&self, this: &ArrayRef) -> Vec { let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; (0..V::nbuffers(view)) @@ -303,6 +306,11 @@ impl DynArray for ArrayInner { V::nbuffers(view) } + fn slot_name(&self, this: &ArrayRef, idx: usize) -> String { + let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; + V::slot_name(view, idx) + } + fn metadata(&self, this: &ArrayRef) -> VortexResult>> { let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; V::serialize(view) @@ -313,7 +321,12 @@ impl DynArray for ArrayInner { V::fmt_metadata(view, f) } - fn dyn_array_hash(&self, this: &ArrayRef, state: &mut dyn Hasher, precision: crate::Precision) { + fn dyn_array_hash( + &self, + _this: &ArrayRef, + state: &mut dyn Hasher, + precision: crate::Precision, + ) { let mut wrapper = HasherWrapper(state); self.len.hash(&mut wrapper); self.dtype.hash(&mut wrapper); @@ -325,19 +338,28 @@ impl DynArray for ArrayInner { V::array_hash(&self.data, &mut wrapper, precision); } - fn dyn_array_eq(&self, this: &ArrayRef, other: &ArrayRef, precision: crate::Precision) -> bool { - other.inner().as_any().downcast_ref::().is_some_and(|other_inner| { - self.len == other.len() - && self.dtype == *other.dtype() - && self.vtable.id() == other.encoding_id() - && self.slots.len() == other_inner.slots.len() - && self - .slots - .iter() - .zip(other_inner.slots.iter()) - .all(|(slot, other_slot)| slot.array_eq(other_slot, precision)) - && V::array_eq(&self.data, &other_inner.data, precision) - }) + fn dyn_array_eq( + &self, + _this: &ArrayRef, + other: &ArrayRef, + precision: crate::Precision, + ) -> bool { + other + .inner() + .as_any() + .downcast_ref::() + .is_some_and(|other_inner| { + self.len == other.len() + && self.dtype == *other.dtype() + && self.vtable.id() == other.encoding_id() + && self.slots.len() == other_inner.slots.len() + && self + .slots + .iter() + .zip(other_inner.slots.iter()) + .all(|(slot, other_slot)| slot.array_eq(other_slot, precision)) + && V::array_eq(&self.data, &other_inner.data, precision) + }) } } diff --git a/vortex-array/src/array/typed.rs b/vortex-array/src/array/typed.rs index ac99da335da..08b86a6b9f4 100644 --- a/vortex-array/src/array/typed.rs +++ b/vortex-array/src/array/typed.rs @@ -49,7 +49,22 @@ impl ArrayParts { self.slots = slots; self } +} + +pub trait TypedArrayRef: AsRef + Deref { + fn slots_ref(&self) -> &[Option]; +} + +impl TypedArrayRef for Array { + fn slots_ref(&self) -> &[Option] { + self.slots() + } +} +impl TypedArrayRef for ArrayView<'_, V> { + fn slots_ref(&self) -> &[Option] { + self.slots() + } } // ============================================================================= // ArrayInner — the concrete type stored inside Arc @@ -74,7 +89,8 @@ impl ArrayInner { /// Create a new inner array from explicit construction parameters. #[doc(hidden)] pub fn try_new(new: ArrayParts) -> VortexResult { - new.vtable.validate(&new.data, &new.dtype, new.len, &new.slots)?; + new.vtable + .validate(&new.data, &new.dtype, new.len, &new.slots)?; Ok(unsafe { Self::from_data_unchecked( new.vtable, @@ -263,15 +279,25 @@ impl Array { &self.downcast_inner().data } - /// Returns the full typed array construction parts. - pub fn into_parts(self) -> ArrayParts { - let inner = self.downcast_inner(); - ArrayParts { - vtable: inner.vtable.clone(), - dtype: inner.dtype.clone(), - len: inner.len, - data: inner.data.clone(), - slots: inner.slots.clone(), + /// Returns the full typed array construction parts if this handle owns the allocation. + pub fn try_into_parts(self) -> Result, Self> { + let Self { inner, _phantom } = self; + let any = inner.into_inner().into_any_arc(); + let inner = Arc::downcast::>(any) + .unwrap_or_else(|_| unreachable!("typed array must contain ArrayInner for its vtable")); + + match Arc::try_unwrap(inner) { + Ok(inner) => Ok(ArrayParts { + vtable: inner.vtable, + dtype: inner.dtype, + len: inner.len, + data: inner.data, + slots: inner.slots, + }), + Err(inner) => Err(Self { + inner: ArrayRef::from_inner(inner), + _phantom: PhantomData, + }), } } @@ -472,11 +498,24 @@ mod tests { #[test] fn typed_array_into_parts_roundtrips() { let array = PrimitiveArray::new(buffer![1i32, 2, 3], Validity::NonNullable); - let expected = array.clone(); + let expected = PrimitiveArray::new(buffer![1i32, 2, 3], Validity::NonNullable); - let parts = array.into_parts(); + let parts = array.try_into_parts().unwrap(); let rebuilt = Array::::try_from_parts(parts).unwrap(); assert_arrays_eq!(rebuilt, expected); } + + #[test] + fn typed_array_try_into_parts_requires_unique_owner() { + let array = PrimitiveArray::new(buffer![1i32, 2, 3], Validity::NonNullable); + let alias = array.clone(); + + let array = match array.try_into_parts() { + Ok(_) => panic!("aliased arrays should not move out their backing parts"), + Err(array) => array, + }; + + assert_arrays_eq!(array, alias); + } } diff --git a/vortex-array/src/array/view.rs b/vortex-array/src/array/view.rs index 789f551b097..b8fe7fe0d46 100644 --- a/vortex-array/src/array/view.rs +++ b/vortex-array/src/array/view.rs @@ -10,7 +10,6 @@ use vortex_error::VortexResult; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayId; -use crate::array::ArrayInner; use crate::array::VTable; use crate::dtype::DType; use crate::stats::StatsSetRef; @@ -33,10 +32,7 @@ impl Clone for ArrayView<'_, V> { impl<'a, V: VTable> ArrayView<'a, V> { /// # Safety /// Caller must ensure `data` is the `V::ArrayData` stored inside `array`. - pub(crate) unsafe fn new_unchecked( - array: &'a ArrayRef, - data: &'a V::ArrayData, - ) -> Self { + pub(crate) unsafe fn new_unchecked(array: &'a ArrayRef, data: &'a V::ArrayData) -> Self { debug_assert!(array.is::()); Self { array, data } } @@ -50,13 +46,7 @@ impl<'a, V: VTable> ArrayView<'a, V> { } pub fn slots(&self) -> &'a [Option] { - &self - .array - .inner() - .as_any() - .downcast_ref::>() - .expect("ArrayView slots requested for mismatched array type") - .slots + &self.array.slots() } pub fn dtype(&self) -> &DType { diff --git a/vortex-array/src/array/vtable/mod.rs b/vortex-array/src/array/vtable/mod.rs index 79eed22585b..cc0797ac966 100644 --- a/vortex-array/src/array/vtable/mod.rs +++ b/vortex-array/src/array/vtable/mod.rs @@ -73,11 +73,7 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { fn array_hash(data: &Self::ArrayData, state: &mut H, precision: Precision); /// Compares two arrays of the same type for equality. - fn array_eq( - data: &Self::ArrayData, - other: &Self::ArrayData, - precision: Precision, - ) -> bool; + fn array_eq(data: &Self::ArrayData, other: &Self::ArrayData, precision: Precision) -> bool; /// Returns the number of buffers in the array. fn nbuffers(array: ArrayView<'_, Self>) -> usize; @@ -95,7 +91,7 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { /// /// The default counts non-None slots. fn nchildren(array: ArrayView<'_, Self>) -> usize { - Self::slots(array).iter().filter(|s| s.is_some()).count() + array.slots().iter().filter(|s| s.is_some()).count() } /// Returns the child at the given index. @@ -105,7 +101,8 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { /// # Panics /// Panics if `idx >= nchildren(array)`. fn child(array: ArrayView<'_, Self>, idx: usize) -> ArrayRef { - Self::slots(array) + array + .slots() .iter() .filter_map(|s| s.clone()) .nth(idx) @@ -119,7 +116,8 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { /// # Panics /// Panics if `idx >= nchildren(array)`. fn child_name(array: ArrayView<'_, Self>, idx: usize) -> String { - Self::slots(array) + array + .slots() .iter() .enumerate() .filter(|(_, s)| s.is_some()) @@ -166,23 +164,6 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { Ok(()) } - /// Returns the slots of the array as a slice. - /// - /// Slots provide fixed-position storage for child arrays. Each encoding defines named - /// constants (e.g. `VALIDITY_SLOT`, `ELEMENTS_SLOT`) that index into this slice, so child - /// access is a direct index rather than a dynamic lookup. - /// - /// Slots are `Option` to allow individual children to be _taken_ (moved out) - /// without invalidating the indices of other slots. For example, removing the validity - /// child leaves a `None` at `VALIDITY_SLOT` while all other slot indices remain stable. - /// - /// The backing storage is a `Vec` (rather than a fixed-size array) so that it can be - /// moved out of an `ArrayData` into the concrete `Array` type during deserialization - /// without copying. - fn slots<'a>(array: ArrayView<'a, Self>) -> &'a [Option] { - array.slots() - } - /// Returns the name of the slot at the given index. /// /// # Panics diff --git a/vortex-array/src/arrays/bool/array.rs b/vortex-array/src/arrays/bool/array.rs index a0824b8cd3a..18859b97249 100644 --- a/vortex-array/src/arrays/bool/array.rs +++ b/vortex-array/src/arrays/bool/array.rs @@ -13,7 +13,7 @@ use crate::ArrayRef; use crate::IntoArray; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::Bool; @@ -72,28 +72,20 @@ pub struct BoolDataParts { pub len: usize, } -pub trait BoolArrayExt { - fn bool_data(&self) -> &BoolData; - fn as_slots(&self) -> &[Option]; - fn dtype(&self) -> &DType; - +pub trait BoolArrayExt: TypedArrayRef { fn nullability(&self) -> crate::dtype::Nullability { - match self.dtype() { + match self.as_ref().dtype() { DType::Bool(nullability) => *nullability, _ => unreachable!("BoolArrayExt requires a bool dtype"), } } - fn validity_child(&self) -> Option<&ArrayRef> { - self.as_slots()[VALIDITY_SLOT].as_ref() - } - fn validity(&self) -> Validity { - child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.nullability()) + child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.nullability()) } fn bool_validity_mask(&self) -> Mask { - self.validity().to_mask(self.bool_data().len) + self.validity().to_mask(self.len) } fn maybe_to_mask(&self) -> VortexResult> { @@ -102,7 +94,7 @@ pub trait BoolArrayExt { Validity::AllInvalid => false, Validity::Array(a) => a.statistics().compute_min::().unwrap_or(false), }; - Ok(all_valid.then(|| Mask::from_buffer(self.bool_data().to_bit_buffer()))) + Ok(all_valid.then(|| Mask::from_buffer(self.to_bit_buffer()))) } fn to_mask(&self) -> Mask { @@ -114,41 +106,14 @@ pub trait BoolArrayExt { fn to_mask_fill_null_false(&self) -> Mask { let validity_mask = self.bool_validity_mask(); let buffer = match validity_mask { - Mask::AllTrue(_) => self.bool_data().to_bit_buffer(), - Mask::AllFalse(_) => return Mask::new_false(self.bool_data().len), - Mask::Values(validity) => validity.bit_buffer() & self.bool_data().to_bit_buffer(), + Mask::AllTrue(_) => self.to_bit_buffer(), + Mask::AllFalse(_) => return Mask::new_false(self.len), + Mask::Values(validity) => validity.bit_buffer() & self.to_bit_buffer(), }; Mask::from_buffer(buffer) } } - -impl BoolArrayExt for Array { - fn bool_data(&self) -> &BoolData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn dtype(&self) -> &DType { - Array::dtype(self) - } -} - -impl BoolArrayExt for ArrayView<'_, Bool> { - fn bool_data(&self) -> &BoolData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn dtype(&self) -> &DType { - ArrayView::dtype(self) - } -} +impl> BoolArrayExt for T {} /// Field accessors and non-consuming methods on the inner bool data. impl BoolData { diff --git a/vortex-array/src/arrays/bool/vtable/mod.rs b/vortex-array/src/arrays/bool/vtable/mod.rs index 08ea0079c80..82759e116e0 100644 --- a/vortex-array/src/arrays/bool/vtable/mod.rs +++ b/vortex-array/src/arrays/bool/vtable/mod.rs @@ -18,7 +18,6 @@ use crate::ExecutionResult; use crate::array::Array; use crate::array::ArrayView; use crate::array::VTable; -use crate::arrays::bool::array::BoolArrayExt; use crate::arrays::bool::BoolData; use crate::arrays::bool::array::SLOT_NAMES; use crate::buffer::BufferHandle; @@ -61,7 +60,8 @@ impl VTable for Bool { } fn array_eq(data: &BoolData, other: &BoolData, precision: Precision) -> bool { - data.to_bit_buffer().array_eq(&other.to_bit_buffer(), precision) + data.to_bit_buffer() + .array_eq(&other.to_bit_buffer(), precision) } fn nbuffers(_array: ArrayView<'_, Self>) -> usize { @@ -96,7 +96,13 @@ impl VTable for Bool { write!(f, "BoolMetadata {{ offset: {} }}", array.offset) } - fn validate(&self, data: &BoolData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + fn validate( + &self, + data: &BoolData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { let DType::Bool(nullability) = dtype else { vortex_bail!("Expected bool dtype, got {dtype:?}"); }; @@ -150,15 +156,10 @@ impl VTable for Bool { Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) } diff --git a/vortex-array/src/arrays/chunked/array.rs b/vortex-array/src/arrays/chunked/array.rs index f1fe56e3811..b146917ebdb 100644 --- a/vortex-array/src/arrays/chunked/array.rs +++ b/vortex-array/src/arrays/chunked/array.rs @@ -21,6 +21,7 @@ use crate::LEGACY_SESSION; use crate::VortexSessionExecute; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::TypedArrayRef; use crate::array::ArrayView; use crate::arrays::Chunked; use crate::arrays::PrimitiveArray; @@ -39,33 +40,28 @@ pub(super) const CHUNKS_OFFSET: usize = 1; #[derive(Clone, Debug)] pub struct ChunkedData; -pub trait ChunkedArrayExt { - fn chunked_data(&self) -> &ChunkedData; - fn chunked_dtype(&self) -> &DType; - fn chunked_len(&self) -> usize; - fn as_slots(&self) -> &[Option]; - +pub trait ChunkedArrayExt: TypedArrayRef { fn chunk_offsets_array(&self) -> &ArrayRef { - self.as_slots()[CHUNK_OFFSETS_SLOT] + self.slots_ref()[CHUNK_OFFSETS_SLOT] .as_ref() - .expect("validated chunk offsets slot") + .vortex_expect("validated chunk offsets slot") } fn nchunks(&self) -> usize { - self.as_slots().len().saturating_sub(CHUNKS_OFFSET) + self.slots_ref().len().saturating_sub(CHUNKS_OFFSET) } fn chunk(&self, idx: usize) -> &ArrayRef { - self.as_slots()[CHUNKS_OFFSET + idx] + self.slots_ref()[CHUNKS_OFFSET + idx] .as_ref() - .expect("validated chunk slot") + .vortex_expect("validated chunk slot") } fn iter_chunks<'a>(&'a self) -> Box + 'a> { Box::new( - self.as_slots()[CHUNKS_OFFSET..] + self.slots_ref()[CHUNKS_OFFSET..] .iter() - .map(|slot| slot.as_ref().expect("validated chunk slot")), + .map(|slot| slot.as_ref().vortex_expect("validated chunk slot")), ) } @@ -88,7 +84,7 @@ pub trait ChunkedArrayExt { } fn find_chunk_idx(&self, index: usize) -> VortexResult<(usize, usize)> { - assert!(index <= self.chunked_len(), "Index out of bounds of the array"); + assert!(index <= self.as_ref().len(), "Index out of bounds of the array"); let index = index as u64; let chunk_offsets = self.chunk_offsets(); let index_chunk = chunk_offsets @@ -103,54 +99,19 @@ pub trait ChunkedArrayExt { fn array_iterator(&self) -> impl ArrayIterator + '_ { ArrayIteratorAdapter::new( - self.chunked_dtype().clone(), + self.as_ref().dtype().clone(), self.iter_chunks().map(|chunk| Ok(chunk.clone())), ) } fn array_stream(&self) -> impl ArrayStream + '_ { ArrayStreamAdapter::new( - self.chunked_dtype().clone(), + self.as_ref().dtype().clone(), stream::iter(self.iter_chunks().map(|chunk| Ok(chunk.clone()))), ) } } - -impl ChunkedArrayExt for Array { - fn chunked_data(&self) -> &ChunkedData { - self.data() - } - - fn chunked_dtype(&self) -> &DType { - self.dtype() - } - - fn chunked_len(&self) -> usize { - self.len() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} - -impl ChunkedArrayExt for ArrayView<'_, Chunked> { - fn chunked_data(&self) -> &ChunkedData { - self.data() - } - - fn chunked_dtype(&self) -> &DType { - self.dtype() - } - - fn chunked_len(&self) -> usize { - self.len() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} +impl> ChunkedArrayExt for T {} impl Array { pub fn chunk_offsets_array(&self) -> &ArrayRef { @@ -181,9 +142,6 @@ impl Array { ::non_empty_chunks(self) } - pub(crate) fn find_chunk_idx(&self, index: usize) -> VortexResult<(usize, usize)> { - ::find_chunk_idx(self, index) - } } impl ArrayView<'_, Chunked> { diff --git a/vortex-array/src/arrays/chunked/paired_chunks.rs b/vortex-array/src/arrays/chunked/paired_chunks.rs index 9db5a5ba03c..5b9bae9bb85 100644 --- a/vortex-array/src/arrays/chunked/paired_chunks.rs +++ b/vortex-array/src/arrays/chunked/paired_chunks.rs @@ -6,10 +6,12 @@ use std::ops::Range; use vortex_error::VortexResult; use crate::ArrayRef; -use crate::array::Array; use crate::array::ArrayView; use crate::arrays::Chunked; +#[cfg(test)] +use crate::array::Array; + pub(crate) struct AlignedPair { pub left: ArrayRef, pub right: ArrayRef, @@ -69,6 +71,7 @@ pub(crate) struct PairedChunks { total_len: usize, } +#[cfg(test)] impl Array { pub(crate) fn paired_chunks(&self, other: &Array) -> PairedChunks { assert_eq!( diff --git a/vortex-array/src/arrays/chunked/vtable/mod.rs b/vortex-array/src/arrays/chunked/vtable/mod.rs index 280a2fcf135..3b035c64469 100644 --- a/vortex-array/src/arrays/chunked/vtable/mod.rs +++ b/vortex-array/src/arrays/chunked/vtable/mod.rs @@ -34,8 +34,6 @@ use crate::dtype::DType; use crate::dtype::Nullability; use crate::dtype::PType; use crate::executor::VortexSessionExecute; -use crate::hash::ArrayEq; -use crate::hash::ArrayHash; use crate::serde::ArrayChildren; use crate::vtable; mod canonical; @@ -170,7 +168,7 @@ impl VTable for Chunked { &DType::Primitive(PType::U64, Nullability::NonNullable), nchunks + 1, )?; - let chunk_offsets_buf = chunk_offsets.clone().to_primitive().to_buffer::(); + let chunk_offsets_buf = chunk_offsets.to_primitive().to_buffer::(); let mut slots = Vec::with_capacity(children.len()); slots.push(Some(chunk_offsets)); for (idx, (start, end)) in chunk_offsets_buf.iter().copied().tuple_windows().enumerate() { diff --git a/vortex-array/src/arrays/constant/array.rs b/vortex-array/src/arrays/constant/array.rs index 5038f70657d..1acc4e898bc 100644 --- a/vortex-array/src/arrays/constant/array.rs +++ b/vortex-array/src/arrays/constant/array.rs @@ -6,8 +6,6 @@ use crate::array::ArrayParts; use crate::arrays::Constant; use crate::scalar::Scalar; -pub(super) const NUM_SLOTS: usize = 0; - #[derive(Clone, Debug)] pub struct ConstantData { pub(super) scalar: Scalar, diff --git a/vortex-array/src/arrays/constant/vtable/mod.rs b/vortex-array/src/arrays/constant/vtable/mod.rs index bba8f65c1e1..06be7cd1d71 100644 --- a/vortex-array/src/arrays/constant/vtable/mod.rs +++ b/vortex-array/src/arrays/constant/vtable/mod.rs @@ -21,7 +21,6 @@ use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; use crate::arrays::constant::ConstantData; -use crate::arrays::constant::array::NUM_SLOTS; use crate::arrays::constant::compute::rules::PARENT_RULES; use crate::arrays::constant::vtable::canonical::constant_canonicalize; use crate::buffer::BufferHandle; diff --git a/vortex-array/src/arrays/decimal/array.rs b/vortex-array/src/arrays/decimal/array.rs index 6c693755c13..65ac1f107bf 100644 --- a/vortex-array/src/arrays/decimal/array.rs +++ b/vortex-array/src/arrays/decimal/array.rs @@ -17,6 +17,7 @@ use crate::IntoArray; use crate::array::Array; use crate::array::ArrayParts; use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::Decimal; @@ -111,61 +112,30 @@ pub struct DecimalDataParts { pub validity: Validity, } -pub trait DecimalArrayExt { - fn decimal_data(&self) -> &DecimalData; - fn as_slots(&self) -> &[Option]; - fn dtype(&self) -> &DType; - +pub trait DecimalArrayExt: TypedArrayRef { fn decimal_dtype(&self) -> DecimalDType { - match self.dtype() { + match self.as_ref().dtype() { DType::Decimal(decimal_dtype, _) => *decimal_dtype, _ => unreachable!("DecimalArrayExt requires a decimal dtype"), } } fn nullability(&self) -> Nullability { - match self.dtype() { + match self.as_ref().dtype() { DType::Decimal(_, nullability) => *nullability, _ => unreachable!("DecimalArrayExt requires a decimal dtype"), } } fn validity_child(&self) -> Option<&ArrayRef> { - self.as_slots()[VALIDITY_SLOT].as_ref() + self.slots_ref()[VALIDITY_SLOT].as_ref() } fn validity(&self) -> Validity { - child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.nullability()) - } -} - -impl DecimalArrayExt for Array { - fn decimal_data(&self) -> &DecimalData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn dtype(&self) -> &DType { - Array::dtype(self) - } -} - -impl DecimalArrayExt for ArrayView<'_, Decimal> { - fn decimal_data(&self) -> &DecimalData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn dtype(&self) -> &DType { - ArrayView::dtype(self) + child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.nullability()) } } +impl> DecimalArrayExt for T {} impl DecimalData { /// Build the slots vector for this array. @@ -358,7 +328,9 @@ impl DecimalData { } pub fn into_parts(self) -> DecimalDataParts { - vortex_panic!("DecimalData::into_parts requires outer dtype; use Array::into_data_parts") + vortex_panic!( + "DecimalData::into_parts requires outer dtype; use Array::into_data_parts" + ) } /// Returns the underlying [`ByteBuffer`] of the array. @@ -462,7 +434,9 @@ impl Array { let slots = DecimalData::make_slots(&validity, len); let data = DecimalData::new(buffer, decimal_dtype, validity); unsafe { - Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(Decimal, dtype, len, data).with_slots(slots), + ) } } @@ -481,7 +455,9 @@ impl Array { let slots = DecimalData::make_slots(&validity, len); let data = unsafe { DecimalData::new_unchecked(buffer, decimal_dtype, validity) }; unsafe { - Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(Decimal, dtype, len, data).with_slots(slots), + ) } } @@ -496,7 +472,9 @@ impl Array { let slots = DecimalData::make_slots(&validity, len); let data = DecimalData::try_new(buffer, decimal_dtype, validity)?; Ok(unsafe { - Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(Decimal, dtype, len, data).with_slots(slots), + ) }) } @@ -509,13 +487,11 @@ impl Array { iter: I, decimal_dtype: DecimalDType, ) -> Self { - let data = DecimalData::from_iter(iter, decimal_dtype); - let dtype = DType::Decimal(decimal_dtype, Nullability::NonNullable); - let len = data.len(); - let slots = DecimalData::make_slots(&Validity::from(dtype.nullability()), len); - unsafe { - Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) - } + Self::new( + BufferMut::from_iter(iter.into_iter()).freeze(), + decimal_dtype, + Validity::NonNullable, + ) } /// Creates a new [`DecimalArray`] from an iterator of optional values. @@ -523,13 +499,28 @@ impl Array { iter: I, decimal_dtype: DecimalDType, ) -> Self { - let data = DecimalData::from_option_iter(iter, decimal_dtype); - let dtype = DType::Decimal(decimal_dtype, Nullability::Nullable); - let len = data.len(); - let slots = DecimalData::make_slots(&Validity::from(dtype.nullability()), len); - unsafe { - Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + let iter = iter.into_iter(); + let mut values = BufferMut::with_capacity(iter.size_hint().0); + let mut validity = BitBufferMut::with_capacity(values.capacity()); + + for value in iter { + match value { + Some(value) => { + values.push(value); + validity.append(true); + } + None => { + values.push(T::default()); + validity.append(false); + } + } } + + Self::new( + values.freeze(), + decimal_dtype, + Validity::from(validity.freeze()), + ) } /// Creates a new [`DecimalArray`] from a [`BufferHandle`]. @@ -544,7 +535,9 @@ impl Array { let slots = DecimalData::make_slots(&validity, len); let data = DecimalData::new_handle(values, values_type, decimal_dtype, validity); unsafe { - Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(Decimal, dtype, len, data).with_slots(slots), + ) } } @@ -566,10 +559,16 @@ impl Array { DecimalData::new_unchecked_handle(values, values_type, decimal_dtype, validity) }; unsafe { - Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(Decimal, dtype, len, data).with_slots(slots), + ) } } + #[allow( + clippy::cognitive_complexity, + reason = "patching depends on both patch and value physical types" + )] pub fn patch(self, patches: &Patches, ctx: &mut ExecutionCtx) -> VortexResult { let offset = patches.offset(); let dtype = self.dtype().clone(); @@ -607,7 +606,9 @@ impl Array { }); let slots = DecimalData::make_slots(&patched_validity, len); Ok(unsafe { - Array::from_parts_unchecked(ArrayParts::new(Decimal, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(Decimal, dtype, len, data).with_slots(slots), + ) }) } diff --git a/vortex-array/src/arrays/decimal/vtable/mod.rs b/vortex-array/src/arrays/decimal/vtable/mod.rs index 65f0684207f..0c4c6004b2e 100644 --- a/vortex-array/src/arrays/decimal/vtable/mod.rs +++ b/vortex-array/src/arrays/decimal/vtable/mod.rs @@ -16,7 +16,6 @@ use crate::ExecutionResult; use crate::array::Array; use crate::array::ArrayView; use crate::array::VTable; -use crate::arrays::decimal::DecimalArrayExt; use crate::arrays::decimal::DecimalData; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -93,7 +92,13 @@ impl VTable for Decimal { )) } - fn validate(&self, data: &DecimalData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + fn validate( + &self, + data: &DecimalData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { let DType::Decimal(_, nullability) = dtype else { vortex_bail!("Expected decimal dtype, got {dtype:?}"); }; @@ -158,15 +163,10 @@ impl VTable for Decimal { Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) } diff --git a/vortex-array/src/arrays/dict/array.rs b/vortex-array/src/arrays/dict/array.rs index 698c53c8fd1..24c1fa157d0 100644 --- a/vortex-array/src/arrays/dict/array.rs +++ b/vortex-array/src/arrays/dict/array.rs @@ -11,10 +11,10 @@ use vortex_mask::AllOr; use crate::ArrayRef; use crate::ToCanonical; use crate::array::Array; -use crate::array::ArrayView; use crate::array::ArrayParts; +use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::arrays::Dict; -use crate::dtype::DType; use crate::dtype::PType; use crate::match_each_integer_ptype; @@ -106,14 +106,22 @@ impl DictData { } } -pub trait DictArrayExt { - fn dict_data(&self) -> &DictData; - fn codes(&self) -> &ArrayRef; - fn values(&self) -> &ArrayRef; +pub trait DictArrayExt: TypedArrayRef { + fn codes(&self) -> &ArrayRef { + self.slots_ref()[CODES_SLOT] + .as_ref() + .vortex_expect("DictArray codes slot") + } + + fn values(&self) -> &ArrayRef { + self.slots_ref()[VALUES_SLOT] + .as_ref() + .vortex_expect("DictArray values slot") + } #[inline] fn has_all_values_referenced(&self) -> bool { - self.dict_data().all_values_referenced + self.all_values_referenced } fn validate_all_values_referenced(&self) -> VortexResult<()> { @@ -131,6 +139,7 @@ pub trait DictArrayExt { Ok(()) } + #[allow(clippy::cognitive_complexity, reason = "branching depends on validity representation and code type")] fn compute_referenced_values_mask(&self, referenced: bool) -> VortexResult { let codes_validity = self.codes().validity_mask()?; let codes_primitive = self.codes().to_primitive(); @@ -173,42 +182,7 @@ pub trait DictArrayExt { Ok(BitBuffer::from(values_vec)) } } - -impl DictArrayExt for Array { - fn dict_data(&self) -> &DictData { - self.data() - } - - fn codes(&self) -> &ArrayRef { - self.slots()[CODES_SLOT] - .as_ref() - .vortex_expect("DictArray codes slot") - } - - fn values(&self) -> &ArrayRef { - self.slots()[VALUES_SLOT] - .as_ref() - .vortex_expect("DictArray values slot") - } -} - -impl DictArrayExt for ArrayView<'_, Dict> { - fn dict_data(&self) -> &DictData { - self.data() - } - - fn codes(&self) -> &ArrayRef { - self.slots()[CODES_SLOT] - .as_ref() - .vortex_expect("DictArray codes slot") - } - - fn values(&self) -> &ArrayRef { - self.slots()[VALUES_SLOT] - .as_ref() - .vortex_expect("DictArray values slot") - } -} +impl> DictArrayExt for T {} impl Array { #[inline] diff --git a/vortex-array/src/arrays/dict/execute.rs b/vortex-array/src/arrays/dict/execute.rs index 74bd911315a..da2f549c62c 100644 --- a/vortex-array/src/arrays/dict/execute.rs +++ b/vortex-array/src/arrays/dict/execute.rs @@ -27,7 +27,6 @@ use crate::arrays::StructArray; use crate::arrays::VarBinView; use crate::arrays::VarBinViewArray; use crate::arrays::VariantArray; -use crate::arrays::variant::VariantArrayExt; use crate::arrays::dict::TakeExecute; use crate::arrays::dict::TakeReduce; diff --git a/vortex-array/src/arrays/dict/vtable/mod.rs b/vortex-array/src/arrays/dict/vtable/mod.rs index 2f178b4bf49..6b4892db248 100644 --- a/vortex-array/src/arrays/dict/vtable/mod.rs +++ b/vortex-array/src/arrays/dict/vtable/mod.rs @@ -12,7 +12,6 @@ use vortex_error::vortex_panic; use vortex_session::VortexSession; use super::DictData; -use super::DictArrayExt; use super::DictMetadata; use super::array::CODES_SLOT; use super::array::SLOT_NAMES; @@ -35,8 +34,6 @@ use crate::dtype::Nullability; use crate::dtype::PType; use crate::executor::ExecutionCtx; use crate::executor::ExecutionResult; -use crate::hash::ArrayEq; -use crate::hash::ArrayHash; use crate::require_child; use crate::scalar::Scalar; use crate::serde::ArrayChildren; @@ -64,22 +61,32 @@ impl VTable for Dict { Self::ID } - fn validate(&self, data: &DictData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + fn validate( + &self, + data: &DictData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { _ = data; - let codes = slots[CODES_SLOT].as_ref().vortex_expect("DictArray codes slot"); + let codes = slots[CODES_SLOT] + .as_ref() + .vortex_expect("DictArray codes slot"); let values = slots[VALUES_SLOT] .as_ref() .vortex_expect("DictArray values slot"); vortex_ensure!(codes.len() == len, "DictArray codes length mismatch"); vortex_ensure!( - values.dtype().union_nullability(codes.dtype().nullability()) == *dtype, + values + .dtype() + .union_nullability(codes.dtype().nullability()) + == *dtype, "DictArray dtype does not match codes/values dtype" ); Ok(()) } - fn array_hash(_data: &DictData, _state: &mut H, _precision: Precision) { - } + fn array_hash(_data: &DictData, _state: &mut H, _precision: Precision) {} fn array_eq(_data: &DictData, _other: &DictData, _precision: Precision) -> bool { true @@ -143,28 +150,18 @@ impl VTable for Dict { let all_values_referenced = metadata.all_values_referenced.unwrap_or(false); Ok( - crate::array::ArrayParts::new( - self.clone(), - dtype.clone(), - len, - unsafe { - DictData::new_unchecked(codes.clone(), values.clone()) - .set_all_values_referenced(all_values_referenced) - }, - ) + crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, unsafe { + DictData::new_unchecked(codes.clone(), values.clone()) + .set_all_values_referenced(all_values_referenced) + }) .with_slots(vec![Some(codes), Some(values)]), ) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { if array.is_empty() { let result_dtype = array diff --git a/vortex-array/src/arrays/extension/array.rs b/vortex-array/src/arrays/extension/array.rs index 2c11008fd04..962c1dec0ed 100644 --- a/vortex-array/src/arrays/extension/array.rs +++ b/vortex-array/src/arrays/extension/array.rs @@ -6,8 +6,9 @@ use vortex_error::VortexResult; use crate::ArrayRef; use crate::array::Array; -use crate::array::ArrayView; use crate::array::ArrayParts; +use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::arrays::Extension; use crate::dtype::DType; use crate::dtype::extension::ExtDTypeRef; @@ -119,34 +120,14 @@ impl ExtensionData { } } -pub trait ExtensionArrayExt { - fn extension_data(&self) -> &ExtensionData; - fn storage_array(&self) -> &ArrayRef; -} - -impl ExtensionArrayExt for Array { - fn extension_data(&self) -> &ExtensionData { - self.data() - } - - fn storage_array(&self) -> &ArrayRef { - self.slots()[STORAGE_SLOT] - .as_ref() - .vortex_expect("ExtensionArray storage slot") - } -} - -impl ExtensionArrayExt for ArrayView<'_, Extension> { - fn extension_data(&self) -> &ExtensionData { - self.data() - } - +pub trait ExtensionArrayExt: TypedArrayRef { fn storage_array(&self) -> &ArrayRef { - self.slots()[STORAGE_SLOT] + self.slots_ref()[STORAGE_SLOT] .as_ref() .vortex_expect("ExtensionArray storage slot") } } +impl> ExtensionArrayExt for T {} impl Array { #[inline] diff --git a/vortex-array/src/arrays/extension/vtable/mod.rs b/vortex-array/src/arrays/extension/vtable/mod.rs index d67ecbc843e..3cf2afd642c 100644 --- a/vortex-array/src/arrays/extension/vtable/mod.rs +++ b/vortex-array/src/arrays/extension/vtable/mod.rs @@ -22,15 +22,12 @@ use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; use crate::array::ValidityVTableFromChild; -use crate::arrays::extension::ExtensionArrayExt; use crate::arrays::extension::ExtensionData; -use crate::arrays::extension::array::STORAGE_SLOT; use crate::arrays::extension::array::SLOT_NAMES; +use crate::arrays::extension::array::STORAGE_SLOT; use crate::arrays::extension::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; -use crate::hash::ArrayEq; -use crate::hash::ArrayHash; use crate::serde::ArrayChildren; use crate::vtable; @@ -69,10 +66,6 @@ impl VTable for Extension { None } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } @@ -81,7 +74,13 @@ impl VTable for Extension { Ok(Some(vec![])) } - fn validate(&self, data: &ExtensionData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + fn validate( + &self, + data: &ExtensionData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { _ = data; let storage = slots[STORAGE_SLOT] .as_ref() @@ -127,18 +126,15 @@ impl VTable for Extension { vortex_bail!("Expected 1 child, got {}", children.len()); } let storage = children.get(0, ext_dtype.storage_dtype(), len)?; - Ok( - crate::array::ArrayParts::new( - self.clone(), - dtype.clone(), - len, - ExtensionData::new(ext_dtype.clone(), storage.clone()), - ) - .with_slots(vec![Some(storage)]), + Ok(crate::array::ArrayParts::new( + self.clone(), + dtype.clone(), + len, + ExtensionData::new(ext_dtype.clone(), storage.clone()), ) + .with_slots(vec![Some(storage)])) } - fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) } diff --git a/vortex-array/src/arrays/extension/vtable/validity.rs b/vortex-array/src/arrays/extension/vtable/validity.rs index 6d535687088..f10941d5225 100644 --- a/vortex-array/src/arrays/extension/vtable/validity.rs +++ b/vortex-array/src/arrays/extension/vtable/validity.rs @@ -5,7 +5,6 @@ use crate::ArrayRef; use crate::array::ArrayView; use crate::array::ValidityChild; use crate::arrays::Extension; -use crate::arrays::extension::ExtensionArrayExt; impl ValidityChild for Extension { fn validity_child(array: ArrayView<'_, Extension>) -> ArrayRef { diff --git a/vortex-array/src/arrays/filter/array.rs b/vortex-array/src/arrays/filter/array.rs index 2ab9974800a..f4722bae46c 100644 --- a/vortex-array/src/arrays/filter/array.rs +++ b/vortex-array/src/arrays/filter/array.rs @@ -9,9 +9,8 @@ use vortex_mask::Mask; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::arrays::Filter; -use crate::dtype::DType; /// The source array being filtered. pub(super) const CHILD_SLOT: usize = 0; @@ -33,55 +32,14 @@ pub struct FilterDataParts { pub mask: Mask, } -pub trait FilterArrayExt { - fn filter_data(&self) -> &FilterData; - fn filter_dtype(&self) -> &DType; - fn filter_len(&self) -> usize; - +pub trait FilterArrayExt: TypedArrayRef { fn child(&self) -> &ArrayRef { - self.as_slots()[CHILD_SLOT] + self.slots_ref()[CHILD_SLOT] .as_ref() - .expect("validated filter child slot") - } - - fn as_slots(&self) -> &[Option]; -} - -impl FilterArrayExt for Array { - fn filter_data(&self) -> &FilterData { - self.data() - } - - fn filter_dtype(&self) -> &DType { - self.dtype() - } - - fn filter_len(&self) -> usize { - self.len() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} - -impl FilterArrayExt for ArrayView<'_, Filter> { - fn filter_data(&self) -> &FilterData { - self.data() - } - - fn filter_dtype(&self) -> &DType { - self.dtype() - } - - fn filter_len(&self) -> usize { - self.len() - } - - fn as_slots(&self) -> &[Option] { - self.slots() + .vortex_expect("validated filter child slot") } } +impl> FilterArrayExt for T {} impl FilterData { pub fn new(array: ArrayRef, mask: Mask) -> Self { diff --git a/vortex-array/src/arrays/filter/execute/mod.rs b/vortex-array/src/arrays/filter/execute/mod.rs index adffac80d8a..7307241a197 100644 --- a/vortex-array/src/arrays/filter/execute/mod.rs +++ b/vortex-array/src/arrays/filter/execute/mod.rs @@ -23,7 +23,6 @@ use crate::arrays::Filter; use crate::arrays::NullArray; use crate::arrays::VariantArray; use crate::arrays::filter::FilterArrayExt; -use crate::arrays::variant::VariantArrayExt; use crate::scalar::Scalar; use crate::validity::Validity; diff --git a/vortex-array/src/arrays/fixed_size_list/array.rs b/vortex-array/src/arrays/fixed_size_list/array.rs index 5e117db4e06..decea560e1c 100644 --- a/vortex-array/src/arrays/fixed_size_list/array.rs +++ b/vortex-array/src/arrays/fixed_size_list/array.rs @@ -10,6 +10,7 @@ use vortex_error::vortex_ensure; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::TypedArrayRef; use crate::array::ArrayView; use crate::array::child_to_validity; use crate::array::validity_to_child; @@ -206,14 +207,9 @@ impl FixedSizeListData { } -pub trait FixedSizeListArrayExt { - fn fixed_size_list_data(&self) -> &FixedSizeListData; - fn as_slots(&self) -> &[Option]; - fn len(&self) -> usize; - fn dtype(&self) -> &DType; - +pub trait FixedSizeListArrayExt: TypedArrayRef { fn dtype_parts(&self) -> (&DType, u32, crate::dtype::Nullability) { - match self.dtype() { + match self.as_ref().dtype() { DType::FixedSizeList(element_dtype, list_size, nullability) => { (element_dtype.as_ref(), *list_size, *nullability) } @@ -222,7 +218,7 @@ pub trait FixedSizeListArrayExt { } fn elements(&self) -> &ArrayRef { - self.as_slots()[ELEMENTS_SLOT] + self.slots_ref()[ELEMENTS_SLOT] .as_ref() .vortex_expect("FixedSizeListArray elements slot") } @@ -234,49 +230,14 @@ pub trait FixedSizeListArrayExt { fn fixed_size_list_validity(&self) -> Validity { let (_, _, nullability) = self.dtype_parts(); - child_to_validity(&self.as_slots()[VALIDITY_SLOT], nullability) + child_to_validity(&self.slots_ref()[VALIDITY_SLOT], nullability) } fn fixed_size_list_validity_mask(&self) -> vortex_mask::Mask { - self.fixed_size_list_validity().to_mask(self.len()) - } -} - -impl FixedSizeListArrayExt for Array { - fn fixed_size_list_data(&self) -> &FixedSizeListData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn len(&self) -> usize { - Array::len(self) - } - - fn dtype(&self) -> &DType { - Array::dtype(self) - } -} - -impl FixedSizeListArrayExt for ArrayView<'_, FixedSizeList> { - fn fixed_size_list_data(&self) -> &FixedSizeListData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn len(&self) -> usize { - ArrayView::len(self) - } - - fn dtype(&self) -> &DType { - ArrayView::dtype(self) + self.fixed_size_list_validity().to_mask(self.as_ref().len()) } } +impl> FixedSizeListArrayExt for T {} impl Array { /// Creates a new `FixedSizeListArray`. @@ -358,13 +319,16 @@ impl Array { } pub fn into_data_parts(self) -> FixedSizeListDataParts { - let parts = self.into_parts(); + let dtype = self.dtype().clone(); + let elements = self + .slots()[ELEMENTS_SLOT] + .clone() + .vortex_expect("FixedSizeListArray elements slot"); + let validity = self.fixed_size_list_validity(); FixedSizeListDataParts { - elements: parts.slots[ELEMENTS_SLOT] - .clone() - .vortex_expect("FixedSizeListArray elements slot"), - validity: child_to_validity(&parts.slots[VALIDITY_SLOT], parts.dtype.nullability()), - dtype: parts.dtype, + elements, + validity, + dtype, } } } 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 40b769242d3..febf3ef612e 100644 --- a/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs +++ b/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs @@ -25,8 +25,6 @@ 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; -use crate::hash::ArrayEq; -use crate::hash::ArrayHash; use crate::serde::ArrayChildren; use crate::validity::Validity; use crate::vtable; @@ -53,11 +51,19 @@ impl VTable for FixedSizeList { Self::ID } - fn array_hash(data: &FixedSizeListData, state: &mut H, _precision: Precision) { + fn array_hash( + data: &FixedSizeListData, + state: &mut H, + _precision: Precision, + ) { data.degenerate_len.hash(state); } - fn array_eq(data: &FixedSizeListData, other: &FixedSizeListData, _precision: Precision) -> bool { + fn array_eq( + data: &FixedSizeListData, + other: &FixedSizeListData, + _precision: Precision, + ) -> bool { data.degenerate_len == other.degenerate_len } @@ -94,8 +100,18 @@ impl VTable for FixedSizeList { Ok(Some(vec![])) } - fn validate(&self, data: &FixedSizeListData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { - vortex_ensure!(slots.len() == NUM_SLOTS, "FixedSizeListArray expected {NUM_SLOTS} slots, found {}", slots.len()); + fn validate( + &self, + data: &FixedSizeListData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "FixedSizeListArray expected {NUM_SLOTS} slots, found {}", + slots.len() + ); let DType::FixedSizeList(_, list_size, nullability) = dtype else { vortex_bail!("Expected `DType::FixedSizeList`, got {dtype:?}"); }; @@ -113,11 +129,8 @@ impl VTable for FixedSizeList { len ); - let actual_dtype = DType::FixedSizeList( - Arc::new(elements.dtype().clone()), - *list_size, - *nullability, - ); + let actual_dtype = + DType::FixedSizeList(Arc::new(elements.dtype().clone()), *list_size, *nullability); vortex_ensure!( &actual_dtype == dtype, "FixedSizeListArray dtype {} does not match outer dtype {}", @@ -175,15 +188,10 @@ impl VTable for FixedSizeList { Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) } diff --git a/vortex-array/src/arrays/fixed_size_list/vtable/validity.rs b/vortex-array/src/arrays/fixed_size_list/vtable/validity.rs index 2740dd95d9c..bed05f6fc86 100644 --- a/vortex-array/src/arrays/fixed_size_list/vtable/validity.rs +++ b/vortex-array/src/arrays/fixed_size_list/vtable/validity.rs @@ -5,7 +5,6 @@ use vortex_error::VortexResult; use crate::array::ArrayView; use crate::array::ValidityVTable; -use crate::arrays::fixed_size_list::FixedSizeListArrayExt; use crate::arrays::fixed_size_list::vtable::FixedSizeList; use crate::validity::Validity; diff --git a/vortex-array/src/arrays/list/array.rs b/vortex-array/src/arrays/list/array.rs index acd6b1fc306..2845132642d 100644 --- a/vortex-array/src/arrays/list/array.rs +++ b/vortex-array/src/arrays/list/array.rs @@ -17,6 +17,7 @@ use crate::VortexSessionExecute; use crate::aggregate_fn::fns::min_max::min_max; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::TypedArrayRef; use crate::array::ArrayView; use crate::array::child_to_validity; use crate::array::validity_to_child; @@ -256,41 +257,40 @@ impl ListData { // the offset type and manual subtraction and fast path where `offsets[0] == 0`. } -pub trait ListArrayExt { - fn list_data(&self) -> &ListData; - fn as_slots(&self) -> &[Option]; - fn len(&self) -> usize; - fn dtype(&self) -> &DType; - +pub trait ListArrayExt: TypedArrayRef { fn nullability(&self) -> crate::dtype::Nullability { - match self.dtype() { + match self.as_ref().dtype() { DType::List(_, nullability) => *nullability, _ => unreachable!("ListArrayExt requires a list dtype"), } } fn elements(&self) -> &ArrayRef { - self.as_slots()[ELEMENTS_SLOT] + self.slots_ref()[ELEMENTS_SLOT] .as_ref() .vortex_expect("ListArray elements slot") } fn offsets(&self) -> &ArrayRef { - self.as_slots()[OFFSETS_SLOT] + self.slots_ref()[OFFSETS_SLOT] .as_ref() .vortex_expect("ListArray offsets slot") } fn list_validity(&self) -> Validity { - child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.nullability()) + child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.nullability()) } fn list_validity_mask(&self) -> vortex_mask::Mask { - self.list_validity().to_mask(self.len()) + self.list_validity().to_mask(self.as_ref().len()) } fn offset_at(&self, index: usize) -> VortexResult { - vortex_ensure!(index <= self.len(), "Index {index} out of bounds 0..={}", self.len()); + vortex_ensure!( + index <= self.as_ref().len(), + "Index {index} out of bounds 0..={}", + self.as_ref().len() + ); if let Some(p) = self.offsets().as_opt::() { Ok(match_each_native_ptype!(p.ptype(), |P| { @@ -313,46 +313,11 @@ pub trait ListArrayExt { fn sliced_elements(&self) -> VortexResult { let start = self.offset_at(0)?; - let end = self.offset_at(self.len())?; + let end = self.offset_at(self.as_ref().len())?; self.elements().slice(start..end) } } - -impl ListArrayExt for Array { - fn list_data(&self) -> &ListData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn len(&self) -> usize { - Array::len(self) - } - - fn dtype(&self) -> &DType { - Array::dtype(self) - } -} - -impl ListArrayExt for ArrayView<'_, List> { - fn list_data(&self) -> &ListData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn len(&self) -> usize { - ArrayView::len(self) - } - - fn dtype(&self) -> &DType { - ArrayView::dtype(self) - } -} +impl> ListArrayExt for T {} impl Array { /// Creates a new `ListArray`. @@ -423,16 +388,21 @@ impl Array { } pub fn into_data_parts(self) -> ListDataParts { - let parts = self.into_parts(); + let dtype = self.dtype().clone(); + let elements = self + .slots()[ELEMENTS_SLOT] + .clone() + .vortex_expect("ListArray elements slot"); + let offsets = self + .slots()[OFFSETS_SLOT] + .clone() + .vortex_expect("ListArray offsets slot"); + let validity = self.list_validity(); ListDataParts { - elements: parts.slots[ELEMENTS_SLOT] - .clone() - .vortex_expect("ListArray elements slot"), - offsets: parts.slots[OFFSETS_SLOT] - .clone() - .vortex_expect("ListArray offsets slot"), - validity: child_to_validity(&parts.slots[VALIDITY_SLOT], parts.dtype.nullability()), - dtype: parts.dtype, + elements, + offsets, + validity, + dtype, } } @@ -476,6 +446,10 @@ impl ArrayView<'_, List> { ListArrayExt::sliced_elements(self) } + pub fn reset_offsets(&self, recurse: bool) -> VortexResult> { + self.into_owned().reset_offsets(recurse) + } + pub fn element_dtype(&self) -> &DType { self.elements().dtype() } diff --git a/vortex-array/src/arrays/list/tests.rs b/vortex-array/src/arrays/list/tests.rs index f815acb3bb0..e2e7407d111 100644 --- a/vortex-array/src/arrays/list/tests.rs +++ b/vortex-array/src/arrays/list/tests.rs @@ -14,8 +14,6 @@ use crate::Canonical; use crate::IntoArray; use crate::LEGACY_SESSION; use crate::VortexSessionExecute; -use crate::array::Array; -use crate::array::ArrayParts; use crate::arrays::FilterArray; use crate::arrays::List; use crate::arrays::PrimitiveArray; @@ -915,20 +913,8 @@ fn test_recursive_compact_list_of_lists() { assert_eq!(recursive_flat_elements.len(), 7); // Verify data integrity is preserved - let non_recursive_array = Array::try_from_parts(ArrayParts::new( - List, - non_recursive.dtype(), - non_recursive.len(), - non_recursive.clone(), - )) - .unwrap(); - let recursive_array = Array::try_from_parts(ArrayParts::new( - List, - recursive.dtype(), - recursive.len(), - recursive.clone(), - )) - .unwrap(); + let non_recursive_array = non_recursive.into_array(); + let recursive_array = recursive.into_array(); assert_eq!( non_recursive_array.scalar_at(0).unwrap(), recursive_array.scalar_at(0).unwrap() diff --git a/vortex-array/src/arrays/list/vtable/mod.rs b/vortex-array/src/arrays/list/vtable/mod.rs index d2c1257cbcf..339df50d234 100644 --- a/vortex-array/src/arrays/list/vtable/mod.rs +++ b/vortex-array/src/arrays/list/vtable/mod.rs @@ -30,8 +30,6 @@ use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::dtype::Nullability; use crate::dtype::PType; -use crate::hash::ArrayEq; -use crate::hash::ArrayHash; use crate::serde::ArrayChildren; use crate::validity::Validity; use crate::vtable; @@ -57,8 +55,7 @@ impl VTable for List { Self::ID } - fn array_hash(_data: &ListData, _state: &mut H, _precision: Precision) { - } + fn array_hash(_data: &ListData, _state: &mut H, _precision: Precision) {} fn array_eq(_data: &ListData, _other: &ListData, _precision: Precision) -> bool { true @@ -94,8 +91,18 @@ impl VTable for List { )) } - fn validate(&self, _data: &ListData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { - vortex_ensure!(slots.len() == NUM_SLOTS, "ListArray expected {NUM_SLOTS} slots, found {}", slots.len()); + fn validate( + &self, + _data: &ListData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "ListArray expected {NUM_SLOTS} slots, found {}", + slots.len() + ); let elements = slots[crate::arrays::list::array::ELEMENTS_SLOT] .as_ref() .vortex_expect("ListArray elements slot"); @@ -160,15 +167,10 @@ impl VTable for List { Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done( list_view_from_list(array, ctx)?.into_array(), diff --git a/vortex-array/src/arrays/listview/array.rs b/vortex-array/src/arrays/listview/array.rs index 58af73d1833..4c6c624cc63 100644 --- a/vortex-array/src/arrays/listview/array.rs +++ b/vortex-array/src/arrays/listview/array.rs @@ -14,6 +14,7 @@ use crate::ArrayRef; use crate::ToCanonical; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::TypedArrayRef; use crate::array::ArrayView; use crate::array::child_to_validity; use crate::array::validity_to_child; @@ -309,47 +310,46 @@ impl ListViewData { } } -pub trait ListViewArrayExt { - fn listview_data(&self) -> &ListViewData; - fn as_slots(&self) -> &[Option]; - fn len(&self) -> usize; - fn dtype(&self) -> &DType; - +pub trait ListViewArrayExt: TypedArrayRef { fn nullability(&self) -> crate::dtype::Nullability { - match self.dtype() { + match self.as_ref().dtype() { DType::List(_, nullability) => *nullability, _ => unreachable!("ListViewArrayExt requires a list dtype"), } } fn elements(&self) -> &ArrayRef { - self.as_slots()[ELEMENTS_SLOT] + self.slots_ref()[ELEMENTS_SLOT] .as_ref() .vortex_expect("ListViewArray elements slot") } fn offsets(&self) -> &ArrayRef { - self.as_slots()[OFFSETS_SLOT] + self.slots_ref()[OFFSETS_SLOT] .as_ref() .vortex_expect("ListViewArray offsets slot") } fn sizes(&self) -> &ArrayRef { - self.as_slots()[SIZES_SLOT] + self.slots_ref()[SIZES_SLOT] .as_ref() .vortex_expect("ListViewArray sizes slot") } fn listview_validity(&self) -> Validity { - child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.nullability()) + child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.nullability()) } fn listview_validity_mask(&self) -> vortex_mask::Mask { - self.listview_validity().to_mask(self.len()) + self.listview_validity().to_mask(self.as_ref().len()) } fn offset_at(&self, index: usize) -> usize { - assert!(index < self.len(), "Index {index} out of bounds 0..{}", self.len()); + assert!( + index < self.as_ref().len(), + "Index {index} out of bounds 0..{}", + self.as_ref().len() + ); self.offsets() .as_opt::() .map(|p| match_each_integer_ptype!(p.ptype(), |P| { p.as_slice::

()[index].as_() })) @@ -364,7 +364,12 @@ pub trait ListViewArrayExt { } fn size_at(&self, index: usize) -> usize { - assert!(index < self.len(), "Index {} out of bounds 0..{}", index, self.len()); + assert!( + index < self.as_ref().len(), + "Index {} out of bounds 0..{}", + index, + self.as_ref().len() + ); self.sizes() .as_opt::() .map(|p| match_each_integer_ptype!(p.ptype(), |P| { p.as_slice::

()[index].as_() })) @@ -384,42 +389,7 @@ pub trait ListViewArrayExt { self.elements().slice(offset..offset + size) } } - -impl ListViewArrayExt for Array { - fn listview_data(&self) -> &ListViewData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn len(&self) -> usize { - Array::len(self) - } - - fn dtype(&self) -> &DType { - Array::dtype(self) - } -} - -impl ListViewArrayExt for ArrayView<'_, ListView> { - fn listview_data(&self) -> &ListViewData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn len(&self) -> usize { - ArrayView::len(self) - } - - fn dtype(&self) -> &DType { - ArrayView::dtype(self) - } -} +impl> ListViewArrayExt for T {} impl Array { /// Creates a new `ListViewArray`. @@ -529,25 +499,25 @@ impl Array { } pub fn into_data_parts(self) -> ListViewDataParts { - let parts = self.into_parts(); + let elements = self + .slots()[ELEMENTS_SLOT] + .clone() + .vortex_expect("ListViewArray elements slot"); + let offsets = self + .slots()[OFFSETS_SLOT] + .clone() + .vortex_expect("ListViewArray offsets slot"); + let sizes = self + .slots()[SIZES_SLOT] + .clone() + .vortex_expect("ListViewArray sizes slot"); + let validity = self.listview_validity(); ListViewDataParts { - elements_dtype: Arc::new( - parts.slots[ELEMENTS_SLOT] - .as_ref() - .vortex_expect("ListViewArray elements slot") - .dtype() - .clone(), - ), - elements: parts.slots[ELEMENTS_SLOT] - .clone() - .vortex_expect("ListViewArray elements slot"), - offsets: parts.slots[OFFSETS_SLOT] - .clone() - .vortex_expect("ListViewArray offsets slot"), - sizes: parts.slots[SIZES_SLOT] - .clone() - .vortex_expect("ListViewArray sizes slot"), - validity: child_to_validity(&parts.slots[VALIDITY_SLOT], parts.dtype.nullability()), + elements_dtype: Arc::new(elements.dtype().clone()), + elements, + offsets, + sizes, + validity, } } } diff --git a/vortex-array/src/arrays/listview/conversion.rs b/vortex-array/src/arrays/listview/conversion.rs index 8d244b8b722..b9ea820072d 100644 --- a/vortex-array/src/arrays/listview/conversion.rs +++ b/vortex-array/src/arrays/listview/conversion.rs @@ -9,11 +9,8 @@ use crate::Canonical; use crate::ExecutionCtx; use crate::IntoArray; use crate::ToCanonical; -use crate::array::Array; -use crate::array::ArrayParts; use crate::arrays::ExtensionArray; use crate::arrays::FixedSizeListArray; -use crate::arrays::List; use crate::arrays::ListArray; use crate::arrays::ListViewArray; use crate::arrays::PrimitiveArray; diff --git a/vortex-array/src/arrays/listview/vtable/mod.rs b/vortex-array/src/arrays/listview/vtable/mod.rs index 3f517ca45db..6e914bed841 100644 --- a/vortex-array/src/arrays/listview/vtable/mod.rs +++ b/vortex-array/src/arrays/listview/vtable/mod.rs @@ -28,8 +28,6 @@ use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::dtype::Nullability; use crate::dtype::PType; -use crate::hash::ArrayEq; -use crate::hash::ArrayHash; use crate::serde::ArrayChildren; use crate::validity::Validity; use crate::vtable; @@ -95,8 +93,18 @@ impl VTable for ListView { )) } - fn validate(&self, _data: &ListViewData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { - vortex_ensure!(slots.len() == NUM_SLOTS, "ListViewArray expected {NUM_SLOTS} slots, found {}", slots.len()); + fn validate( + &self, + _data: &ListViewData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "ListViewArray expected {NUM_SLOTS} slots, found {}", + slots.len() + ); let elements = slots[crate::arrays::listview::array::ELEMENTS_SLOT] .as_ref() .vortex_expect("ListViewArray elements slot"); @@ -177,20 +185,20 @@ impl VTable for ListView { len, )?; - let data = ListViewData::try_new(elements.clone(), offsets.clone(), sizes.clone(), validity.clone())?; + let data = ListViewData::try_new( + elements.clone(), + offsets.clone(), + sizes.clone(), + validity.clone(), + )?; let slots = ListViewData::make_slots(elements, offsets, sizes, &validity, len); Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) } diff --git a/vortex-array/src/arrays/listview/vtable/validity.rs b/vortex-array/src/arrays/listview/vtable/validity.rs index 64ede5cc142..e53c5cc4179 100644 --- a/vortex-array/src/arrays/listview/vtable/validity.rs +++ b/vortex-array/src/arrays/listview/vtable/validity.rs @@ -5,7 +5,6 @@ use vortex_error::VortexResult; use crate::array::ArrayView; use crate::array::ValidityVTable; -use crate::arrays::listview::ListViewArrayExt; use crate::arrays::listview::vtable::ListView; use crate::validity::Validity; diff --git a/vortex-array/src/arrays/masked/array.rs b/vortex-array/src/arrays/masked/array.rs index 58dc693e3d7..94ce84dbe45 100644 --- a/vortex-array/src/arrays/masked/array.rs +++ b/vortex-array/src/arrays/masked/array.rs @@ -1,16 +1,17 @@ // 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; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::ArrayView; +use crate::array::TypedArrayRef; +use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::Masked; -use crate::dtype::DType; use crate::validity::Validity; /// The underlying child array being masked. @@ -23,70 +24,26 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["child", "validity"]; #[derive(Clone, Debug)] pub struct MaskedData; -pub trait MaskedArrayExt { - fn masked_data(&self) -> &MaskedData; - fn masked_dtype(&self) -> &DType; - fn masked_len(&self) -> usize; - +pub trait MaskedArrayExt: TypedArrayRef { fn child(&self) -> &ArrayRef { - self.as_slots()[CHILD_SLOT] + self.slots_ref()[CHILD_SLOT] .as_ref() - .expect("validated masked child slot") + .vortex_expect("validated masked child slot") } fn validity_child(&self) -> Option<&ArrayRef> { - self.as_slots()[VALIDITY_SLOT].as_ref() + self.slots_ref()[VALIDITY_SLOT].as_ref() } fn masked_validity(&self) -> Validity { - match self.validity_child() { - Some(validity) => Validity::Array(validity.clone()), - None => Validity::AllValid, - } + child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.as_ref().dtype().nullability()) } fn masked_validity_mask(&self) -> vortex_mask::Mask { - self.masked_validity().to_mask(self.masked_len()) - } - - fn as_slots(&self) -> &[Option]; -} - -impl MaskedArrayExt for Array { - fn masked_data(&self) -> &MaskedData { - self.data() - } - - fn masked_dtype(&self) -> &DType { - self.dtype() - } - - fn masked_len(&self) -> usize { - self.len() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} - -impl MaskedArrayExt for ArrayView<'_, Masked> { - fn masked_data(&self) -> &MaskedData { - self.data() - } - - fn masked_dtype(&self) -> &DType { - self.dtype() - } - - fn masked_len(&self) -> usize { - self.len() - } - - fn as_slots(&self) -> &[Option] { - self.slots() + self.masked_validity().to_mask(self.as_ref().len()) } } +impl> MaskedArrayExt for T {} impl MaskedData { pub(crate) fn try_new(child: ArrayRef, validity: Validity) -> VortexResult { diff --git a/vortex-array/src/arrays/masked/execute.rs b/vortex-array/src/arrays/masked/execute.rs index 1b9491003e5..b4f8266aabc 100644 --- a/vortex-array/src/arrays/masked/execute.rs +++ b/vortex-array/src/arrays/masked/execute.rs @@ -21,7 +21,6 @@ use crate::arrays::PrimitiveArray; use crate::arrays::StructArray; use crate::arrays::VarBinViewArray; use crate::arrays::VariantArray; -use crate::arrays::variant::VariantArrayExt; use crate::dtype::Nullability; use crate::executor::ExecutionCtx; use crate::match_each_decimal_value_type; diff --git a/vortex-array/src/arrays/masked/vtable/mod.rs b/vortex-array/src/arrays/masked/vtable/mod.rs index e7c172eb6f6..fdb36aeaab0 100644 --- a/vortex-array/src/arrays/masked/vtable/mod.rs +++ b/vortex-array/src/arrays/masked/vtable/mod.rs @@ -31,8 +31,6 @@ use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::executor::ExecutionCtx; use crate::executor::ExecutionResult; -use crate::hash::ArrayEq; -use crate::hash::ArrayHash; use crate::scalar::Scalar; use crate::serde::ArrayChildren; use crate::validity::Validity; @@ -58,7 +56,7 @@ impl VTable for Masked { fn validate( &self, - data: &MaskedData, + _data: &MaskedData, dtype: &DType, len: usize, slots: &[Option], diff --git a/vortex-array/src/arrays/null/mod.rs b/vortex-array/src/arrays/null/mod.rs index 5f595ee4862..546063e6265 100644 --- a/vortex-array/src/arrays/null/mod.rs +++ b/vortex-array/src/arrays/null/mod.rs @@ -25,8 +25,6 @@ use crate::serde::ArrayChildren; use crate::validity::Validity; use crate::vtable; -const NUM_SLOTS: usize = 0; - pub(crate) mod compute; vtable!(Null, Null, NullData); diff --git a/vortex-array/src/arrays/patched/array.rs b/vortex-array/src/arrays/patched/array.rs index 8677f428e6e..21b519db43f 100644 --- a/vortex-array/src/arrays/patched/array.rs +++ b/vortex-array/src/arrays/patched/array.rs @@ -16,7 +16,7 @@ use crate::ExecutionCtx; use crate::IntoArray; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::arrays::Patched; use crate::arrays::PrimitiveArray; use crate::arrays::patched::TransposedPatches; @@ -115,45 +115,40 @@ fn patch_values_from_slots(slots: &[Option]) -> &ArrayRef { .vortex_expect("PatchedArray values slot") } -pub trait PatchedArrayExt { - fn patched_data(&self) -> &PatchedData; - fn patched_slots(&self) -> &[Option]; - fn patched_len(&self) -> usize; - fn patched_dtype(&self) -> &DType; - +pub trait PatchedArrayExt: TypedArrayRef { #[inline] fn base_array(&self) -> &ArrayRef { - base_array_from_slots(self.patched_slots()) + base_array_from_slots(self.slots_ref()) } #[inline] fn lane_offsets(&self) -> &ArrayRef { - lane_offsets_from_slots(self.patched_slots()) + lane_offsets_from_slots(self.slots_ref()) } #[inline] fn patch_indices(&self) -> &ArrayRef { - patch_indices_from_slots(self.patched_slots()) + patch_indices_from_slots(self.slots_ref()) } #[inline] fn patch_values(&self) -> &ArrayRef { - patch_values_from_slots(self.patched_slots()) + patch_values_from_slots(self.slots_ref()) } #[inline] fn n_lanes(&self) -> usize { - self.patched_data().n_lanes + self.n_lanes } #[inline] fn offset(&self) -> usize { - self.patched_data().offset + self.offset } #[inline] fn lane_range(&self, chunk: usize, lane: usize) -> VortexResult> { - assert!(chunk * 1024 <= self.patched_len() + self.offset()); + assert!(chunk * 1024 <= self.as_ref().len() + self.offset()); assert!(lane < self.n_lanes()); let start = self.lane_offsets().scalar_at(chunk * self.n_lanes() + lane)?; @@ -187,12 +182,12 @@ pub trait PatchedArrayExt { let begin = (chunks.start * 1024).saturating_sub(self.offset()); let end = (chunks.end * 1024) .saturating_sub(self.offset()) - .min(self.patched_len()); + .min(self.as_ref().len()); let offset = if chunks.start == 0 { self.offset() } else { 0 }; let inner = self.base_array().slice(begin..end)?; let len = inner.len(); - let dtype = self.patched_dtype().clone(); + let dtype = self.as_ref().dtype().clone(); let slots = vec![ Some(inner), Some(sliced_lane_offsets), @@ -204,41 +199,7 @@ pub trait PatchedArrayExt { } } -impl PatchedArrayExt for Array { - fn patched_data(&self) -> &PatchedData { - self.data() - } - - fn patched_slots(&self) -> &[Option] { - self.slots() - } - - fn patched_len(&self) -> usize { - self.len() - } - - fn patched_dtype(&self) -> &DType { - self.dtype() - } -} - -impl PatchedArrayExt for ArrayView<'_, Patched> { - fn patched_data(&self) -> &PatchedData { - self.data() - } - - fn patched_slots(&self) -> &[Option] { - self.slots() - } - - fn patched_len(&self) -> usize { - self.len() - } - - fn patched_dtype(&self) -> &DType { - self.dtype() - } -} +impl> PatchedArrayExt for T {} impl Array { pub fn from_array_and_patches( diff --git a/vortex-array/src/arrays/patched/compute/compare.rs b/vortex-array/src/arrays/patched/compute/compare.rs index c103062e52b..9f4d2119e95 100644 --- a/vortex-array/src/arrays/patched/compute/compare.rs +++ b/vortex-array/src/arrays/patched/compute/compare.rs @@ -52,13 +52,12 @@ impl CompareKernel for Patched { .execute::(ctx)? .into_bool(); - let result = result.into_parts(); + let validity = child_to_validity(&result.slots()[0], result.dtype().nullability()); let BoolDataParts { bits, offset, len, - } = result.data.into_parts(); - let validity = child_to_validity(&result.slots[0], result.dtype.nullability()); + } = result.into_data().into_parts(); let mut bits = BitBufferMut::from_buffer(bits.unwrap_host().into_mut(), offset, len); diff --git a/vortex-array/src/arrays/patched/vtable/mod.rs b/vortex-array/src/arrays/patched/vtable/mod.rs index 43e55351558..d0b472a192b 100644 --- a/vortex-array/src/arrays/patched/vtable/mod.rs +++ b/vortex-array/src/arrays/patched/vtable/mod.rs @@ -15,8 +15,6 @@ use vortex_error::VortexResult; use vortex_error::vortex_panic; use vortex_session::VortexSession; -use crate::ArrayEq; -use crate::ArrayHash; use crate::ArrayRef; use crate::Canonical; use crate::ExecutionCtx; @@ -24,8 +22,8 @@ use crate::ExecutionResult; use crate::IntoArray; use crate::Precision; use crate::array::Array; -use crate::array::ArrayParts; use crate::array::ArrayId; +use crate::array::ArrayParts; use crate::array::ArrayView; use crate::array::VTable; use crate::array::ValidityChild; @@ -97,7 +95,13 @@ impl VTable for Patched { 0 } - fn validate(&self, data: &PatchedData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + fn validate( + &self, + data: &PatchedData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { data.validate(dtype, len, slots) } @@ -154,12 +158,14 @@ impl VTable for Patched { let values = children.get(3, dtype, n_patches)?; let data = PatchedData { n_lanes, offset }; - Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(vec![ - Some(inner), - Some(lane_offsets), - Some(indices), - Some(values), - ])) + Ok( + ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(vec![ + Some(inner), + Some(lane_offsets), + Some(indices), + Some(values), + ]), + ) } fn append_to_builder( @@ -225,15 +231,10 @@ impl VTable for Patched { Ok(()) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { let inner = array .base_array() @@ -351,6 +352,7 @@ mod tests { use crate::arrays::Patched; use crate::arrays::PatchedArray; use crate::arrays::PrimitiveArray; + use crate::arrays::patched::array::PatchedArrayExt; use crate::assert_arrays_eq; use crate::builders::builder_with_capacity; use crate::patches::Patches; diff --git a/vortex-array/src/arrays/primitive/array/mod.rs b/vortex-array/src/arrays/primitive/array/mod.rs index 7e65d599087..145c60fc432 100644 --- a/vortex-array/src/arrays/primitive/array/mod.rs +++ b/vortex-array/src/arrays/primitive/array/mod.rs @@ -16,6 +16,7 @@ use vortex_error::vortex_panic; use crate::ToCanonical; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::TypedArrayRef; use crate::array::ArrayView; use crate::arrays::Primitive; use crate::arrays::PrimitiveArray; @@ -87,74 +88,34 @@ pub struct PrimitiveDataParts { pub validity: Validity, } -pub trait PrimitiveArrayExt { - fn primitive_data(&self) -> &PrimitiveData; - fn as_slots(&self) -> &[Option]; - fn dtype(&self) -> &DType; - fn len(&self) -> usize; - +pub trait PrimitiveArrayExt: TypedArrayRef { fn ptype(&self) -> PType { - match self.dtype() { + match self.as_ref().dtype() { DType::Primitive(ptype, _) => *ptype, _ => unreachable!("PrimitiveArrayExt requires a primitive dtype"), } } fn nullability(&self) -> Nullability { - match self.dtype() { + match self.as_ref().dtype() { DType::Primitive(_, nullability) => *nullability, _ => unreachable!("PrimitiveArrayExt requires a primitive dtype"), } } fn validity_child(&self) -> Option<&ArrayRef> { - self.as_slots()[VALIDITY_SLOT].as_ref() + self.slots_ref()[VALIDITY_SLOT].as_ref() } fn validity(&self) -> Validity { - child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.nullability()) + child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.nullability()) } fn validity_mask(&self) -> vortex_mask::Mask { - self.validity().to_mask(self.len()) - } -} - -impl PrimitiveArrayExt for Array { - fn primitive_data(&self) -> &PrimitiveData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn dtype(&self) -> &DType { - Array::dtype(self) - } - - fn len(&self) -> usize { - Array::len(self) - } -} - -impl PrimitiveArrayExt for ArrayView<'_, Primitive> { - fn primitive_data(&self) -> &PrimitiveData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn dtype(&self) -> &DType { - ArrayView::dtype(self) - } - - fn len(&self) -> usize { - ArrayView::len(self) + self.validity().to_mask(self.as_ref().len()) } } +impl> PrimitiveArrayExt for T {} // TODO(connor): There are a lot of places where we could be using `new_unchecked` in the codebase. impl PrimitiveData { diff --git a/vortex-array/src/arrays/primitive/vtable/mod.rs b/vortex-array/src/arrays/primitive/vtable/mod.rs index cb5d2b31e3d..907429e65c9 100644 --- a/vortex-array/src/arrays/primitive/vtable/mod.rs +++ b/vortex-array/src/arrays/primitive/vtable/mod.rs @@ -13,7 +13,6 @@ use crate::ExecutionResult; use crate::array::Array; use crate::array::ArrayView; use crate::array::VTable; -use crate::arrays::primitive::array::PrimitiveArrayExt; use crate::arrays::primitive::PrimitiveData; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -79,7 +78,13 @@ impl VTable for Primitive { Ok(Some(vec![])) } - fn validate(&self, data: &PrimitiveData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + fn validate( + &self, + data: &PrimitiveData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { let DType::Primitive(_, nullability) = dtype else { vortex_bail!("Expected primitive dtype, got {dtype:?}"); }; @@ -162,15 +167,10 @@ impl VTable for Primitive { Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) } diff --git a/vortex-array/src/arrays/scalar_fn/array.rs b/vortex-array/src/arrays/scalar_fn/array.rs index aee80a8af1b..bf1a982efe3 100644 --- a/vortex-array/src/arrays/scalar_fn/array.rs +++ b/vortex-array/src/arrays/scalar_fn/array.rs @@ -43,12 +43,11 @@ impl ScalarFnData { } pub trait ScalarFnArrayDataExt { - fn scalar_fn_data(&self) -> &ScalarFnData; - fn get_child(&self, idx: usize) -> &ArrayRef; - fn nchildren(&self) -> usize; + fn child_at(&self, idx: usize) -> &ArrayRef; + fn child_count(&self) -> usize; fn iter_children(&self) -> impl Iterator + '_ { - (0..self.nchildren()).map(|idx| self.get_child(idx)) + (0..self.child_count()).map(|idx| self.child_at(idx)) } fn children(&self) -> Vec { @@ -57,33 +56,25 @@ pub trait ScalarFnArrayDataExt { } impl ScalarFnArrayDataExt for Array { - fn scalar_fn_data(&self) -> &ScalarFnData { - self.data() - } - - fn get_child(&self, idx: usize) -> &ArrayRef { + fn child_at(&self, idx: usize) -> &ArrayRef { self.slots()[idx] .as_ref() .vortex_expect("ScalarFnArray child slot") } - fn nchildren(&self) -> usize { + fn child_count(&self) -> usize { self.slots().len() } } impl ScalarFnArrayDataExt for ArrayView<'_, ScalarFnVTable> { - fn scalar_fn_data(&self) -> &ScalarFnData { - self.data() - } - - fn get_child(&self, idx: usize) -> &ArrayRef { + fn child_at(&self, idx: usize) -> &ArrayRef { self.slots()[idx] .as_ref() .vortex_expect("ScalarFnArray child slot") } - fn nchildren(&self) -> usize { + fn child_count(&self) -> usize { self.slots().len() } } @@ -102,14 +93,17 @@ impl Array { ScalarFnArrayDataExt::children(self) } + #[allow(clippy::same_name_method)] pub fn get_child(&self, idx: usize) -> &ArrayRef { - ScalarFnArrayDataExt::get_child(self, idx) + ScalarFnArrayDataExt::child_at(self, idx) } + #[allow(clippy::same_name_method)] pub fn nchildren(&self) -> usize { - ScalarFnArrayDataExt::nchildren(self) + ScalarFnArrayDataExt::child_count(self) } + #[allow(clippy::same_name_method)] pub fn iter_children(&self) -> impl Iterator + '_ { (0..self.nchildren()).map(|idx| self.get_child(idx)) } @@ -139,14 +133,17 @@ impl ArrayView<'_, ScalarFnVTable> { ScalarFnArrayDataExt::children(self) } + #[allow(clippy::same_name_method)] pub fn get_child(&self, idx: usize) -> &ArrayRef { - ScalarFnArrayDataExt::get_child(self, idx) + ScalarFnArrayDataExt::child_at(self, idx) } + #[allow(clippy::same_name_method)] pub fn nchildren(&self) -> usize { - ScalarFnArrayDataExt::nchildren(self) + ScalarFnArrayDataExt::child_count(self) } + #[allow(clippy::same_name_method)] pub fn iter_children(&self) -> impl Iterator + '_ { (0..self.nchildren()).map(|idx| self.get_child(idx)) } diff --git a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs index 89340418e6f..a7d01689f88 100644 --- a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs +++ b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs @@ -16,8 +16,6 @@ use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; -use crate::ArrayEq; -use crate::ArrayHash; use crate::ArrayRef; use crate::IntoArray; use crate::Precision; @@ -27,7 +25,6 @@ use crate::array::ArrayParts; use crate::array::ArrayView; use crate::array::VTable; use crate::arrays::scalar_fn::array::ScalarFnData; -use crate::arrays::scalar_fn::array::ScalarFnArrayDataExt; use crate::arrays::scalar_fn::rules::PARENT_RULES; use crate::arrays::scalar_fn::rules::RULES; use crate::buffer::BufferHandle; @@ -63,16 +60,19 @@ impl VTable for ScalarFnVTable { self.scalar_fn.id() } - fn validate(&self, data: &ScalarFnData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + fn validate( + &self, + data: &ScalarFnData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { vortex_ensure!( data.scalar_fn == self.scalar_fn, "ScalarFnArray data scalar_fn does not match vtable" ); vortex_ensure!( - slots - .iter() - .flatten() - .all(|c| c.len() == len), + slots.iter().flatten().all(|c| c.len() == len), "All child arrays must have the same length as the scalar function array" ); @@ -126,10 +126,6 @@ impl VTable for ScalarFnVTable { vortex_bail!("Deserialization of ScalarFnVTable metadata is not supported"); } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(array: ArrayView<'_, Self>, idx: usize) -> String { array .scalar_fn() @@ -139,7 +135,6 @@ impl VTable for ScalarFnVTable { .to_string() } - fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { ctx.log(format_args!("scalar_fn({}): executing", array.scalar_fn())); let args = VecExecutionArgs::new(array.children(), array.len()); @@ -185,15 +180,13 @@ pub trait ScalarFnArrayExt: scalar_fn::ScalarFnVTable { scalar_fn: scalar_fn.clone(), }; let vtable = ScalarFnVTable { scalar_fn }; - Ok( - unsafe { - Array::from_parts_unchecked( - ArrayParts::new(vtable, dtype, len, data) - .with_slots(children.into_iter().map(Some).collect()), - ) - } - .into_array(), - ) + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(vtable, dtype, len, data) + .with_slots(children.into_iter().map(Some).collect()), + ) + } + .into_array()) } } impl ScalarFnArrayExt for V {} diff --git a/vortex-array/src/arrays/shared/array.rs b/vortex-array/src/arrays/shared/array.rs index 05529759480..287c867b912 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; @@ -14,9 +15,8 @@ use crate::Canonical; use crate::IntoArray; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::arrays::Shared; -use crate::dtype::DType; /// The source array that is shared and lazily computed. pub(super) const SOURCE_SLOT: usize = 0; @@ -34,19 +34,15 @@ pub struct SharedData { } #[allow(async_fn_in_trait)] -pub trait SharedArrayExt { - fn shared_data(&self) -> &SharedData; - fn shared_dtype(&self) -> &DType; - fn shared_len(&self) -> usize; - +pub trait SharedArrayExt: TypedArrayRef { fn source(&self) -> &ArrayRef { - self.as_slots()[SOURCE_SLOT] + self.slots_ref()[SOURCE_SLOT] .as_ref() - .expect("validated shared source slot") + .vortex_expect("validated shared source slot") } fn current_array_ref(&self) -> &ArrayRef { - match self.shared_data().cached.get() { + match self.cached.get() { Some(Ok(arr)) => arr, _ => self.source(), } @@ -56,7 +52,7 @@ pub trait SharedArrayExt { &self, f: impl FnOnce(&ArrayRef) -> VortexResult, ) -> VortexResult { - let result = self.shared_data().cached.get_or_init(|| { + let result = self.cached.get_or_init(|| { f(self.source()).map(|c| c.into_array()).map_err(Arc::new) }); result.clone().map_err(Into::into) @@ -67,13 +63,13 @@ pub trait SharedArrayExt { F: FnOnce(ArrayRef) -> Fut, Fut: Future>, { - if let Some(result) = self.shared_data().cached.get() { + if let Some(result) = self.cached.get() { return result.clone().map_err(Into::into); } - let _guard = self.shared_data().async_compute_lock.lock().await; + let _guard = self.async_compute_lock.lock().await; - if let Some(result) = self.shared_data().cached.get() { + if let Some(result) = self.cached.get() { return result.clone().map_err(Into::into); } @@ -82,48 +78,11 @@ pub trait SharedArrayExt { .map(|c| c.into_array()) .map_err(Arc::new); - let result = self.shared_data().cached.get_or_init(|| computed); + let result = self.cached.get_or_init(|| computed); result.clone().map_err(Into::into) } - - fn as_slots(&self) -> &[Option]; -} - -impl SharedArrayExt for Array { - fn shared_data(&self) -> &SharedData { - self.data() - } - - fn shared_dtype(&self) -> &DType { - self.dtype() - } - - fn shared_len(&self) -> usize { - self.len() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} - -impl SharedArrayExt for ArrayView<'_, Shared> { - fn shared_data(&self) -> &SharedData { - self.data() - } - - fn shared_dtype(&self) -> &DType { - self.dtype() - } - - fn shared_len(&self) -> usize { - self.len() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } } +impl> SharedArrayExt for T {} impl SharedData { pub fn new() -> Self { @@ -134,6 +93,12 @@ impl SharedData { } } +impl Default for SharedData { + fn default() -> Self { + Self::new() + } +} + impl Array { /// Creates a new `SharedArray`. pub fn new(source: ArrayRef) -> Self { diff --git a/vortex-array/src/arrays/shared/vtable.rs b/vortex-array/src/arrays/shared/vtable.rs index 5101b5bb02a..914d7746a22 100644 --- a/vortex-array/src/arrays/shared/vtable.rs +++ b/vortex-array/src/arrays/shared/vtable.rs @@ -22,8 +22,6 @@ use crate::arrays::shared::SharedArrayExt; use crate::arrays::shared::array::SLOT_NAMES; use crate::buffer::BufferHandle; use crate::dtype::DType; -use crate::hash::ArrayEq; -use crate::hash::ArrayHash; use crate::scalar::Scalar; use crate::validity::Validity; use crate::vtable; diff --git a/vortex-array/src/arrays/slice/array.rs b/vortex-array/src/arrays/slice/array.rs index 56a75ac5167..12deeba11de 100644 --- a/vortex-array/src/arrays/slice/array.rs +++ b/vortex-array/src/arrays/slice/array.rs @@ -10,7 +10,7 @@ use vortex_error::vortex_panic; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::arrays::Slice; /// The underlying child array being sliced. @@ -27,46 +27,14 @@ pub struct SliceDataParts { pub range: Range, } -pub trait SliceArrayExt { - fn slice_data(&self) -> &SliceData; - fn slice_len(&self) -> usize; - +pub trait SliceArrayExt: TypedArrayRef { fn child(&self) -> &ArrayRef { - self.as_slots()[CHILD_SLOT] + self.slots_ref()[CHILD_SLOT] .as_ref() - .expect("validated slice child slot") - } - - fn as_slots(&self) -> &[Option]; -} - -impl SliceArrayExt for Array { - fn slice_data(&self) -> &SliceData { - self.data() - } - - fn slice_len(&self) -> usize { - self.len() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } -} - -impl SliceArrayExt for ArrayView<'_, Slice> { - fn slice_data(&self) -> &SliceData { - self.data() - } - - fn slice_len(&self) -> usize { - self.len() - } - - fn as_slots(&self) -> &[Option] { - self.slots() + .vortex_expect("validated slice child slot") } } +impl> SliceArrayExt for T {} impl SliceData { fn try_new(child: &ArrayRef, range: Range) -> VortexResult { diff --git a/vortex-array/src/arrays/slice/vtable.rs b/vortex-array/src/arrays/slice/vtable.rs index 0397ac54c17..25426d9634f 100644 --- a/vortex-array/src/arrays/slice/vtable.rs +++ b/vortex-array/src/arrays/slice/vtable.rs @@ -15,8 +15,6 @@ use vortex_error::vortex_panic; use vortex_session::VortexSession; use crate::AnyCanonical; -use crate::ArrayEq; -use crate::ArrayHash; use crate::ArrayRef; use crate::Canonical; use crate::IntoArray; diff --git a/vortex-array/src/arrays/struct_/array.rs b/vortex-array/src/arrays/struct_/array.rs index 079483b972b..aa73b33f80c 100644 --- a/vortex-array/src/arrays/struct_/array.rs +++ b/vortex-array/src/arrays/struct_/array.rs @@ -14,6 +14,7 @@ use crate::ArrayRef; use crate::IntoArray; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::TypedArrayRef; use crate::array::ArrayView; use crate::array::child_to_validity; use crate::array::validity_to_child; @@ -336,28 +337,24 @@ impl StructData { } } -pub trait StructArrayExt { - fn struct_data(&self) -> &StructData; - fn as_slots(&self) -> &[Option]; - fn dtype(&self) -> &DType; - +pub trait StructArrayExt: TypedArrayRef { fn nullability(&self) -> crate::dtype::Nullability { - match self.dtype() { + match self.as_ref().dtype() { DType::Struct(_, nullability) => *nullability, _ => unreachable!("StructArrayExt requires a struct dtype"), } } fn names(&self) -> &FieldNames { - self.struct_data().names() + StructData::names(self) } fn struct_validity(&self) -> Validity { - child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.nullability()) + child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.nullability()) } fn iter_unmasked_fields(&self) -> impl Iterator + '_ { - self.as_slots()[FIELDS_OFFSET..] + self.slots_ref()[FIELDS_OFFSET..] .iter() .map(|s| s.as_ref().vortex_expect("StructArray field slot")) } @@ -367,7 +364,7 @@ pub trait StructArrayExt { } fn unmasked_field(&self, idx: usize) -> &ArrayRef { - self.as_slots()[FIELDS_OFFSET + idx] + self.slots_ref()[FIELDS_OFFSET + idx] .as_ref() .vortex_expect("StructArray field slot") } @@ -396,34 +393,7 @@ pub trait StructArrayExt { ) } } - -impl StructArrayExt for Array { - fn struct_data(&self) -> &StructData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn dtype(&self) -> &DType { - Array::dtype(self) - } -} - -impl StructArrayExt for ArrayView<'_, Struct> { - fn struct_data(&self) -> &StructData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn dtype(&self) -> &DType { - ArrayView::dtype(self) - } -} +impl> StructArrayExt for T {} impl Array { /// Creates a new `StructArray`. @@ -572,19 +542,19 @@ impl Array { } pub fn into_data_parts(self) -> StructDataParts { - let parts = self.into_parts(); + let fields: Arc<[ArrayRef]> = self.slots()[FIELDS_OFFSET..] + .iter() + .map(|s| s.as_ref().vortex_expect("StructArray field slot").clone()) + .collect(); + let names = self.data().names.clone(); + let validity = self.validity().vortex_expect("StructArray validity"); let struct_fields = StructFields::new( - parts.data.names.clone(), - parts.slots[FIELDS_OFFSET..] + names, + fields .iter() - .map(|slot| slot.as_ref().vortex_expect("StructArray field slot").dtype().clone()) + .map(|field| field.dtype().clone()) .collect(), ); - let fields: Arc<[ArrayRef]> = parts.slots[FIELDS_OFFSET..] - .iter() - .map(|s| s.as_ref().vortex_expect("StructArray field slot").clone()) - .collect(); - let validity = child_to_validity(&parts.slots[VALIDITY_SLOT], parts.dtype.nullability()); StructDataParts { struct_fields, fields, validity } } diff --git a/vortex-array/src/arrays/struct_/vtable/mod.rs b/vortex-array/src/arrays/struct_/vtable/mod.rs index 6bcf40ba530..91693465b59 100644 --- a/vortex-array/src/arrays/struct_/vtable/mod.rs +++ b/vortex-array/src/arrays/struct_/vtable/mod.rs @@ -31,8 +31,6 @@ mod validity; use crate::Precision; use crate::array::ArrayId; -use crate::hash::ArrayEq; -use crate::hash::ArrayHash; vtable!(Struct, Struct, StructData); @@ -57,7 +55,13 @@ impl VTable for Struct { 0 } - fn validate(&self, data: &StructData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + fn validate( + &self, + data: &StructData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { let DType::Struct(struct_dtype, nullability) = dtype else { vortex_bail!("Expected struct dtype, found {:?}", dtype) }; @@ -106,7 +110,8 @@ impl VTable for Struct { vortex_bail!("StructArray cannot have fieldless length and field slots"); } - for (idx, (slot, field_dtype)) in field_slots.iter().zip(struct_dtype.fields()).enumerate() { + for (idx, (slot, field_dtype)) in field_slots.iter().zip(struct_dtype.fields()).enumerate() + { let field = slot .as_ref() .ok_or_else(|| vortex_error::vortex_err!("StructArray missing field slot {idx}"))?; @@ -185,14 +190,11 @@ impl VTable for Struct { .try_collect()?; let slots = StructData::make_slots(&field_children, &validity, len); - let data = StructData::try_new_with_dtype(field_children, struct_dtype.clone(), len, validity)?; + let data = + StructData::try_new_with_dtype(field_children, struct_dtype.clone(), len, validity)?; Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(array: ArrayView<'_, Self>, idx: usize) -> String { if idx == VALIDITY_SLOT { "validity".to_string() @@ -201,7 +203,6 @@ impl VTable for Struct { } } - fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) } diff --git a/vortex-array/src/arrays/varbin/array.rs b/vortex-array/src/arrays/varbin/array.rs index a56df5fdf6f..73ebefe57e6 100644 --- a/vortex-array/src/arrays/varbin/array.rs +++ b/vortex-array/src/arrays/varbin/array.rs @@ -14,6 +14,7 @@ use crate::ArrayRef; use crate::ToCanonical; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::TypedArrayRef; use crate::array::ArrayView; use crate::array::child_to_validity; use crate::array::validity_to_child; @@ -307,23 +308,19 @@ impl VarBinData { } } -pub trait VarBinArrayExt { - fn varbin_data(&self) -> &VarBinData; - fn as_slots(&self) -> &[Option]; - fn dtype(&self) -> &DType; - +pub trait VarBinArrayExt: TypedArrayRef { fn offsets(&self) -> &ArrayRef { - self.as_slots()[OFFSETS_SLOT] + self.slots_ref()[OFFSETS_SLOT] .as_ref() .vortex_expect("VarBinArray offsets slot") } fn validity_child(&self) -> Option<&ArrayRef> { - self.as_slots()[VALIDITY_SLOT].as_ref() + self.slots_ref()[VALIDITY_SLOT].as_ref() } fn dtype_parts(&self) -> (bool, Nullability) { - match self.dtype() { + match self.as_ref().dtype() { DType::Utf8(nullability) => (true, *nullability), DType::Binary(nullability) => (false, *nullability), _ => unreachable!("VarBinArrayExt requires a utf8 or binary dtype"), @@ -339,17 +336,19 @@ pub trait VarBinArrayExt { } fn varbin_validity(&self) -> Validity { - child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.nullability()) + child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.nullability()) } fn varbin_validity_mask(&self) -> Mask { - self.varbin_validity().to_mask(self.len()) + self.varbin_validity().to_mask(self.as_ref().len()) } - fn len(&self) -> usize; - fn offset_at(&self, index: usize) -> usize { - assert!(index <= self.len(), "Index {index} out of bounds 0..={}", self.len()); + assert!( + index <= self.as_ref().len(), + "Index {index} out of bounds 0..={}", + self.as_ref().len() + ); (&self .offsets() @@ -362,51 +361,16 @@ pub trait VarBinArrayExt { fn bytes_at(&self, index: usize) -> ByteBuffer { let start = self.offset_at(index); let end = self.offset_at(index + 1); - self.varbin_data().bytes().slice(start..end) + self.bytes().slice(start..end) } fn sliced_bytes(&self) -> ByteBuffer { let first_offset: usize = self.offset_at(0); - let last_offset = self.offset_at(self.len()); - self.varbin_data().bytes().slice(first_offset..last_offset) - } -} - -impl VarBinArrayExt for Array { - fn varbin_data(&self) -> &VarBinData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn len(&self) -> usize { - Array::len(self) - } - - fn dtype(&self) -> &DType { - Array::dtype(self) - } -} - -impl VarBinArrayExt for ArrayView<'_, VarBin> { - fn varbin_data(&self) -> &VarBinData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn len(&self) -> usize { - ArrayView::len(self) - } - - fn dtype(&self) -> &DType { - ArrayView::dtype(self) + let last_offset = self.offset_at(self.as_ref().len()); + self.bytes().slice(first_offset..last_offset) } } +impl> VarBinArrayExt for T {} /// Forwarding constructors for `VarBinArray` (= `Array`). impl Array { @@ -497,15 +461,14 @@ impl Array { } pub fn into_data_parts(self) -> VarBinDataParts { - let parts = self.into_parts(); - let dtype = parts.dtype; - let validity = child_to_validity(&parts.slots[VALIDITY_SLOT], dtype.nullability()); + let dtype = self.dtype().clone(); + let validity = self.varbin_validity(); + let offsets = self.offsets().clone(); + let data = self.into_data(); VarBinDataParts { dtype, - bytes: parts.data.bytes, - offsets: parts.slots[OFFSETS_SLOT] - .clone() - .vortex_expect("VarBinArray offsets slot"), + bytes: data.bytes, + offsets, validity, } } diff --git a/vortex-array/src/arrays/varbin/vtable/mod.rs b/vortex-array/src/arrays/varbin/vtable/mod.rs index c4c4e05995e..b6515eba8b0 100644 --- a/vortex-array/src/arrays/varbin/vtable/mod.rs +++ b/vortex-array/src/arrays/varbin/vtable/mod.rs @@ -70,8 +70,18 @@ impl VTable for VarBin { 1 } - fn validate(&self, _data: &VarBinData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { - vortex_ensure!(slots.len() == NUM_SLOTS, "VarBinArray expected {NUM_SLOTS} slots, found {}", slots.len()); + fn validate( + &self, + _data: &VarBinData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "VarBinArray expected {NUM_SLOTS} slots, found {}", + slots.len() + ); let offsets = slots[crate::arrays::varbin::array::OFFSETS_SLOT] .as_ref() .vortex_expect("VarBinArray offsets slot"); @@ -81,7 +91,10 @@ impl VTable for VarBin { offsets.len().saturating_sub(1), len ); - vortex_ensure!(matches!(dtype, DType::Binary(_) | DType::Utf8(_)), "VarBinArray dtype must be binary or utf8, got {dtype}"); + vortex_ensure!( + matches!(dtype, DType::Binary(_) | DType::Utf8(_)), + "VarBinArray dtype must be binary or utf8, got {dtype}" + ); Ok(()) } @@ -145,15 +158,10 @@ impl VTable for VarBin { Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn reduce_parent( array: ArrayView<'_, Self>, parent: &ArrayRef, diff --git a/vortex-array/src/arrays/varbinview/array.rs b/vortex-array/src/arrays/varbinview/array.rs index ef86b5a4888..016f0157ec8 100644 --- a/vortex-array/src/arrays/varbinview/array.rs +++ b/vortex-array/src/arrays/varbinview/array.rs @@ -18,6 +18,7 @@ use vortex_mask::Mask; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::TypedArrayRef; use crate::array::ArrayView; use crate::array::child_to_validity; use crate::array::validity_to_child; @@ -527,14 +528,9 @@ impl VarBinViewData { } } -pub trait VarBinViewArrayExt { - fn varbinview_data(&self) -> &VarBinViewData; - fn as_slots(&self) -> &[Option]; - fn dtype(&self) -> &DType; - fn len(&self) -> usize; - +pub trait VarBinViewArrayExt: TypedArrayRef { fn dtype_parts(&self) -> (bool, Nullability) { - match self.dtype() { + match self.as_ref().dtype() { DType::Utf8(nullability) => (true, *nullability), DType::Binary(nullability) => (false, *nullability), _ => unreachable!("VarBinViewArrayExt requires a utf8 or binary dtype"), @@ -542,49 +538,14 @@ pub trait VarBinViewArrayExt { } fn varbinview_validity(&self) -> Validity { - child_to_validity(&self.as_slots()[VALIDITY_SLOT], self.dtype_parts().1) + child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.dtype_parts().1) } fn varbinview_validity_mask(&self) -> Mask { - self.varbinview_validity().to_mask(self.len()) - } -} - -impl VarBinViewArrayExt for Array { - fn varbinview_data(&self) -> &VarBinViewData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn dtype(&self) -> &DType { - Array::dtype(self) - } - - fn len(&self) -> usize { - Array::len(self) - } -} - -impl VarBinViewArrayExt for ArrayView<'_, VarBinView> { - fn varbinview_data(&self) -> &VarBinViewData { - self.data() - } - - fn as_slots(&self) -> &[Option] { - self.slots() - } - - fn dtype(&self) -> &DType { - ArrayView::dtype(self) - } - - fn len(&self) -> usize { - ArrayView::len(self) + self.varbinview_validity().to_mask(self.as_ref().len()) } } +impl> VarBinViewArrayExt for T {} impl Array { #[inline] @@ -604,41 +565,65 @@ impl Array { iter: I, dtype: DType, ) -> Self { - let array = VarBinViewData::from_iter(iter, dtype.clone()); - let slots = VarBinViewData::make_slots(&Validity::from(dtype.nullability()), array.len()); - Self::from_prevalidated_data(dtype, array, slots) + let iter = iter.into_iter(); + let mut builder = VarBinViewBuilder::with_capacity(dtype, iter.size_hint().0); + for value in iter { + match value { + Some(value) => builder.append_value(value), + None => builder.append_null(), + } + } + builder.finish_into_varbinview() } pub fn from_iter_str, I: IntoIterator>(iter: I) -> Self { - let dtype = DType::Utf8(Nullability::NonNullable); - let array = VarBinViewData::from_iter_str(iter); - let slots = VarBinViewData::make_slots(&Validity::NonNullable, array.len()); - Self::from_prevalidated_data(dtype, array, slots) + let iter = iter.into_iter(); + let mut builder = + VarBinViewBuilder::with_capacity(DType::Utf8(Nullability::NonNullable), iter.size_hint().0); + for value in iter { + builder.append_value(value.as_ref()); + } + builder.finish_into_varbinview() } pub fn from_iter_nullable_str, I: IntoIterator>>( iter: I, ) -> Self { - let dtype = DType::Utf8(Nullability::Nullable); - let array = VarBinViewData::from_iter_nullable_str(iter); - let slots = VarBinViewData::make_slots(&Validity::AllValid, array.len()); - Self::from_prevalidated_data(dtype, array, slots) + let iter = iter.into_iter(); + let mut builder = + VarBinViewBuilder::with_capacity(DType::Utf8(Nullability::Nullable), iter.size_hint().0); + for value in iter { + match value { + Some(value) => builder.append_value(value.as_ref()), + None => builder.append_null(), + } + } + builder.finish_into_varbinview() } pub fn from_iter_bin, I: IntoIterator>(iter: I) -> Self { - let dtype = DType::Binary(Nullability::NonNullable); - let array = VarBinViewData::from_iter_bin(iter); - let slots = VarBinViewData::make_slots(&Validity::NonNullable, array.len()); - Self::from_prevalidated_data(dtype, array, slots) + let iter = iter.into_iter(); + let mut builder = + VarBinViewBuilder::with_capacity(DType::Binary(Nullability::NonNullable), iter.size_hint().0); + for value in iter { + builder.append_value(value.as_ref()); + } + builder.finish_into_varbinview() } pub fn from_iter_nullable_bin, I: IntoIterator>>( iter: I, ) -> Self { - let dtype = DType::Binary(Nullability::Nullable); - let array = VarBinViewData::from_iter_nullable_bin(iter); - let slots = VarBinViewData::make_slots(&Validity::AllValid, array.len()); - Self::from_prevalidated_data(dtype, array, slots) + let iter = iter.into_iter(); + let mut builder = + VarBinViewBuilder::with_capacity(DType::Binary(Nullability::Nullable), iter.size_hint().0); + for value in iter { + match value { + Some(value) => builder.append_value(value.as_ref()), + None => builder.append_null(), + } + } + builder.finish_into_varbinview() } /// Creates a new `VarBinViewArray`. @@ -708,13 +693,13 @@ impl Array { } pub fn into_data_parts(self) -> VarBinViewDataParts { - let parts = self.into_parts(); - let dtype = parts.dtype; - let validity = child_to_validity(&parts.slots[VALIDITY_SLOT], dtype.nullability()); + let dtype = self.dtype().clone(); + let validity = self.varbinview_validity(); + let data = self.into_data(); VarBinViewDataParts { dtype, - buffers: parts.data.buffers, - views: parts.data.views, + buffers: data.buffers, + views: data.views, validity, } } diff --git a/vortex-array/src/arrays/varbinview/compute/zip.rs b/vortex-array/src/arrays/varbinview/compute/zip.rs index 8938769e1e0..80d34056cd3 100644 --- a/vortex-array/src/arrays/varbinview/compute/zip.rs +++ b/vortex-array/src/arrays/varbinview/compute/zip.rs @@ -15,7 +15,6 @@ use crate::IntoArray; use crate::array::ArrayView; use crate::arrays::VarBinView; use crate::arrays::VarBinViewArray; -use crate::arrays::varbinview::VarBinViewArrayExt; use crate::arrays::varbinview::BinaryView; use crate::builders::DeduplicatedBuffers; use crate::builders::LazyBitBufferBuilder; diff --git a/vortex-array/src/arrays/varbinview/vtable/mod.rs b/vortex-array/src/arrays/varbinview/vtable/mod.rs index f2f1d65bae1..89050a4fc7f 100644 --- a/vortex-array/src/arrays/varbinview/vtable/mod.rs +++ b/vortex-array/src/arrays/varbinview/vtable/mod.rs @@ -21,7 +21,6 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; -use crate::arrays::varbinview::VarBinViewArrayExt; use crate::arrays::varbinview::BinaryView; use crate::arrays::varbinview::VarBinViewData; use crate::arrays::varbinview::array::NUM_SLOTS; @@ -56,7 +55,11 @@ impl VTable for VarBinView { Self::ID } - fn array_hash(data: &VarBinViewData, state: &mut H, precision: Precision) { + fn array_hash( + data: &VarBinViewData, + state: &mut H, + precision: Precision, + ) { for buffer in data.buffers.iter() { buffer.array_hash(state, precision); } @@ -66,10 +69,10 @@ impl VTable for VarBinView { fn array_eq(data: &VarBinViewData, other: &VarBinViewData, precision: Precision) -> bool { data.buffers.len() == other.buffers.len() && data - .buffers - .iter() - .zip(other.buffers.iter()) - .all(|(a, b)| a.array_eq(b, precision)) + .buffers + .iter() + .zip(other.buffers.iter()) + .all(|(a, b)| a.array_eq(b, precision)) && data.views.array_eq(&other.views, precision) } @@ -77,15 +80,28 @@ impl VTable for VarBinView { array.data_buffers().len() + 1 } - fn validate(&self, data: &VarBinViewData, dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { - vortex_ensure!(slots.len() == NUM_SLOTS, "VarBinViewArray expected {NUM_SLOTS} slots, found {}", slots.len()); + fn validate( + &self, + data: &VarBinViewData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { + vortex_ensure!( + slots.len() == NUM_SLOTS, + "VarBinViewArray expected {NUM_SLOTS} slots, found {}", + slots.len() + ); vortex_ensure!( data.len() == len, "VarBinViewArray length {} does not match outer length {}", data.len(), len ); - vortex_ensure!(matches!(dtype, DType::Binary(_) | DType::Utf8(_)), "VarBinViewArray dtype must be binary or utf8, got {dtype}"); + vortex_ensure!( + matches!(dtype, DType::Binary(_) | DType::Utf8(_)), + "VarBinViewArray dtype must be binary or utf8, got {dtype}" + ); Ok(()) } @@ -177,20 +193,20 @@ impl VTable for VarBinView { .collect::>(); let views = Buffer::::from_byte_buffer(views_handle.clone().as_host().clone()); - let data = VarBinViewData::try_new(views, Arc::from(data_buffers), dtype.clone(), validity.clone())?; + let data = VarBinViewData::try_new( + views, + Arc::from(data_buffers), + dtype.clone(), + validity.clone(), + )?; let slots = VarBinViewData::make_slots(&validity, len); Ok(crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots)) } - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - array.slots() - } - fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String { SLOT_NAMES[idx].to_string() } - fn reduce_parent( array: ArrayView<'_, Self>, parent: &ArrayRef, diff --git a/vortex-array/src/arrays/varbinview/vtable/validity.rs b/vortex-array/src/arrays/varbinview/vtable/validity.rs index f9dfbf64def..bffe34f22e6 100644 --- a/vortex-array/src/arrays/varbinview/vtable/validity.rs +++ b/vortex-array/src/arrays/varbinview/vtable/validity.rs @@ -5,7 +5,6 @@ use vortex_error::VortexResult; use crate::array::ArrayView; use crate::array::ValidityVTable; -use crate::arrays::varbinview::VarBinViewArrayExt; use crate::arrays::varbinview::vtable::VarBinView; use crate::validity::Validity; diff --git a/vortex-array/src/arrays/variant/mod.rs b/vortex-array/src/arrays/variant/mod.rs index f74730084c7..9b5246ec1a6 100644 --- a/vortex-array/src/arrays/variant/mod.rs +++ b/vortex-array/src/arrays/variant/mod.rs @@ -5,9 +5,12 @@ mod vtable; pub use self::vtable::Variant; pub use self::vtable::VariantArray; +use vortex_error::VortexExpect; + use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::TypedArrayRef; use crate::array::ArrayView; use crate::dtype::DType; @@ -25,55 +28,20 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["child"]; #[derive(Clone, Debug)] pub struct VariantData; -pub trait VariantArrayExt { - fn variant_data(&self) -> &VariantData; - fn variant_dtype(&self) -> &DType; - fn variant_len(&self) -> usize; - +pub trait VariantArrayExt: TypedArrayRef { fn child(&self) -> &ArrayRef { - self.as_slots()[0].as_ref().expect("validated variant child slot") - } - - fn as_slots(&self) -> &[Option]; -} - -impl VariantArrayExt for Array { - fn variant_data(&self) -> &VariantData { - self.data() - } - - fn variant_dtype(&self) -> &DType { - self.dtype() - } - - fn variant_len(&self) -> usize { - self.len() - } - - fn as_slots(&self) -> &[Option] { - self.slots() + self.slots_ref()[0] + .as_ref() + .vortex_expect("validated variant child slot") } } +impl> VariantArrayExt for T {} -impl VariantArrayExt for ArrayView<'_, Variant> { - fn variant_data(&self) -> &VariantData { - self.data() - } - - fn variant_dtype(&self) -> &DType { - self.dtype() - } - - fn variant_len(&self) -> usize { - self.len() - } - - fn as_slots(&self) -> &[Option] { - self.slots() +impl Array { + pub fn child(&self) -> &ArrayRef { + VariantArrayExt::child(self) } -} -impl Array { /// Creates a new `VariantArray`. pub fn new(child: ArrayRef) -> Self { let dtype = DType::Variant(child.dtype().nullability()); @@ -87,3 +55,9 @@ impl Array { .with_stats_set(stats) } } + +impl ArrayView<'_, Variant> { + pub fn child(&self) -> &ArrayRef { + VariantArrayExt::child(self) + } +} diff --git a/vortex-array/src/arrays/variant/vtable/mod.rs b/vortex-array/src/arrays/variant/vtable/mod.rs index 4f04085f567..4cdfeaaa0f9 100644 --- a/vortex-array/src/arrays/variant/vtable/mod.rs +++ b/vortex-array/src/arrays/variant/vtable/mod.rs @@ -11,8 +11,6 @@ use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_panic; -use crate::ArrayEq; -use crate::ArrayHash; use crate::ArrayRef; use crate::ExecutionCtx; use crate::ExecutionResult; @@ -21,9 +19,7 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; -use crate::arrays::variant::NUM_SLOTS; use crate::arrays::variant::SLOT_NAMES; -use crate::arrays::variant::VariantArrayExt; use crate::arrays::variant::VariantData; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -52,7 +48,7 @@ impl VTable for Variant { fn validate( &self, - data: &Self::ArrayData, + _data: &Self::ArrayData, dtype: &DType, len: usize, slots: &[Option], diff --git a/vortex-array/src/arrays/variant/vtable/operations.rs b/vortex-array/src/arrays/variant/vtable/operations.rs index fb6fc0eb499..0e0495b7a91 100644 --- a/vortex-array/src/arrays/variant/vtable/operations.rs +++ b/vortex-array/src/arrays/variant/vtable/operations.rs @@ -7,7 +7,6 @@ use crate::ExecutionCtx; use crate::array::ArrayView; use crate::array::OperationsVTable; use crate::arrays::Variant; -use crate::arrays::variant::VariantArrayExt; use crate::scalar::Scalar; impl OperationsVTable for Variant { diff --git a/vortex-array/src/arrays/variant/vtable/validity.rs b/vortex-array/src/arrays/variant/vtable/validity.rs index 42237c81977..93fc2b786c6 100644 --- a/vortex-array/src/arrays/variant/vtable/validity.rs +++ b/vortex-array/src/arrays/variant/vtable/validity.rs @@ -6,7 +6,6 @@ use vortex_error::VortexResult; use crate::array::ArrayView; use crate::array::ValidityVTable; use crate::arrays::Variant; -use crate::arrays::variant::VariantArrayExt; use crate::validity::Validity; impl ValidityVTable for Variant { diff --git a/vortex-array/src/arrow/executor/dictionary.rs b/vortex-array/src/arrow/executor/dictionary.rs index 2c36c9f9672..6b42a25be53 100644 --- a/vortex-array/src/arrow/executor/dictionary.rs +++ b/vortex-array/src/arrow/executor/dictionary.rs @@ -21,7 +21,6 @@ use crate::arrays::Constant; use crate::arrays::ConstantArray; use crate::arrays::Dict; use crate::arrays::DictArray; -use crate::arrays::dict::DictArrayExt; use crate::arrow::ArrowArrayExecutor; pub(super) fn to_arrow_dictionary( diff --git a/vortex-array/src/canonical.rs b/vortex-array/src/canonical.rs index bdfceed9064..f45084f9c21 100644 --- a/vortex-array/src/canonical.rs +++ b/vortex-array/src/canonical.rs @@ -38,7 +38,6 @@ use crate::arrays::VarBinView; use crate::arrays::VarBinViewArray; use crate::arrays::Variant; use crate::arrays::VariantArray; -use crate::arrays::variant::VariantArrayExt; use crate::arrays::bool::BoolDataParts; use crate::arrays::decimal::DecimalDataParts; use crate::arrays::listview::ListViewDataParts; @@ -546,13 +545,12 @@ impl Executable for CanonicalValidity { match array.execute::(ctx)? { n @ Canonical::Null(_) => Ok(CanonicalValidity(n)), Canonical::Bool(b) => { - let b = b.into_parts(); + let validity = child_to_validity(&b.slots()[0], b.dtype().nullability()); let BoolDataParts { bits, offset, len, - } = b.data.into_parts(); - let validity = child_to_validity(&b.slots[0], b.dtype.nullability()); + } = b.into_data().into_parts(); Ok(CanonicalValidity(Canonical::Bool( BoolArray::try_new_from_handle(bits, offset, len, validity.execute(ctx)?)?, ))) @@ -669,13 +667,12 @@ impl Executable for RecursiveCanonical { match array.execute::(ctx)? { n @ Canonical::Null(_) => Ok(RecursiveCanonical(n)), Canonical::Bool(b) => { - let b = b.into_parts(); + let validity = child_to_validity(&b.slots()[0], b.dtype().nullability()); let BoolDataParts { bits, offset, len, - } = b.data.into_parts(); - let validity = child_to_validity(&b.slots[0], b.dtype.nullability()); + } = b.into_data().into_parts(); Ok(RecursiveCanonical(Canonical::Bool( BoolArray::try_new_from_handle(bits, offset, len, validity.execute(ctx)?)?, ))) diff --git a/vortex-array/src/optimizer/mod.rs b/vortex-array/src/optimizer/mod.rs index b7ab6664374..4feee5170c7 100644 --- a/vortex-array/src/optimizer/mod.rs +++ b/vortex-array/src/optimizer/mod.rs @@ -98,7 +98,7 @@ fn try_optimize_recursive(array: &ArrayRef) -> VortexResult> { new_slots.push(Some(new_child)); any_slot_optimized = true; } else { - new_slots.push(Some(child)); + new_slots.push(Some(child.clone())); } } None => new_slots.push(None), diff --git a/vortex-cuda/benches/dynamic_dispatch_cuda.rs b/vortex-cuda/benches/dynamic_dispatch_cuda.rs index 6d4bb42d619..1f5688b08b3 100644 --- a/vortex-cuda/benches/dynamic_dispatch_cuda.rs +++ b/vortex-cuda/benches/dynamic_dispatch_cuda.rs @@ -26,11 +26,13 @@ use vortex::array::validity::Validity::NonNullable; use vortex::buffer::Buffer; use vortex::dtype::PType; use vortex::encodings::alp::ALP; +use vortex::encodings::alp::ALPArrayExt; use vortex::encodings::alp::ALPFloat; use vortex::encodings::alp::Exponents; use vortex::encodings::alp::alp_encode; use vortex::encodings::fastlanes::BitPackedData; use vortex::encodings::fastlanes::FoR; +use vortex::encodings::fastlanes::FoRArrayExt; use vortex::encodings::fastlanes::FoRData; use vortex::encodings::runend::RunEnd; use vortex::error::VortexExpect; diff --git a/vortex-cuda/src/dynamic_dispatch/mod.rs b/vortex-cuda/src/dynamic_dispatch/mod.rs index cc886f9e81a..49bd06bc076 100644 --- a/vortex-cuda/src/dynamic_dispatch/mod.rs +++ b/vortex-cuda/src/dynamic_dispatch/mod.rs @@ -435,11 +435,13 @@ mod tests { use vortex::buffer::Buffer; use vortex::dtype::PType; use vortex::encodings::alp::ALP; + use vortex::encodings::alp::ALPArrayExt; use vortex::encodings::alp::ALPFloat; use vortex::encodings::alp::Exponents; use vortex::encodings::alp::alp_encode; use vortex::encodings::fastlanes::BitPacked; use vortex::encodings::fastlanes::BitPackedArray; + use vortex::encodings::fastlanes::FoRArrayExt; use vortex::encodings::fastlanes::FoR; use vortex::encodings::runend::RunEnd; use vortex::encodings::zigzag::ZigZag; diff --git a/vortex-cuda/src/kernel/encodings/bitpacked.rs b/vortex-cuda/src/kernel/encodings/bitpacked.rs index 3bdff6b439d..6409109cb3e 100644 --- a/vortex-cuda/src/kernel/encodings/bitpacked.rs +++ b/vortex-cuda/src/kernel/encodings/bitpacked.rs @@ -176,6 +176,7 @@ mod tests { use vortex::array::validity::Validity::NonNullable; use vortex::buffer::Buffer; use vortex::error::VortexExpect; + use vortex::encodings::fastlanes::BitPackedArrayExt; use vortex::session::VortexSession; use super::*; @@ -199,7 +200,7 @@ mod tests { // Last two items should be patched let bp_with_patches = BitPacked::encode(&array.into_array(), bw)?; - assert!(bp_with_patches.patches(bp_with_patches.len()).is_some()); + assert!(bp_with_patches.patches().is_some()); let cpu_result = bp_with_patches.to_canonical()?.into_array(); @@ -230,7 +231,7 @@ mod tests { // Last two items should be patched let bp_with_patches = BitPacked::encode(&array.into_array(), 9)?; - assert!(bp_with_patches.patches(bp_with_patches.len()).is_some()); + assert!(bp_with_patches.patches().is_some()); let cpu_result = bp_with_patches.to_canonical()?.into_array(); diff --git a/vortex-duckdb/src/exporter/decimal.rs b/vortex-duckdb/src/exporter/decimal.rs index 765e76272ca..2fe226b7f31 100644 --- a/vortex-duckdb/src/exporter/decimal.rs +++ b/vortex-duckdb/src/exporter/decimal.rs @@ -47,7 +47,7 @@ pub(crate) fn new_exporter( decimal_dtype, values_type, values, - } = array.into_data().into_parts(); + } = array.into_data_parts(); let dest_values_type = precision_to_duckdb_storage_size(&decimal_dtype)?; let nullability = validity.nullability(); let validity = validity.to_array(len).execute::(ctx)?; diff --git a/vortex-layout/src/layouts/repartition.rs b/vortex-layout/src/layouts/repartition.rs index 741aef8b853..74b1bde0e98 100644 --- a/vortex-layout/src/layouts/repartition.rs +++ b/vortex-layout/src/layouts/repartition.rs @@ -475,6 +475,7 @@ mod tests { let _output = buf.pop_front().unwrap(); // Transition SharedState from Source to Cached for ALL slices sharing this Arc. + use vortex_array::arrays::shared::SharedArrayExt; shared_handle.get_or_compute(|source| source.to_canonical())?; // Before the fix this panicked with "attempt to subtract with overflow". diff --git a/vortex-python/src/arrays/builtins/chunked.rs b/vortex-python/src/arrays/builtins/chunked.rs index 5ca1aafd67f..25ce35cdd43 100644 --- a/vortex-python/src/arrays/builtins/chunked.rs +++ b/vortex-python/src/arrays/builtins/chunked.rs @@ -5,7 +5,6 @@ use pyo3::PyRef; use pyo3::pyclass; use pyo3::pymethods; use vortex::array::arrays::Chunked; -use vortex::array::arrays::chunked::ChunkedArrayExt; use crate::arrays::PyArrayRef; use crate::arrays::native::EncodingSubclass; diff --git a/vortex-python/src/arrays/builtins/struct_.rs b/vortex-python/src/arrays/builtins/struct_.rs index 1c9151650fc..a2b1ef9d0e1 100644 --- a/vortex-python/src/arrays/builtins/struct_.rs +++ b/vortex-python/src/arrays/builtins/struct_.rs @@ -10,7 +10,6 @@ use vortex::error::VortexExpect; use vortex::array::arrays::Struct; use crate::arrays::PyArrayRef; -use crate::arrays::native::AsArrayRef; use crate::arrays::native::EncodingSubclass; use crate::arrays::native::PyNativeArray; use crate::error::PyVortexResult; diff --git a/vortex-python/src/arrays/py/vtable.rs b/vortex-python/src/arrays/py/vtable.rs index b7daf0529d0..076e0327e49 100644 --- a/vortex-python/src/arrays/py/vtable.rs +++ b/vortex-python/src/arrays/py/vtable.rs @@ -108,10 +108,6 @@ impl VTable for PythonVTable { vortex_bail!("PythonArray deserialization is not supported"); } - fn slots(_array: ArrayView<'_, Self>) -> &[Option] { - &[] - } - fn slot_name(_array: ArrayView<'_, Self>, _idx: usize) -> String { vortex_panic!("PythonArray has no slots") } diff --git a/vortex/benches/common_encoding_tree_throughput.rs b/vortex/benches/common_encoding_tree_throughput.rs index 6f48a19de3a..0e64c4fc80a 100644 --- a/vortex/benches/common_encoding_tree_throughput.rs +++ b/vortex/benches/common_encoding_tree_throughput.rs @@ -25,15 +25,19 @@ use vortex::array::builtins::ArrayBuiltins; use vortex::dtype::DType; use vortex::dtype::PType; use vortex::encodings::alp::ALP; +use vortex::encodings::alp::ALPArrayExt; use vortex::encodings::alp::alp_encode; use vortex::encodings::datetime_parts::DateTimeParts; use vortex::encodings::datetime_parts::split_temporal; use vortex::encodings::fastlanes::BitPacked; use vortex::encodings::fastlanes::FoR; +use vortex::encodings::fastlanes::FoRArrayExt; use vortex::encodings::fsst::FSST; +use vortex::encodings::fsst::FSSTArrayExt; use vortex::encodings::fsst::fsst_compress; use vortex::encodings::fsst::fsst_train_compressor; use vortex::encodings::runend::RunEnd; +use vortex::encodings::runend::RunEndArrayExt; use vortex::error::VortexExpect; use vortex::extension::datetime::TimeUnit; From 011e328efdf1d63ad758896e654c1d67b9d7aed1 Mon Sep 17 00:00:00 2001 From: Nicholas Gates Date: Sun, 5 Apr 2026 12:03:38 -0400 Subject: [PATCH 06/10] Engine Signed-off-by: Nicholas Gates --- encodings/alp/public-api.lock | 8 +- encodings/alp/src/alp/compress.rs | 2 +- encodings/alp/src/alp/compute/between.rs | 2 +- encodings/alp/src/alp/compute/cast.rs | 2 +- encodings/alp/src/alp/compute/compare.rs | 2 +- encodings/bytebool/public-api.lock | 2 - encodings/datetime-parts/public-api.lock | 4 +- encodings/datetime-parts/src/array.rs | 2 +- encodings/datetime-parts/src/compute/rules.rs | 2 +- encodings/decimal-byte-parts/public-api.lock | 4 +- encodings/fastlanes/public-api.lock | 8 - .../src/bitpacking/array/bitpack_compress.rs | 2 +- .../fastlanes/src/bitpacking/array/mod.rs | 8 +- .../src/bitpacking/compute/filter.rs | 2 +- .../fastlanes/src/bitpacking/compute/take.rs | 2 +- .../src/bitpacking/vtable/operations.rs | 5 +- .../src/delta/array/delta_decompress.rs | 2 +- encodings/fastlanes/src/delta/array/mod.rs | 4 +- encodings/fastlanes/src/delta/vtable/slice.rs | 9 +- .../fastlanes/src/for/array/for_compress.rs | 17 +- .../fastlanes/src/for/array/for_decompress.rs | 2 +- .../fastlanes/src/for/compute/is_sorted.rs | 2 +- encodings/fastlanes/src/for/mod.rs | 2 +- encodings/fastlanes/src/rle/array/mod.rs | 5 +- .../fastlanes/src/rle/array/rle_compress.rs | 2 +- encodings/fastlanes/src/rle/mod.rs | 2 +- encodings/fsst/public-api.lock | 2 - encodings/parquet-variant/src/array.rs | 6 +- encodings/parquet-variant/src/kernel.rs | 2 +- encodings/parquet-variant/src/lib.rs | 2 +- encodings/parquet-variant/src/operations.rs | 2 +- encodings/pco/public-api.lock | 4 +- encodings/runend/public-api.lock | 2 - encodings/runend/src/arrow.rs | 12 +- encodings/runend/src/compute/take_from.rs | 2 +- encodings/sequence/public-api.lock | 4 +- encodings/sparse/public-api.lock | 4 +- encodings/zigzag/public-api.lock | 2 - encodings/zstd/public-api.lock | 4 +- vortex-array/public-api.lock | 304 ++---------------- vortex-array/src/array/view.rs | 2 +- vortex-array/src/arrays/bool/array.rs | 6 +- vortex-array/src/arrays/chunked/array.rs | 18 +- vortex-array/src/arrays/chunked/mod.rs | 2 +- .../src/arrays/chunked/paired_chunks.rs | 5 +- vortex-array/src/arrays/chunked/tests.rs | 5 +- vortex-array/src/arrays/chunked/vtable/mod.rs | 17 +- .../src/arrays/constant/vtable/mod.rs | 13 +- vortex-array/src/arrays/decimal/array.rs | 2 +- vortex-array/src/arrays/decimal/mod.rs | 2 +- vortex-array/src/arrays/dict/array.rs | 30 +- vortex-array/src/arrays/extension/array.rs | 10 +- vortex-array/src/arrays/extension/mod.rs | 2 +- vortex-array/src/arrays/filter/array.rs | 4 +- vortex-array/src/arrays/filter/mod.rs | 2 +- vortex-array/src/arrays/filter/vtable.rs | 12 +- .../src/arrays/fixed_size_list/array.rs | 18 +- .../arrays/fixed_size_list/compute/take.rs | 2 +- vortex-array/src/arrays/list/array.rs | 31 +- vortex-array/src/arrays/list/compute/take.rs | 2 +- vortex-array/src/arrays/listview/array.rs | 78 +++-- vortex-array/src/arrays/listview/mod.rs | 2 +- vortex-array/src/arrays/masked/array.rs | 5 +- .../src/arrays/masked/compute/filter.rs | 2 +- .../src/arrays/masked/compute/take.rs | 2 +- vortex-array/src/arrays/masked/mod.rs | 2 +- vortex-array/src/arrays/masked/vtable/mod.rs | 14 +- .../src/arrays/masked/vtable/validity.rs | 2 +- vortex-array/src/arrays/null/mod.rs | 13 +- vortex-array/src/arrays/patched/array.rs | 8 +- .../src/arrays/patched/compute/compare.rs | 10 +- .../src/arrays/patched/compute/filter.rs | 2 +- .../src/arrays/patched/compute/take.rs | 2 +- .../src/arrays/primitive/array/mod.rs | 36 ++- .../src/arrays/primitive/compute/cast.rs | 2 +- vortex-array/src/arrays/primitive/mod.rs | 2 +- vortex-array/src/arrays/scalar_fn/array.rs | 2 +- vortex-array/src/arrays/shared/array.rs | 6 +- vortex-array/src/arrays/shared/mod.rs | 2 +- vortex-array/src/arrays/shared/vtable.rs | 2 +- vortex-array/src/arrays/slice/mod.rs | 2 +- vortex-array/src/arrays/slice/vtable.rs | 12 +- vortex-array/src/arrays/struct_/array.rs | 58 +++- vortex-array/src/arrays/struct_/mod.rs | 2 +- vortex-array/src/arrays/varbin/array.rs | 11 +- vortex-array/src/arrays/varbin/mod.rs | 2 +- vortex-array/src/arrays/varbinview/array.rs | 51 +-- vortex-array/src/arrays/varbinview/mod.rs | 2 +- vortex-array/src/arrays/variant/mod.rs | 6 +- vortex-array/src/arrays/variant/vtable/mod.rs | 7 +- vortex-array/src/arrow/executor/dictionary.rs | 5 +- vortex-array/src/canonical.rs | 14 +- vortex-array/src/optimizer/mod.rs | 2 +- vortex-btrblocks/src/schemes/integer.rs | 2 +- vortex-cuda/src/arrow/canonical.rs | 5 +- vortex-cuda/src/canonical.rs | 5 +- vortex-cuda/src/dynamic_dispatch/mod.rs | 2 +- vortex-cuda/src/kernel/encodings/bitpacked.rs | 2 +- vortex-python/src/arrays/builtins/struct_.rs | 2 +- 99 files changed, 412 insertions(+), 615 deletions(-) diff --git a/encodings/alp/public-api.lock b/encodings/alp/public-api.lock index 2afab0178de..2f54de00534 100644 --- a/encodings/alp/public-api.lock +++ b/encodings/alp/public-api.lock @@ -34,7 +34,7 @@ pub type vortex_alp::ALP::ValidityVTable = vortex_array::array::vtable::validity pub fn vortex_alp::ALP::array_eq(data: &vortex_alp::ALPData, other: &vortex_alp::ALPData, _precision: vortex_array::hash::Precision) -> bool -pub fn vortex_alp::ALP::array_hash(data: &vortex_alp::ALPData, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_alp::ALP::array_hash(data: &vortex_alp::ALPData, state: &mut H, _precision: vortex_array::hash::Precision) pub fn vortex_alp::ALP::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle @@ -56,8 +56,6 @@ pub fn vortex_alp::ALP::serialize(array: vortex_array::array::view::ArrayView<'_ pub fn vortex_alp::ALP::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_alp::ALP::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_alp::ALP::validate(&self, data: &vortex_alp::ALPData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_alp::ALP @@ -190,8 +188,6 @@ pub fn vortex_alp::ALPRD::serialize(array: vortex_array::array::view::ArrayView< pub fn vortex_alp::ALPRD::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_alp::ALPRD::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_alp::ALPRD::validate(&self, data: &vortex_alp::ALPRDData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_alp::ALPRD @@ -230,8 +226,6 @@ pub fn vortex_alp::ALPRDData::into_parts(self, left_parts: vortex_array::array:: pub fn vortex_alp::ALPRDData::left_parts_dictionary(&self) -> &vortex_buffer::buffer::Buffer -pub fn vortex_alp::ALPRDData::left_parts_patches(&self) -> core::option::Option - pub fn vortex_alp::ALPRDData::right_bit_width(&self) -> u8 pub fn vortex_alp::ALPRDData::try_new(dtype: vortex_array::dtype::DType, left_parts: vortex_array::array::erased::ArrayRef, left_parts_dictionary: vortex_buffer::buffer::Buffer, right_parts: vortex_array::array::erased::ArrayRef, right_bit_width: u8, left_parts_patches: core::option::Option) -> vortex_error::VortexResult diff --git a/encodings/alp/src/alp/compress.rs b/encodings/alp/src/alp/compress.rs index ec4af466cc9..a8215eef6fb 100644 --- a/encodings/alp/src/alp/compress.rs +++ b/encodings/alp/src/alp/compress.rs @@ -133,8 +133,8 @@ mod tests { use vortex_buffer::Buffer; use vortex_buffer::buffer; - use crate::alp::array::ALPArrayExt; use super::*; + use crate::alp::array::ALPArrayExt; use crate::decompress_into_array; #[test] diff --git a/encodings/alp/src/alp/compute/between.rs b/encodings/alp/src/alp/compute/between.rs index aac162dc030..163a236b483 100644 --- a/encodings/alp/src/alp/compute/between.rs +++ b/encodings/alp/src/alp/compute/between.rs @@ -18,8 +18,8 @@ use vortex_array::scalar_fn::fns::between::StrictComparison; use vortex_error::VortexResult; use crate::ALP; -use crate::alp::array::ALPArrayExt; use crate::ALPFloat; +use crate::alp::array::ALPArrayExt; use crate::match_each_alp_float_ptype; impl BetweenReduce for ALP { diff --git a/encodings/alp/src/alp/compute/cast.rs b/encodings/alp/src/alp/compute/cast.rs index 26cc5c55fbe..950688dfcac 100644 --- a/encodings/alp/src/alp/compute/cast.rs +++ b/encodings/alp/src/alp/compute/cast.rs @@ -10,8 +10,8 @@ use vortex_array::patches::Patches; use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_error::VortexResult; -use crate::alp::ALP; use crate::ALPArrayExt; +use crate::alp::ALP; impl CastReduce for ALP { fn cast(array: ArrayView<'_, Self>, dtype: &DType) -> VortexResult> { diff --git a/encodings/alp/src/alp/compute/compare.rs b/encodings/alp/src/alp/compute/compare.rs index 6d557344d30..f15821c725b 100644 --- a/encodings/alp/src/alp/compute/compare.rs +++ b/encodings/alp/src/alp/compute/compare.rs @@ -18,8 +18,8 @@ use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_err; -use crate::ALPArrayExt; use crate::ALP; +use crate::ALPArrayExt; use crate::ALPFloat; use crate::match_each_alp_float_ptype; diff --git a/encodings/bytebool/public-api.lock b/encodings/bytebool/public-api.lock index 86963b1b487..65a35e05e36 100644 --- a/encodings/bytebool/public-api.lock +++ b/encodings/bytebool/public-api.lock @@ -52,8 +52,6 @@ pub fn vortex_bytebool::ByteBool::serialize(_array: vortex_array::array::view::A pub fn vortex_bytebool::ByteBool::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_bytebool::ByteBool::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_bytebool::ByteBool::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_bytebool::ByteBool diff --git a/encodings/datetime-parts/public-api.lock b/encodings/datetime-parts/public-api.lock index 30cd25dbcc2..d1ef86b4455 100644 --- a/encodings/datetime-parts/public-api.lock +++ b/encodings/datetime-parts/public-api.lock @@ -50,9 +50,7 @@ pub fn vortex_datetime_parts::DateTimeParts::serialize(array: vortex_array::arra pub fn vortex_datetime_parts::DateTimeParts::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_datetime_parts::DateTimeParts::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_datetime_parts::DateTimeParts::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_datetime_parts::DateTimeParts::validate(&self, _data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_datetime_parts::DateTimeParts diff --git a/encodings/datetime-parts/src/array.rs b/encodings/datetime-parts/src/array.rs index 4fe10ede53a..c0164254d18 100644 --- a/encodings/datetime-parts/src/array.rs +++ b/encodings/datetime-parts/src/array.rs @@ -32,11 +32,11 @@ use vortex_error::vortex_err; use vortex_error::vortex_panic; use vortex_session::VortexSession; +use crate::TemporalParts; use crate::canonical::decode_to_temporal; use crate::compute::kernel::PARENT_KERNELS; use crate::compute::rules::PARENT_RULES; use crate::split_temporal; -use crate::TemporalParts; vtable!(DateTimeParts, DateTimeParts, DateTimePartsData); diff --git a/encodings/datetime-parts/src/compute/rules.rs b/encodings/datetime-parts/src/compute/rules.rs index 7bf5e874e1e..8488d2ab1ae 100644 --- a/encodings/datetime-parts/src/compute/rules.rs +++ b/encodings/datetime-parts/src/compute/rules.rs @@ -25,8 +25,8 @@ use vortex_array::scalar_fn::fns::mask::MaskReduceAdaptor; use vortex_error::VortexExpect; use vortex_error::VortexResult; -use crate::array::DateTimePartsArrayExt; use crate::DateTimeParts; +use crate::array::DateTimePartsArrayExt; use crate::timestamp; pub(crate) const PARENT_RULES: ParentRuleSet = ParentRuleSet::new(&[ ParentRuleSet::lift(&DTPFilterPushDownRule), diff --git a/encodings/decimal-byte-parts/public-api.lock b/encodings/decimal-byte-parts/public-api.lock index 5a6cb6ddc47..57da6a69840 100644 --- a/encodings/decimal-byte-parts/public-api.lock +++ b/encodings/decimal-byte-parts/public-api.lock @@ -48,9 +48,7 @@ pub fn vortex_decimal_byte_parts::DecimalByteParts::serialize(array: vortex_arra pub fn vortex_decimal_byte_parts::DecimalByteParts::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_decimal_byte_parts::DecimalByteParts::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_decimal_byte_parts::DecimalByteParts::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_decimal_byte_parts::DecimalByteParts::validate(&self, _data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_decimal_byte_parts::DecimalByteParts diff --git a/encodings/fastlanes/public-api.lock b/encodings/fastlanes/public-api.lock index 26e0269bcc1..51c99cf6584 100644 --- a/encodings/fastlanes/public-api.lock +++ b/encodings/fastlanes/public-api.lock @@ -170,8 +170,6 @@ pub fn vortex_fastlanes::BitPacked::serialize(array: vortex_array::array::view:: pub fn vortex_fastlanes::BitPacked::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_fastlanes::BitPacked::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_fastlanes::BitPacked::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_fastlanes::BitPacked @@ -292,8 +290,6 @@ pub fn vortex_fastlanes::Delta::serialize(array: vortex_array::array::view::Arra pub fn vortex_fastlanes::Delta::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_fastlanes::Delta::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_fastlanes::Delta::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_fastlanes::Delta @@ -376,8 +372,6 @@ pub fn vortex_fastlanes::FoR::serialize(array: vortex_array::array::view::ArrayV pub fn vortex_fastlanes::FoR::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_fastlanes::FoR::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_fastlanes::FoR::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_fastlanes::FoR @@ -478,8 +472,6 @@ pub fn vortex_fastlanes::RLE::serialize(array: vortex_array::array::view::ArrayV pub fn vortex_fastlanes::RLE::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_fastlanes::RLE::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_fastlanes::RLE::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_fastlanes::RLE diff --git a/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs b/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs index ced79774660..1ff01860014 100644 --- a/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs +++ b/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs @@ -422,10 +422,10 @@ mod test { use vortex_error::VortexError; use vortex_session::VortexSession; - use crate::bitpacking::array::BitPackedArrayExt; use super::*; use crate::BitPackedData; use crate::bitpack_compress::test_harness::make_array; + use crate::bitpacking::array::BitPackedArrayExt; static SESSION: LazyLock = LazyLock::new(|| VortexSession::empty().with::()); diff --git a/encodings/fastlanes/src/bitpacking/array/mod.rs b/encodings/fastlanes/src/bitpacking/array/mod.rs index 5e034e98d39..8a8d38b367e 100644 --- a/encodings/fastlanes/src/bitpacking/array/mod.rs +++ b/encodings/fastlanes/src/bitpacking/array/mod.rs @@ -417,8 +417,8 @@ mod test { use vortex_array::assert_arrays_eq; use vortex_buffer::Buffer; - use crate::bitpacking::array::BitPackedArrayExt; use crate::BitPackedData; + use crate::bitpacking::array::BitPackedArrayExt; #[test] fn test_encode() { @@ -453,11 +453,7 @@ mod test { let parray = values.clone().into_array(); let packed_with_patches = BitPackedData::encode(&parray, 9).unwrap(); - assert!( - packed_with_patches - .patches() - .is_some() - ); + assert!(packed_with_patches.patches().is_some()); assert_arrays_eq!( packed_with_patches.as_array().to_primitive(), PrimitiveArray::new(values, vortex_array::validity::Validity::NonNullable) diff --git a/encodings/fastlanes/src/bitpacking/compute/filter.rs b/encodings/fastlanes/src/bitpacking/compute/filter.rs index 18b489e5f5b..ec2e7f6ea68 100644 --- a/encodings/fastlanes/src/bitpacking/compute/filter.rs +++ b/encodings/fastlanes/src/bitpacking/compute/filter.rs @@ -185,8 +185,8 @@ mod test { use vortex_buffer::buffer; use vortex_mask::Mask; - use crate::bitpacking::array::BitPackedArrayExt; use crate::BitPackedData; + use crate::bitpacking::array::BitPackedArrayExt; #[test] fn take_indices() { diff --git a/encodings/fastlanes/src/bitpacking/compute/take.rs b/encodings/fastlanes/src/bitpacking/compute/take.rs index d4983de0d3f..9422b44be1b 100644 --- a/encodings/fastlanes/src/bitpacking/compute/take.rs +++ b/encodings/fastlanes/src/bitpacking/compute/take.rs @@ -174,9 +174,9 @@ mod test { use vortex_buffer::Buffer; use vortex_buffer::buffer; - use crate::bitpacking::array::BitPackedArrayExt; use crate::BitPackedArray; use crate::BitPackedData; + use crate::bitpacking::array::BitPackedArrayExt; use crate::bitpacking::compute::take::take_primitive; #[test] diff --git a/encodings/fastlanes/src/bitpacking/vtable/operations.rs b/encodings/fastlanes/src/bitpacking/vtable/operations.rs index 00611d502b6..4e2213cf87a 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/operations.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/operations.rs @@ -8,8 +8,8 @@ use vortex_array::vtable::OperationsVTable; use vortex_error::VortexResult; use crate::BitPacked; -use crate::bitpacking::array::BitPackedArrayExt; use crate::bitpack_decompress; +use crate::bitpacking::array::BitPackedArrayExt; impl OperationsVTable for BitPacked { fn scalar_at( array: ArrayView<'_, BitPacked>, @@ -46,8 +46,6 @@ mod test { use vortex_array::scalar::Scalar; use vortex_array::validity::Validity; use vortex_buffer::Alignment; - - use crate::bitpacking::array::BitPackedArrayExt; use vortex_buffer::Buffer; use vortex_buffer::ByteBuffer; use vortex_buffer::buffer; @@ -55,6 +53,7 @@ mod test { use crate::BitPacked; use crate::BitPackedArray; use crate::BitPackedData; + use crate::bitpacking::array::BitPackedArrayExt; fn bp(array: &ArrayRef, bit_width: u8) -> BitPackedArray { BitPackedData::encode(array, bit_width).unwrap() diff --git a/encodings/fastlanes/src/delta/array/delta_decompress.rs b/encodings/fastlanes/src/delta/array/delta_decompress.rs index 95110ae37d9..d6404dfb905 100644 --- a/encodings/fastlanes/src/delta/array/delta_decompress.rs +++ b/encodings/fastlanes/src/delta/array/delta_decompress.rs @@ -16,9 +16,9 @@ use vortex_buffer::Buffer; use vortex_buffer::BufferMut; use vortex_error::VortexResult; -use crate::delta::array::DeltaArrayExt; use crate::DeltaArray; use crate::bit_transpose::untranspose_validity; +use crate::delta::array::DeltaArrayExt; pub fn delta_decompress( array: &DeltaArray, diff --git a/encodings/fastlanes/src/delta/array/mod.rs b/encodings/fastlanes/src/delta/array/mod.rs index 374d642423a..033039875d6 100644 --- a/encodings/fastlanes/src/delta/array/mod.rs +++ b/encodings/fastlanes/src/delta/array/mod.rs @@ -108,9 +108,7 @@ impl DeltaData { len: usize, ) -> VortexResult<()> { Self::validate_parts(bases, deltas, self.offset, len)?; - let expected_dtype = bases - .dtype() - .with_nullability(deltas.dtype().nullability()); + let expected_dtype = bases.dtype().with_nullability(deltas.dtype().nullability()); vortex_ensure!( dtype == &expected_dtype, "DeltaArray dtype mismatch: expected {expected_dtype}, got {dtype}" diff --git a/encodings/fastlanes/src/delta/vtable/slice.rs b/encodings/fastlanes/src/delta/vtable/slice.rs index b2aa2450c0b..17b088dac92 100644 --- a/encodings/fastlanes/src/delta/vtable/slice.rs +++ b/encodings/fastlanes/src/delta/vtable/slice.rs @@ -26,12 +26,11 @@ impl SliceReduce for Delta { let deltas = array.deltas(); let lanes = lane_count(array.dtype().as_ptype()); - let new_bases = - bases.slice(min(start_chunk * lanes, bases.len())..min(stop_chunk * lanes, bases.len()))?; + let new_bases = bases + .slice(min(start_chunk * lanes, bases.len())..min(stop_chunk * lanes, bases.len()))?; - let new_deltas = deltas.slice( - min(start_chunk * 1024, deltas.len())..min(stop_chunk * 1024, deltas.len()), - )?; + let new_deltas = deltas + .slice(min(start_chunk * 1024, deltas.len())..min(stop_chunk * 1024, deltas.len()))?; Ok(Some( Delta::try_new(new_bases, new_deltas, physical_start % 1024, range.len())?.into_array(), diff --git a/encodings/fastlanes/src/for/array/for_compress.rs b/encodings/fastlanes/src/for/array/for_compress.rs index de5286db4b4..aa72d884c93 100644 --- a/encodings/fastlanes/src/for/array/for_compress.rs +++ b/encodings/fastlanes/src/for/array/for_compress.rs @@ -35,14 +35,13 @@ fn compress_primitive( ) -> VortexResult { // Set null values to the min value, ensuring that decompress into a value in the primitive // range (and stop them wrapping around). - let encoded = parray - .map_each_with_validity::(|(v, bool)| { - if bool { - v.wrapping_sub(&min) - } else { - T::zero() - } - })?; + let encoded = parray.map_each_with_validity::(|(v, bool)| { + if bool { + v.wrapping_sub(&min) + } else { + T::zero() + } + })?; Ok(encoded) } @@ -62,9 +61,9 @@ mod test { use vortex_buffer::buffer; use vortex_session::VortexSession; - use crate::r#for::array::FoRArrayExt; use super::*; use crate::BitPackedData; + use crate::r#for::array::FoRArrayExt; use crate::r#for::array::for_decompress::decompress; use crate::r#for::array::for_decompress::fused_decompress; diff --git a/encodings/fastlanes/src/for/array/for_decompress.rs b/encodings/fastlanes/src/for/array/for_decompress.rs index f50d54055fb..e19ef8d0ff3 100644 --- a/encodings/fastlanes/src/for/array/for_decompress.rs +++ b/encodings/fastlanes/src/for/array/for_decompress.rs @@ -20,8 +20,8 @@ use vortex_error::VortexResult; use crate::BitPacked; use crate::BitPackedArrayExt; use crate::FoRArray; -use crate::r#for::array::FoRArrayExt; use crate::bitpack_decompress; +use crate::r#for::array::FoRArrayExt; use crate::unpack_iter::UnpackStrategy; use crate::unpack_iter::UnpackedChunks; diff --git a/encodings/fastlanes/src/for/compute/is_sorted.rs b/encodings/fastlanes/src/for/compute/is_sorted.rs index 06d3ce7d220..3b81c45c03d 100644 --- a/encodings/fastlanes/src/for/compute/is_sorted.rs +++ b/encodings/fastlanes/src/for/compute/is_sorted.rs @@ -63,8 +63,8 @@ mod test { use vortex_array::validity::Validity; use vortex_buffer::buffer; - use crate::r#for::array::FoRArrayExt; use crate::FoRData; + use crate::r#for::array::FoRArrayExt; #[test] fn test_sorted() { diff --git a/encodings/fastlanes/src/for/mod.rs b/encodings/fastlanes/src/for/mod.rs index 98bb775bf8a..8a70fe30499 100644 --- a/encodings/fastlanes/src/for/mod.rs +++ b/encodings/fastlanes/src/for/mod.rs @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::FoRData; pub use array::FoRArrayExt; +pub use array::FoRData; pub(crate) mod compute; diff --git a/encodings/fastlanes/src/rle/array/mod.rs b/encodings/fastlanes/src/rle/array/mod.rs index 3635faa0a0d..8965282be4c 100644 --- a/encodings/fastlanes/src/rle/array/mod.rs +++ b/encodings/fastlanes/src/rle/array/mod.rs @@ -59,7 +59,8 @@ impl RLEData { length: usize, ) -> VortexResult<()> { Self::validate_parts(values, indices, value_idx_offsets, self.offset, length)?; - let expected_dtype = DType::Primitive(values.dtype().as_ptype(), indices.dtype().nullability()); + let expected_dtype = + DType::Primitive(values.dtype().as_ptype(), indices.dtype().nullability()); vortex_ensure!( dtype == &expected_dtype, "RLE dtype mismatch: expected {expected_dtype}, got {dtype}" @@ -249,10 +250,10 @@ mod tests { use vortex_error::VortexResult; use vortex_session::registry::ReadContext; - use crate::rle::array::RLEArrayExt; use crate::FL_CHUNK_SIZE; use crate::RLE; use crate::RLEData; + use crate::rle::array::RLEArrayExt; use crate::test::SESSION; #[test] diff --git a/encodings/fastlanes/src/rle/array/rle_compress.rs b/encodings/fastlanes/src/rle/array/rle_compress.rs index 9c9c6419124..a175f1f1cb7 100644 --- a/encodings/fastlanes/src/rle/array/rle_compress.rs +++ b/encodings/fastlanes/src/rle/array/rle_compress.rs @@ -148,8 +148,8 @@ mod tests { use vortex_buffer::buffer; use vortex_error::VortexExpect; - use crate::rle::array::RLEArrayExt; use super::*; + use crate::rle::array::RLEArrayExt; #[test] fn test_encode_decode() { diff --git a/encodings/fastlanes/src/rle/mod.rs b/encodings/fastlanes/src/rle/mod.rs index ff1e580db1d..1c580683908 100644 --- a/encodings/fastlanes/src/rle/mod.rs +++ b/encodings/fastlanes/src/rle/mod.rs @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::RLEData; pub use array::RLEArrayExt; +pub use array::RLEData; mod compute; mod kernel; diff --git a/encodings/fsst/public-api.lock b/encodings/fsst/public-api.lock index 362797f114d..e098dc6787e 100644 --- a/encodings/fsst/public-api.lock +++ b/encodings/fsst/public-api.lock @@ -50,8 +50,6 @@ pub fn vortex_fsst::FSST::serialize(array: vortex_array::array::view::ArrayView< pub fn vortex_fsst::FSST::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_fsst::FSST::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_fsst::FSST::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_fsst::FSST diff --git a/encodings/parquet-variant/src/array.rs b/encodings/parquet-variant/src/array.rs index bddc6ce5f37..6bb8936992a 100644 --- a/encodings/parquet-variant/src/array.rs +++ b/encodings/parquet-variant/src/array.rs @@ -116,7 +116,11 @@ impl ParquetVariantData { Ok(Self) } - pub(crate) fn validate_slots(dtype: &DType, len: usize, slots: &[Option]) -> VortexResult<()> { + pub(crate) fn validate_slots( + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { let validity = child_to_validity(&slots[VALIDITY_SLOT], dtype.nullability()); Self::validate_parts( &validity, diff --git a/encodings/parquet-variant/src/kernel.rs b/encodings/parquet-variant/src/kernel.rs index 01525f076f8..d47d4e31267 100644 --- a/encodings/parquet-variant/src/kernel.rs +++ b/encodings/parquet-variant/src/kernel.rs @@ -17,8 +17,8 @@ use vortex_array::kernel::ParentKernelSet; use vortex_error::VortexResult; use vortex_mask::Mask; -use crate::ParquetVariantArrayExt; use crate::ParquetVariant; +use crate::ParquetVariantArrayExt; pub(crate) static PARENT_KERNELS: ParentKernelSet = ParentKernelSet::new(&[ ParentKernelSet::lift(&FilterExecuteAdaptor(ParquetVariant)), diff --git a/encodings/parquet-variant/src/lib.rs b/encodings/parquet-variant/src/lib.rs index 9bff17b96e6..9ecc9216daa 100644 --- a/encodings/parquet-variant/src/lib.rs +++ b/encodings/parquet-variant/src/lib.rs @@ -30,7 +30,7 @@ mod operations; mod validity; mod vtable; -pub use array::ParquetVariantData; pub use array::ParquetVariantArrayExt; +pub use array::ParquetVariantData; pub use vtable::ParquetVariant; pub use vtable::ParquetVariantArray; diff --git a/encodings/parquet-variant/src/operations.rs b/encodings/parquet-variant/src/operations.rs index 695ed00cd88..6660e936805 100644 --- a/encodings/parquet-variant/src/operations.rs +++ b/encodings/parquet-variant/src/operations.rs @@ -355,8 +355,8 @@ mod tests { use vortex_array::scalar::ScalarValue; use vortex_error::VortexResult; - use crate::ParquetVariantArrayExt; use crate::ParquetVariant; + use crate::ParquetVariantArrayExt; use crate::ParquetVariantData; use crate::operations::parquet_variant_to_scalar; diff --git a/encodings/pco/public-api.lock b/encodings/pco/public-api.lock index 895705faa58..9ff76694ac1 100644 --- a/encodings/pco/public-api.lock +++ b/encodings/pco/public-api.lock @@ -46,9 +46,7 @@ pub fn vortex_pco::Pco::serialize(array: vortex_array::array::view::ArrayView<'_ pub fn vortex_pco::Pco::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_pco::Pco::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_pco::Pco::validate(&self, data: &vortex_pco::PcoData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_pco::Pco::validate(&self, data: &vortex_pco::PcoData, dtype: &vortex_array::dtype::DType, len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_pco::Pco diff --git a/encodings/runend/public-api.lock b/encodings/runend/public-api.lock index a58f066d306..d5eabf6eb84 100644 --- a/encodings/runend/public-api.lock +++ b/encodings/runend/public-api.lock @@ -72,8 +72,6 @@ pub fn vortex_runend::RunEnd::serialize(array: vortex_array::array::view::ArrayV pub fn vortex_runend::RunEnd::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_runend::RunEnd::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_runend::RunEnd::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_runend::RunEnd diff --git a/encodings/runend/src/arrow.rs b/encodings/runend/src/arrow.rs index 34cd43208aa..cbbaea2c27a 100644 --- a/encodings/runend/src/arrow.rs +++ b/encodings/runend/src/arrow.rs @@ -135,12 +135,7 @@ mod tests { ) }; - RunEnd::try_new_offset_length( - ends_slice, - values_slice, - offset, - array.len(), - ) + RunEnd::try_new_offset_length(ends_slice, values_slice, offset, array.len()) } #[test] @@ -286,10 +281,7 @@ mod tests { ) } - fn execute( - array: ArrayRef, - dt: &DataType, - ) -> VortexResult { + fn execute(array: ArrayRef, dt: &DataType) -> VortexResult { array.execute_arrow(Some(dt), &mut SESSION.create_execution_ctx()) } diff --git a/encodings/runend/src/compute/take_from.rs b/encodings/runend/src/compute/take_from.rs index 6f25e1c2f92..570336646f1 100644 --- a/encodings/runend/src/compute/take_from.rs +++ b/encodings/runend/src/compute/take_from.rs @@ -62,9 +62,9 @@ mod tests { use vortex_error::VortexResult; use vortex_session::VortexSession; - use crate::array::RunEndArrayExt; use crate::RunEnd; use crate::RunEndArray; + use crate::array::RunEndArrayExt; use crate::compute::take_from::RunEndTakeFrom; /// Build a DictArray whose codes are run-end encoded. diff --git a/encodings/sequence/public-api.lock b/encodings/sequence/public-api.lock index fea1b505915..7ac9f28a880 100644 --- a/encodings/sequence/public-api.lock +++ b/encodings/sequence/public-api.lock @@ -50,9 +50,7 @@ pub fn vortex_sequence::Sequence::serialize(array: vortex_array::array::view::Ar pub fn vortex_sequence::Sequence::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_sequence::Sequence::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_sequence::Sequence::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_sequence::Sequence::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_sequence::Sequence diff --git a/encodings/sparse/public-api.lock b/encodings/sparse/public-api.lock index ab48148d9bc..0e2553c479c 100644 --- a/encodings/sparse/public-api.lock +++ b/encodings/sparse/public-api.lock @@ -52,9 +52,7 @@ pub fn vortex_sparse::Sparse::serialize(array: vortex_array::array::view::ArrayV pub fn vortex_sparse::Sparse::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_sparse::Sparse::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_sparse::Sparse::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_sparse::Sparse::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_sparse::Sparse diff --git a/encodings/zigzag/public-api.lock b/encodings/zigzag/public-api.lock index 96695ef486c..b3e2e83132e 100644 --- a/encodings/zigzag/public-api.lock +++ b/encodings/zigzag/public-api.lock @@ -48,8 +48,6 @@ pub fn vortex_zigzag::ZigZag::serialize(_array: vortex_array::array::view::Array pub fn vortex_zigzag::ZigZag::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_zigzag::ZigZag::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_zigzag::ZigZag::validate(&self, _data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_zigzag::ZigZag diff --git a/encodings/zstd/public-api.lock b/encodings/zstd/public-api.lock index ea802a3c299..df62496a916 100644 --- a/encodings/zstd/public-api.lock +++ b/encodings/zstd/public-api.lock @@ -54,9 +54,7 @@ pub fn vortex_zstd::Zstd::serialize(array: vortex_array::array::view::ArrayView< pub fn vortex_zstd::Zstd::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_zstd::Zstd::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_zstd::Zstd::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_zstd::Zstd::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_zstd::Zstd diff --git a/vortex-array/public-api.lock b/vortex-array/public-api.lock index dd8cbdb42fe..7290576421e 100644 --- a/vortex-array/public-api.lock +++ b/vortex-array/public-api.lock @@ -904,8 +904,6 @@ pub fn vortex_array::arrays::Bool::serialize(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Bool::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Bool::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Bool @@ -1054,8 +1052,6 @@ pub fn vortex_array::arrays::Chunked::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Chunked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Chunked::validate(&self, _data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Chunked @@ -1222,8 +1218,6 @@ pub fn vortex_array::arrays::Constant::serialize(_array: vortex_array::ArrayView pub fn vortex_array::arrays::Constant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Constant @@ -1402,8 +1396,6 @@ pub fn vortex_array::arrays::Decimal::serialize(array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Decimal::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Decimal::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Decimal @@ -1604,8 +1596,6 @@ pub fn vortex_array::arrays::dict::Dict::serialize(array: vortex_array::ArrayVie pub fn vortex_array::arrays::dict::Dict::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::dict::Dict::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::dict::Dict @@ -1708,8 +1698,6 @@ pub fn vortex_array::arrays::dict::Dict::serialize(array: vortex_array::ArrayVie pub fn vortex_array::arrays::dict::Dict::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::dict::Dict::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::dict::Dict @@ -1992,8 +1980,6 @@ pub fn vortex_array::arrays::Extension::serialize(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Extension::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Extension::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityChild for vortex_array::arrays::Extension @@ -2118,8 +2104,6 @@ pub fn vortex_array::arrays::Filter::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Filter::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Filter @@ -2306,8 +2290,6 @@ pub fn vortex_array::arrays::FixedSizeList::serialize(_array: vortex_array::Arra pub fn vortex_array::arrays::FixedSizeList::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::FixedSizeList::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::FixedSizeList @@ -2446,8 +2428,6 @@ pub fn vortex_array::arrays::List::serialize(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::List::validate(&self, _data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::List @@ -2618,8 +2598,6 @@ pub fn vortex_array::arrays::ListView::serialize(array: vortex_array::ArrayView< pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::ListView::validate(&self, _data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::ListView @@ -2790,9 +2768,7 @@ pub fn vortex_array::arrays::Masked::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Masked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - -pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::validate(&self, _data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Masked @@ -2916,8 +2892,6 @@ pub fn vortex_array::arrays::null::Null::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::null::Null::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::null::Null @@ -3024,8 +2998,6 @@ pub fn vortex_array::arrays::patched::Patched::serialize(array: vortex_array::Ar pub fn vortex_array::arrays::patched::Patched::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::patched::Patched::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityChild for vortex_array::arrays::patched::Patched @@ -3246,8 +3218,6 @@ pub fn vortex_array::arrays::Primitive::serialize(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Primitive::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Primitive::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Primitive @@ -3520,8 +3490,6 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_array: vortex pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::scalar_fn::ScalarFnVTable @@ -3602,8 +3570,6 @@ pub fn vortex_array::arrays::Shared::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Shared::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Shared::validate(&self, _data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Shared @@ -3620,6 +3586,10 @@ impl core::clone::Clone for vortex_array::arrays::shared::SharedData pub fn vortex_array::arrays::shared::SharedData::clone(&self) -> vortex_array::arrays::shared::SharedData +impl core::default::Default for vortex_array::arrays::shared::SharedData + +pub fn vortex_array::arrays::shared::SharedData::default() -> Self + impl core::fmt::Debug for vortex_array::arrays::shared::SharedData pub fn vortex_array::arrays::shared::SharedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result @@ -3710,8 +3680,6 @@ pub fn vortex_array::arrays::slice::Slice::serialize(_array: vortex_array::Array pub fn vortex_array::arrays::slice::Slice::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::slice::Slice @@ -3936,8 +3904,6 @@ pub fn vortex_array::arrays::Struct::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Struct::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Struct::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Struct @@ -4130,8 +4096,6 @@ pub fn vortex_array::arrays::VarBin::serialize(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::VarBin::validate(&self, _data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::VarBin @@ -4496,8 +4460,6 @@ pub fn vortex_array::arrays::VarBinView::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::VarBinView::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBinView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::VarBinView @@ -4682,9 +4644,7 @@ pub fn vortex_array::arrays::Variant::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Variant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - -pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::validate(&self, _data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Variant @@ -4772,8 +4732,6 @@ pub fn vortex_array::arrays::Bool::serialize(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Bool::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Bool::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Bool @@ -4872,8 +4830,6 @@ pub fn vortex_array::arrays::Chunked::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Chunked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Chunked::validate(&self, _data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Chunked @@ -4974,8 +4930,6 @@ pub fn vortex_array::arrays::Constant::serialize(_array: vortex_array::ArrayView pub fn vortex_array::arrays::Constant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Constant @@ -5072,8 +5026,6 @@ pub fn vortex_array::arrays::Decimal::serialize(array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Decimal::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Decimal::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Decimal @@ -5172,8 +5124,6 @@ pub fn vortex_array::arrays::dict::Dict::serialize(array: vortex_array::ArrayVie pub fn vortex_array::arrays::dict::Dict::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::dict::Dict::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::dict::Dict @@ -5274,8 +5224,6 @@ pub fn vortex_array::arrays::Extension::serialize(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Extension::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Extension::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityChild for vortex_array::arrays::Extension @@ -5368,8 +5316,6 @@ pub fn vortex_array::arrays::Filter::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Filter::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Filter @@ -5438,8 +5384,6 @@ pub fn vortex_array::arrays::FixedSizeList::serialize(_array: vortex_array::Arra pub fn vortex_array::arrays::FixedSizeList::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::FixedSizeList::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::FixedSizeList @@ -5524,8 +5468,6 @@ pub fn vortex_array::arrays::List::serialize(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::List::validate(&self, _data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::List @@ -5614,8 +5556,6 @@ pub fn vortex_array::arrays::ListView::serialize(array: vortex_array::ArrayView< pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::ListView::validate(&self, _data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::ListView @@ -5700,9 +5640,7 @@ pub fn vortex_array::arrays::Masked::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Masked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - -pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::validate(&self, _data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Masked @@ -5790,8 +5728,6 @@ pub fn vortex_array::arrays::null::Null::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::null::Null::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::null::Null @@ -5876,8 +5812,6 @@ pub fn vortex_array::arrays::patched::Patched::serialize(array: vortex_array::Ar pub fn vortex_array::arrays::patched::Patched::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::patched::Patched::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityChild for vortex_array::arrays::patched::Patched @@ -5962,8 +5896,6 @@ pub fn vortex_array::arrays::Primitive::serialize(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Primitive::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Primitive::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Primitive @@ -6058,8 +5990,6 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_array: vortex pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::scalar_fn::ScalarFnVTable @@ -6128,8 +6058,6 @@ pub fn vortex_array::arrays::Shared::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Shared::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Shared::validate(&self, _data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Shared @@ -6198,8 +6126,6 @@ pub fn vortex_array::arrays::slice::Slice::serialize(_array: vortex_array::Array pub fn vortex_array::arrays::slice::Slice::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::slice::Slice @@ -6272,8 +6198,6 @@ pub fn vortex_array::arrays::Struct::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Struct::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Struct::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Struct @@ -6366,8 +6290,6 @@ pub fn vortex_array::arrays::VarBin::serialize(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::VarBin::validate(&self, _data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::VarBin @@ -6460,8 +6382,6 @@ pub fn vortex_array::arrays::VarBinView::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::VarBinView::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBinView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::VarBinView @@ -6550,9 +6470,7 @@ pub fn vortex_array::arrays::Variant::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Variant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - -pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::validate(&self, _data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::ValidityVTable for vortex_array::arrays::Variant @@ -18780,8 +18698,6 @@ pub fn vortex_array::vtable::ArrayVTable::serialize(array: vortex_array::ArrayVi pub fn vortex_array::vtable::ArrayVTable::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::vtable::ArrayVTable::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::vtable::ArrayVTable::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Bool @@ -18828,8 +18744,6 @@ pub fn vortex_array::arrays::Bool::serialize(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Bool::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Bool::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Chunked @@ -18876,8 +18790,6 @@ pub fn vortex_array::arrays::Chunked::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Chunked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Chunked::validate(&self, _data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Constant @@ -18924,8 +18836,6 @@ pub fn vortex_array::arrays::Constant::serialize(_array: vortex_array::ArrayView pub fn vortex_array::arrays::Constant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Decimal @@ -18972,8 +18882,6 @@ pub fn vortex_array::arrays::Decimal::serialize(array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Decimal::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Decimal::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Extension @@ -19020,8 +18928,6 @@ pub fn vortex_array::arrays::Extension::serialize(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Extension::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Extension::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Filter @@ -19068,8 +18974,6 @@ pub fn vortex_array::arrays::Filter::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Filter::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::FixedSizeList @@ -19116,8 +19020,6 @@ pub fn vortex_array::arrays::FixedSizeList::serialize(_array: vortex_array::Arra pub fn vortex_array::arrays::FixedSizeList::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::FixedSizeList::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::List @@ -19164,8 +19066,6 @@ pub fn vortex_array::arrays::List::serialize(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::List::validate(&self, _data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::ListView @@ -19212,8 +19112,6 @@ pub fn vortex_array::arrays::ListView::serialize(array: vortex_array::ArrayView< pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::ListView::validate(&self, _data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Masked @@ -19260,9 +19158,7 @@ pub fn vortex_array::arrays::Masked::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Masked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - -pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::validate(&self, _data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Primitive @@ -19308,8 +19204,6 @@ pub fn vortex_array::arrays::Primitive::serialize(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Primitive::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Primitive::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Shared @@ -19356,8 +19250,6 @@ pub fn vortex_array::arrays::Shared::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Shared::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Shared::validate(&self, _data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Struct @@ -19404,8 +19296,6 @@ pub fn vortex_array::arrays::Struct::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Struct::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Struct::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBin @@ -19452,8 +19342,6 @@ pub fn vortex_array::arrays::VarBin::serialize(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::VarBin::validate(&self, _data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBinView @@ -19500,8 +19388,6 @@ pub fn vortex_array::arrays::VarBinView::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::VarBinView::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBinView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Variant @@ -19548,9 +19434,7 @@ pub fn vortex_array::arrays::Variant::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Variant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - -pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::validate(&self, _data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::dict::Dict @@ -19596,8 +19480,6 @@ pub fn vortex_array::arrays::dict::Dict::serialize(array: vortex_array::ArrayVie pub fn vortex_array::arrays::dict::Dict::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::dict::Dict::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::null::Null @@ -19644,8 +19526,6 @@ pub fn vortex_array::arrays::null::Null::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::null::Null::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::patched::Patched @@ -19692,8 +19572,6 @@ pub fn vortex_array::arrays::patched::Patched::serialize(array: vortex_array::Ar pub fn vortex_array::arrays::patched::Patched::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::patched::Patched::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::scalar_fn::ScalarFnVTable @@ -19740,8 +19618,6 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_array: vortex pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::slice::Slice @@ -19788,8 +19664,6 @@ pub fn vortex_array::arrays::slice::Slice::serialize(_array: vortex_array::Array pub fn vortex_array::arrays::slice::Slice::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> pub trait vortex_array::vtable::DynVTable: 'static + core::marker::Send + core::marker::Sync + core::fmt::Debug @@ -19960,8 +19834,6 @@ pub fn vortex_array::vtable::VTable::serialize(array: vortex_array::ArrayView<'_ pub fn vortex_array::vtable::VTable::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::vtable::VTable::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::vtable::VTable::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Bool @@ -20008,8 +19880,6 @@ pub fn vortex_array::arrays::Bool::serialize(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Bool::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Bool::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Chunked @@ -20056,8 +19926,6 @@ pub fn vortex_array::arrays::Chunked::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Chunked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Chunked::validate(&self, _data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Constant @@ -20104,8 +19972,6 @@ pub fn vortex_array::arrays::Constant::serialize(_array: vortex_array::ArrayView pub fn vortex_array::arrays::Constant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Decimal @@ -20152,8 +20018,6 @@ pub fn vortex_array::arrays::Decimal::serialize(array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Decimal::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Decimal::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Extension @@ -20200,8 +20064,6 @@ pub fn vortex_array::arrays::Extension::serialize(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Extension::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Extension::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Filter @@ -20248,8 +20110,6 @@ pub fn vortex_array::arrays::Filter::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Filter::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::FixedSizeList @@ -20296,8 +20156,6 @@ pub fn vortex_array::arrays::FixedSizeList::serialize(_array: vortex_array::Arra pub fn vortex_array::arrays::FixedSizeList::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::FixedSizeList::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::List @@ -20344,8 +20202,6 @@ pub fn vortex_array::arrays::List::serialize(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::List::validate(&self, _data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::ListView @@ -20392,8 +20248,6 @@ pub fn vortex_array::arrays::ListView::serialize(array: vortex_array::ArrayView< pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::ListView::validate(&self, _data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Masked @@ -20440,9 +20294,7 @@ pub fn vortex_array::arrays::Masked::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Masked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - -pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::validate(&self, _data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Primitive @@ -20488,8 +20340,6 @@ pub fn vortex_array::arrays::Primitive::serialize(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Primitive::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Primitive::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Shared @@ -20536,8 +20386,6 @@ pub fn vortex_array::arrays::Shared::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Shared::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Shared::validate(&self, _data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Struct @@ -20584,8 +20432,6 @@ pub fn vortex_array::arrays::Struct::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Struct::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Struct::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBin @@ -20632,8 +20478,6 @@ pub fn vortex_array::arrays::VarBin::serialize(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::VarBin::validate(&self, _data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBinView @@ -20680,8 +20524,6 @@ pub fn vortex_array::arrays::VarBinView::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::VarBinView::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBinView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Variant @@ -20728,9 +20570,7 @@ pub fn vortex_array::arrays::Variant::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Variant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - -pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::validate(&self, _data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::dict::Dict @@ -20776,8 +20616,6 @@ pub fn vortex_array::arrays::dict::Dict::serialize(array: vortex_array::ArrayVie pub fn vortex_array::arrays::dict::Dict::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::dict::Dict::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::null::Null @@ -20824,8 +20662,6 @@ pub fn vortex_array::arrays::null::Null::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::null::Null::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::patched::Patched @@ -20872,8 +20708,6 @@ pub fn vortex_array::arrays::patched::Patched::serialize(array: vortex_array::Ar pub fn vortex_array::arrays::patched::Patched::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::patched::Patched::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::scalar_fn::ScalarFnVTable @@ -20920,8 +20754,6 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_array: vortex pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::slice::Slice @@ -20968,8 +20800,6 @@ pub fn vortex_array::arrays::slice::Slice::serialize(_array: vortex_array::Array pub fn vortex_array::arrays::slice::Slice::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> pub trait vortex_array::vtable::ValidityChild @@ -21720,6 +21550,8 @@ pub fn vortex_array::Array::varbinview_validit impl vortex_array::Array +pub fn vortex_array::Array::child(&self) -> &vortex_array::ArrayRef + pub fn vortex_array::Array::new(child: vortex_array::ArrayRef) -> Self impl vortex_array::Array @@ -21820,8 +21652,6 @@ pub fn vortex_array::Array::encoding_id(&self) -> vortex_array::ArrayId pub fn vortex_array::Array::into_data(self) -> ::ArrayData -pub fn vortex_array::Array::into_parts(self) -> vortex_array::ArrayParts - pub fn vortex_array::Array::is_empty(&self) -> bool pub fn vortex_array::Array::len(&self) -> usize @@ -21834,6 +21664,8 @@ pub fn vortex_array::Array::try_from_array_ref(array: vortex_array::ArrayRef) pub fn vortex_array::Array::try_from_parts(new: vortex_array::ArrayParts) -> vortex_error::VortexResult +pub fn vortex_array::Array::try_into_parts(self) -> core::result::Result, Self> + pub fn vortex_array::Array::with_stats_set(self, stats: vortex_array::stats::StatsSet) -> Self impl core::convert::From> for vortex_array::Array @@ -22038,7 +21870,7 @@ pub fn vortex_array::ArrayRef::slice(&self, range: core::ops::range::Range alloc::string::String -pub fn vortex_array::ArrayRef::slots(&self) -> alloc::vec::Vec> +pub fn vortex_array::ArrayRef::slots(&self) -> &[core::option::Option] pub fn vortex_array::ArrayRef::statistics(&self) -> vortex_array::stats::StatsSetRef<'_> @@ -22486,6 +22318,8 @@ pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::offset_at(&self, pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::offsets(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::reset_offsets(&self, recurse: bool) -> vortex_error::VortexResult> + pub fn vortex_array::ArrayView<'_, vortex_array::arrays::List>::sliced_elements(&self) -> vortex_error::VortexResult impl vortex_array::ArrayView<'_, vortex_array::arrays::ListView> @@ -22552,6 +22386,10 @@ pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview pub fn vortex_array::ArrayView<'_, vortex_array::arrays::VarBinView>::varbinview_validity_mask(&self) -> vortex_mask::Mask +impl vortex_array::ArrayView<'_, vortex_array::arrays::Variant> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Variant>::child(&self) -> &vortex_array::ArrayRef + impl vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict> pub fn vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>::codes(&self) -> &vortex_array::ArrayRef @@ -22908,8 +22746,6 @@ pub fn vortex_array::ArrayVTable::serialize(array: vortex_array::ArrayView<'_, S pub fn vortex_array::ArrayVTable::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::ArrayVTable::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::ArrayVTable::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Bool @@ -22956,8 +22792,6 @@ pub fn vortex_array::arrays::Bool::serialize(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Bool::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Bool::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Chunked @@ -23004,8 +22838,6 @@ pub fn vortex_array::arrays::Chunked::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Chunked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Chunked::validate(&self, _data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Constant @@ -23052,8 +22884,6 @@ pub fn vortex_array::arrays::Constant::serialize(_array: vortex_array::ArrayView pub fn vortex_array::arrays::Constant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Decimal @@ -23100,8 +22930,6 @@ pub fn vortex_array::arrays::Decimal::serialize(array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Decimal::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Decimal::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Extension @@ -23148,8 +22976,6 @@ pub fn vortex_array::arrays::Extension::serialize(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Extension::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Extension::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Filter @@ -23196,8 +23022,6 @@ pub fn vortex_array::arrays::Filter::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Filter::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::FixedSizeList @@ -23244,8 +23068,6 @@ pub fn vortex_array::arrays::FixedSizeList::serialize(_array: vortex_array::Arra pub fn vortex_array::arrays::FixedSizeList::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::FixedSizeList::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::List @@ -23292,8 +23114,6 @@ pub fn vortex_array::arrays::List::serialize(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::List::validate(&self, _data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::ListView @@ -23340,8 +23160,6 @@ pub fn vortex_array::arrays::ListView::serialize(array: vortex_array::ArrayView< pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::ListView::validate(&self, _data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Masked @@ -23388,9 +23206,7 @@ pub fn vortex_array::arrays::Masked::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Masked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - -pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::validate(&self, _data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Primitive @@ -23436,8 +23252,6 @@ pub fn vortex_array::arrays::Primitive::serialize(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Primitive::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Primitive::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Shared @@ -23484,8 +23298,6 @@ pub fn vortex_array::arrays::Shared::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Shared::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Shared::validate(&self, _data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Struct @@ -23532,8 +23344,6 @@ pub fn vortex_array::arrays::Struct::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Struct::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Struct::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBin @@ -23580,8 +23390,6 @@ pub fn vortex_array::arrays::VarBin::serialize(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::VarBin::validate(&self, _data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBinView @@ -23628,8 +23436,6 @@ pub fn vortex_array::arrays::VarBinView::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::VarBinView::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBinView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Variant @@ -23676,9 +23482,7 @@ pub fn vortex_array::arrays::Variant::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Variant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - -pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::validate(&self, _data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::dict::Dict @@ -23724,8 +23528,6 @@ pub fn vortex_array::arrays::dict::Dict::serialize(array: vortex_array::ArrayVie pub fn vortex_array::arrays::dict::Dict::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::dict::Dict::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::null::Null @@ -23772,8 +23574,6 @@ pub fn vortex_array::arrays::null::Null::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::null::Null::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::patched::Patched @@ -23820,8 +23620,6 @@ pub fn vortex_array::arrays::patched::Patched::serialize(array: vortex_array::Ar pub fn vortex_array::arrays::patched::Patched::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::patched::Patched::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::scalar_fn::ScalarFnVTable @@ -23868,8 +23666,6 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_array: vortex pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::slice::Slice @@ -23916,8 +23712,6 @@ pub fn vortex_array::arrays::slice::Slice::serialize(_array: vortex_array::Array pub fn vortex_array::arrays::slice::Slice::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> pub trait vortex_array::DeserializeMetadata where Self: core::marker::Sized @@ -24336,8 +24130,6 @@ pub fn vortex_array::VTable::serialize(array: vortex_array::ArrayView<'_, Self>) pub fn vortex_array::VTable::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::VTable::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::VTable::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Bool @@ -24384,8 +24176,6 @@ pub fn vortex_array::arrays::Bool::serialize(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::Bool::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Bool::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Bool::validate(&self, data: &vortex_array::arrays::bool::BoolData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Chunked @@ -24432,8 +24222,6 @@ pub fn vortex_array::arrays::Chunked::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Chunked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Chunked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Chunked::validate(&self, _data: &vortex_array::arrays::chunked::ChunkedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Constant @@ -24480,8 +24268,6 @@ pub fn vortex_array::arrays::Constant::serialize(_array: vortex_array::ArrayView pub fn vortex_array::arrays::Constant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Constant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Constant::validate(&self, data: &vortex_array::arrays::constant::ConstantData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Decimal @@ -24528,8 +24314,6 @@ pub fn vortex_array::arrays::Decimal::serialize(array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Decimal::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Decimal::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Decimal::validate(&self, data: &vortex_array::arrays::decimal::DecimalData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Extension @@ -24576,8 +24360,6 @@ pub fn vortex_array::arrays::Extension::serialize(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Extension::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Extension::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Extension::validate(&self, data: &vortex_array::arrays::extension::ExtensionData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Filter @@ -24624,8 +24406,6 @@ pub fn vortex_array::arrays::Filter::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Filter::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Filter::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Filter::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::FixedSizeList @@ -24672,8 +24452,6 @@ pub fn vortex_array::arrays::FixedSizeList::serialize(_array: vortex_array::Arra pub fn vortex_array::arrays::FixedSizeList::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::FixedSizeList::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::FixedSizeList::validate(&self, data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::List @@ -24720,8 +24498,6 @@ pub fn vortex_array::arrays::List::serialize(array: vortex_array::ArrayView<'_, pub fn vortex_array::arrays::List::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::List::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::List::validate(&self, _data: &vortex_array::arrays::list::ListData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::ListView @@ -24768,8 +24544,6 @@ pub fn vortex_array::arrays::ListView::serialize(array: vortex_array::ArrayView< pub fn vortex_array::arrays::ListView::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::ListView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::ListView::validate(&self, _data: &vortex_array::arrays::listview::ListViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Masked @@ -24816,9 +24590,7 @@ pub fn vortex_array::arrays::Masked::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Masked::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Masked::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - -pub fn vortex_array::arrays::Masked::validate(&self, data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::validate(&self, _data: &vortex_array::arrays::masked::MaskedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Primitive @@ -24864,8 +24636,6 @@ pub fn vortex_array::arrays::Primitive::serialize(_array: vortex_array::ArrayVie pub fn vortex_array::arrays::Primitive::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Primitive::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Primitive::validate(&self, data: &vortex_array::arrays::primitive::PrimitiveData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Shared @@ -24912,8 +24682,6 @@ pub fn vortex_array::arrays::Shared::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Shared::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Shared::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::Shared::validate(&self, _data: &vortex_array::arrays::shared::SharedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Struct @@ -24960,8 +24728,6 @@ pub fn vortex_array::arrays::Struct::serialize(_array: vortex_array::ArrayView<' pub fn vortex_array::arrays::Struct::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Struct::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::Struct::validate(&self, data: &vortex_array::arrays::struct_::StructData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBin @@ -25008,8 +24774,6 @@ pub fn vortex_array::arrays::VarBin::serialize(array: vortex_array::ArrayView<'_ pub fn vortex_array::arrays::VarBin::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBin::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::VarBin::validate(&self, _data: &vortex_array::arrays::varbin::VarBinData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::VarBinView @@ -25056,8 +24820,6 @@ pub fn vortex_array::arrays::VarBinView::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::VarBinView::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::VarBinView::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::VarBinView::validate(&self, data: &vortex_array::arrays::varbinview::VarBinViewData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::Variant @@ -25104,9 +24866,7 @@ pub fn vortex_array::arrays::Variant::serialize(_array: vortex_array::ArrayView< pub fn vortex_array::arrays::Variant::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::Variant::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - -pub fn vortex_array::arrays::Variant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::validate(&self, _data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::dict::Dict @@ -25152,8 +24912,6 @@ pub fn vortex_array::arrays::dict::Dict::serialize(array: vortex_array::ArrayVie pub fn vortex_array::arrays::dict::Dict::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::dict::Dict::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::dict::Dict::validate(&self, data: &vortex_array::arrays::dict::DictData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::null::Null @@ -25200,8 +24958,6 @@ pub fn vortex_array::arrays::null::Null::serialize(_array: vortex_array::ArrayVi pub fn vortex_array::arrays::null::Null::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::null::Null::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::null::Null::validate(&self, _data: &vortex_array::arrays::null::NullData, dtype: &vortex_array::dtype::DType, _len: usize, _slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::patched::Patched @@ -25248,8 +25004,6 @@ pub fn vortex_array::arrays::patched::Patched::serialize(array: vortex_array::Ar pub fn vortex_array::arrays::patched::Patched::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::patched::Patched::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::patched::Patched::validate(&self, data: &vortex_array::arrays::patched::PatchedData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::scalar_fn::ScalarFnVTable @@ -25296,8 +25050,6 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_array: vortex pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slot_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::slots(array: vortex_array::ArrayView<'_, Self>) -> &[core::option::Option] - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validate(&self, data: &vortex_array::arrays::scalar_fn::ScalarFnData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::VTable for vortex_array::arrays::slice::Slice @@ -25344,8 +25096,6 @@ pub fn vortex_array::arrays::slice::Slice::serialize(_array: vortex_array::Array pub fn vortex_array::arrays::slice::Slice::slot_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_array::arrays::slice::Slice::slots<'a>(array: vortex_array::ArrayView<'a, Self>) -> &'a [core::option::Option] - pub fn vortex_array::arrays::slice::Slice::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> pub trait vortex_array::ValidityChild diff --git a/vortex-array/src/array/view.rs b/vortex-array/src/array/view.rs index b8fe7fe0d46..c751429abf8 100644 --- a/vortex-array/src/array/view.rs +++ b/vortex-array/src/array/view.rs @@ -46,7 +46,7 @@ impl<'a, V: VTable> ArrayView<'a, V> { } pub fn slots(&self) -> &'a [Option] { - &self.array.slots() + self.array.slots() } pub fn dtype(&self) -> &DType { diff --git a/vortex-array/src/arrays/bool/array.rs b/vortex-array/src/arrays/bool/array.rs index 18859b97249..f6edd3d0ce7 100644 --- a/vortex-array/src/arrays/bool/array.rs +++ b/vortex-array/src/arrays/bool/array.rs @@ -293,11 +293,7 @@ impl BoolData { bits.len() * 8, ); - Ok(Self { - bits, - offset, - len, - }) + Ok(Self { bits, offset, len }) } pub(super) unsafe fn new_unchecked(bits: BitBuffer, validity: Validity) -> Self { diff --git a/vortex-array/src/arrays/chunked/array.rs b/vortex-array/src/arrays/chunked/array.rs index b146917ebdb..d3bbbe4c328 100644 --- a/vortex-array/src/arrays/chunked/array.rs +++ b/vortex-array/src/arrays/chunked/array.rs @@ -21,8 +21,8 @@ use crate::LEGACY_SESSION; use crate::VortexSessionExecute; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::TypedArrayRef; use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::arrays::Chunked; use crate::arrays::PrimitiveArray; use crate::dtype::DType; @@ -84,7 +84,10 @@ pub trait ChunkedArrayExt: TypedArrayRef { } fn find_chunk_idx(&self, index: usize) -> VortexResult<(usize, usize)> { - assert!(index <= self.as_ref().len(), "Index out of bounds of the array"); + assert!( + index <= self.as_ref().len(), + "Index out of bounds of the array" + ); let index = index as u64; let chunk_offsets = self.chunk_offsets(); let index_chunk = chunk_offsets @@ -141,7 +144,6 @@ impl Array { pub fn non_empty_chunks(&self) -> Box + '_> { ::non_empty_chunks(self) } - } impl ArrayView<'_, Chunked> { @@ -267,10 +269,12 @@ impl Array { && !chunks_to_combine.is_empty() { new_chunks.push( - unsafe { Array::::new_unchecked(chunks_to_combine, self.dtype().clone()) } - .into_array() - .to_canonical()? - .into_array(), + unsafe { + Array::::new_unchecked(chunks_to_combine, self.dtype().clone()) + } + .into_array() + .to_canonical()? + .into_array(), ); new_chunk_n_bytes = 0; diff --git a/vortex-array/src/arrays/chunked/mod.rs b/vortex-array/src/arrays/chunked/mod.rs index 8b5f32a9586..ef3b413e692 100644 --- a/vortex-array/src/arrays/chunked/mod.rs +++ b/vortex-array/src/arrays/chunked/mod.rs @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::ChunkedData; pub use array::ChunkedArrayExt; +pub use array::ChunkedData; pub use vtable::ChunkedArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/chunked/paired_chunks.rs b/vortex-array/src/arrays/chunked/paired_chunks.rs index 5b9bae9bb85..2a468aa65db 100644 --- a/vortex-array/src/arrays/chunked/paired_chunks.rs +++ b/vortex-array/src/arrays/chunked/paired_chunks.rs @@ -6,11 +6,10 @@ use std::ops::Range; use vortex_error::VortexResult; use crate::ArrayRef; -use crate::array::ArrayView; -use crate::arrays::Chunked; - #[cfg(test)] use crate::array::Array; +use crate::array::ArrayView; +use crate::arrays::Chunked; pub(crate) struct AlignedPair { pub left: ArrayRef, diff --git a/vortex-array/src/arrays/chunked/tests.rs b/vortex-array/src/arrays/chunked/tests.rs index 8b258b959b3..870997695f0 100644 --- a/vortex-array/src/arrays/chunked/tests.rs +++ b/vortex-array/src/arrays/chunked/tests.rs @@ -44,7 +44,10 @@ fn with_slot_rewrites_chunk_and_offsets() { assert_eq!(array.nchunks(), 3); assert_eq!(array.chunk_offsets(), buffer![0u64, 3, 6, 9]); - assert_arrays_eq!(array.chunk(0).clone(), PrimitiveArray::from_iter([10u64, 11, 12])); + assert_arrays_eq!( + array.chunk(0).clone(), + PrimitiveArray::from_iter([10u64, 11, 12]) + ); assert_arrays_eq!( array.array().clone(), PrimitiveArray::from_iter([10u64, 11, 12, 4, 5, 6, 7, 8, 9]) diff --git a/vortex-array/src/arrays/chunked/vtable/mod.rs b/vortex-array/src/arrays/chunked/vtable/mod.rs index 3b035c64469..78c12ec5f00 100644 --- a/vortex-array/src/arrays/chunked/vtable/mod.rs +++ b/vortex-array/src/arrays/chunked/vtable/mod.rs @@ -58,7 +58,11 @@ impl VTable for Chunked { Self::ID } - fn array_hash(_data: &ChunkedData, _state: &mut H, _precision: Precision) { + fn array_hash( + _data: &ChunkedData, + _state: &mut H, + _precision: Precision, + ) { } fn array_eq(_data: &ChunkedData, _other: &ChunkedData, _precision: Precision) -> bool { @@ -133,7 +137,8 @@ impl VTable for Chunked { dtype ); vortex_ensure!( - chunk.len() == usize::try_from(end - start).vortex_expect("chunk len must fit in usize"), + chunk.len() + == usize::try_from(end - start).vortex_expect("chunk len must fit in usize"), "ChunkedArray chunk {} len {} does not match offsets span {}", idx, chunk.len(), @@ -171,7 +176,12 @@ impl VTable for Chunked { let chunk_offsets_buf = chunk_offsets.to_primitive().to_buffer::(); let mut slots = Vec::with_capacity(children.len()); slots.push(Some(chunk_offsets)); - for (idx, (start, end)) in chunk_offsets_buf.iter().copied().tuple_windows().enumerate() { + for (idx, (start, end)) in chunk_offsets_buf + .iter() + .copied() + .tuple_windows() + .enumerate() + { let chunk_len = usize::try_from(end - start) .map_err(|_| vortex_err!("chunk_len {} exceeds usize range", end - start))?; slots.push(Some(children.get(idx + CHUNKS_OFFSET, dtype, chunk_len)?)); @@ -187,7 +197,6 @@ impl VTable for Chunked { } } - fn append_to_builder( array: ArrayView<'_, Self>, builder: &mut dyn ArrayBuilder, diff --git a/vortex-array/src/arrays/constant/vtable/mod.rs b/vortex-array/src/arrays/constant/vtable/mod.rs index 06be7cd1d71..842bb0f7230 100644 --- a/vortex-array/src/arrays/constant/vtable/mod.rs +++ b/vortex-array/src/arrays/constant/vtable/mod.rs @@ -76,19 +76,11 @@ impl VTable for Constant { Ok(()) } - fn array_hash( - data: &ConstantData, - state: &mut H, - _precision: Precision, - ) { + fn array_hash(data: &ConstantData, state: &mut H, _precision: Precision) { data.scalar.hash(state); } - fn array_eq( - data: &ConstantData, - other: &ConstantData, - _precision: Precision, - ) -> bool { + fn array_eq(data: &ConstantData, other: &ConstantData, _precision: Precision) -> bool { data.scalar == other.scalar } @@ -116,7 +108,6 @@ impl VTable for Constant { vortex_panic!("ConstantArray slot_name index {idx} out of bounds") } - fn serialize(_array: ArrayView<'_, Self>) -> VortexResult>> { // HACK: Because the scalar is stored in the buffers, we do not need to serialize the // metadata at all. diff --git a/vortex-array/src/arrays/decimal/array.rs b/vortex-array/src/arrays/decimal/array.rs index 65ac1f107bf..5c069219c11 100644 --- a/vortex-array/src/arrays/decimal/array.rs +++ b/vortex-array/src/arrays/decimal/array.rs @@ -488,7 +488,7 @@ impl Array { decimal_dtype: DecimalDType, ) -> Self { Self::new( - BufferMut::from_iter(iter.into_iter()).freeze(), + BufferMut::from_iter(iter).freeze(), decimal_dtype, Validity::NonNullable, ) diff --git a/vortex-array/src/arrays/decimal/mod.rs b/vortex-array/src/arrays/decimal/mod.rs index 95a105cb804..489a67a0531 100644 --- a/vortex-array/src/arrays/decimal/mod.rs +++ b/vortex-array/src/arrays/decimal/mod.rs @@ -2,9 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; +pub use array::DecimalArrayExt; pub use array::DecimalData; pub use array::DecimalDataParts; -pub use array::DecimalArrayExt; pub use vtable::DecimalArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/dict/array.rs b/vortex-array/src/arrays/dict/array.rs index 24c1fa157d0..e786f01a238 100644 --- a/vortex-array/src/arrays/dict/array.rs +++ b/vortex-array/src/arrays/dict/array.rs @@ -139,7 +139,10 @@ pub trait DictArrayExt: TypedArrayRef { Ok(()) } - #[allow(clippy::cognitive_complexity, reason = "branching depends on validity representation and code type")] + #[allow( + clippy::cognitive_complexity, + reason = "branching depends on validity representation and code type" + )] fn compute_referenced_values_mask(&self, referenced: bool) -> VortexResult { let codes_validity = self.codes().validity_mask()?; let codes_primitive = self.codes().to_primitive(); @@ -210,26 +213,28 @@ impl Array { /// Build a new `DictArray` from its components, `codes` and `values`. pub fn new(codes: ArrayRef, values: ArrayRef) -> Self { - let dtype = values.dtype().union_nullability(codes.dtype().nullability()); + let dtype = values + .dtype() + .union_nullability(codes.dtype().nullability()); let len = codes.len(); let data = DictData::new(codes.clone(), values.clone()); unsafe { Array::from_parts_unchecked( - ArrayParts::new(Dict, dtype, len, data) - .with_slots(vec![Some(codes), Some(values)]), + ArrayParts::new(Dict, dtype, len, data).with_slots(vec![Some(codes), Some(values)]), ) } } /// Build a new `DictArray` from its components, `codes` and `values`. pub fn try_new(codes: ArrayRef, values: ArrayRef) -> VortexResult { - let dtype = values.dtype().union_nullability(codes.dtype().nullability()); + let dtype = values + .dtype() + .union_nullability(codes.dtype().nullability()); let len = codes.len(); let data = DictData::try_new(codes.clone(), values.clone())?; Ok(unsafe { Array::from_parts_unchecked( - ArrayParts::new(Dict, dtype, len, data) - .with_slots(vec![Some(codes), Some(values)]), + ArrayParts::new(Dict, dtype, len, data).with_slots(vec![Some(codes), Some(values)]), ) }) } @@ -240,13 +245,14 @@ impl Array { /// /// See [`DictData::new_unchecked`]. pub unsafe fn new_unchecked(codes: ArrayRef, values: ArrayRef) -> Self { - let dtype = values.dtype().union_nullability(codes.dtype().nullability()); + let dtype = values + .dtype() + .union_nullability(codes.dtype().nullability()); let len = codes.len(); let data = unsafe { DictData::new_unchecked(codes.clone(), values.clone()) }; unsafe { Array::from_parts_unchecked( - ArrayParts::new(Dict, dtype, len, data) - .with_slots(vec![Some(codes), Some(values)]), + ArrayParts::new(Dict, dtype, len, data).with_slots(vec![Some(codes), Some(values)]), ) } } @@ -265,9 +271,7 @@ impl Array { .set_all_values_referenced(all_values_referenced) }; unsafe { - Array::from_parts_unchecked( - ArrayParts::new(Dict, dtype, len, data).with_slots(slots), - ) + Array::from_parts_unchecked(ArrayParts::new(Dict, dtype, len, data).with_slots(slots)) } } } diff --git a/vortex-array/src/arrays/extension/array.rs b/vortex-array/src/arrays/extension/array.rs index 962c1dec0ed..09456447de0 100644 --- a/vortex-array/src/arrays/extension/array.rs +++ b/vortex-array/src/arrays/extension/array.rs @@ -109,9 +109,7 @@ impl ExtensionData { "ExtensionArray: storage_dtype must match storage array DType", ); - Self { - ext_dtype, - } + Self { ext_dtype } } /// The extension dtype of this array. @@ -146,8 +144,7 @@ impl Array { let data = ExtensionData::new(ext_dtype, storage_array.clone()); unsafe { Array::from_parts_unchecked( - ArrayParts::new(Extension, dtype, len, data) - .with_slots(vec![Some(storage_array)]), + ArrayParts::new(Extension, dtype, len, data).with_slots(vec![Some(storage_array)]), ) } } @@ -159,8 +156,7 @@ impl Array { let data = ExtensionData::try_new(ext_dtype, storage_array.clone())?; Ok(unsafe { Array::from_parts_unchecked( - ArrayParts::new(Extension, dtype, len, data) - .with_slots(vec![Some(storage_array)]), + ArrayParts::new(Extension, dtype, len, data).with_slots(vec![Some(storage_array)]), ) }) } diff --git a/vortex-array/src/arrays/extension/mod.rs b/vortex-array/src/arrays/extension/mod.rs index 19b81cfd2df..802545025c1 100644 --- a/vortex-array/src/arrays/extension/mod.rs +++ b/vortex-array/src/arrays/extension/mod.rs @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::ExtensionData; pub use array::ExtensionArrayExt; +pub use array::ExtensionData; pub use vtable::ExtensionArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/filter/array.rs b/vortex-array/src/arrays/filter/array.rs index f4722bae46c..c160b1440f7 100644 --- a/vortex-array/src/arrays/filter/array.rs +++ b/vortex-array/src/arrays/filter/array.rs @@ -74,9 +74,7 @@ impl FilterData { } pub fn into_parts(self) -> FilterDataParts { - FilterDataParts { - mask: self.mask, - } + FilterDataParts { mask: self.mask } } } diff --git a/vortex-array/src/arrays/filter/mod.rs b/vortex-array/src/arrays/filter/mod.rs index 103c2a73b1a..39859bc5b25 100644 --- a/vortex-array/src/arrays/filter/mod.rs +++ b/vortex-array/src/arrays/filter/mod.rs @@ -2,9 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; +pub use array::FilterArrayExt; pub use array::FilterData; pub use array::FilterDataParts; -pub use array::FilterArrayExt; pub use vtable::FilterArray; mod execute; diff --git a/vortex-array/src/arrays/filter/vtable.rs b/vortex-array/src/arrays/filter/vtable.rs index ee3ff009825..e5609e10e3c 100644 --- a/vortex-array/src/arrays/filter/vtable.rs +++ b/vortex-array/src/arrays/filter/vtable.rs @@ -22,10 +22,10 @@ use crate::array::ArrayView; use crate::array::OperationsVTable; use crate::array::VTable; use crate::array::ValidityVTable; +use crate::arrays::filter::FilterArrayExt; use crate::arrays::filter::array::CHILD_SLOT; use crate::arrays::filter::array::FilterData; use crate::arrays::filter::array::SLOT_NAMES; -use crate::arrays::filter::FilterArrayExt; use crate::arrays::filter::execute::execute_filter; use crate::arrays::filter::execute::execute_filter_fast_paths; use crate::arrays::filter::rules::PARENT_RULES; @@ -64,8 +64,13 @@ impl VTable for Filter { len: usize, slots: &[Option], ) -> VortexResult<()> { - vortex_ensure!(slots[CHILD_SLOT].is_some(), "FilterArray child slot must be present"); - let child = slots[CHILD_SLOT].as_ref().vortex_expect("validated child slot"); + vortex_ensure!( + slots[CHILD_SLOT].is_some(), + "FilterArray child slot must be present" + ); + let child = slots[CHILD_SLOT] + .as_ref() + .vortex_expect("validated child slot"); vortex_ensure!( child.dtype() == dtype, "FilterArray dtype {} does not match outer dtype {}", @@ -129,7 +134,6 @@ impl VTable for Filter { vortex_bail!("Filter array is not serializable") } - fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { if let Some(canonical) = execute_filter_fast_paths(array.as_view(), ctx)? { return Ok(ExecutionResult::done(canonical)); diff --git a/vortex-array/src/arrays/fixed_size_list/array.rs b/vortex-array/src/arrays/fixed_size_list/array.rs index decea560e1c..0a246d5af78 100644 --- a/vortex-array/src/arrays/fixed_size_list/array.rs +++ b/vortex-array/src/arrays/fixed_size_list/array.rs @@ -10,8 +10,8 @@ use vortex_error::vortex_ensure; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::TypedArrayRef; use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::FixedSizeList; @@ -204,7 +204,6 @@ impl FixedSizeListData { Ok(()) } - } pub trait FixedSizeListArrayExt: TypedArrayRef { @@ -320,8 +319,7 @@ impl Array { pub fn into_data_parts(self) -> FixedSizeListDataParts { let dtype = self.dtype().clone(); - let elements = self - .slots()[ELEMENTS_SLOT] + let elements = self.slots()[ELEMENTS_SLOT] .clone() .vortex_expect("FixedSizeListArray elements slot"); let validity = self.fixed_size_list_validity(); @@ -341,7 +339,11 @@ impl Array { index, Array::len(self), ); - debug_assert!(self.fixed_size_list_validity().is_valid(index).unwrap_or(false)); + debug_assert!( + self.fixed_size_list_validity() + .is_valid(index) + .unwrap_or(false) + ); let start = self.list_size() as usize * index; let end = self.list_size() as usize * (index + 1); @@ -373,7 +375,11 @@ impl ArrayView<'_, FixedSizeList> { index, ArrayView::len(self), ); - debug_assert!(self.fixed_size_list_validity().is_valid(index).unwrap_or(false)); + debug_assert!( + self.fixed_size_list_validity() + .is_valid(index) + .unwrap_or(false) + ); let start = self.list_size() as usize * index; let end = self.list_size() as usize * (index + 1); diff --git a/vortex-array/src/arrays/fixed_size_list/compute/take.rs b/vortex-array/src/arrays/fixed_size_list/compute/take.rs index 560d649effe..2b22287773d 100644 --- a/vortex-array/src/arrays/fixed_size_list/compute/take.rs +++ b/vortex-array/src/arrays/fixed_size_list/compute/take.rs @@ -13,9 +13,9 @@ use crate::array::ArrayView; use crate::arrays::FixedSizeList; use crate::arrays::FixedSizeListArray; use crate::arrays::Primitive; -use crate::arrays::primitive::PrimitiveArrayExt; use crate::arrays::PrimitiveArray; use crate::arrays::dict::TakeExecute; +use crate::arrays::primitive::PrimitiveArrayExt; use crate::dtype::IntegerPType; use crate::executor::ExecutionCtx; use crate::match_each_integer_ptype; diff --git a/vortex-array/src/arrays/list/array.rs b/vortex-array/src/arrays/list/array.rs index 2845132642d..616b338ec39 100644 --- a/vortex-array/src/arrays/list/array.rs +++ b/vortex-array/src/arrays/list/array.rs @@ -17,8 +17,8 @@ use crate::VortexSessionExecute; use crate::aggregate_fn::fns::min_max::min_max; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::TypedArrayRef; use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::ConstantArray; @@ -110,7 +110,11 @@ impl ListData { validity: &Validity, len: usize, ) -> Vec> { - vec![Some(elements), Some(offsets), validity_to_child(validity, len)] + vec![ + Some(elements), + Some(offsets), + validity_to_child(validity, len), + ] } /// Creates a new `ListArray`. @@ -326,7 +330,9 @@ impl Array { let len = offsets.len().saturating_sub(1); let slots = ListData::make_slots(elements.clone(), offsets.clone(), &validity, len); let data = ListData::new(elements, offsets, validity); - unsafe { Array::from_parts_unchecked(ArrayParts::new(List, dtype, len, data).with_slots(slots)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(List, dtype, len, data).with_slots(slots)) + } } /// Constructs a new `ListArray`. @@ -339,7 +345,9 @@ impl Array { let len = offsets.len().saturating_sub(1); let slots = ListData::make_slots(elements.clone(), offsets.clone(), &validity, len); let data = ListData::try_new(elements, offsets, validity)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(List, dtype, len, data).with_slots(slots)) }) + Ok(unsafe { + Array::from_parts_unchecked(ArrayParts::new(List, dtype, len, data).with_slots(slots)) + }) } /// Creates a new `ListArray` without validation. @@ -352,7 +360,9 @@ impl Array { let len = offsets.len().saturating_sub(1); let slots = ListData::make_slots(elements.clone(), offsets.clone(), &validity, len); let data = unsafe { ListData::new_unchecked(elements, offsets, validity) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(List, dtype, len, data).with_slots(slots)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(List, dtype, len, data).with_slots(slots)) + } } pub fn elements(&self) -> &ArrayRef { @@ -389,12 +399,10 @@ impl Array { pub fn into_data_parts(self) -> ListDataParts { let dtype = self.dtype().clone(); - let elements = self - .slots()[ELEMENTS_SLOT] + let elements = self.slots()[ELEMENTS_SLOT] .clone() .vortex_expect("ListArray elements slot"); - let offsets = self - .slots()[OFFSETS_SLOT] + let offsets = self.slots()[OFFSETS_SLOT] .clone() .vortex_expect("ListArray offsets slot"); let validity = self.list_validity(); @@ -411,7 +419,10 @@ impl Array { if recurse && elements.is_canonical() { elements = elements.to_canonical()?.compact()?.into_array(); } else if recurse && let Some(child_list_array) = elements.as_opt::() { - elements = child_list_array.into_owned().reset_offsets(recurse)?.into_array(); + elements = child_list_array + .into_owned() + .reset_offsets(recurse)? + .into_array(); } let offsets = self.offsets(); diff --git a/vortex-array/src/arrays/list/compute/take.rs b/vortex-array/src/arrays/list/compute/take.rs index 478ee6c3dad..6c9ef4b1a60 100644 --- a/vortex-array/src/arrays/list/compute/take.rs +++ b/vortex-array/src/arrays/list/compute/take.rs @@ -10,9 +10,9 @@ use crate::array::ArrayView; use crate::arrays::List; use crate::arrays::ListArray; use crate::arrays::Primitive; -use crate::arrays::primitive::PrimitiveArrayExt; use crate::arrays::PrimitiveArray; use crate::arrays::dict::TakeExecute; +use crate::arrays::primitive::PrimitiveArrayExt; use crate::builders::ArrayBuilder; use crate::builders::PrimitiveBuilder; use crate::dtype::IntegerPType; diff --git a/vortex-array/src/arrays/listview/array.rs b/vortex-array/src/arrays/listview/array.rs index 4c6c624cc63..aea20a5f9d9 100644 --- a/vortex-array/src/arrays/listview/array.rs +++ b/vortex-array/src/arrays/listview/array.rs @@ -14,8 +14,8 @@ use crate::ArrayRef; use crate::ToCanonical; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::TypedArrayRef; use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::ListView; @@ -396,11 +396,18 @@ impl Array { pub fn new(elements: ArrayRef, offsets: ArrayRef, sizes: ArrayRef, validity: Validity) -> Self { let dtype = DType::List(Arc::new(elements.dtype().clone()), validity.nullability()); let len = offsets.len(); - let slots = - ListViewData::make_slots(elements.clone(), offsets.clone(), sizes.clone(), &validity, len); + let slots = ListViewData::make_slots( + elements.clone(), + offsets.clone(), + sizes.clone(), + &validity, + len, + ); let data = ListViewData::new(elements, offsets, sizes, validity); unsafe { - Array::from_parts_unchecked(ArrayParts::new(ListView, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(ListView, dtype, len, data).with_slots(slots), + ) } } @@ -413,11 +420,18 @@ impl Array { ) -> VortexResult { let dtype = DType::List(Arc::new(elements.dtype().clone()), validity.nullability()); let len = offsets.len(); - let slots = - ListViewData::make_slots(elements.clone(), offsets.clone(), sizes.clone(), &validity, len); + let slots = ListViewData::make_slots( + elements.clone(), + offsets.clone(), + sizes.clone(), + &validity, + len, + ); let data = ListViewData::try_new(elements, offsets, sizes, validity)?; Ok(unsafe { - Array::from_parts_unchecked(ArrayParts::new(ListView, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(ListView, dtype, len, data).with_slots(slots), + ) }) } @@ -434,11 +448,18 @@ impl Array { ) -> Self { let dtype = DType::List(Arc::new(elements.dtype().clone()), validity.nullability()); let len = offsets.len(); - let slots = - ListViewData::make_slots(elements.clone(), offsets.clone(), sizes.clone(), &validity, len); + let slots = ListViewData::make_slots( + elements.clone(), + offsets.clone(), + sizes.clone(), + &validity, + len, + ); let data = unsafe { ListViewData::new_unchecked(elements, offsets, sizes, validity) }; unsafe { - Array::from_parts_unchecked(ArrayParts::new(ListView, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(ListView, dtype, len, data).with_slots(slots), + ) } } @@ -449,21 +470,31 @@ impl Array { /// See [`ListViewData::with_zero_copy_to_list`]. pub unsafe fn with_zero_copy_to_list(self, is_zctl: bool) -> Self { if cfg!(debug_assertions) && is_zctl { - validate_zctl(self.elements(), self.offsets().to_primitive(), self.sizes().to_primitive()) - .vortex_expect("Failed to validate zero-copy to list flag"); + validate_zctl( + self.elements(), + self.offsets().to_primitive(), + self.sizes().to_primitive(), + ) + .vortex_expect("Failed to validate zero-copy to list flag"); } let dtype = self.dtype().clone(); let len = self.len(); let slots = self.slots().to_vec(); let data = unsafe { self.into_data().with_zero_copy_to_list(is_zctl) }; unsafe { - Array::from_parts_unchecked(ArrayParts::new(ListView, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(ListView, dtype, len, data).with_slots(slots), + ) } } pub fn verify_is_zero_copy_to_list(&self) -> bool { - validate_zctl(self.elements(), self.offsets().to_primitive(), self.sizes().to_primitive()) - .is_ok() + validate_zctl( + self.elements(), + self.offsets().to_primitive(), + self.sizes().to_primitive(), + ) + .is_ok() } pub fn elements(&self) -> &ArrayRef { @@ -499,16 +530,13 @@ impl Array { } pub fn into_data_parts(self) -> ListViewDataParts { - let elements = self - .slots()[ELEMENTS_SLOT] + let elements = self.slots()[ELEMENTS_SLOT] .clone() .vortex_expect("ListViewArray elements slot"); - let offsets = self - .slots()[OFFSETS_SLOT] + let offsets = self.slots()[OFFSETS_SLOT] .clone() .vortex_expect("ListViewArray offsets slot"); - let sizes = self - .slots()[SIZES_SLOT] + let sizes = self.slots()[SIZES_SLOT] .clone() .vortex_expect("ListViewArray sizes slot"); let validity = self.listview_validity(); @@ -556,8 +584,12 @@ impl ArrayView<'_, ListView> { } pub fn verify_is_zero_copy_to_list(&self) -> bool { - validate_zctl(self.elements(), self.offsets().to_primitive(), self.sizes().to_primitive()) - .is_ok() + validate_zctl( + self.elements(), + self.offsets().to_primitive(), + self.sizes().to_primitive(), + ) + .is_ok() } } diff --git a/vortex-array/src/arrays/listview/mod.rs b/vortex-array/src/arrays/listview/mod.rs index 52faadf92ea..77f2a279160 100644 --- a/vortex-array/src/arrays/listview/mod.rs +++ b/vortex-array/src/arrays/listview/mod.rs @@ -2,9 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; +pub use array::ListViewArrayExt; pub use array::ListViewData; pub use array::ListViewDataParts; -pub use array::ListViewArrayExt; pub use vtable::ListViewArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/masked/array.rs b/vortex-array/src/arrays/masked/array.rs index 94ce84dbe45..d0977ecf30a 100644 --- a/vortex-array/src/arrays/masked/array.rs +++ b/vortex-array/src/arrays/masked/array.rs @@ -36,7 +36,10 @@ pub trait MaskedArrayExt: TypedArrayRef { } fn masked_validity(&self) -> Validity { - child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.as_ref().dtype().nullability()) + child_to_validity( + &self.slots_ref()[VALIDITY_SLOT], + self.as_ref().dtype().nullability(), + ) } fn masked_validity_mask(&self) -> vortex_mask::Mask { diff --git a/vortex-array/src/arrays/masked/compute/filter.rs b/vortex-array/src/arrays/masked/compute/filter.rs index 98aefdc425b..fb3969b4bb8 100644 --- a/vortex-array/src/arrays/masked/compute/filter.rs +++ b/vortex-array/src/arrays/masked/compute/filter.rs @@ -9,8 +9,8 @@ use crate::IntoArray; use crate::array::ArrayView; use crate::arrays::Masked; use crate::arrays::MaskedArray; -use crate::arrays::masked::MaskedArrayExt; use crate::arrays::filter::FilterReduce; +use crate::arrays::masked::MaskedArrayExt; impl FilterReduce for Masked { fn filter(array: ArrayView<'_, Masked>, mask: &Mask) -> VortexResult> { diff --git a/vortex-array/src/arrays/masked/compute/take.rs b/vortex-array/src/arrays/masked/compute/take.rs index e415bb2a49e..c02a88a08fe 100644 --- a/vortex-array/src/arrays/masked/compute/take.rs +++ b/vortex-array/src/arrays/masked/compute/take.rs @@ -8,8 +8,8 @@ use crate::IntoArray; use crate::array::ArrayView; use crate::arrays::Masked; use crate::arrays::MaskedArray; -use crate::arrays::masked::MaskedArrayExt; use crate::arrays::dict::TakeReduce; +use crate::arrays::masked::MaskedArrayExt; use crate::builtins::ArrayBuiltins; use crate::scalar::Scalar; diff --git a/vortex-array/src/arrays/masked/mod.rs b/vortex-array/src/arrays/masked/mod.rs index 0a0d717857b..ac437d30321 100644 --- a/vortex-array/src/arrays/masked/mod.rs +++ b/vortex-array/src/arrays/masked/mod.rs @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::MaskedData; pub use array::MaskedArrayExt; +pub use array::MaskedData; pub use vtable::MaskedArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/masked/vtable/mod.rs b/vortex-array/src/arrays/masked/vtable/mod.rs index fdb36aeaab0..09129892dc4 100644 --- a/vortex-array/src/arrays/masked/vtable/mod.rs +++ b/vortex-array/src/arrays/masked/vtable/mod.rs @@ -21,10 +21,10 @@ use crate::array::ArrayView; use crate::array::VTable; use crate::array::validity_to_child; use crate::arrays::ConstantArray; -use crate::arrays::masked::array::CHILD_SLOT; +use crate::arrays::masked::MaskedArrayExt; use crate::arrays::masked::MaskedData; +use crate::arrays::masked::array::CHILD_SLOT; use crate::arrays::masked::array::SLOT_NAMES; -use crate::arrays::masked::MaskedArrayExt; use crate::arrays::masked::compute::rules::PARENT_RULES; use crate::arrays::masked::mask_validity_canonical; use crate::buffer::BufferHandle; @@ -61,12 +61,14 @@ impl VTable for Masked { len: usize, slots: &[Option], ) -> VortexResult<()> { - vortex_ensure!(slots[CHILD_SLOT].is_some(), "MaskedArray child slot must be present"); - let child = slots[CHILD_SLOT].as_ref().vortex_expect("validated child slot"); vortex_ensure!( - child.len() == len, - "MaskedArray child length mismatch" + slots[CHILD_SLOT].is_some(), + "MaskedArray child slot must be present" ); + let child = slots[CHILD_SLOT] + .as_ref() + .vortex_expect("validated child slot"); + vortex_ensure!(child.len() == len, "MaskedArray child length mismatch"); vortex_ensure!( child.dtype().as_nullable() == *dtype, "MaskedArray dtype does not match child and validity" diff --git a/vortex-array/src/arrays/masked/vtable/validity.rs b/vortex-array/src/arrays/masked/vtable/validity.rs index b1370171714..e79c882e003 100644 --- a/vortex-array/src/arrays/masked/vtable/validity.rs +++ b/vortex-array/src/arrays/masked/vtable/validity.rs @@ -5,8 +5,8 @@ use vortex_error::VortexResult; use crate::array::ArrayView; use crate::array::ValidityVTable; -use crate::arrays::masked::vtable::Masked; use crate::arrays::masked::MaskedArrayExt; +use crate::arrays::masked::vtable::Masked; use crate::validity::Validity; impl ValidityVTable for Masked { diff --git a/vortex-array/src/arrays/null/mod.rs b/vortex-array/src/arrays/null/mod.rs index 546063e6265..94711016092 100644 --- a/vortex-array/src/arrays/null/mod.rs +++ b/vortex-array/src/arrays/null/mod.rs @@ -50,19 +50,11 @@ impl VTable for Null { Ok(()) } - fn array_hash( - _data: &NullData, - _state: &mut H, - _precision: Precision, - ) { + fn array_hash(_data: &NullData, _state: &mut H, _precision: Precision) { // len and dtype are hashed by ArrayInner; NullData has no additional fields. } - fn array_eq( - _data: &NullData, - _other: &NullData, - _precision: Precision, - ) -> bool { + fn array_eq(_data: &NullData, _other: &NullData, _precision: Precision) -> bool { // len, dtype, and slots are compared by ArrayInner; NullData has no additional fields. true } @@ -83,7 +75,6 @@ impl VTable for Null { vortex_panic!("NullArray slot_name index {idx} out of bounds") } - fn serialize(_array: ArrayView<'_, Self>) -> VortexResult>> { Ok(Some(vec![])) } diff --git a/vortex-array/src/arrays/patched/array.rs b/vortex-array/src/arrays/patched/array.rs index 21b519db43f..f8168375997 100644 --- a/vortex-array/src/arrays/patched/array.rs +++ b/vortex-array/src/arrays/patched/array.rs @@ -151,7 +151,9 @@ pub trait PatchedArrayExt: TypedArrayRef { assert!(chunk * 1024 <= self.as_ref().len() + self.offset()); assert!(lane < self.n_lanes()); - let start = self.lane_offsets().scalar_at(chunk * self.n_lanes() + lane)?; + let start = self + .lane_offsets() + .scalar_at(chunk * self.n_lanes() + lane)?; let stop = self .lane_offsets() .scalar_at(chunk * self.n_lanes() + lane + 1)?; @@ -195,7 +197,9 @@ pub trait PatchedArrayExt: TypedArrayRef { Some(values), ]; - Ok(unsafe { Array::::from_prevalidated_parts(dtype, len, slots, self.n_lanes(), offset) }) + Ok(unsafe { + Array::::from_prevalidated_parts(dtype, len, slots, self.n_lanes(), offset) + }) } } diff --git a/vortex-array/src/arrays/patched/compute/compare.rs b/vortex-array/src/arrays/patched/compute/compare.rs index 9f4d2119e95..889b41a198e 100644 --- a/vortex-array/src/arrays/patched/compute/compare.rs +++ b/vortex-array/src/arrays/patched/compute/compare.rs @@ -9,14 +9,14 @@ use crate::ArrayRef; use crate::Canonical; use crate::ExecutionCtx; use crate::IntoArray; -use crate::array::child_to_validity; use crate::array::ArrayView; +use crate::array::child_to_validity; use crate::arrays::BoolArray; use crate::arrays::ConstantArray; use crate::arrays::Patched; -use crate::arrays::patched::PatchedArrayExt; use crate::arrays::PrimitiveArray; use crate::arrays::bool::BoolDataParts; +use crate::arrays::patched::PatchedArrayExt; use crate::arrays::primitive::NativeValue; use crate::builtins::ArrayBuiltins; use crate::dtype::NativePType; @@ -53,11 +53,7 @@ impl CompareKernel for Patched { .into_bool(); let validity = child_to_validity(&result.slots()[0], result.dtype().nullability()); - let BoolDataParts { - bits, - offset, - len, - } = result.into_data().into_parts(); + let BoolDataParts { bits, offset, len } = result.into_data().into_parts(); let mut bits = BitBufferMut::from_buffer(bits.unwrap_host().into_mut(), offset, len); diff --git a/vortex-array/src/arrays/patched/compute/filter.rs b/vortex-array/src/arrays/patched/compute/filter.rs index 01b392b2880..01a61f9f323 100644 --- a/vortex-array/src/arrays/patched/compute/filter.rs +++ b/vortex-array/src/arrays/patched/compute/filter.rs @@ -10,8 +10,8 @@ use crate::IntoArray; use crate::array::ArrayView; use crate::arrays::FilterArray; use crate::arrays::Patched; -use crate::arrays::patched::PatchedArrayExt; use crate::arrays::filter::FilterReduce; +use crate::arrays::patched::PatchedArrayExt; impl FilterReduce for Patched { fn filter(array: ArrayView<'_, Self>, mask: &Mask) -> VortexResult> { diff --git a/vortex-array/src/arrays/patched/compute/take.rs b/vortex-array/src/arrays/patched/compute/take.rs index f0c21d64bba..5c5930dbb70 100644 --- a/vortex-array/src/arrays/patched/compute/take.rs +++ b/vortex-array/src/arrays/patched/compute/take.rs @@ -10,9 +10,9 @@ use crate::ExecutionCtx; use crate::IntoArray; use crate::array::ArrayView; use crate::arrays::Patched; -use crate::arrays::patched::PatchedArrayExt; use crate::arrays::PrimitiveArray; use crate::arrays::dict::TakeExecute; +use crate::arrays::patched::PatchedArrayExt; use crate::arrays::primitive::PrimitiveDataParts; use crate::dtype::IntegerPType; use crate::dtype::NativePType; diff --git a/vortex-array/src/arrays/primitive/array/mod.rs b/vortex-array/src/arrays/primitive/array/mod.rs index 145c60fc432..0af637e21b5 100644 --- a/vortex-array/src/arrays/primitive/array/mod.rs +++ b/vortex-array/src/arrays/primitive/array/mod.rs @@ -16,8 +16,8 @@ use vortex_error::vortex_panic; use crate::ToCanonical; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::TypedArrayRef; use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::arrays::Primitive; use crate::arrays::PrimitiveArray; use crate::dtype::DType; @@ -223,7 +223,9 @@ impl Array { let data = PrimitiveData::empty::(nullability); let slots = PrimitiveData::make_slots(&Validity::from(nullability), len); unsafe { - Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(Primitive, dtype, len, data).with_slots(slots), + ) } } @@ -239,7 +241,9 @@ impl Array { let slots = PrimitiveData::make_slots(&validity, len); let data = PrimitiveData::new(buffer, validity); unsafe { - Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(Primitive, dtype, len, data).with_slots(slots), + ) } } @@ -250,7 +254,9 @@ impl Array { let slots = PrimitiveData::make_slots(&validity, len); let data = PrimitiveData::try_new(buffer, validity)?; Ok(unsafe { - Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(Primitive, dtype, len, data).with_slots(slots), + ) }) } @@ -265,7 +271,9 @@ impl Array { let slots = PrimitiveData::make_slots(&validity, len); let data = unsafe { PrimitiveData::new_unchecked(buffer, validity) }; unsafe { - Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(Primitive, dtype, len, data).with_slots(slots), + ) } } @@ -284,7 +292,9 @@ impl Array { let slots = PrimitiveData::make_slots(&validity, len); let data = unsafe { PrimitiveData::new_unchecked_from_handle(handle, ptype, validity) }; unsafe { - Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(Primitive, dtype, len, data).with_slots(slots), + ) } } @@ -305,7 +315,9 @@ impl Array { let slots = PrimitiveData::make_slots(&validity, len); let data = PrimitiveData::from_byte_buffer(buffer, ptype, validity); unsafe { - Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(Primitive, dtype, len, data).with_slots(slots), + ) } } @@ -322,7 +334,9 @@ impl Array { let data = PrimitiveData::from_values_byte_buffer(valid_elems_buffer, ptype, validity, n_rows); unsafe { - Array::from_parts_unchecked(ArrayParts::new(Primitive, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(Primitive, dtype, len, data).with_slots(slots), + ) } } @@ -371,7 +385,9 @@ impl Array { impl PrimitiveData { /// Consume the primitive array and returns its component parts. pub fn into_parts(self) -> PrimitiveDataParts { - vortex_panic!("PrimitiveData::into_parts requires outer dtype; use Array::into_data_parts") + vortex_panic!( + "PrimitiveData::into_parts requires outer dtype; use Array::into_data_parts" + ) } } @@ -517,7 +533,6 @@ impl Array { pub fn buffer_handle(&self) -> &BufferHandle { &self.data().buffer } - } impl ArrayView<'_, Primitive> { @@ -528,5 +543,4 @@ impl ArrayView<'_, Primitive> { pub fn buffer_handle(&self) -> &BufferHandle { &self.data().buffer } - } diff --git a/vortex-array/src/arrays/primitive/compute/cast.rs b/vortex-array/src/arrays/primitive/compute/cast.rs index 4e547a734bf..9053afaf66f 100644 --- a/vortex-array/src/arrays/primitive/compute/cast.rs +++ b/vortex-array/src/arrays/primitive/compute/cast.rs @@ -15,8 +15,8 @@ use crate::IntoArray; use crate::aggregate_fn; use crate::array::ArrayView; use crate::arrays::Primitive; -use crate::arrays::primitive::PrimitiveArrayExt; use crate::arrays::PrimitiveArray; +use crate::arrays::primitive::PrimitiveArrayExt; use crate::dtype::DType; use crate::dtype::NativePType; use crate::dtype::Nullability; diff --git a/vortex-array/src/arrays/primitive/mod.rs b/vortex-array/src/arrays/primitive/mod.rs index 4bd6c1aa028..4d62f1da517 100644 --- a/vortex-array/src/arrays/primitive/mod.rs +++ b/vortex-array/src/arrays/primitive/mod.rs @@ -2,9 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; +pub use array::PrimitiveArrayExt; pub use array::PrimitiveData; pub use array::PrimitiveDataParts; -pub use array::PrimitiveArrayExt; pub use array::chunk_range; pub use array::patch_chunk; pub use vtable::PrimitiveArray; diff --git a/vortex-array/src/arrays/scalar_fn/array.rs b/vortex-array/src/arrays/scalar_fn/array.rs index bf1a982efe3..00a4cd4b2aa 100644 --- a/vortex-array/src/arrays/scalar_fn/array.rs +++ b/vortex-array/src/arrays/scalar_fn/array.rs @@ -7,8 +7,8 @@ use vortex_error::vortex_ensure; use crate::ArrayRef; use crate::array::Array; -use crate::array::ArrayView; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::arrays::ScalarFnVTable; use crate::scalar_fn::ScalarFnRef; diff --git a/vortex-array/src/arrays/shared/array.rs b/vortex-array/src/arrays/shared/array.rs index 287c867b912..4836d5eb73c 100644 --- a/vortex-array/src/arrays/shared/array.rs +++ b/vortex-array/src/arrays/shared/array.rs @@ -52,9 +52,9 @@ pub trait SharedArrayExt: TypedArrayRef { &self, f: impl FnOnce(&ArrayRef) -> VortexResult, ) -> VortexResult { - let result = self.cached.get_or_init(|| { - f(self.source()).map(|c| c.into_array()).map_err(Arc::new) - }); + let result = self + .cached + .get_or_init(|| f(self.source()).map(|c| c.into_array()).map_err(Arc::new)); result.clone().map_err(Into::into) } diff --git a/vortex-array/src/arrays/shared/mod.rs b/vortex-array/src/arrays/shared/mod.rs index 03aab52b02f..5d947388a5b 100644 --- a/vortex-array/src/arrays/shared/mod.rs +++ b/vortex-array/src/arrays/shared/mod.rs @@ -4,8 +4,8 @@ mod array; mod vtable; -pub use array::SharedData; pub use array::SharedArrayExt; +pub use array::SharedData; pub use vtable::Shared; pub use vtable::SharedArray; diff --git a/vortex-array/src/arrays/shared/vtable.rs b/vortex-array/src/arrays/shared/vtable.rs index 914d7746a22..d57dd5be6d4 100644 --- a/vortex-array/src/arrays/shared/vtable.rs +++ b/vortex-array/src/arrays/shared/vtable.rs @@ -17,8 +17,8 @@ use crate::array::ArrayView; use crate::array::OperationsVTable; use crate::array::VTable; use crate::array::ValidityVTable; -use crate::arrays::shared::SharedData; use crate::arrays::shared::SharedArrayExt; +use crate::arrays::shared::SharedData; use crate::arrays::shared::array::SLOT_NAMES; use crate::buffer::BufferHandle; use crate::dtype::DType; diff --git a/vortex-array/src/arrays/slice/mod.rs b/vortex-array/src/arrays/slice/mod.rs index 4f4397e37f7..8eec9d85310 100644 --- a/vortex-array/src/arrays/slice/mod.rs +++ b/vortex-array/src/arrays/slice/mod.rs @@ -15,9 +15,9 @@ mod vtable; use std::ops::Range; +pub use array::SliceArrayExt; pub use array::SliceData; pub use array::SliceDataParts; -pub use array::SliceArrayExt; use vortex_error::VortexResult; pub use vtable::*; diff --git a/vortex-array/src/arrays/slice/vtable.rs b/vortex-array/src/arrays/slice/vtable.rs index 25426d9634f..1ff36050ffa 100644 --- a/vortex-array/src/arrays/slice/vtable.rs +++ b/vortex-array/src/arrays/slice/vtable.rs @@ -25,10 +25,10 @@ use crate::array::ArrayView; use crate::array::OperationsVTable; use crate::array::VTable; use crate::array::ValidityVTable; +use crate::arrays::slice::SliceArrayExt; use crate::arrays::slice::array::CHILD_SLOT; use crate::arrays::slice::array::SLOT_NAMES; use crate::arrays::slice::array::SliceData; -use crate::arrays::slice::SliceArrayExt; use crate::arrays::slice::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -64,8 +64,13 @@ impl VTable for Slice { len: usize, slots: &[Option], ) -> VortexResult<()> { - vortex_ensure!(slots[CHILD_SLOT].is_some(), "SliceArray child slot must be present"); - let child = slots[CHILD_SLOT].as_ref().vortex_expect("validated child slot"); + vortex_ensure!( + slots[CHILD_SLOT].is_some(), + "SliceArray child slot must be present" + ); + let child = slots[CHILD_SLOT] + .as_ref() + .vortex_expect("validated child slot"); vortex_ensure!( child.dtype() == dtype, "SliceArray dtype {} does not match outer dtype {}", @@ -130,7 +135,6 @@ impl VTable for Slice { vortex_bail!("Slice array is not serializable") } - fn execute(array: 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/struct_/array.rs b/vortex-array/src/arrays/struct_/array.rs index aa73b33f80c..3952541d406 100644 --- a/vortex-array/src/arrays/struct_/array.rs +++ b/vortex-array/src/arrays/struct_/array.rs @@ -14,8 +14,8 @@ use crate::ArrayRef; use crate::IntoArray; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::TypedArrayRef; use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::Struct; @@ -405,10 +405,17 @@ impl Array { ) -> Self { let fields = fields.into(); let field_dtypes: Vec<_> = fields.iter().map(|d| d.dtype().clone()).collect(); - let dtype = DType::Struct(StructFields::new(names.clone(), field_dtypes), validity.nullability()); + let dtype = DType::Struct( + StructFields::new(names.clone(), field_dtypes), + validity.nullability(), + ); let slots = StructData::make_slots(&fields, &validity, length); let data = StructData::new(names, fields, length, validity); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, length, data).with_slots(slots)) } + unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Struct, dtype, length, data).with_slots(slots), + ) + } } /// Constructs a new `StructArray`. @@ -420,10 +427,17 @@ impl Array { ) -> VortexResult { let fields = fields.into(); let field_dtypes: Vec<_> = fields.iter().map(|d| d.dtype().clone()).collect(); - let dtype = DType::Struct(StructFields::new(names.clone(), field_dtypes), validity.nullability()); + let dtype = DType::Struct( + StructFields::new(names.clone(), field_dtypes), + validity.nullability(), + ); let slots = StructData::make_slots(&fields, &validity, length); let data = StructData::try_new(names, fields, length, validity)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, length, data).with_slots(slots)) }) + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Struct, dtype, length, data).with_slots(slots), + ) + }) } /// Creates a new `StructArray` without validation. @@ -441,7 +455,11 @@ impl Array { let outer_dtype = DType::Struct(dtype.clone(), validity.nullability()); let slots = StructData::make_slots(&fields, &validity, length); let data = unsafe { StructData::new_unchecked(fields, dtype, length, validity) }; - unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, outer_dtype, length, data).with_slots(slots)) } + unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Struct, outer_dtype, length, data).with_slots(slots), + ) + } } /// Constructs a new `StructArray` with an explicit dtype. @@ -455,7 +473,11 @@ impl Array { let outer_dtype = DType::Struct(dtype.clone(), validity.nullability()); let slots = StructData::make_slots(&fields, &validity, length); let data = StructData::try_new_with_dtype(fields, dtype, length, validity)?; - Ok(unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, outer_dtype, length, data).with_slots(slots)) }) + Ok(unsafe { + Array::from_parts_unchecked( + ArrayParts::new(Struct, outer_dtype, length, data).with_slots(slots), + ) + }) } /// Construct a `StructArray` from named fields. @@ -497,7 +519,12 @@ impl Array { .map(ArrayRef::len) .ok_or_else(|| vortex_err!("StructArray cannot be constructed from an empty slice of arrays because the length is unspecified"))?; - Self::try_new(FieldNames::from_iter(names), fields, len, Validity::NonNullable) + Self::try_new( + FieldNames::from_iter(names), + fields, + len, + Validity::NonNullable, + ) } // TODO(aduffy): Add equivalent function to support field masks for nested column access. @@ -538,7 +565,9 @@ impl Array { crate::dtype::Nullability::NonNullable, ); let slots = StructData::make_slots(&[], &Validity::NonNullable, len); - unsafe { Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, len, data).with_slots(slots)) } + unsafe { + Array::from_parts_unchecked(ArrayParts::new(Struct, dtype, len, data).with_slots(slots)) + } } pub fn into_data_parts(self) -> StructDataParts { @@ -550,12 +579,13 @@ impl Array { let validity = self.validity().vortex_expect("StructArray validity"); let struct_fields = StructFields::new( names, - fields - .iter() - .map(|field| field.dtype().clone()) - .collect(), + fields.iter().map(|field| field.dtype().clone()).collect(), ); - StructDataParts { struct_fields, fields, validity } + StructDataParts { + struct_fields, + fields, + validity, + } } pub fn remove_column(&self, name: impl Into) -> Option<(Self, ArrayRef)> { diff --git a/vortex-array/src/arrays/struct_/mod.rs b/vortex-array/src/arrays/struct_/mod.rs index 3888bffabea..3ad34f225a1 100644 --- a/vortex-array/src/arrays/struct_/mod.rs +++ b/vortex-array/src/arrays/struct_/mod.rs @@ -2,9 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; +pub use array::StructArrayExt; pub use array::StructData; pub use array::StructDataParts; -pub use array::StructArrayExt; pub use vtable::StructArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/varbin/array.rs b/vortex-array/src/arrays/varbin/array.rs index 73ebefe57e6..29f5fb3fbec 100644 --- a/vortex-array/src/arrays/varbin/array.rs +++ b/vortex-array/src/arrays/varbin/array.rs @@ -14,8 +14,8 @@ use crate::ArrayRef; use crate::ToCanonical; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::TypedArrayRef; use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::VarBin; @@ -187,12 +187,9 @@ impl VarBinData { Self::validate(&offsets, &bytes, &dtype, &validity) .vortex_expect("[Debug Assertion]: Invalid `VarBinArray` parameters"); - let _ = - Self::dtype_parts(&dtype).vortex_expect("VarBinArray dtype must be utf8 or binary"); + let _ = Self::dtype_parts(&dtype).vortex_expect("VarBinArray dtype must be utf8 or binary"); - Self { - bytes, - } + Self { bytes } } /// Validates the components that would be used to create a `VarBinArray`. @@ -294,7 +291,7 @@ impl VarBinData { /// # Note /// /// Bytes child buffer is never sliced when the array is sliced so this can include values - /// that are not logically present in the array. Users should prefer [sliced_bytes][Self::sliced_bytes] + /// that are not logically present in the array. Users should prefer `sliced_bytes` /// unless they're resolving values via the offset child array. #[inline] pub fn bytes(&self) -> &ByteBuffer { diff --git a/vortex-array/src/arrays/varbin/mod.rs b/vortex-array/src/arrays/varbin/mod.rs index 6a0a6848096..a8f321fec9a 100644 --- a/vortex-array/src/arrays/varbin/mod.rs +++ b/vortex-array/src/arrays/varbin/mod.rs @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::VarBinData; pub use array::VarBinArrayExt; +pub use array::VarBinData; pub use array::VarBinDataParts; pub use vtable::VarBinArray; diff --git a/vortex-array/src/arrays/varbinview/array.rs b/vortex-array/src/arrays/varbinview/array.rs index 016f0157ec8..a17ee33fa76 100644 --- a/vortex-array/src/arrays/varbinview/array.rs +++ b/vortex-array/src/arrays/varbinview/array.rs @@ -18,8 +18,8 @@ use vortex_mask::Mask; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::TypedArrayRef; use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::array::child_to_validity; use crate::array::validity_to_child; use crate::arrays::VarBinView; @@ -270,10 +270,7 @@ impl VarBinViewData { ) -> Self { let _ = Self::dtype_parts(&dtype).vortex_expect("VarBinViewArray dtype must be utf8 or binary"); - Self { - buffers, - views, - } + Self { buffers, views } } /// Validates the components that would be used to create a `VarBinViewArray`. @@ -549,10 +546,16 @@ impl> VarBinViewArrayExt for T {} impl Array { #[inline] - fn from_prevalidated_data(dtype: DType, data: VarBinViewData, slots: Vec>) -> Self { + fn from_prevalidated_data( + dtype: DType, + data: VarBinViewData, + slots: Vec>, + ) -> Self { let len = data.len(); unsafe { - Array::from_parts_unchecked(ArrayParts::new(VarBinView, dtype, len, data).with_slots(slots)) + Array::from_parts_unchecked( + ArrayParts::new(VarBinView, dtype, len, data).with_slots(slots), + ) } } @@ -578,8 +581,10 @@ impl Array { pub fn from_iter_str, I: IntoIterator>(iter: I) -> Self { let iter = iter.into_iter(); - let mut builder = - VarBinViewBuilder::with_capacity(DType::Utf8(Nullability::NonNullable), iter.size_hint().0); + let mut builder = VarBinViewBuilder::with_capacity( + DType::Utf8(Nullability::NonNullable), + iter.size_hint().0, + ); for value in iter { builder.append_value(value.as_ref()); } @@ -590,8 +595,10 @@ impl Array { iter: I, ) -> Self { let iter = iter.into_iter(); - let mut builder = - VarBinViewBuilder::with_capacity(DType::Utf8(Nullability::Nullable), iter.size_hint().0); + let mut builder = VarBinViewBuilder::with_capacity( + DType::Utf8(Nullability::Nullable), + iter.size_hint().0, + ); for value in iter { match value { Some(value) => builder.append_value(value.as_ref()), @@ -603,8 +610,10 @@ impl Array { pub fn from_iter_bin, I: IntoIterator>(iter: I) -> Self { let iter = iter.into_iter(); - let mut builder = - VarBinViewBuilder::with_capacity(DType::Binary(Nullability::NonNullable), iter.size_hint().0); + let mut builder = VarBinViewBuilder::with_capacity( + DType::Binary(Nullability::NonNullable), + iter.size_hint().0, + ); for value in iter { builder.append_value(value.as_ref()); } @@ -615,8 +624,10 @@ impl Array { iter: I, ) -> Self { let iter = iter.into_iter(); - let mut builder = - VarBinViewBuilder::with_capacity(DType::Binary(Nullability::Nullable), iter.size_hint().0); + let mut builder = VarBinViewBuilder::with_capacity( + DType::Binary(Nullability::Nullable), + iter.size_hint().0, + ); for value in iter { match value { Some(value) => builder.append_value(value.as_ref()), @@ -649,8 +660,9 @@ impl Array { dtype: DType, validity: Validity, ) -> Self { - let data = - unsafe { VarBinViewData::new_unchecked(views, buffers, dtype.clone(), validity.clone()) }; + let data = unsafe { + VarBinViewData::new_unchecked(views, buffers, dtype.clone(), validity.clone()) + }; let slots = VarBinViewData::make_slots(&validity, data.len()); Self::from_prevalidated_data(dtype, data, slots) } @@ -678,8 +690,9 @@ impl Array { dtype: DType, validity: Validity, ) -> Self { - let data = - unsafe { VarBinViewData::new_handle_unchecked(views, buffers, dtype.clone(), validity.clone()) }; + let data = unsafe { + VarBinViewData::new_handle_unchecked(views, buffers, dtype.clone(), validity.clone()) + }; let slots = VarBinViewData::make_slots(&validity, data.len()); Self::from_prevalidated_data(dtype, data, slots) } diff --git a/vortex-array/src/arrays/varbinview/mod.rs b/vortex-array/src/arrays/varbinview/mod.rs index 932eef96d88..be82b952f30 100644 --- a/vortex-array/src/arrays/varbinview/mod.rs +++ b/vortex-array/src/arrays/varbinview/mod.rs @@ -2,9 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; +pub use array::VarBinViewArrayExt; pub use array::VarBinViewData; pub use array::VarBinViewDataParts; -pub use array::VarBinViewArrayExt; pub use vtable::VarBinViewArray; mod accessor; diff --git a/vortex-array/src/arrays/variant/mod.rs b/vortex-array/src/arrays/variant/mod.rs index 9b5246ec1a6..f5f433f0db4 100644 --- a/vortex-array/src/arrays/variant/mod.rs +++ b/vortex-array/src/arrays/variant/mod.rs @@ -3,15 +3,15 @@ mod vtable; -pub use self::vtable::Variant; -pub use self::vtable::VariantArray; use vortex_error::VortexExpect; +pub use self::vtable::Variant; +pub use self::vtable::VariantArray; use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; -use crate::array::TypedArrayRef; use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::dtype::DType; pub(super) const NUM_SLOTS: usize = 1; diff --git a/vortex-array/src/arrays/variant/vtable/mod.rs b/vortex-array/src/arrays/variant/vtable/mod.rs index 4cdfeaaa0f9..e8b3b0d9d89 100644 --- a/vortex-array/src/arrays/variant/vtable/mod.rs +++ b/vortex-array/src/arrays/variant/vtable/mod.rs @@ -79,8 +79,7 @@ impl VTable for Variant { Ok(()) } - fn array_hash(_data: &VariantData, _state: &mut H, _precision: Precision) { - } + fn array_hash(_data: &VariantData, _state: &mut H, _precision: Precision) {} fn array_eq(_data: &VariantData, _other: &VariantData, _precision: Precision) -> bool { true @@ -138,12 +137,10 @@ impl VTable for Variant { } } - fn execute(array: Array, _ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(array)) } } #[cfg(test)] -mod tests { -} +mod tests {} diff --git a/vortex-array/src/arrow/executor/dictionary.rs b/vortex-array/src/arrow/executor/dictionary.rs index 6b42a25be53..6c607bcc74e 100644 --- a/vortex-array/src/arrow/executor/dictionary.rs +++ b/vortex-array/src/arrow/executor/dictionary.rs @@ -78,7 +78,10 @@ fn dict_to_dict( ctx: &mut ExecutionCtx, ) -> VortexResult { let codes = array.codes().clone().execute_arrow(Some(codes_type), ctx)?; - let values = array.values().clone().execute_arrow(Some(values_type), ctx)?; + let values = array + .values() + .clone() + .execute_arrow(Some(values_type), ctx)?; make_dict_array(codes_type, codes, values) } diff --git a/vortex-array/src/canonical.rs b/vortex-array/src/canonical.rs index f45084f9c21..ca0acc2f434 100644 --- a/vortex-array/src/canonical.rs +++ b/vortex-array/src/canonical.rs @@ -16,8 +16,8 @@ use crate::ArrayRef; use crate::Executable; use crate::ExecutionCtx; use crate::IntoArray; -use crate::array::child_to_validity; use crate::array::ArrayView; +use crate::array::child_to_validity; use crate::arrays::Bool; use crate::arrays::BoolArray; use crate::arrays::Decimal; @@ -546,11 +546,7 @@ impl Executable for CanonicalValidity { n @ Canonical::Null(_) => Ok(CanonicalValidity(n)), Canonical::Bool(b) => { let validity = child_to_validity(&b.slots()[0], b.dtype().nullability()); - let BoolDataParts { - bits, - offset, - len, - } = b.into_data().into_parts(); + let BoolDataParts { bits, offset, len } = b.into_data().into_parts(); Ok(CanonicalValidity(Canonical::Bool( BoolArray::try_new_from_handle(bits, offset, len, validity.execute(ctx)?)?, ))) @@ -668,11 +664,7 @@ impl Executable for RecursiveCanonical { n @ Canonical::Null(_) => Ok(RecursiveCanonical(n)), Canonical::Bool(b) => { let validity = child_to_validity(&b.slots()[0], b.dtype().nullability()); - let BoolDataParts { - bits, - offset, - len, - } = b.into_data().into_parts(); + let BoolDataParts { bits, offset, len } = b.into_data().into_parts(); Ok(RecursiveCanonical(Canonical::Bool( BoolArray::try_new_from_handle(bits, offset, len, validity.execute(ctx)?)?, ))) diff --git a/vortex-array/src/optimizer/mod.rs b/vortex-array/src/optimizer/mod.rs index 4feee5170c7..a7051980efd 100644 --- a/vortex-array/src/optimizer/mod.rs +++ b/vortex-array/src/optimizer/mod.rs @@ -94,7 +94,7 @@ fn try_optimize_recursive(array: &ArrayRef) -> VortexResult> { for slot in current_array.slots() { match slot { Some(child) => { - if let Some(new_child) = try_optimize_recursive(&child)? { + if let Some(new_child) = try_optimize_recursive(child)? { new_slots.push(Some(new_child)); any_slot_optimized = true; } else { diff --git a/vortex-btrblocks/src/schemes/integer.rs b/vortex-btrblocks/src/schemes/integer.rs index f39be87189c..05e407217c8 100644 --- a/vortex-btrblocks/src/schemes/integer.rs +++ b/vortex-btrblocks/src/schemes/integer.rs @@ -18,9 +18,9 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_err; +use vortex_fastlanes::BitPackedArrayExt; use vortex_fastlanes::FoR; use vortex_fastlanes::FoRArrayExt; -use vortex_fastlanes::BitPackedArrayExt; use vortex_fastlanes::bitpack_compress::bit_width_histogram; use vortex_fastlanes::bitpack_compress::bitpack_encode; use vortex_fastlanes::bitpack_compress::find_best_bit_width; diff --git a/vortex-cuda/src/arrow/canonical.rs b/vortex-cuda/src/arrow/canonical.rs index 16901f6a038..f28c18ed7a4 100644 --- a/vortex-cuda/src/arrow/canonical.rs +++ b/vortex-cuda/src/arrow/canonical.rs @@ -130,10 +130,7 @@ fn export_canonical( Canonical::Bool(bool_array) => { let validity = bool_array.validity()?; let BoolDataParts { - bits, - offset, - len, - .. + bits, offset, len, .. } = bool_array.into_data().into_parts(); check_validity_empty(&validity)?; diff --git a/vortex-cuda/src/canonical.rs b/vortex-cuda/src/canonical.rs index 0e6392cbcdd..a738e0c0e54 100644 --- a/vortex-cuda/src/canonical.rs +++ b/vortex-cuda/src/canonical.rs @@ -65,10 +65,7 @@ impl CanonicalCudaExt for Canonical { // Also update other method to copy validity to host. let validity = bool.validity()?; let BoolDataParts { - bits, - offset, - len, - .. + bits, offset, len, .. } = bool.into_data().into_parts(); let bits = BitBuffer::new_with_offset(bits.try_into_host()?.await?, offset, len); diff --git a/vortex-cuda/src/dynamic_dispatch/mod.rs b/vortex-cuda/src/dynamic_dispatch/mod.rs index 49bd06bc076..4cf2560a766 100644 --- a/vortex-cuda/src/dynamic_dispatch/mod.rs +++ b/vortex-cuda/src/dynamic_dispatch/mod.rs @@ -441,8 +441,8 @@ mod tests { use vortex::encodings::alp::alp_encode; use vortex::encodings::fastlanes::BitPacked; use vortex::encodings::fastlanes::BitPackedArray; - use vortex::encodings::fastlanes::FoRArrayExt; use vortex::encodings::fastlanes::FoR; + use vortex::encodings::fastlanes::FoRArrayExt; use vortex::encodings::runend::RunEnd; use vortex::encodings::zigzag::ZigZag; use vortex::error::VortexExpect; diff --git a/vortex-cuda/src/kernel/encodings/bitpacked.rs b/vortex-cuda/src/kernel/encodings/bitpacked.rs index 6409109cb3e..df60a305388 100644 --- a/vortex-cuda/src/kernel/encodings/bitpacked.rs +++ b/vortex-cuda/src/kernel/encodings/bitpacked.rs @@ -175,8 +175,8 @@ mod tests { use vortex::array::dtype::NativePType; use vortex::array::validity::Validity::NonNullable; use vortex::buffer::Buffer; - use vortex::error::VortexExpect; use vortex::encodings::fastlanes::BitPackedArrayExt; + use vortex::error::VortexExpect; use vortex::session::VortexSession; use super::*; diff --git a/vortex-python/src/arrays/builtins/struct_.rs b/vortex-python/src/arrays/builtins/struct_.rs index a2b1ef9d0e1..f363cfed401 100644 --- a/vortex-python/src/arrays/builtins/struct_.rs +++ b/vortex-python/src/arrays/builtins/struct_.rs @@ -6,8 +6,8 @@ use pyo3::PyRef; use pyo3::PyResult; use pyo3::pyclass; use pyo3::pymethods; -use vortex::error::VortexExpect; use vortex::array::arrays::Struct; +use vortex::error::VortexExpect; use crate::arrays::PyArrayRef; use crate::arrays::native::EncodingSubclass; From 72257b4ba18f1cc253efc307897d12d24fb0fd98 Mon Sep 17 00:00:00 2001 From: Nicholas Gates Date: Sun, 5 Apr 2026 16:11:17 -0400 Subject: [PATCH 07/10] Engine Signed-off-by: Nicholas Gates --- encodings/alp/public-api.lock | 24 +- encodings/alp/src/alp/array.rs | 39 +- encodings/alp/src/alp_rd/array.rs | 47 +- encodings/bytebool/public-api.lock | 12 +- encodings/bytebool/src/array.rs | 23 +- encodings/datetime-parts/public-api.lock | 12 +- encodings/datetime-parts/src/array.rs | 34 +- encodings/decimal-byte-parts/public-api.lock | 12 +- .../src/decimal_byte_parts/mod.rs | 31 +- encodings/fastlanes/public-api.lock | 50 +- .../fastlanes/src/bitpacking/array/mod.rs | 13 +- .../fastlanes/src/bitpacking/vtable/mod.rs | 37 +- encodings/fastlanes/src/delta/array/mod.rs | 7 +- encodings/fastlanes/src/delta/vtable/mod.rs | 23 +- encodings/fastlanes/src/for/array/mod.rs | 2 +- encodings/fastlanes/src/for/vtable/mod.rs | 23 +- encodings/fastlanes/src/rle/array/mod.rs | 15 +- encodings/fastlanes/src/rle/vtable/mod.rs | 23 +- encodings/fsst/public-api.lock | 12 +- encodings/fsst/src/array.rs | 46 +- encodings/parquet-variant/src/array.rs | 9 +- encodings/parquet-variant/src/vtable.rs | 22 +- encodings/pco/public-api.lock | 12 +- encodings/pco/src/array.rs | 77 +- encodings/runend/public-api.lock | 14 +- encodings/runend/src/array.rs | 32 +- encodings/sequence/public-api.lock | 12 +- encodings/sequence/src/array.rs | 25 +- encodings/sparse/public-api.lock | 12 +- encodings/sparse/src/lib.rs | 23 +- encodings/zigzag/public-api.lock | 12 +- encodings/zigzag/src/array.rs | 23 +- encodings/zstd/public-api.lock | 12 +- encodings/zstd/src/array.rs | 75 +- encodings/zstd/src/zstd_buffers.rs | 55 +- vortex-array/public-api.lock | 940 +++++++----------- vortex-array/src/array/erased.rs | 5 +- vortex-array/src/array/mod.rs | 22 +- vortex-array/src/array/typed.rs | 21 +- vortex-array/src/array/vtable/mod.rs | 12 +- vortex-array/src/arrays/bool/array.rs | 63 +- vortex-array/src/arrays/bool/vtable/mod.rs | 33 +- vortex-array/src/arrays/chunked/array.rs | 14 +- .../src/arrays/chunked/paired_chunks.rs | 2 +- vortex-array/src/arrays/chunked/vtable/mod.rs | 25 +- .../src/arrays/constant/vtable/mod.rs | 23 +- vortex-array/src/arrays/decimal/array.rs | 50 +- vortex-array/src/arrays/decimal/vtable/mod.rs | 24 +- vortex-array/src/arrays/dict/array.rs | 4 +- vortex-array/src/arrays/dict/vtable/mod.rs | 20 +- vortex-array/src/arrays/extension/array.rs | 2 +- .../src/arrays/extension/vtable/mod.rs | 25 +- vortex-array/src/arrays/filter/array.rs | 2 +- vortex-array/src/arrays/filter/vtable.rs | 20 +- .../src/arrays/fixed_size_list/array.rs | 4 +- .../src/arrays/fixed_size_list/vtable/mod.rs | 33 +- vortex-array/src/arrays/list/array.rs | 16 +- vortex-array/src/arrays/list/vtable/mod.rs | 19 +- vortex-array/src/arrays/listview/array.rs | 8 +- .../src/arrays/listview/vtable/mod.rs | 23 +- vortex-array/src/arrays/masked/array.rs | 6 +- vortex-array/src/arrays/masked/vtable/mod.rs | 21 +- vortex-array/src/arrays/null/mod.rs | 26 +- vortex-array/src/arrays/patched/array.rs | 14 +- .../src/arrays/patched/compute/compare.rs | 3 +- vortex-array/src/arrays/patched/vtable/mod.rs | 25 +- .../src/arrays/primitive/array/cast.rs | 16 - .../src/arrays/primitive/array/mod.rs | 56 +- .../src/arrays/primitive/vtable/mod.rs | 20 +- vortex-array/src/arrays/scalar_fn/array.rs | 57 +- .../src/arrays/scalar_fn/vtable/mod.rs | 22 +- vortex-array/src/arrays/shared/array.rs | 2 +- vortex-array/src/arrays/shared/vtable.rs | 21 +- vortex-array/src/arrays/slice/array.rs | 2 +- vortex-array/src/arrays/slice/vtable.rs | 24 +- vortex-array/src/arrays/struct_/array.rs | 6 +- vortex-array/src/arrays/struct_/vtable/mod.rs | 21 +- vortex-array/src/arrays/varbin/array.rs | 6 +- vortex-array/src/arrays/varbin/vtable/mod.rs | 22 +- vortex-array/src/arrays/varbinview/array.rs | 2 +- .../src/arrays/varbinview/vtable/mod.rs | 43 +- vortex-array/src/arrays/variant/mod.rs | 2 +- vortex-array/src/arrays/variant/vtable/mod.rs | 18 +- vortex-array/src/canonical.rs | 6 +- vortex-btrblocks/src/schemes/integer.rs | 2 +- vortex-cuda/src/arrow/canonical.rs | 4 +- vortex-cuda/src/canonical.rs | 3 +- vortex-cuda/src/executor.rs | 6 - vortex-cuda/src/hybrid_dispatch/mod.rs | 2 +- vortex-cuda/src/kernel/arrays/dict.rs | 10 +- vortex-cuda/src/kernel/encodings/alp.rs | 2 +- .../src/kernel/encodings/date_time_parts.rs | 6 +- .../kernel/encodings/decimal_byte_parts.rs | 3 +- vortex-cuda/src/kernel/encodings/for_.rs | 2 +- vortex-cuda/src/kernel/encodings/runend.rs | 4 +- vortex-cuda/src/kernel/encodings/zigzag.rs | 2 +- vortex-cuda/src/kernel/filter/decimal.rs | 2 +- vortex-cuda/src/kernel/patches/mod.rs | 6 +- vortex-python/src/arrays/py/vtable.rs | 22 +- 99 files changed, 1417 insertions(+), 1410 deletions(-) diff --git a/encodings/alp/public-api.lock b/encodings/alp/public-api.lock index 2f54de00534..a92ca50dacd 100644 --- a/encodings/alp/public-api.lock +++ b/encodings/alp/public-api.lock @@ -32,10 +32,6 @@ pub type vortex_alp::ALP::OperationsVTable = vortex_alp::ALP pub type vortex_alp::ALP::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_alp::ALP::array_eq(data: &vortex_alp::ALPData, other: &vortex_alp::ALPData, _precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_alp::ALP::array_hash(data: &vortex_alp::ALPData, state: &mut H, _precision: vortex_array::hash::Precision) - pub fn vortex_alp::ALP::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_alp::ALP::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -118,6 +114,14 @@ impl core::fmt::Debug for vortex_alp::ALPData pub fn vortex_alp::ALPData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_alp::ALPData + +pub fn vortex_alp::ALPData::array_eq(&self, other: &Self, _precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_alp::ALPData + +pub fn vortex_alp::ALPData::array_hash(&self, state: &mut H, _precision: vortex_array::hash::Precision) + pub struct vortex_alp::ALPMetadata impl core::clone::Clone for vortex_alp::ALPMetadata @@ -164,10 +168,6 @@ pub type vortex_alp::ALPRD::OperationsVTable = vortex_alp::ALPRD pub type vortex_alp::ALPRD::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_alp::ALPRD::array_eq(data: &vortex_alp::ALPRDData, other: &vortex_alp::ALPRDData, precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_alp::ALPRD::array_hash(data: &vortex_alp::ALPRDData, state: &mut H, precision: vortex_array::hash::Precision) - pub fn vortex_alp::ALPRD::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_alp::ALPRD::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -238,6 +238,14 @@ impl core::fmt::Debug for vortex_alp::ALPRDData pub fn vortex_alp::ALPRDData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_alp::ALPRDData + +pub fn vortex_alp::ALPRDData::array_eq(&self, other: &Self, precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_alp::ALPRDData + +pub fn vortex_alp::ALPRDData::array_hash(&self, state: &mut H, precision: vortex_array::hash::Precision) + pub struct vortex_alp::ALPRDDataParts pub vortex_alp::ALPRDDataParts::left_parts: vortex_array::array::erased::ArrayRef diff --git a/encodings/alp/src/alp/array.rs b/encodings/alp/src/alp/array.rs index b04d35476bc..38c78dd71c6 100644 --- a/encodings/alp/src/alp/array.rs +++ b/encodings/alp/src/alp/array.rs @@ -3,9 +3,12 @@ use std::fmt::Debug; use std::hash::Hash; +use std::hash::Hasher; use prost::Message; use vortex_array::Array; +use vortex_array::ArrayEq; +use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -43,6 +46,22 @@ use crate::alp::rules::RULES; vtable!(ALP, ALP, ALPData); +impl ArrayHash for ALPData { + fn array_hash(&self, state: &mut H, _precision: Precision) { + self.exponents.hash(state); + self.patch_offset.hash(state); + self.patch_offset_within_chunk.hash(state); + } +} + +impl ArrayEq for ALPData { + fn array_eq(&self, other: &Self, _precision: Precision) -> bool { + self.exponents == other.exponents + && self.patch_offset == other.patch_offset + && self.patch_offset_within_chunk == other.patch_offset_within_chunk + } +} + impl VTable for ALP { type ArrayData = ALPData; @@ -75,18 +94,6 @@ impl VTable for ALP { ) } - fn array_hash(data: &ALPData, state: &mut H, _precision: Precision) { - data.exponents.hash(state); - data.patch_offset.hash(state); - data.patch_offset_within_chunk.hash(state); - } - - fn array_eq(data: &ALPData, other: &ALPData, _precision: Precision) -> bool { - data.exponents == other.exponents - && data.patch_offset == other.patch_offset - && data.patch_offset_within_chunk == other.patch_offset_within_chunk - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } @@ -413,7 +420,6 @@ impl ALPData { Some(p) => (Some(p.offset()), p.offset_within_chunk()), None => (None, None), }; - drop((encoded, patches)); Ok(Self { patch_offset, @@ -427,7 +433,7 @@ impl ALPData { /// See [`ALPData::try_new`] for information about the preconditions that should be checked /// **before** calling this method. pub(crate) unsafe fn new_unchecked( - encoded: ArrayRef, + _encoded: ArrayRef, exponents: Exponents, patches: Option, ) -> Self { @@ -435,7 +441,6 @@ impl ALPData { Some(p) => (Some(p.offset()), p.offset_within_chunk()), None => (None, None), }; - drop((encoded, patches)); Self { patch_offset, @@ -516,7 +521,7 @@ impl ALPData { pub trait ALPArrayExt: TypedArrayRef { fn encoded(&self) -> &ArrayRef { - self.slots_ref()[ENCODED_SLOT] + self.as_ref().slots()[ENCODED_SLOT] .as_ref() .vortex_expect("ALPArray encoded slot") } @@ -527,7 +532,7 @@ pub trait ALPArrayExt: TypedArrayRef { fn patches(&self) -> Option { patches_from_slots( - self.slots_ref(), + self.as_ref().slots(), self.patch_offset, self.patch_offset_within_chunk, self.as_ref().len(), diff --git a/encodings/alp/src/alp_rd/array.rs b/encodings/alp/src/alp_rd/array.rs index aeb395c9bf8..e646a7239c7 100644 --- a/encodings/alp/src/alp_rd/array.rs +++ b/encodings/alp/src/alp_rd/array.rs @@ -3,6 +3,7 @@ use std::fmt::Debug; use std::hash::Hash; +use std::hash::Hasher; use itertools::Itertools; use prost::Message; @@ -63,6 +64,25 @@ pub struct ALPRDMetadata { patches: Option, } +impl ArrayHash for ALPRDData { + fn array_hash(&self, state: &mut H, precision: Precision) { + self.left_parts_dictionary.array_hash(state, precision); + self.right_bit_width.hash(state); + self.patch_offset.hash(state); + self.patch_offset_within_chunk.hash(state); + } +} + +impl ArrayEq for ALPRDData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + self.left_parts_dictionary + .array_eq(&other.left_parts_dictionary, precision) + && self.right_bit_width == other.right_bit_width + && self.patch_offset == other.patch_offset + && self.patch_offset_within_chunk == other.patch_offset_within_chunk + } +} + impl VTable for ALPRD { type ArrayData = ALPRDData; @@ -83,21 +103,6 @@ impl VTable for ALPRD { data.validate_against_outer(dtype, len, slots) } - fn array_hash(data: &ALPRDData, state: &mut H, precision: Precision) { - data.left_parts_dictionary.array_hash(state, precision); - data.right_bit_width.hash(state); - data.patch_offset.hash(state); - data.patch_offset_within_chunk.hash(state); - } - - fn array_eq(data: &ALPRDData, other: &ALPRDData, precision: Precision) -> bool { - data.left_parts_dictionary - .array_eq(&other.left_parts_dictionary, precision) - && data.right_bit_width == other.right_bit_width - && data.patch_offset == other.patch_offset - && data.patch_offset_within_chunk == other.patch_offset_within_chunk - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } @@ -531,14 +536,12 @@ impl ALPRDData { /// it constructs it from parts. pub(crate) unsafe fn new_unchecked( _dtype: DType, - left_parts: ArrayRef, + _left_parts: ArrayRef, left_parts_dictionary: Buffer, - right_parts: ArrayRef, + _right_parts: ArrayRef, right_bit_width: u8, left_parts_patches: Option, ) -> Self { - drop(left_parts); - drop(right_parts); Self { patch_offset: left_parts_patches.as_ref().map(Patches::offset), patch_offset_within_chunk: left_parts_patches @@ -631,11 +634,11 @@ fn patches_from_slots( pub trait ALPRDArrayExt: TypedArrayRef { fn left_parts(&self) -> &ArrayRef { - left_parts_from_slots(self.slots_ref()) + left_parts_from_slots(self.as_ref().slots()) } fn right_parts(&self) -> &ArrayRef { - right_parts_from_slots(self.slots_ref()) + right_parts_from_slots(self.as_ref().slots()) } fn right_bit_width(&self) -> u8 { @@ -644,7 +647,7 @@ pub trait ALPRDArrayExt: TypedArrayRef { fn left_parts_patches(&self) -> Option { patches_from_slots( - self.slots_ref(), + self.as_ref().slots(), self.patch_offset, self.patch_offset_within_chunk, self.as_ref().len(), diff --git a/encodings/bytebool/public-api.lock b/encodings/bytebool/public-api.lock index 65a35e05e36..612746bff2a 100644 --- a/encodings/bytebool/public-api.lock +++ b/encodings/bytebool/public-api.lock @@ -28,10 +28,6 @@ pub type vortex_bytebool::ByteBool::OperationsVTable = vortex_bytebool::ByteBool pub type vortex_bytebool::ByteBool::ValidityVTable = vortex_bytebool::ByteBool -pub fn vortex_bytebool::ByteBool::array_eq(data: &vortex_bytebool::ByteBoolData, other: &vortex_bytebool::ByteBoolData, precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_bytebool::ByteBool::array_hash(data: &vortex_bytebool::ByteBoolData, state: &mut H, precision: vortex_array::hash::Precision) - pub fn vortex_bytebool::ByteBool::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_bytebool::ByteBool::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -112,6 +108,14 @@ impl core::fmt::Debug for vortex_bytebool::ByteBoolData pub fn vortex_bytebool::ByteBoolData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_bytebool::ByteBoolData + +pub fn vortex_bytebool::ByteBoolData::array_eq(&self, other: &Self, precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_bytebool::ByteBoolData + +pub fn vortex_bytebool::ByteBoolData::array_hash(&self, state: &mut H, precision: vortex_array::hash::Precision) + pub trait vortex_bytebool::ByteBoolArrayExt: vortex_array::array::typed::TypedArrayRef pub fn vortex_bytebool::ByteBoolArrayExt::validity(&self) -> vortex_array::validity::Validity diff --git a/encodings/bytebool/src/array.rs b/encodings/bytebool/src/array.rs index e304419e18b..ce2661ef082 100644 --- a/encodings/bytebool/src/array.rs +++ b/encodings/bytebool/src/array.rs @@ -2,6 +2,7 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use std::fmt::Debug; +use std::hash::Hasher; use vortex_array::Array; use vortex_array::ArrayEq; @@ -40,6 +41,18 @@ use crate::kernel::PARENT_KERNELS; vtable!(ByteBool, ByteBool, ByteBoolData); +impl ArrayHash for ByteBoolData { + fn array_hash(&self, state: &mut H, precision: Precision) { + self.buffer.array_hash(state, precision); + } +} + +impl ArrayEq for ByteBoolData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + self.buffer.array_eq(&other.buffer, precision) + } +} + impl VTable for ByteBool { type ArrayData = ByteBoolData; @@ -61,14 +74,6 @@ impl VTable for ByteBool { ByteBoolData::validate(data.buffer(), &validity, dtype, len) } - fn array_hash(data: &ByteBoolData, state: &mut H, precision: Precision) { - data.buffer.array_hash(state, precision); - } - - fn array_eq(data: &ByteBoolData, other: &ByteBoolData, precision: Precision) -> bool { - data.buffer.array_eq(&other.buffer, precision) - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 1 } @@ -168,7 +173,7 @@ pub struct ByteBoolData { pub trait ByteBoolArrayExt: TypedArrayRef { fn validity(&self) -> Validity { child_to_validity( - &self.slots_ref()[VALIDITY_SLOT], + &self.as_ref().slots()[VALIDITY_SLOT], self.as_ref().dtype().nullability(), ) } diff --git a/encodings/datetime-parts/public-api.lock b/encodings/datetime-parts/public-api.lock index d1ef86b4455..f0418a8b4d1 100644 --- a/encodings/datetime-parts/public-api.lock +++ b/encodings/datetime-parts/public-api.lock @@ -26,10 +26,6 @@ pub type vortex_datetime_parts::DateTimeParts::OperationsVTable = vortex_datetim pub type vortex_datetime_parts::DateTimeParts::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_datetime_parts::DateTimeParts::array_eq(_data: &vortex_datetime_parts::DateTimePartsData, _other: &vortex_datetime_parts::DateTimePartsData, _precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_datetime_parts::DateTimeParts::array_hash(_data: &vortex_datetime_parts::DateTimePartsData, _state: &mut H, _precision: vortex_array::hash::Precision) - pub fn vortex_datetime_parts::DateTimeParts::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_datetime_parts::DateTimeParts::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -104,6 +100,14 @@ impl core::fmt::Debug for vortex_datetime_parts::DateTimePartsData pub fn vortex_datetime_parts::DateTimePartsData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_datetime_parts::DateTimePartsData + +pub fn vortex_datetime_parts::DateTimePartsData::array_eq(&self, _other: &Self, _precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_datetime_parts::DateTimePartsData + +pub fn vortex_datetime_parts::DateTimePartsData::array_hash(&self, _state: &mut H, _precision: vortex_array::hash::Precision) + #[repr(C)] pub struct vortex_datetime_parts::DateTimePartsMetadata pub vortex_datetime_parts::DateTimePartsMetadata::days_ptype: i32 diff --git a/encodings/datetime-parts/src/array.rs b/encodings/datetime-parts/src/array.rs index c0164254d18..1a0174947f9 100644 --- a/encodings/datetime-parts/src/array.rs +++ b/encodings/datetime-parts/src/array.rs @@ -2,9 +2,12 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use std::fmt::Debug; +use std::hash::Hasher; use prost::Message; use vortex_array::Array; +use vortex_array::ArrayEq; +use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -40,6 +43,16 @@ use crate::split_temporal; vtable!(DateTimeParts, DateTimeParts, DateTimePartsData); +impl ArrayHash for DateTimePartsData { + fn array_hash(&self, _state: &mut H, _precision: Precision) {} +} + +impl ArrayEq for DateTimePartsData { + fn array_eq(&self, _other: &Self, _precision: Precision) -> bool { + true + } +} + #[derive(Clone, prost::Message)] #[repr(C)] pub struct DateTimePartsMetadata { @@ -99,21 +112,6 @@ impl VTable for DateTimeParts { DateTimePartsData::validate(dtype, days, seconds, subseconds, len) } - fn array_hash( - _data: &DateTimePartsData, - _state: &mut H, - _precision: Precision, - ) { - } - - fn array_eq( - _data: &DateTimePartsData, - _other: &DateTimePartsData, - _precision: Precision, - ) -> bool { - true - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } @@ -221,19 +219,19 @@ pub struct DateTimePartsData {} pub trait DateTimePartsArrayExt: TypedArrayRef { fn days(&self) -> &ArrayRef { - self.slots_ref()[DAYS_SLOT] + self.as_ref().slots()[DAYS_SLOT] .as_ref() .vortex_expect("DateTimePartsArray days slot") } fn seconds(&self) -> &ArrayRef { - self.slots_ref()[SECONDS_SLOT] + self.as_ref().slots()[SECONDS_SLOT] .as_ref() .vortex_expect("DateTimePartsArray seconds slot") } fn subseconds(&self) -> &ArrayRef { - self.slots_ref()[SUBSECONDS_SLOT] + self.as_ref().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 57da6a69840..0df4b476b17 100644 --- a/encodings/decimal-byte-parts/public-api.lock +++ b/encodings/decimal-byte-parts/public-api.lock @@ -24,10 +24,6 @@ pub type vortex_decimal_byte_parts::DecimalByteParts::OperationsVTable = vortex_ pub type vortex_decimal_byte_parts::DecimalByteParts::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_decimal_byte_parts::DecimalByteParts::array_eq(_data: &vortex_decimal_byte_parts::DecimalBytePartsData, _other: &vortex_decimal_byte_parts::DecimalBytePartsData, _precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_decimal_byte_parts::DecimalByteParts::array_hash(_data: &vortex_decimal_byte_parts::DecimalBytePartsData, _state: &mut H, _precision: vortex_array::hash::Precision) - pub fn vortex_decimal_byte_parts::DecimalByteParts::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_decimal_byte_parts::DecimalByteParts::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -96,6 +92,14 @@ impl core::fmt::Debug for vortex_decimal_byte_parts::DecimalBytePartsData pub fn vortex_decimal_byte_parts::DecimalBytePartsData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_decimal_byte_parts::DecimalBytePartsData + +pub fn vortex_decimal_byte_parts::DecimalBytePartsData::array_eq(&self, _other: &Self, _precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_decimal_byte_parts::DecimalBytePartsData + +pub fn vortex_decimal_byte_parts::DecimalBytePartsData::array_hash(&self, _state: &mut H, _precision: vortex_array::hash::Precision) + pub struct vortex_decimal_byte_parts::DecimalBytePartsDataParts pub vortex_decimal_byte_parts::DecimalBytePartsDataParts::msp: vortex_array::array::erased::ArrayRef 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 0ea4d5d5d3f..82dca7e9cd2 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs @@ -1,6 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::hash::Hasher; + use vortex_array::Array; use vortex_array::ArrayParts; use vortex_array::ArrayView; @@ -9,6 +11,8 @@ mod rules; mod slice; use prost::Message as _; +use vortex_array::ArrayEq; +use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayRef; use vortex_array::ExecutionCtx; @@ -44,6 +48,16 @@ use crate::decimal_byte_parts::rules::PARENT_RULES; vtable!(DecimalByteParts, DecimalByteParts, DecimalBytePartsData); +impl ArrayHash for DecimalBytePartsData { + fn array_hash(&self, _state: &mut H, _precision: Precision) {} +} + +impl ArrayEq for DecimalBytePartsData { + fn array_eq(&self, _other: &Self, _precision: Precision) -> bool { + true + } +} + #[derive(Clone, prost::Message)] pub struct DecimalBytesPartsMetadata { #[prost(enumeration = "PType", tag = "1")] @@ -78,21 +92,6 @@ impl VTable for DecimalByteParts { DecimalBytePartsData::validate(msp, *decimal_dtype, dtype, len) } - fn array_hash( - _data: &DecimalBytePartsData, - _state: &mut H, - _precision: Precision, - ) { - } - - fn array_eq( - _data: &DecimalBytePartsData, - _other: &DecimalBytePartsData, - _precision: Precision, - ) -> bool { - true - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } @@ -193,7 +192,7 @@ pub struct DecimalBytePartsDataParts { pub trait DecimalBytePartsArrayExt: TypedArrayRef { fn msp(&self) -> &ArrayRef { - self.slots_ref()[MSP_SLOT] + self.as_ref().slots()[MSP_SLOT] .as_ref() .vortex_expect("DecimalBytePartsArray msp slot") } diff --git a/encodings/fastlanes/public-api.lock b/encodings/fastlanes/public-api.lock index 51c99cf6584..3a25d1e170b 100644 --- a/encodings/fastlanes/public-api.lock +++ b/encodings/fastlanes/public-api.lock @@ -146,10 +146,6 @@ pub type vortex_fastlanes::BitPacked::ValidityVTable = vortex_fastlanes::BitPack pub fn vortex_fastlanes::BitPacked::append_to_builder(array: vortex_array::array::view::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_fastlanes::BitPacked::array_eq(data: &vortex_fastlanes::BitPackedData, other: &vortex_fastlanes::BitPackedData, precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_fastlanes::BitPacked::array_hash(data: &vortex_fastlanes::BitPackedData, state: &mut H, precision: vortex_array::hash::Precision) - pub fn vortex_fastlanes::BitPacked::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_fastlanes::BitPacked::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -228,6 +224,14 @@ impl core::fmt::Debug for vortex_fastlanes::BitPackedData pub fn vortex_fastlanes::BitPackedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_fastlanes::BitPackedData + +pub fn vortex_fastlanes::BitPackedData::array_eq(&self, other: &Self, precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_fastlanes::BitPackedData + +pub fn vortex_fastlanes::BitPackedData::array_hash(&self, state: &mut H, precision: vortex_array::hash::Precision) + pub struct vortex_fastlanes::BitPackedDataParts pub vortex_fastlanes::BitPackedDataParts::bit_width: u8 @@ -268,10 +272,6 @@ pub type vortex_fastlanes::Delta::OperationsVTable = vortex_fastlanes::Delta pub type vortex_fastlanes::Delta::ValidityVTable = vortex_fastlanes::Delta -pub fn vortex_fastlanes::Delta::array_eq(data: &vortex_fastlanes::DeltaData, other: &vortex_fastlanes::DeltaData, _precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_fastlanes::Delta::array_hash(data: &vortex_fastlanes::DeltaData, state: &mut H, _precision: vortex_array::hash::Precision) - pub fn vortex_fastlanes::Delta::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_fastlanes::Delta::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -322,6 +322,14 @@ impl core::fmt::Debug for vortex_fastlanes::DeltaData pub fn vortex_fastlanes::DeltaData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_fastlanes::DeltaData + +pub fn vortex_fastlanes::DeltaData::array_eq(&self, other: &Self, _precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_fastlanes::DeltaData + +pub fn vortex_fastlanes::DeltaData::array_hash(&self, state: &mut H, _precision: vortex_array::hash::Precision) + pub struct vortex_fastlanes::FoR impl vortex_fastlanes::FoR @@ -348,10 +356,6 @@ pub type vortex_fastlanes::FoR::OperationsVTable = vortex_fastlanes::FoR pub type vortex_fastlanes::FoR::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_fastlanes::FoR::array_eq(data: &vortex_fastlanes::FoRData, other: &vortex_fastlanes::FoRData, _precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_fastlanes::FoR::array_hash(data: &vortex_fastlanes::FoRData, state: &mut H, _precision: vortex_array::hash::Precision) - pub fn vortex_fastlanes::FoR::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_fastlanes::FoR::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -420,6 +424,14 @@ impl core::fmt::Debug for vortex_fastlanes::FoRData pub fn vortex_fastlanes::FoRData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_fastlanes::FoRData + +pub fn vortex_fastlanes::FoRData::array_eq(&self, other: &Self, _precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_fastlanes::FoRData + +pub fn vortex_fastlanes::FoRData::array_hash(&self, state: &mut H, _precision: vortex_array::hash::Precision) + pub struct vortex_fastlanes::RLE impl vortex_fastlanes::RLE @@ -448,10 +460,6 @@ pub type vortex_fastlanes::RLE::OperationsVTable = vortex_fastlanes::RLE pub type vortex_fastlanes::RLE::ValidityVTable = vortex_fastlanes::RLE -pub fn vortex_fastlanes::RLE::array_eq(data: &vortex_fastlanes::RLEData, other: &vortex_fastlanes::RLEData, _precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_fastlanes::RLE::array_hash(data: &vortex_fastlanes::RLEData, state: &mut H, _precision: vortex_array::hash::Precision) - pub fn vortex_fastlanes::RLE::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_fastlanes::RLE::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -498,7 +506,7 @@ pub fn vortex_fastlanes::RLEData::encode(array: &vortex_array::arrays::primitive impl vortex_fastlanes::RLEData -pub unsafe fn vortex_fastlanes::RLEData::new_unchecked(values: vortex_array::array::erased::ArrayRef, indices: vortex_array::array::erased::ArrayRef, values_idx_offsets: vortex_array::array::erased::ArrayRef, offset: usize) -> Self +pub unsafe fn vortex_fastlanes::RLEData::new_unchecked(_values: vortex_array::array::erased::ArrayRef, _indices: vortex_array::array::erased::ArrayRef, _values_idx_offsets: vortex_array::array::erased::ArrayRef, offset: usize) -> Self pub fn vortex_fastlanes::RLEData::offset(&self) -> usize @@ -512,6 +520,14 @@ impl core::fmt::Debug for vortex_fastlanes::RLEData pub fn vortex_fastlanes::RLEData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_fastlanes::RLEData + +pub fn vortex_fastlanes::RLEData::array_eq(&self, other: &Self, _precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_fastlanes::RLEData + +pub fn vortex_fastlanes::RLEData::array_hash(&self, state: &mut H, _precision: vortex_array::hash::Precision) + pub trait vortex_fastlanes::BitPackedArrayExt: vortex_array::array::typed::TypedArrayRef pub fn vortex_fastlanes::BitPackedArrayExt::bit_width(&self) -> u8 diff --git a/encodings/fastlanes/src/bitpacking/array/mod.rs b/encodings/fastlanes/src/bitpacking/array/mod.rs index 8a8d38b367e..164ddd9e8ba 100644 --- a/encodings/fastlanes/src/bitpacking/array/mod.rs +++ b/encodings/fastlanes/src/bitpacking/array/mod.rs @@ -89,13 +89,12 @@ impl BitPackedData { /// bit-packed array. pub(crate) unsafe fn new_unchecked( packed: BufferHandle, - validity: Validity, + _validity: Validity, patches: Option, bit_width: u8, - len: usize, + _len: usize, offset: u16, ) -> Self { - drop((validity, len)); let (patch_offset, patch_offset_within_chunk) = match &patches { Some(p) => (Some(p.offset()), p.offset_within_chunk()), None => (None, None), @@ -343,22 +342,22 @@ pub trait BitPackedArrayExt: TypedArrayRef { #[inline] fn patch_indices(&self) -> Option<&ArrayRef> { - self.slots_ref()[PATCH_INDICES_SLOT].as_ref() + self.as_ref().slots()[PATCH_INDICES_SLOT].as_ref() } #[inline] fn patch_values(&self) -> Option<&ArrayRef> { - self.slots_ref()[PATCH_VALUES_SLOT].as_ref() + self.as_ref().slots()[PATCH_VALUES_SLOT].as_ref() } #[inline] fn patch_chunk_offsets(&self) -> Option<&ArrayRef> { - self.slots_ref()[PATCH_CHUNK_OFFSETS_SLOT].as_ref() + self.as_ref().slots()[PATCH_CHUNK_OFFSETS_SLOT].as_ref() } #[inline] fn validity_child(&self) -> Option<&ArrayRef> { - self.slots_ref()[VALIDITY_SLOT].as_ref() + self.as_ref().slots()[VALIDITY_SLOT].as_ref() } #[inline] diff --git a/encodings/fastlanes/src/bitpacking/vtable/mod.rs b/encodings/fastlanes/src/bitpacking/vtable/mod.rs index 9a25cb85770..cfab43d63e7 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/mod.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/mod.rs @@ -2,6 +2,7 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use std::hash::Hash; +use std::hash::Hasher; use prost::Message; use vortex_array::AnyCanonical; @@ -67,6 +68,26 @@ pub struct BitPackedMetadata { pub(crate) patches: Option, } +impl ArrayHash for BitPackedData { + fn array_hash(&self, state: &mut H, precision: Precision) { + self.offset.hash(state); + self.bit_width.hash(state); + self.packed.array_hash(state, precision); + self.patch_offset.hash(state); + self.patch_offset_within_chunk.hash(state); + } +} + +impl ArrayEq for BitPackedData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + self.offset == other.offset + && self.bit_width == other.bit_width + && self.packed.array_eq(&other.packed, precision) + && self.patch_offset == other.patch_offset + && self.patch_offset_within_chunk == other.patch_offset_within_chunk + } +} + impl VTable for BitPacked { type ArrayData = BitPackedData; @@ -106,22 +127,6 @@ impl VTable for BitPacked { data.validate_against_slots(dtype, len, &validity, patches.as_ref()) } - fn array_hash(data: &BitPackedData, state: &mut H, precision: Precision) { - data.offset.hash(state); - data.bit_width.hash(state); - data.packed.array_hash(state, precision); - data.patch_offset.hash(state); - data.patch_offset_within_chunk.hash(state); - } - - fn array_eq(data: &BitPackedData, other: &BitPackedData, precision: Precision) -> bool { - data.offset == other.offset - && data.bit_width == other.bit_width - && data.packed.array_eq(&other.packed, precision) - && data.patch_offset == other.patch_offset - && data.patch_offset_within_chunk == other.patch_offset_within_chunk - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 1 } diff --git a/encodings/fastlanes/src/delta/array/mod.rs b/encodings/fastlanes/src/delta/array/mod.rs index 033039875d6..d479a726342 100644 --- a/encodings/fastlanes/src/delta/array/mod.rs +++ b/encodings/fastlanes/src/delta/array/mod.rs @@ -67,13 +67,13 @@ pub struct DeltaData { pub trait DeltaArrayExt: TypedArrayRef { fn bases(&self) -> &ArrayRef { - self.slots_ref()[BASES_SLOT] + self.as_ref().slots()[BASES_SLOT] .as_ref() .vortex_expect("DeltaArray bases slot") } fn deltas(&self) -> &ArrayRef { - self.slots_ref()[DELTAS_SLOT] + self.as_ref().slots()[DELTAS_SLOT] .as_ref() .vortex_expect("DeltaArray deltas slot") } @@ -156,8 +156,7 @@ impl DeltaData { Ok(()) } - pub(crate) unsafe fn new_unchecked(bases: ArrayRef, deltas: ArrayRef, offset: usize) -> Self { - drop((bases, deltas)); + pub(crate) unsafe fn new_unchecked(_bases: ArrayRef, _deltas: ArrayRef, offset: usize) -> Self { Self { offset } } } diff --git a/encodings/fastlanes/src/delta/vtable/mod.rs b/encodings/fastlanes/src/delta/vtable/mod.rs index 189a64a0bae..7d4fc52da23 100644 --- a/encodings/fastlanes/src/delta/vtable/mod.rs +++ b/encodings/fastlanes/src/delta/vtable/mod.rs @@ -2,10 +2,13 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use std::hash::Hash; +use std::hash::Hasher; use fastlanes::FastLanes; use prost::Message; use vortex_array::Array; +use vortex_array::ArrayEq; +use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -52,6 +55,18 @@ pub struct DeltaMetadata { offset: u32, // must be <1024 } +impl ArrayHash for DeltaData { + fn array_hash(&self, state: &mut H, _precision: Precision) { + self.offset.hash(state); + } +} + +impl ArrayEq for DeltaData { + fn array_eq(&self, other: &Self, _precision: Precision) -> bool { + self.offset == other.offset + } +} + impl VTable for Delta { type ArrayData = DeltaData; @@ -81,14 +96,6 @@ impl VTable for Delta { ) } - fn array_hash(data: &DeltaData, state: &mut H, _precision: Precision) { - data.offset.hash(state); - } - - fn array_eq(data: &DeltaData, other: &DeltaData, _precision: Precision) -> bool { - data.offset == other.offset - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/encodings/fastlanes/src/for/array/mod.rs b/encodings/fastlanes/src/for/array/mod.rs index 9ae406f372b..fcb285b03b7 100644 --- a/encodings/fastlanes/src/for/array/mod.rs +++ b/encodings/fastlanes/src/for/array/mod.rs @@ -29,7 +29,7 @@ pub struct FoRData { pub trait FoRArrayExt: TypedArrayRef { fn encoded(&self) -> &ArrayRef { - self.slots_ref()[ENCODED_SLOT] + self.as_ref().slots()[ENCODED_SLOT] .as_ref() .vortex_expect("FoRArray encoded slot") } diff --git a/encodings/fastlanes/src/for/vtable/mod.rs b/encodings/fastlanes/src/for/vtable/mod.rs index d2e880b175c..15fbbe2bfb2 100644 --- a/encodings/fastlanes/src/for/vtable/mod.rs +++ b/encodings/fastlanes/src/for/vtable/mod.rs @@ -3,8 +3,11 @@ use std::fmt::Debug; use std::hash::Hash; +use std::hash::Hasher; use vortex_array::Array; +use vortex_array::ArrayEq; +use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -44,6 +47,18 @@ mod validity; vtable!(FoR, FoR, FoRData); +impl ArrayHash for FoRData { + fn array_hash(&self, state: &mut H, _precision: Precision) { + self.reference.hash(state); + } +} + +impl ArrayEq for FoRData { + fn array_eq(&self, other: &Self, _precision: Precision) -> bool { + self.reference == other.reference + } +} + impl VTable for FoR { type ArrayData = FoRData; @@ -65,14 +80,6 @@ impl VTable for FoR { FoRData::validate_parts(encoded, &data.reference, dtype, len) } - fn array_hash(data: &FoRData, state: &mut H, _precision: Precision) { - data.reference.hash(state); - } - - fn array_eq(data: &FoRData, other: &FoRData, _precision: Precision) -> bool { - data.reference == other.reference - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/encodings/fastlanes/src/rle/array/mod.rs b/encodings/fastlanes/src/rle/array/mod.rs index 8965282be4c..72ed007d000 100644 --- a/encodings/fastlanes/src/rle/array/mod.rs +++ b/encodings/fastlanes/src/rle/array/mod.rs @@ -145,8 +145,6 @@ impl RLEData { length: usize, ) -> VortexResult { Self::validate(&values, &indices, &values_idx_offsets, offset, length)?; - - drop((values, indices, values_idx_offsets)); Ok(Self { offset }) } @@ -158,12 +156,11 @@ impl RLEData { /// - The `indices` array contains valid indices into chunks of the `values` array /// - The `values_idx_offsets` array contains valid chunk start offsets pub unsafe fn new_unchecked( - values: ArrayRef, - indices: ArrayRef, - values_idx_offsets: ArrayRef, + _values: ArrayRef, + _indices: ArrayRef, + _values_idx_offsets: ArrayRef, offset: usize, ) -> Self { - drop((values, indices, values_idx_offsets)); Self { offset } } @@ -176,21 +173,21 @@ impl RLEData { pub trait RLEArrayExt: TypedArrayRef { #[inline] fn values(&self) -> &ArrayRef { - self.slots_ref()[VALUES_SLOT] + self.as_ref().slots()[VALUES_SLOT] .as_ref() .vortex_expect("RLEArray values slot must be populated") } #[inline] fn indices(&self) -> &ArrayRef { - self.slots_ref()[INDICES_SLOT] + self.as_ref().slots()[INDICES_SLOT] .as_ref() .vortex_expect("RLEArray indices slot must be populated") } #[inline] fn values_idx_offsets(&self) -> &ArrayRef { - self.slots_ref()[VALUES_IDX_OFFSETS_SLOT] + self.as_ref().slots()[VALUES_IDX_OFFSETS_SLOT] .as_ref() .vortex_expect("RLEArray values_idx_offsets slot must be populated") } diff --git a/encodings/fastlanes/src/rle/vtable/mod.rs b/encodings/fastlanes/src/rle/vtable/mod.rs index 19dd286dfb1..4549613535e 100644 --- a/encodings/fastlanes/src/rle/vtable/mod.rs +++ b/encodings/fastlanes/src/rle/vtable/mod.rs @@ -2,9 +2,12 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use std::hash::Hash; +use std::hash::Hasher; use prost::Message; use vortex_array::Array; +use vortex_array::ArrayEq; +use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -58,6 +61,18 @@ pub struct RLEMetadata { pub offset: u64, } +impl ArrayHash for RLEData { + fn array_hash(&self, state: &mut H, _precision: Precision) { + self.offset.hash(state); + } +} + +impl ArrayEq for RLEData { + fn array_eq(&self, other: &Self, _precision: Precision) -> bool { + self.offset == other.offset + } +} + impl VTable for RLE { type ArrayData = RLEData; @@ -90,14 +105,6 @@ impl VTable for RLE { ) } - fn array_hash(data: &RLEData, state: &mut H, _precision: Precision) { - data.offset.hash(state); - } - - fn array_eq(data: &RLEData, other: &RLEData, _precision: Precision) -> bool { - data.offset == other.offset - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/encodings/fsst/public-api.lock b/encodings/fsst/public-api.lock index e098dc6787e..c0ed70deb46 100644 --- a/encodings/fsst/public-api.lock +++ b/encodings/fsst/public-api.lock @@ -26,10 +26,6 @@ pub type vortex_fsst::FSST::ValidityVTable = vortex_array::array::vtable::validi pub fn vortex_fsst::FSST::append_to_builder(array: vortex_array::array::view::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_fsst::FSST::array_eq(data: &vortex_fsst::FSSTData, other: &vortex_fsst::FSSTData, precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_fsst::FSST::array_hash(data: &vortex_fsst::FSSTData, state: &mut H, precision: vortex_array::hash::Precision) - pub fn vortex_fsst::FSST::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_fsst::FSST::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -116,6 +112,14 @@ impl core::fmt::Debug for vortex_fsst::FSSTData pub fn vortex_fsst::FSSTData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_fsst::FSSTData + +pub fn vortex_fsst::FSSTData::array_eq(&self, other: &Self, precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_fsst::FSSTData + +pub fn vortex_fsst::FSSTData::array_hash(&self, state: &mut H, precision: vortex_array::hash::Precision) + pub struct vortex_fsst::FSSTMetadata impl vortex_fsst::FSSTMetadata diff --git a/encodings/fsst/src/array.rs b/encodings/fsst/src/array.rs index 6d2ca344a1c..fa614c2a733 100644 --- a/encodings/fsst/src/array.rs +++ b/encodings/fsst/src/array.rs @@ -3,6 +3,7 @@ use std::fmt::Debug; use std::fmt::Formatter; +use std::hash::Hasher; use std::sync::Arc; use std::sync::LazyLock; @@ -71,6 +72,28 @@ impl FSSTMetadata { } } +impl ArrayHash for FSSTData { + fn array_hash(&self, state: &mut H, precision: Precision) { + self.symbols.array_hash(state, precision); + self.symbol_lengths.array_hash(state, precision); + self.codes.clone().into_array().array_hash(state, precision); + } +} + +impl ArrayEq for FSSTData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + self.symbols.array_eq(&other.symbols, precision) + && self + .symbol_lengths + .array_eq(&other.symbol_lengths, precision) + && self + .codes + .clone() + .into_array() + .array_eq(&other.codes.clone().into_array(), precision) + } +} + impl VTable for FSST { type ArrayData = FSSTData; type OperationsVTable = Self; @@ -90,24 +113,6 @@ impl VTable for FSST { data.validate(dtype, len, slots) } - fn array_hash(data: &FSSTData, state: &mut H, precision: Precision) { - data.symbols.array_hash(state, precision); - data.symbol_lengths.array_hash(state, precision); - data.codes.clone().into_array().array_hash(state, precision); - } - - fn array_eq(data: &FSSTData, other: &FSSTData, precision: Precision) -> bool { - data.symbols.array_eq(&other.symbols, precision) - && data - .symbol_lengths - .array_eq(&other.symbol_lengths, precision) - && data - .codes - .clone() - .into_array() - .array_eq(&other.codes.clone().into_array(), precision) - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 3 } @@ -489,9 +494,8 @@ impl FSSTData { symbols: Buffer, symbol_lengths: Buffer, codes: VarBinArray, - uncompressed_lengths: ArrayRef, + _uncompressed_lengths: ArrayRef, ) -> Self { - drop(uncompressed_lengths); let symbols2 = symbols.clone(); let symbol_lengths2 = symbol_lengths.clone(); let compressor = Arc::new(LazyLock::new(Box::new(move || { @@ -560,7 +564,7 @@ fn uncompressed_lengths_from_slots(slots: &[Option]) -> &ArrayRef { pub trait FSSTArrayExt: TypedArrayRef { fn uncompressed_lengths(&self) -> &ArrayRef { - uncompressed_lengths_from_slots(self.slots_ref()) + uncompressed_lengths_from_slots(self.as_ref().slots()) } fn uncompressed_lengths_dtype(&self) -> &DType { diff --git a/encodings/parquet-variant/src/array.rs b/encodings/parquet-variant/src/array.rs index 6bb8936992a..358e01ac2b3 100644 --- a/encodings/parquet-variant/src/array.rs +++ b/encodings/parquet-variant/src/array.rs @@ -112,7 +112,6 @@ impl ParquetVariantData { &dtype, len, )?; - drop((validity, metadata, value, typed_value)); Ok(Self) } @@ -230,24 +229,24 @@ impl ParquetVariantData { pub trait ParquetVariantArrayExt: TypedArrayRef { fn metadata_array(&self) -> &ArrayRef { - self.slots_ref()[METADATA_SLOT] + self.as_ref().slots()[METADATA_SLOT] .as_ref() .vortex_expect("ParquetVariantArray metadata slot") } fn validity(&self) -> Validity { child_to_validity( - &self.slots_ref()[VALIDITY_SLOT], + &self.as_ref().slots()[VALIDITY_SLOT], self.as_ref().dtype().nullability(), ) } fn value_array(&self) -> Option<&ArrayRef> { - self.slots_ref()[VALUE_SLOT].as_ref() + self.as_ref().slots()[VALUE_SLOT].as_ref() } fn typed_value_array(&self) -> Option<&ArrayRef> { - self.slots_ref()[TYPED_VALUE_SLOT].as_ref() + self.as_ref().slots()[TYPED_VALUE_SLOT].as_ref() } fn to_arrow(&self, ctx: &mut ExecutionCtx) -> VortexResult { diff --git a/encodings/parquet-variant/src/vtable.rs b/encodings/parquet-variant/src/vtable.rs index 8857b21dc6c..f5171165b1d 100644 --- a/encodings/parquet-variant/src/vtable.rs +++ b/encodings/parquet-variant/src/vtable.rs @@ -5,6 +5,8 @@ use std::hash::Hasher; use prost::Message; use vortex_array::Array; +use vortex_array::ArrayEq; +use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -77,16 +79,6 @@ impl VTable for ParquetVariant { ParquetVariantData::validate_slots(dtype, len, slots) } - fn array_hash(_data: &ParquetVariantData, _state: &mut H, _precision: Precision) {} - - fn array_eq( - _data: &ParquetVariantData, - _other: &ParquetVariantData, - _precision: Precision, - ) -> bool { - true - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } @@ -208,6 +200,16 @@ impl VTable for ParquetVariant { } } +impl ArrayHash for ParquetVariantData { + fn array_hash(&self, _state: &mut H, _precision: Precision) {} +} + +impl ArrayEq for ParquetVariantData { + fn array_eq(&self, _other: &Self, _precision: Precision) -> bool { + true + } +} + #[cfg(test)] mod tests { use vortex_array::ArrayContext; diff --git a/encodings/pco/public-api.lock b/encodings/pco/public-api.lock index 9ff76694ac1..47e76a743bc 100644 --- a/encodings/pco/public-api.lock +++ b/encodings/pco/public-api.lock @@ -24,10 +24,6 @@ pub type vortex_pco::Pco::OperationsVTable = vortex_pco::Pco pub type vortex_pco::Pco::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromValiditySliceHelper -pub fn vortex_pco::Pco::array_eq(data: &vortex_pco::PcoData, other: &vortex_pco::PcoData, precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_pco::Pco::array_hash(data: &vortex_pco::PcoData, state: &mut H, precision: vortex_array::hash::Precision) - pub fn vortex_pco::Pco::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_pco::Pco::buffer_name(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -112,6 +108,14 @@ impl vortex_array::array::vtable::validity::ValiditySliceHelper for vortex_pco:: pub fn vortex_pco::PcoData::unsliced_validity_and_slice(&self) -> (&vortex_array::validity::Validity, usize, usize) +impl vortex_array::hash::ArrayEq for vortex_pco::PcoData + +pub fn vortex_pco::PcoData::array_eq(&self, other: &Self, precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_pco::PcoData + +pub fn vortex_pco::PcoData::array_hash(&self, state: &mut H, precision: vortex_array::hash::Precision) + pub struct vortex_pco::PcoMetadata pub vortex_pco::PcoMetadata::chunks: alloc::vec::Vec diff --git a/encodings/pco/src/array.rs b/encodings/pco/src/array.rs index 757fabf088a..2c5a129cbf9 100644 --- a/encodings/pco/src/array.rs +++ b/encodings/pco/src/array.rs @@ -4,6 +4,7 @@ use std::cmp; use std::fmt::Debug; use std::hash::Hash; +use std::hash::Hasher; use pco::ChunkConfig; use pco::PagingSpec; @@ -80,64 +81,68 @@ const VALUES_PER_CHUNK: usize = pco::DEFAULT_MAX_PAGE_N; vtable!(Pco, Pco, PcoData); -impl VTable for Pco { - type ArrayData = PcoData; - - type OperationsVTable = Self; - type ValidityVTable = ValidityVTableFromValiditySliceHelper; - - fn id(&self) -> ArrayId { - Self::ID - } - - fn validate( - &self, - data: &PcoData, - dtype: &DType, - len: usize, - _slots: &[Option], - ) -> VortexResult<()> { - data.validate(dtype, len) - } - - fn array_hash(data: &PcoData, state: &mut H, precision: Precision) { - data.unsliced_validity.array_hash(state, precision); - data.unsliced_n_rows.hash(state); - data.slice_start.hash(state); - data.slice_stop.hash(state); +impl ArrayHash for PcoData { + fn array_hash(&self, state: &mut H, precision: Precision) { + self.unsliced_validity.array_hash(state, precision); + self.unsliced_n_rows.hash(state); + self.slice_start.hash(state); + self.slice_stop.hash(state); // Hash chunk_metas and pages using pointer-based hashing - for chunk_meta in &data.chunk_metas { + for chunk_meta in &self.chunk_metas { chunk_meta.array_hash(state, precision); } - for page in &data.pages { + for page in &self.pages { page.array_hash(state, precision); } } +} - fn array_eq(data: &PcoData, other: &PcoData, precision: Precision) -> bool { - if !data +impl ArrayEq for PcoData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + if !self .unsliced_validity .array_eq(&other.unsliced_validity, precision) - || data.unsliced_n_rows != other.unsliced_n_rows - || data.slice_start != other.slice_start - || data.slice_stop != other.slice_stop - || data.chunk_metas.len() != other.chunk_metas.len() - || data.pages.len() != other.pages.len() + || self.unsliced_n_rows != other.unsliced_n_rows + || self.slice_start != other.slice_start + || self.slice_stop != other.slice_stop + || self.chunk_metas.len() != other.chunk_metas.len() + || self.pages.len() != other.pages.len() { return false; } - for (a, b) in data.chunk_metas.iter().zip(&other.chunk_metas) { + for (a, b) in self.chunk_metas.iter().zip(&other.chunk_metas) { if !a.array_eq(b, precision) { return false; } } - for (a, b) in data.pages.iter().zip(&other.pages) { + for (a, b) in self.pages.iter().zip(&other.pages) { if !a.array_eq(b, precision) { return false; } } true } +} + +impl VTable for Pco { + type ArrayData = PcoData; + + type OperationsVTable = Self; + type ValidityVTable = ValidityVTableFromValiditySliceHelper; + + fn id(&self) -> ArrayId { + Self::ID + } + + fn validate( + &self, + data: &PcoData, + dtype: &DType, + len: usize, + _slots: &[Option], + ) -> VortexResult<()> { + data.validate(dtype, len) + } fn nbuffers(array: ArrayView<'_, Self>) -> usize { array.chunk_metas.len() + array.pages.len() diff --git a/encodings/runend/public-api.lock b/encodings/runend/public-api.lock index d5eabf6eb84..c2d4245c93e 100644 --- a/encodings/runend/public-api.lock +++ b/encodings/runend/public-api.lock @@ -48,10 +48,6 @@ pub type vortex_runend::RunEnd::OperationsVTable = vortex_runend::RunEnd pub type vortex_runend::RunEnd::ValidityVTable = vortex_runend::RunEnd -pub fn vortex_runend::RunEnd::array_eq(data: &vortex_runend::RunEndData, other: &vortex_runend::RunEndData, _precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_runend::RunEnd::array_hash(data: &vortex_runend::RunEndData, state: &mut H, _precision: vortex_array::hash::Precision) - pub fn vortex_runend::RunEnd::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_runend::RunEnd::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -112,7 +108,7 @@ pub fn vortex_runend::RunEndData::into_parts(self, ends: vortex_array::array::er pub fn vortex_runend::RunEndData::new(ends: vortex_array::array::erased::ArrayRef, values: vortex_array::array::erased::ArrayRef) -> Self -pub unsafe fn vortex_runend::RunEndData::new_unchecked(ends: vortex_array::array::erased::ArrayRef, values: vortex_array::array::erased::ArrayRef, offset: usize, _length: usize) -> Self +pub unsafe fn vortex_runend::RunEndData::new_unchecked(_ends: vortex_array::array::erased::ArrayRef, _values: vortex_array::array::erased::ArrayRef, offset: usize, _length: usize) -> Self impl core::clone::Clone for vortex_runend::RunEndData @@ -122,6 +118,14 @@ impl core::fmt::Debug for vortex_runend::RunEndData pub fn vortex_runend::RunEndData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_runend::RunEndData + +pub fn vortex_runend::RunEndData::array_eq(&self, other: &Self, _precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_runend::RunEndData + +pub fn vortex_runend::RunEndData::array_hash(&self, state: &mut H, _precision: vortex_array::hash::Precision) + impl vortex_array::arrow::FromArrowArray<&arrow_array::array::run_array::RunArray> for vortex_runend::RunEndData where ::Native: vortex_array::dtype::ptype::NativePType pub fn vortex_runend::RunEndData::from_arrow(array: &arrow_array::array::run_array::RunArray, nullable: bool) -> vortex_error::VortexResult diff --git a/encodings/runend/src/array.rs b/encodings/runend/src/array.rs index 0e4860c36e7..47b3ae0ee9d 100644 --- a/encodings/runend/src/array.rs +++ b/encodings/runend/src/array.rs @@ -3,9 +3,12 @@ use std::fmt::Debug; use std::hash::Hash; +use std::hash::Hasher; use prost::Message; use vortex_array::Array; +use vortex_array::ArrayEq; +use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -55,6 +58,18 @@ pub struct RunEndMetadata { pub offset: u64, } +impl ArrayHash for RunEndData { + fn array_hash(&self, state: &mut H, _precision: Precision) { + self.offset.hash(state); + } +} + +impl ArrayEq for RunEndData { + fn array_eq(&self, other: &Self, _precision: Precision) -> bool { + self.offset == other.offset + } +} + impl VTable for RunEnd { type ArrayData = RunEndData; @@ -88,14 +103,6 @@ impl VTable for RunEnd { Ok(()) } - fn array_hash(data: &RunEndData, state: &mut H, _precision: Precision) { - data.offset.hash(state); - } - - fn array_eq(data: &RunEndData, other: &RunEndData, _precision: Precision) -> bool { - data.offset == other.offset - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } @@ -196,13 +203,13 @@ pub trait RunEndArrayExt: TypedArrayRef { } fn ends(&self) -> &ArrayRef { - self.slots_ref()[ENDS_SLOT] + self.as_ref().slots()[ENDS_SLOT] .as_ref() .vortex_expect("RunEndArray ends slot") } fn values(&self) -> &ArrayRef { - self.slots_ref()[VALUES_SLOT] + self.as_ref().slots()[VALUES_SLOT] .as_ref() .vortex_expect("RunEndArray values slot") } @@ -447,12 +454,11 @@ impl RunEndData { /// /// See [`RunEnd::try_new_offset_length`] for the preconditions needed to build a new array. pub unsafe fn new_unchecked( - ends: ArrayRef, - values: ArrayRef, + _ends: ArrayRef, + _values: ArrayRef, offset: usize, _length: usize, ) -> Self { - drop((ends, values)); Self { offset } } diff --git a/encodings/sequence/public-api.lock b/encodings/sequence/public-api.lock index 7ac9f28a880..c0f39432ec1 100644 --- a/encodings/sequence/public-api.lock +++ b/encodings/sequence/public-api.lock @@ -26,10 +26,6 @@ pub type vortex_sequence::Sequence::OperationsVTable = vortex_sequence::Sequence pub type vortex_sequence::Sequence::ValidityVTable = vortex_sequence::Sequence -pub fn vortex_sequence::Sequence::array_eq(data: &vortex_sequence::SequenceData, other: &vortex_sequence::SequenceData, _precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_sequence::Sequence::array_hash(data: &vortex_sequence::SequenceData, state: &mut H, _precision: vortex_array::hash::Precision) - pub fn vortex_sequence::Sequence::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_sequence::Sequence::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -106,6 +102,14 @@ impl core::fmt::Debug for vortex_sequence::SequenceData pub fn vortex_sequence::SequenceData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_sequence::SequenceData + +pub fn vortex_sequence::SequenceData::array_eq(&self, other: &Self, _precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_sequence::SequenceData + +pub fn vortex_sequence::SequenceData::array_hash(&self, state: &mut H, _precision: vortex_array::hash::Precision) + pub struct vortex_sequence::SequenceDataParts pub vortex_sequence::SequenceDataParts::base: vortex_array::scalar::typed_view::primitive::pvalue::PValue diff --git a/encodings/sequence/src/array.rs b/encodings/sequence/src/array.rs index ed67129a0cd..d4b1409deac 100644 --- a/encodings/sequence/src/array.rs +++ b/encodings/sequence/src/array.rs @@ -2,10 +2,13 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use std::hash::Hash; +use std::hash::Hasher; use num_traits::cast::FromPrimitive; use prost::Message; use vortex_array::Array; +use vortex_array::ArrayEq; +use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -200,6 +203,19 @@ impl SequenceData { } } +impl ArrayHash for SequenceData { + fn array_hash(&self, state: &mut H, _precision: Precision) { + self.base.hash(state); + self.multiplier.hash(state); + } +} + +impl ArrayEq for SequenceData { + fn array_eq(&self, other: &Self, _precision: Precision) -> bool { + self.base == other.base && self.multiplier == other.multiplier + } +} + impl VTable for Sequence { type ArrayData = SequenceData; @@ -220,15 +236,6 @@ impl VTable for Sequence { SequenceData::validate(data.base, data.multiplier, dtype, len) } - fn array_hash(data: &SequenceData, state: &mut H, _precision: Precision) { - data.base.hash(state); - data.multiplier.hash(state); - } - - fn array_eq(data: &SequenceData, other: &SequenceData, _precision: Precision) -> bool { - data.base == other.base && data.multiplier == other.multiplier - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/encodings/sparse/public-api.lock b/encodings/sparse/public-api.lock index 0e2553c479c..a0be435e45c 100644 --- a/encodings/sparse/public-api.lock +++ b/encodings/sparse/public-api.lock @@ -28,10 +28,6 @@ pub type vortex_sparse::Sparse::OperationsVTable = vortex_sparse::Sparse pub type vortex_sparse::Sparse::ValidityVTable = vortex_sparse::Sparse -pub fn vortex_sparse::Sparse::array_eq(data: &vortex_sparse::SparseData, other: &vortex_sparse::SparseData, precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_sparse::Sparse::array_hash(data: &vortex_sparse::SparseData, state: &mut H, precision: vortex_array::hash::Precision) - pub fn vortex_sparse::Sparse::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_sparse::Sparse::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -114,6 +110,14 @@ impl core::fmt::Debug for vortex_sparse::SparseData pub fn vortex_sparse::SparseData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_sparse::SparseData + +pub fn vortex_sparse::SparseData::array_eq(&self, other: &Self, precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_sparse::SparseData + +pub fn vortex_sparse::SparseData::array_hash(&self, state: &mut H, precision: vortex_array::hash::Precision) + #[repr(C)] pub struct vortex_sparse::SparseMetadata impl core::clone::Clone for vortex_sparse::SparseMetadata diff --git a/encodings/sparse/src/lib.rs b/encodings/sparse/src/lib.rs index 97d4fb7ae28..532dab37656 100644 --- a/encodings/sparse/src/lib.rs +++ b/encodings/sparse/src/lib.rs @@ -3,6 +3,7 @@ use std::fmt::Debug; use std::hash::Hash; +use std::hash::Hasher; use kernel::PARENT_KERNELS; use prost::Message as _; @@ -64,6 +65,19 @@ pub struct SparseMetadata { patches: PatchesMetadata, } +impl ArrayHash for SparseData { + fn array_hash(&self, state: &mut H, precision: Precision) { + self.patches.array_hash(state, precision); + self.fill_value.hash(state); + } +} + +impl ArrayEq for SparseData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + self.patches.array_eq(&other.patches, precision) && self.fill_value == other.fill_value + } +} + impl VTable for Sparse { type ArrayData = SparseData; @@ -84,15 +98,6 @@ impl VTable for Sparse { SparseData::validate(data.patches(), data.fill_scalar(), dtype, len) } - fn array_hash(data: &SparseData, state: &mut H, precision: Precision) { - data.patches.array_hash(state, precision); - data.fill_value.hash(state); - } - - fn array_eq(data: &SparseData, other: &SparseData, precision: Precision) -> bool { - data.patches.array_eq(&other.patches, precision) && data.fill_value == other.fill_value - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 1 } diff --git a/encodings/zigzag/public-api.lock b/encodings/zigzag/public-api.lock index b3e2e83132e..1599b47510c 100644 --- a/encodings/zigzag/public-api.lock +++ b/encodings/zigzag/public-api.lock @@ -24,10 +24,6 @@ pub type vortex_zigzag::ZigZag::OperationsVTable = vortex_zigzag::ZigZag pub type vortex_zigzag::ZigZag::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_zigzag::ZigZag::array_eq(_data: &vortex_zigzag::ZigZagData, _other: &vortex_zigzag::ZigZagData, _precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_zigzag::ZigZag::array_hash(_data: &vortex_zigzag::ZigZagData, _state: &mut H, _precision: vortex_array::hash::Precision) - pub fn vortex_zigzag::ZigZag::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_zigzag::ZigZag::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -94,6 +90,14 @@ impl core::fmt::Debug for vortex_zigzag::ZigZagData pub fn vortex_zigzag::ZigZagData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_zigzag::ZigZagData + +pub fn vortex_zigzag::ZigZagData::array_eq(&self, _other: &Self, _precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_zigzag::ZigZagData + +pub fn vortex_zigzag::ZigZagData::array_hash(&self, _state: &mut H, _precision: vortex_array::hash::Precision) + pub trait vortex_zigzag::ZigZagArrayExt: vortex_array::array::typed::TypedArrayRef pub fn vortex_zigzag::ZigZagArrayExt::encoded(&self) -> &vortex_array::array::erased::ArrayRef diff --git a/encodings/zigzag/src/array.rs b/encodings/zigzag/src/array.rs index 064a1f4f6c1..9c667764477 100644 --- a/encodings/zigzag/src/array.rs +++ b/encodings/zigzag/src/array.rs @@ -1,7 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::hash::Hasher; + use vortex_array::Array; +use vortex_array::ArrayEq; +use vortex_array::ArrayHash; use vortex_array::ArrayId; use vortex_array::ArrayParts; use vortex_array::ArrayRef; @@ -70,13 +74,6 @@ impl VTable for ZigZag { Ok(()) } - fn array_hash(_data: &ZigZagData, _state: &mut H, _precision: Precision) { - } - - fn array_eq(_data: &ZigZagData, _other: &ZigZagData, _precision: Precision) -> bool { - true - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } @@ -149,6 +146,16 @@ impl VTable for ZigZag { } } +impl ArrayHash for ZigZagData { + fn array_hash(&self, _state: &mut H, _precision: Precision) {} +} + +impl ArrayEq for ZigZagData { + fn array_eq(&self, _other: &Self, _precision: Precision) -> bool { + true + } +} + /// The zigzag-encoded values (signed integers mapped to unsigned). pub(super) const ENCODED_SLOT: usize = 0; pub(super) const NUM_SLOTS: usize = 1; @@ -159,7 +166,7 @@ pub struct ZigZagData {} pub trait ZigZagArrayExt: TypedArrayRef { fn encoded(&self) -> &ArrayRef { - self.slots_ref()[ENCODED_SLOT] + self.as_ref().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 df62496a916..e3ce21c73c1 100644 --- a/encodings/zstd/public-api.lock +++ b/encodings/zstd/public-api.lock @@ -32,10 +32,6 @@ pub type vortex_zstd::Zstd::OperationsVTable = vortex_zstd::Zstd pub type vortex_zstd::Zstd::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromValiditySliceHelper -pub fn vortex_zstd::Zstd::array_eq(data: &vortex_zstd::ZstdData, other: &vortex_zstd::ZstdData, precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_zstd::Zstd::array_hash(data: &vortex_zstd::ZstdData, state: &mut H, precision: vortex_array::hash::Precision) - pub fn vortex_zstd::Zstd::buffer(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_zstd::Zstd::buffer_name(array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -134,6 +130,14 @@ impl vortex_array::array::vtable::validity::ValiditySliceHelper for vortex_zstd: pub fn vortex_zstd::ZstdData::unsliced_validity_and_slice(&self) -> (&vortex_array::validity::Validity, usize, usize) +impl vortex_array::hash::ArrayEq for vortex_zstd::ZstdData + +pub fn vortex_zstd::ZstdData::array_eq(&self, other: &Self, precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_zstd::ZstdData + +pub fn vortex_zstd::ZstdData::array_hash(&self, state: &mut H, precision: vortex_array::hash::Precision) + pub struct vortex_zstd::ZstdDataParts pub vortex_zstd::ZstdDataParts::dictionary: core::option::Option diff --git a/encodings/zstd/src/array.rs b/encodings/zstd/src/array.rs index 13c1bb2301b..f2378e52e5f 100644 --- a/encodings/zstd/src/array.rs +++ b/encodings/zstd/src/array.rs @@ -3,6 +3,7 @@ use std::fmt::Debug; use std::hash::Hash; +use std::hash::Hasher; use std::sync::Arc; use itertools::Itertools as _; @@ -81,28 +82,9 @@ type ViewLen = u32; vtable!(Zstd, Zstd, ZstdData); -impl VTable for Zstd { - type ArrayData = ZstdData; - - type OperationsVTable = Self; - type ValidityVTable = ValidityVTableFromValiditySliceHelper; - - fn id(&self) -> ArrayId { - Self::ID - } - - fn validate( - &self, - data: &Self::ArrayData, - dtype: &DType, - len: usize, - _slots: &[Option], - ) -> VortexResult<()> { - data.validate(dtype, len) - } - - fn array_hash(data: &ZstdData, state: &mut H, precision: Precision) { - match &data.dictionary { +impl ArrayHash for ZstdData { + fn array_hash(&self, state: &mut H, precision: Precision) { + match &self.dictionary { Some(dict) => { true.hash(state); dict.array_hash(state, precision); @@ -111,36 +93,59 @@ impl VTable for Zstd { false.hash(state); } } - for frame in &data.frames { + for frame in &self.frames { frame.array_hash(state, precision); } - data.unsliced_validity.array_hash(state, precision); - data.unsliced_n_rows.hash(state); - data.slice_start.hash(state); - data.slice_stop.hash(state); + self.unsliced_validity.array_hash(state, precision); + self.unsliced_n_rows.hash(state); + self.slice_start.hash(state); + self.slice_stop.hash(state); } +} - fn array_eq(data: &ZstdData, other: &ZstdData, precision: Precision) -> bool { - if !match (&data.dictionary, &other.dictionary) { +impl ArrayEq for ZstdData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + if !match (&self.dictionary, &other.dictionary) { (Some(d1), Some(d2)) => d1.array_eq(d2, precision), (None, None) => true, _ => false, } { return false; } - if data.frames.len() != other.frames.len() { + if self.frames.len() != other.frames.len() { return false; } - for (a, b) in data.frames.iter().zip(&other.frames) { + for (a, b) in self.frames.iter().zip(&other.frames) { if !a.array_eq(b, precision) { return false; } } - data.unsliced_validity + self.unsliced_validity .array_eq(&other.unsliced_validity, precision) - && data.unsliced_n_rows == other.unsliced_n_rows - && data.slice_start == other.slice_start - && data.slice_stop == other.slice_stop + && self.unsliced_n_rows == other.unsliced_n_rows + && self.slice_start == other.slice_start + && self.slice_stop == other.slice_stop + } +} + +impl VTable for Zstd { + type ArrayData = ZstdData; + + type OperationsVTable = Self; + type ValidityVTable = ValidityVTableFromValiditySliceHelper; + + fn id(&self) -> ArrayId { + Self::ID + } + + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + _slots: &[Option], + ) -> VortexResult<()> { + data.validate(dtype, len) } fn nbuffers(array: ArrayView<'_, Self>) -> usize { diff --git a/encodings/zstd/src/zstd_buffers.rs b/encodings/zstd/src/zstd_buffers.rs index e012a28df94..f76cf507706 100644 --- a/encodings/zstd/src/zstd_buffers.rs +++ b/encodings/zstd/src/zstd_buffers.rs @@ -3,6 +3,7 @@ use std::fmt::Debug; use std::hash::Hash; +use std::hash::Hasher; use std::sync::Arc; use prost::Message as _; @@ -324,6 +325,33 @@ fn array_id_from_string(s: &str) -> ArrayId { ArrayId::new_arc(Arc::from(s)) } +impl ArrayHash for ZstdBuffersData { + fn array_hash(&self, state: &mut H, precision: Precision) { + self.inner_encoding_id.hash(state); + self.inner_metadata.hash(state); + for buf in &self.compressed_buffers { + buf.array_hash(state, precision); + } + self.uncompressed_sizes.hash(state); + self.buffer_alignments.hash(state); + } +} + +impl ArrayEq for ZstdBuffersData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + self.inner_encoding_id == other.inner_encoding_id + && self.inner_metadata == other.inner_metadata + && self.compressed_buffers.len() == other.compressed_buffers.len() + && self + .compressed_buffers + .iter() + .zip(&other.compressed_buffers) + .all(|(a, b)| a.array_eq(b, precision)) + && self.uncompressed_sizes == other.uncompressed_sizes + && self.buffer_alignments == other.buffer_alignments + } +} + impl VTable for ZstdBuffers { type ArrayData = ZstdBuffersData; type OperationsVTable = Self; @@ -343,33 +371,6 @@ impl VTable for ZstdBuffers { data.validate() } - fn array_hash( - data: &ZstdBuffersData, - state: &mut H, - precision: Precision, - ) { - data.inner_encoding_id.hash(state); - data.inner_metadata.hash(state); - for buf in &data.compressed_buffers { - buf.array_hash(state, precision); - } - data.uncompressed_sizes.hash(state); - data.buffer_alignments.hash(state); - } - - fn array_eq(data: &ZstdBuffersData, other: &ZstdBuffersData, precision: Precision) -> bool { - data.inner_encoding_id == other.inner_encoding_id - && data.inner_metadata == other.inner_metadata - && data.compressed_buffers.len() == other.compressed_buffers.len() - && data - .compressed_buffers - .iter() - .zip(&other.compressed_buffers) - .all(|(a, b)| a.array_eq(b, precision)) - && data.uncompressed_sizes == other.uncompressed_sizes - && data.buffer_alignments == other.buffer_alignments - } - fn nbuffers(array: ArrayView<'_, Self>) -> usize { array.compressed_buffers.len() } diff --git a/vortex-array/public-api.lock b/vortex-array/public-api.lock index 7290576421e..609672555e1 100644 --- a/vortex-array/public-api.lock +++ b/vortex-array/public-api.lock @@ -870,10 +870,6 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(data: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Bool::array_hash(data: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Bool::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -944,15 +940,7 @@ pub struct vortex_array::arrays::bool::BoolData impl vortex_array::arrays::bool::BoolData -pub fn vortex_array::arrays::bool::BoolData::into_bit_buffer(self) -> vortex_buffer::bit::buf::BitBuffer - -pub fn vortex_array::arrays::bool::BoolData::into_parts(self) -> vortex_array::arrays::bool::BoolDataParts - -pub fn vortex_array::arrays::bool::BoolData::is_empty(&self) -> bool - -pub fn vortex_array::arrays::bool::BoolData::len(&self) -> usize - -pub fn vortex_array::arrays::bool::BoolData::to_bit_buffer(&self) -> vortex_buffer::bit::buf::BitBuffer +pub fn vortex_array::arrays::bool::BoolData::into_parts(self, len: usize) -> vortex_array::arrays::bool::BoolDataParts impl core::clone::Clone for vortex_array::arrays::bool::BoolData @@ -962,6 +950,14 @@ impl core::fmt::Debug for vortex_array::arrays::bool::BoolData pub fn vortex_array::arrays::bool::BoolData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::bool::BoolData + +pub fn vortex_array::arrays::bool::BoolData::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::bool::BoolData + +pub fn vortex_array::arrays::bool::BoolData::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + pub struct vortex_array::arrays::bool::BoolDataParts pub vortex_array::arrays::bool::BoolDataParts::bits: vortex_array::buffer::BufferHandle @@ -1018,10 +1014,6 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(_data: &vortex_array::arrays::chunked::ChunkedData, _other: &vortex_array::arrays::chunked::ChunkedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Chunked::array_hash(_data: &vortex_array::arrays::chunked::ChunkedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Chunked::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -1090,7 +1082,7 @@ pub struct vortex_array::arrays::chunked::ChunkedData impl vortex_array::arrays::chunked::ChunkedData -pub unsafe fn vortex_array::arrays::chunked::ChunkedData::new_unchecked(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self +pub unsafe fn vortex_array::arrays::chunked::ChunkedData::new_unchecked(_chunks: alloc::vec::Vec, _dtype: vortex_array::dtype::DType) -> Self pub fn vortex_array::arrays::chunked::ChunkedData::try_new(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> vortex_error::VortexResult @@ -1104,6 +1096,14 @@ impl core::fmt::Debug for vortex_array::arrays::chunked::ChunkedData pub fn vortex_array::arrays::chunked::ChunkedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::chunked::ChunkedData + +pub fn vortex_array::arrays::chunked::ChunkedData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::chunked::ChunkedData + +pub fn vortex_array::arrays::chunked::ChunkedData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + pub trait vortex_array::arrays::chunked::ChunkedArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::chunked::ChunkedArrayExt::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ @@ -1184,10 +1184,6 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(data: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Constant::array_hash(data: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Constant::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -1270,6 +1266,14 @@ impl core::fmt::Debug for vortex_array::arrays::constant::ConstantData pub fn vortex_array::arrays::constant::ConstantData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::constant::ConstantData + +pub fn vortex_array::arrays::constant::ConstantData::array_eq(&self, other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::constant::ConstantData + +pub fn vortex_array::arrays::constant::ConstantData::array_hash(&self, state: &mut H, _precision: vortex_array::Precision) + pub type vortex_array::arrays::constant::ConstantArray = vortex_array::Array pub mod vortex_array::arrays::datetime @@ -1362,10 +1366,6 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(data: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Decimal::array_hash(data: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Decimal::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -1446,8 +1446,6 @@ pub fn vortex_array::arrays::decimal::DecimalData::from_iter>>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self -pub fn vortex_array::arrays::decimal::DecimalData::into_parts(self) -> vortex_array::arrays::decimal::DecimalDataParts - pub fn vortex_array::arrays::decimal::DecimalData::is_empty(&self) -> bool pub fn vortex_array::arrays::decimal::DecimalData::len(&self) -> usize @@ -1480,6 +1478,14 @@ impl core::fmt::Debug for vortex_array::arrays::decimal::DecimalData pub fn vortex_array::arrays::decimal::DecimalData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::decimal::DecimalData + +pub fn vortex_array::arrays::decimal::DecimalData::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::decimal::DecimalData + +pub fn vortex_array::arrays::decimal::DecimalData::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + pub struct vortex_array::arrays::decimal::DecimalDataParts pub vortex_array::arrays::decimal::DecimalDataParts::decimal_dtype: vortex_array::dtype::DecimalDType @@ -1508,24 +1514,44 @@ pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent(& pub trait vortex_array::arrays::decimal::DecimalArrayExt: vortex_array::TypedArrayRef +pub fn vortex_array::arrays::decimal::DecimalArrayExt::buffer(&self) -> vortex_buffer::buffer::Buffer + +pub fn vortex_array::arrays::decimal::DecimalArrayExt::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle + pub fn vortex_array::arrays::decimal::DecimalArrayExt::decimal_dtype(&self) -> vortex_array::dtype::DecimalDType pub fn vortex_array::arrays::decimal::DecimalArrayExt::nullability(&self) -> vortex_array::dtype::Nullability +pub fn vortex_array::arrays::decimal::DecimalArrayExt::precision(&self) -> u8 + +pub fn vortex_array::arrays::decimal::DecimalArrayExt::scale(&self) -> i8 + pub fn vortex_array::arrays::decimal::DecimalArrayExt::validity(&self) -> vortex_array::validity::Validity pub fn vortex_array::arrays::decimal::DecimalArrayExt::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> +pub fn vortex_array::arrays::decimal::DecimalArrayExt::values_type(&self) -> vortex_array::dtype::DecimalType + impl> vortex_array::arrays::decimal::DecimalArrayExt for T +pub fn T::buffer(&self) -> vortex_buffer::buffer::Buffer + +pub fn T::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle + pub fn T::decimal_dtype(&self) -> vortex_array::dtype::DecimalDType pub fn T::nullability(&self) -> vortex_array::dtype::Nullability +pub fn T::precision(&self) -> u8 + +pub fn T::scale(&self) -> i8 + pub fn T::validity(&self) -> vortex_array::validity::Validity pub fn T::validity_child(&self) -> core::option::Option<&vortex_array::ArrayRef> +pub fn T::values_type(&self) -> vortex_array::dtype::DecimalType + pub fn vortex_array::arrays::decimal::narrowed_decimal(decimal_array: vortex_array::arrays::DecimalArray) -> vortex_array::arrays::DecimalArray pub type vortex_array::arrays::decimal::DecimalArray = vortex_array::Array @@ -1562,10 +1588,6 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(_data: &vortex_array::arrays::dict::DictData, _other: &vortex_array::arrays::dict::DictData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::dict::Dict::array_hash(_data: &vortex_array::arrays::dict::DictData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -1664,10 +1686,6 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(_data: &vortex_array::arrays::dict::DictData, _other: &vortex_array::arrays::dict::DictData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::dict::Dict::array_hash(_data: &vortex_array::arrays::dict::DictData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -1754,6 +1772,14 @@ impl core::fmt::Debug for vortex_array::arrays::dict::DictData pub fn vortex_array::arrays::dict::DictData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::dict::DictData + +pub fn vortex_array::arrays::dict::DictData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::dict::DictData + +pub fn vortex_array::arrays::dict::DictData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + pub struct vortex_array::arrays::dict::DictMetadata impl vortex_array::arrays::dict::DictMetadata @@ -1946,10 +1972,6 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(_data: &vortex_array::arrays::extension::ExtensionData, _other: &vortex_array::arrays::extension::ExtensionData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Extension::array_hash(_data: &vortex_array::arrays::extension::ExtensionData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Extension::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -2030,6 +2052,14 @@ impl core::fmt::Debug for vortex_array::arrays::extension::ExtensionData pub fn vortex_array::arrays::extension::ExtensionData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::extension::ExtensionData + +pub fn vortex_array::arrays::extension::ExtensionData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::extension::ExtensionData + +pub fn vortex_array::arrays::extension::ExtensionData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + pub trait vortex_array::arrays::extension::ExtensionArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::extension::ExtensionArrayExt::storage_array(&self) -> &vortex_array::ArrayRef @@ -2070,10 +2100,6 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(data: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Filter::array_hash(data: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Filter::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -2132,6 +2158,14 @@ impl core::fmt::Debug for vortex_array::arrays::filter::FilterData pub fn vortex_array::arrays::filter::FilterData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::filter::FilterData + +pub fn vortex_array::arrays::filter::FilterData::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::filter::FilterData + +pub fn vortex_array::arrays::filter::FilterData::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + pub struct vortex_array::arrays::filter::FilterDataParts pub vortex_array::arrays::filter::FilterDataParts::mask: vortex_mask::Mask @@ -2256,10 +2290,6 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::FixedSizeList::array_hash(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::FixedSizeList::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -2330,6 +2360,14 @@ impl core::fmt::Debug for vortex_array::arrays::fixed_size_list::FixedSizeListDa pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::fixed_size_list::FixedSizeListData + +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::fixed_size_list::FixedSizeListData + +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + pub struct vortex_array::arrays::fixed_size_list::FixedSizeListDataParts pub vortex_array::arrays::fixed_size_list::FixedSizeListDataParts::dtype: vortex_array::dtype::DType @@ -2394,10 +2432,6 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(_data: &vortex_array::arrays::list::ListData, _other: &vortex_array::arrays::list::ListData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::List::array_hash(_data: &vortex_array::arrays::list::ListData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::List::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -2460,7 +2494,7 @@ impl vortex_array::arrays::list::ListData pub fn vortex_array::arrays::list::ListData::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self -pub unsafe fn vortex_array::arrays::list::ListData::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self +pub unsafe fn vortex_array::arrays::list::ListData::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, _validity: vortex_array::validity::Validity) -> Self pub fn vortex_array::arrays::list::ListData::validate(elements: &vortex_array::ArrayRef, offsets: &vortex_array::ArrayRef, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> @@ -2476,6 +2510,14 @@ impl core::fmt::Debug for vortex_array::arrays::list::ListData pub fn vortex_array::arrays::list::ListData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::list::ListData + +pub fn vortex_array::arrays::list::ListData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::list::ListData + +pub fn vortex_array::arrays::list::ListData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + pub struct vortex_array::arrays::list::ListDataParts pub vortex_array::arrays::list::ListDataParts::dtype: vortex_array::dtype::DType @@ -2564,10 +2606,6 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(data: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::ListView::array_hash(data: &vortex_array::arrays::listview::ListViewData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::ListView::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -2644,6 +2682,14 @@ impl core::fmt::Debug for vortex_array::arrays::listview::ListViewData pub fn vortex_array::arrays::listview::ListViewData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::listview::ListViewData + +pub fn vortex_array::arrays::listview::ListViewData::array_eq(&self, other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::listview::ListViewData + +pub fn vortex_array::arrays::listview::ListViewData::array_hash(&self, state: &mut H, _precision: vortex_array::Precision) + pub struct vortex_array::arrays::listview::ListViewDataParts pub vortex_array::arrays::listview::ListViewDataParts::elements: vortex_array::ArrayRef @@ -2734,10 +2780,6 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(_data: &vortex_array::arrays::masked::MaskedData, _other: &vortex_array::arrays::masked::MaskedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Masked::array_hash(_data: &vortex_array::arrays::masked::MaskedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Masked::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -2800,6 +2842,14 @@ impl core::fmt::Debug for vortex_array::arrays::masked::MaskedData pub fn vortex_array::arrays::masked::MaskedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::masked::MaskedData + +pub fn vortex_array::arrays::masked::MaskedData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::masked::MaskedData + +pub fn vortex_array::arrays::masked::MaskedData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + pub trait vortex_array::arrays::masked::MaskedArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::masked::MaskedArrayExt::child(&self) -> &vortex_array::ArrayRef @@ -2858,10 +2908,6 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_data: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::null::Null::array_hash(_data: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::null::Null::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -2936,6 +2982,14 @@ impl core::fmt::Debug for vortex_array::arrays::null::NullData pub fn vortex_array::arrays::null::NullData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::null::NullData + +pub fn vortex_array::arrays::null::NullData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::null::NullData + +pub fn vortex_array::arrays::null::NullData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + pub type vortex_array::arrays::null::NullArray = vortex_array::Array pub mod vortex_array::arrays::patched @@ -2964,10 +3018,6 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(data: &vortex_array::arrays::patched::PatchedData, other: &vortex_array::arrays::patched::PatchedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::patched::Patched::array_hash(data: &vortex_array::arrays::patched::PatchedData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::patched::Patched::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -3030,6 +3080,14 @@ impl core::fmt::Debug for vortex_array::arrays::patched::PatchedData pub fn vortex_array::arrays::patched::PatchedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::patched::PatchedData + +pub fn vortex_array::arrays::patched::PatchedData::array_eq(&self, other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::patched::PatchedData + +pub fn vortex_array::arrays::patched::PatchedData::array_hash(&self, state: &mut H, _precision: vortex_array::Precision) + pub struct vortex_array::arrays::patched::PatchedMetadata impl core::clone::Clone for vortex_array::arrays::patched::PatchedMetadata @@ -3184,10 +3242,6 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(data: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Primitive::array_hash(data: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Primitive::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -3260,13 +3314,11 @@ impl vortex_array::arrays::primitive::PrimitiveData pub fn vortex_array::arrays::primitive::PrimitiveData::as_slice(&self) -> &[T] -pub fn vortex_array::arrays::primitive::PrimitiveData::reinterpret_cast(&self, ptype: vortex_array::dtype::PType) -> Self - impl vortex_array::arrays::primitive::PrimitiveData pub fn vortex_array::arrays::primitive::PrimitiveData::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::primitive::PrimitiveData::from_buffer_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::primitive::PrimitiveData::from_buffer_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, _validity: vortex_array::validity::Validity) -> Self pub fn vortex_array::arrays::primitive::PrimitiveData::from_byte_buffer(buffer: vortex_buffer::ByteBuffer, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self @@ -3280,10 +3332,6 @@ pub fn vortex_array::arrays::primitive::PrimitiveData::is_empty(&self) -> bool pub fn vortex_array::arrays::primitive::PrimitiveData::len(&self) -> usize -pub fn vortex_array::arrays::primitive::PrimitiveData::map_each(self, f: F) -> Self where T: vortex_array::dtype::NativePType, R: vortex_array::dtype::NativePType, F: core::ops::function::FnMut(T) -> R - -pub fn vortex_array::arrays::primitive::PrimitiveData::map_each_with_validity(self, _f: F) -> vortex_error::VortexResult where T: vortex_array::dtype::NativePType, R: vortex_array::dtype::NativePType, F: core::ops::function::FnMut((T, bool)) -> R - pub fn vortex_array::arrays::primitive::PrimitiveData::ptype(&self) -> vortex_array::dtype::PType pub fn vortex_array::arrays::primitive::PrimitiveData::to_buffer(&self) -> vortex_buffer::buffer::Buffer @@ -3296,7 +3344,7 @@ pub fn vortex_array::arrays::primitive::PrimitiveData::empty(buffer: impl core::convert::Into>, validity: vortex_array::validity::Validity) -> Self -pub unsafe fn vortex_array::arrays::primitive::PrimitiveData::new_unchecked(buffer: vortex_buffer::buffer::Buffer, validity: vortex_array::validity::Validity) -> Self +pub unsafe fn vortex_array::arrays::primitive::PrimitiveData::new_unchecked(buffer: vortex_buffer::buffer::Buffer, _validity: vortex_array::validity::Validity) -> Self pub unsafe fn vortex_array::arrays::primitive::PrimitiveData::new_unchecked_from_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, _validity: vortex_array::validity::Validity) -> Self @@ -3304,10 +3352,6 @@ pub fn vortex_array::arrays::primitive::PrimitiveData::try_new(buffer: &vortex_buffer::buffer::Buffer, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -impl vortex_array::arrays::primitive::PrimitiveData - -pub fn vortex_array::arrays::primitive::PrimitiveData::into_parts(self) -> vortex_array::arrays::primitive::PrimitiveDataParts - impl core::clone::Clone for vortex_array::arrays::primitive::PrimitiveData pub fn vortex_array::arrays::primitive::PrimitiveData::clone(&self) -> vortex_array::arrays::primitive::PrimitiveData @@ -3316,6 +3360,14 @@ impl core::fmt::Debug for vortex_array::arrays::primitive::PrimitiveData pub fn vortex_array::arrays::primitive::PrimitiveData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::primitive::PrimitiveData + +pub fn vortex_array::arrays::primitive::PrimitiveData::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::primitive::PrimitiveData + +pub fn vortex_array::arrays::primitive::PrimitiveData::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + pub struct vortex_array::arrays::primitive::PrimitiveDataParts pub vortex_array::arrays::primitive::PrimitiveDataParts::buffer: vortex_array::buffer::BufferHandle @@ -3342,6 +3394,8 @@ pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_pare pub trait vortex_array::arrays::primitive::PrimitiveArrayExt: vortex_array::TypedArrayRef +pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle + pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::nullability(&self) -> vortex_array::dtype::Nullability pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::ptype(&self) -> vortex_array::dtype::PType @@ -3354,6 +3408,8 @@ pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::validity_mask(&self) impl> vortex_array::arrays::primitive::PrimitiveArrayExt for T +pub fn T::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle + pub fn T::nullability(&self) -> vortex_array::dtype::Nullability pub fn T::ptype(&self) -> vortex_array::dtype::PType @@ -3432,6 +3488,14 @@ impl core::fmt::Debug for vortex_array::arrays::scalar_fn::ScalarFnData pub fn vortex_array::arrays::scalar_fn::ScalarFnData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::scalar_fn::ScalarFnData + +pub fn vortex_array::arrays::scalar_fn::ScalarFnData::array_eq(&self, other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::scalar_fn::ScalarFnData + +pub fn vortex_array::arrays::scalar_fn::ScalarFnData::array_hash(&self, state: &mut H, _precision: vortex_array::Precision) + pub struct vortex_array::arrays::scalar_fn::ScalarFnVTable impl core::clone::Clone for vortex_array::arrays::scalar_fn::ScalarFnVTable @@ -3456,10 +3520,6 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(data: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(data: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -3536,10 +3596,6 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(_data: &vortex_array::arrays::shared::SharedData, _other: &vortex_array::arrays::shared::SharedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Shared::array_hash(_data: &vortex_array::arrays::shared::SharedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Shared::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -3594,6 +3650,14 @@ impl core::fmt::Debug for vortex_array::arrays::shared::SharedData pub fn vortex_array::arrays::shared::SharedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::shared::SharedData + +pub fn vortex_array::arrays::shared::SharedData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::shared::SharedData + +pub fn vortex_array::arrays::shared::SharedData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + pub trait vortex_array::arrays::shared::SharedArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::shared::SharedArrayExt::current_array_ref(&self) -> &vortex_array::ArrayRef @@ -3646,10 +3710,6 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(data: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::slice::Slice::array_hash(data: &vortex_array::arrays::slice::SliceData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::slice::Slice::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -3712,6 +3772,14 @@ impl core::fmt::Debug for vortex_array::arrays::slice::SliceData pub fn vortex_array::arrays::slice::SliceData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::slice::SliceData + +pub fn vortex_array::arrays::slice::SliceData::array_eq(&self, other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::slice::SliceData + +pub fn vortex_array::arrays::slice::SliceData::array_hash(&self, state: &mut H, _precision: vortex_array::Precision) + pub struct vortex_array::arrays::slice::SliceDataParts pub vortex_array::arrays::slice::SliceDataParts::range: core::ops::range::Range @@ -3870,10 +3938,6 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(_data: &vortex_array::arrays::struct_::StructData, _other: &vortex_array::arrays::struct_::StructData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Struct::array_hash(_data: &vortex_array::arrays::struct_::StructData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Struct::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -3952,6 +4016,14 @@ impl core::fmt::Debug for vortex_array::arrays::struct_::StructData pub fn vortex_array::arrays::struct_::StructData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::struct_::StructData + +pub fn vortex_array::arrays::struct_::StructData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::struct_::StructData + +pub fn vortex_array::arrays::struct_::StructData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + pub struct vortex_array::arrays::struct_::StructDataParts pub vortex_array::arrays::struct_::StructDataParts::fields: alloc::sync::Arc<[vortex_array::ArrayRef]> @@ -4062,10 +4134,6 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(data: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::VarBin::array_hash(data: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::VarBin::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -4156,6 +4224,14 @@ impl core::fmt::Debug for vortex_array::arrays::varbin::VarBinData pub fn vortex_array::arrays::varbin::VarBinData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::varbin::VarBinData + +pub fn vortex_array::arrays::varbin::VarBinData::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::varbin::VarBinData + +pub fn vortex_array::arrays::varbin::VarBinData::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + pub struct vortex_array::arrays::varbin::VarBinDataParts pub vortex_array::arrays::varbin::VarBinDataParts::bytes: vortex_array::buffer::BufferHandle @@ -4426,10 +4502,6 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(data: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::VarBinView::array_hash(data: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::VarBinView::buffer_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -4544,6 +4616,14 @@ impl core::iter::traits::collect::FromIterator>>>(iter: T) -> Self +impl vortex_array::ArrayEq for vortex_array::arrays::varbinview::VarBinViewData + +pub fn vortex_array::arrays::varbinview::VarBinViewData::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::varbinview::VarBinViewData + +pub fn vortex_array::arrays::varbinview::VarBinViewData::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::varbinview::VarBinViewData pub fn vortex_array::arrays::varbinview::VarBinViewData::from_iter>>(iter: T) -> Self @@ -4610,10 +4690,6 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(_data: &vortex_array::arrays::variant::VariantData, _other: &vortex_array::arrays::variant::VariantData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Variant::array_hash(_data: &vortex_array::arrays::variant::VariantData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Variant::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -4660,6 +4736,14 @@ impl core::fmt::Debug for vortex_array::arrays::variant::VariantData pub fn vortex_array::arrays::variant::VariantData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::ArrayEq for vortex_array::arrays::variant::VariantData + +pub fn vortex_array::arrays::variant::VariantData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::arrays::variant::VariantData + +pub fn vortex_array::arrays::variant::VariantData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + pub trait vortex_array::arrays::variant::VariantArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::variant::VariantArrayExt::child(&self) -> &vortex_array::ArrayRef @@ -4698,10 +4782,6 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(data: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Bool::array_hash(data: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Bool::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -4796,10 +4876,6 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(_data: &vortex_array::arrays::chunked::ChunkedData, _other: &vortex_array::arrays::chunked::ChunkedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Chunked::array_hash(_data: &vortex_array::arrays::chunked::ChunkedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Chunked::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -4896,10 +4972,6 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(data: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Constant::array_hash(data: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Constant::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -4992,10 +5064,6 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(data: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Decimal::array_hash(data: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Decimal::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -5090,10 +5158,6 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(_data: &vortex_array::arrays::dict::DictData, _other: &vortex_array::arrays::dict::DictData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::dict::Dict::array_hash(_data: &vortex_array::arrays::dict::DictData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -5190,10 +5254,6 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(_data: &vortex_array::arrays::extension::ExtensionData, _other: &vortex_array::arrays::extension::ExtensionData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Extension::array_hash(_data: &vortex_array::arrays::extension::ExtensionData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Extension::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -5282,10 +5342,6 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(data: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Filter::array_hash(data: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Filter::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -5350,10 +5406,6 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::FixedSizeList::array_hash(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::FixedSizeList::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -5434,10 +5486,6 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(_data: &vortex_array::arrays::list::ListData, _other: &vortex_array::arrays::list::ListData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::List::array_hash(_data: &vortex_array::arrays::list::ListData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::List::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -5522,10 +5570,6 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(data: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::ListView::array_hash(data: &vortex_array::arrays::listview::ListViewData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::ListView::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -5606,10 +5650,6 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(_data: &vortex_array::arrays::masked::MaskedData, _other: &vortex_array::arrays::masked::MaskedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Masked::array_hash(_data: &vortex_array::arrays::masked::MaskedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Masked::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -5694,10 +5734,6 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_data: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::null::Null::array_hash(_data: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::null::Null::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -5778,10 +5814,6 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(data: &vortex_array::arrays::patched::PatchedData, other: &vortex_array::arrays::patched::PatchedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::patched::Patched::array_hash(data: &vortex_array::arrays::patched::PatchedData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::patched::Patched::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -5862,10 +5894,6 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(data: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Primitive::array_hash(data: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Primitive::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -5956,10 +5984,6 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(data: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(data: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -6024,10 +6048,6 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(_data: &vortex_array::arrays::shared::SharedData, _other: &vortex_array::arrays::shared::SharedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Shared::array_hash(_data: &vortex_array::arrays::shared::SharedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Shared::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -6092,10 +6112,6 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(data: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::slice::Slice::array_hash(data: &vortex_array::arrays::slice::SliceData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::slice::Slice::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -6164,10 +6180,6 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(_data: &vortex_array::arrays::struct_::StructData, _other: &vortex_array::arrays::struct_::StructData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Struct::array_hash(_data: &vortex_array::arrays::struct_::StructData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Struct::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -6256,10 +6268,6 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(data: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::VarBin::array_hash(data: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::VarBin::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -6348,10 +6356,6 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(data: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::VarBinView::array_hash(data: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::VarBinView::buffer_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -6436,10 +6440,6 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(_data: &vortex_array::arrays::variant::VariantData, _other: &vortex_array::arrays::variant::VariantData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Variant::array_hash(_data: &vortex_array::arrays::variant::VariantData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Variant::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -18656,7 +18656,7 @@ pub fn vortex_array::ValidityVTableFromValiditySliceHelper::validity(array: vort pub trait vortex_array::vtable::ArrayVTable: 'static + core::clone::Clone + core::marker::Sized + core::marker::Send + core::marker::Sync + core::fmt::Debug -pub type vortex_array::vtable::ArrayVTable::ArrayData: 'static + core::marker::Send + core::marker::Sync + core::clone::Clone + core::fmt::Debug +pub type vortex_array::vtable::ArrayVTable::ArrayData: 'static + core::marker::Send + core::marker::Sync + core::clone::Clone + core::fmt::Debug + vortex_array::ArrayHash + vortex_array::ArrayEq pub type vortex_array::vtable::ArrayVTable::OperationsVTable: vortex_array::OperationsVTable @@ -18664,10 +18664,6 @@ pub type vortex_array::vtable::ArrayVTable::ValidityVTable: vortex_array::Validi pub fn vortex_array::vtable::ArrayVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::vtable::ArrayVTable::array_eq(data: &Self::ArrayData, other: &Self::ArrayData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::vtable::ArrayVTable::array_hash(data: &Self::ArrayData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::vtable::ArrayVTable::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::vtable::ArrayVTable::buffer_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -18710,10 +18706,6 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(data: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Bool::array_hash(data: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Bool::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -18756,10 +18748,6 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(_data: &vortex_array::arrays::chunked::ChunkedData, _other: &vortex_array::arrays::chunked::ChunkedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Chunked::array_hash(_data: &vortex_array::arrays::chunked::ChunkedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Chunked::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -18802,10 +18790,6 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(data: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Constant::array_hash(data: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Constant::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -18848,10 +18832,6 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(data: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Decimal::array_hash(data: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Decimal::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -18894,10 +18874,6 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(_data: &vortex_array::arrays::extension::ExtensionData, _other: &vortex_array::arrays::extension::ExtensionData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Extension::array_hash(_data: &vortex_array::arrays::extension::ExtensionData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Extension::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -18940,10 +18916,6 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(data: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Filter::array_hash(data: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Filter::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -18986,10 +18958,6 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::FixedSizeList::array_hash(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::FixedSizeList::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -19032,10 +19000,6 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(_data: &vortex_array::arrays::list::ListData, _other: &vortex_array::arrays::list::ListData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::List::array_hash(_data: &vortex_array::arrays::list::ListData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::List::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -19078,10 +19042,6 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(data: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::ListView::array_hash(data: &vortex_array::arrays::listview::ListViewData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::ListView::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -19124,10 +19084,6 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(_data: &vortex_array::arrays::masked::MaskedData, _other: &vortex_array::arrays::masked::MaskedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Masked::array_hash(_data: &vortex_array::arrays::masked::MaskedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Masked::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -19170,10 +19126,6 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(data: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Primitive::array_hash(data: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Primitive::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -19216,10 +19168,6 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(_data: &vortex_array::arrays::shared::SharedData, _other: &vortex_array::arrays::shared::SharedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Shared::array_hash(_data: &vortex_array::arrays::shared::SharedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Shared::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -19262,10 +19210,6 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(_data: &vortex_array::arrays::struct_::StructData, _other: &vortex_array::arrays::struct_::StructData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Struct::array_hash(_data: &vortex_array::arrays::struct_::StructData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Struct::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -19308,10 +19252,6 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(data: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::VarBin::array_hash(data: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::VarBin::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -19354,10 +19294,6 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(data: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::VarBinView::array_hash(data: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::VarBinView::buffer_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -19400,10 +19336,6 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(_data: &vortex_array::arrays::variant::VariantData, _other: &vortex_array::arrays::variant::VariantData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Variant::array_hash(_data: &vortex_array::arrays::variant::VariantData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Variant::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -19446,10 +19378,6 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(_data: &vortex_array::arrays::dict::DictData, _other: &vortex_array::arrays::dict::DictData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::dict::Dict::array_hash(_data: &vortex_array::arrays::dict::DictData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -19492,10 +19420,6 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_data: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::null::Null::array_hash(_data: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::null::Null::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -19538,10 +19462,6 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(data: &vortex_array::arrays::patched::PatchedData, other: &vortex_array::arrays::patched::PatchedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::patched::Patched::array_hash(data: &vortex_array::arrays::patched::PatchedData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::patched::Patched::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -19584,10 +19504,6 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(data: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(data: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -19630,10 +19546,6 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(data: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::slice::Slice::array_hash(data: &vortex_array::arrays::slice::SliceData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::slice::Slice::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -19792,7 +19704,7 @@ pub fn vortex_array::NotSupported::scalar_at(array: vortex_array::ArrayView<'_, pub trait vortex_array::vtable::VTable: 'static + core::clone::Clone + core::marker::Sized + core::marker::Send + core::marker::Sync + core::fmt::Debug -pub type vortex_array::vtable::VTable::ArrayData: 'static + core::marker::Send + core::marker::Sync + core::clone::Clone + core::fmt::Debug +pub type vortex_array::vtable::VTable::ArrayData: 'static + core::marker::Send + core::marker::Sync + core::clone::Clone + core::fmt::Debug + vortex_array::ArrayHash + vortex_array::ArrayEq pub type vortex_array::vtable::VTable::OperationsVTable: vortex_array::OperationsVTable @@ -19800,10 +19712,6 @@ pub type vortex_array::vtable::VTable::ValidityVTable: vortex_array::ValidityVTa pub fn vortex_array::vtable::VTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::vtable::VTable::array_eq(data: &Self::ArrayData, other: &Self::ArrayData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::vtable::VTable::array_hash(data: &Self::ArrayData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::vtable::VTable::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::vtable::VTable::buffer_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -19846,10 +19754,6 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(data: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Bool::array_hash(data: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Bool::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -19892,10 +19796,6 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(_data: &vortex_array::arrays::chunked::ChunkedData, _other: &vortex_array::arrays::chunked::ChunkedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Chunked::array_hash(_data: &vortex_array::arrays::chunked::ChunkedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Chunked::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -19938,10 +19838,6 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(data: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Constant::array_hash(data: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Constant::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -19984,10 +19880,6 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(data: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Decimal::array_hash(data: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Decimal::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -20030,10 +19922,6 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(_data: &vortex_array::arrays::extension::ExtensionData, _other: &vortex_array::arrays::extension::ExtensionData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Extension::array_hash(_data: &vortex_array::arrays::extension::ExtensionData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Extension::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -20076,10 +19964,6 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(data: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Filter::array_hash(data: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Filter::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -20122,10 +20006,6 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::FixedSizeList::array_hash(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::FixedSizeList::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -20168,10 +20048,6 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(_data: &vortex_array::arrays::list::ListData, _other: &vortex_array::arrays::list::ListData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::List::array_hash(_data: &vortex_array::arrays::list::ListData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::List::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -20214,10 +20090,6 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(data: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::ListView::array_hash(data: &vortex_array::arrays::listview::ListViewData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::ListView::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -20260,10 +20132,6 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(_data: &vortex_array::arrays::masked::MaskedData, _other: &vortex_array::arrays::masked::MaskedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Masked::array_hash(_data: &vortex_array::arrays::masked::MaskedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Masked::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -20306,10 +20174,6 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(data: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Primitive::array_hash(data: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Primitive::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -20352,10 +20216,6 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(_data: &vortex_array::arrays::shared::SharedData, _other: &vortex_array::arrays::shared::SharedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Shared::array_hash(_data: &vortex_array::arrays::shared::SharedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Shared::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -20398,10 +20258,6 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(_data: &vortex_array::arrays::struct_::StructData, _other: &vortex_array::arrays::struct_::StructData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Struct::array_hash(_data: &vortex_array::arrays::struct_::StructData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Struct::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -20444,10 +20300,6 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(data: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::VarBin::array_hash(data: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::VarBin::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -20490,10 +20342,6 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(data: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::VarBinView::array_hash(data: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::VarBinView::buffer_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -20536,10 +20384,6 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(_data: &vortex_array::arrays::variant::VariantData, _other: &vortex_array::arrays::variant::VariantData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Variant::array_hash(_data: &vortex_array::arrays::variant::VariantData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Variant::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -20582,10 +20426,6 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(_data: &vortex_array::arrays::dict::DictData, _other: &vortex_array::arrays::dict::DictData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::dict::Dict::array_hash(_data: &vortex_array::arrays::dict::DictData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -20628,10 +20468,6 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_data: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::null::Null::array_hash(_data: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::null::Null::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -20674,10 +20510,6 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(data: &vortex_array::arrays::patched::PatchedData, other: &vortex_array::arrays::patched::PatchedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::patched::Patched::array_hash(data: &vortex_array::arrays::patched::PatchedData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::patched::Patched::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -20720,10 +20552,6 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(data: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(data: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -20766,10 +20594,6 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(data: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::slice::Slice::array_hash(data: &vortex_array::arrays::slice::SliceData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::slice::Slice::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -21194,6 +21018,8 @@ pub fn vortex_array::Array::new_handle(handle: vorte pub unsafe fn vortex_array::Array::new_unchecked(bits: vortex_buffer::bit::buf::BitBuffer, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::Array::to_bit_buffer(&self) -> vortex_buffer::bit::buf::BitBuffer + pub fn vortex_array::Array::to_mask(&self) -> vortex_mask::Mask pub fn vortex_array::Array::to_mask_fill_null_false(&self) -> vortex_mask::Mask @@ -21770,8 +21596,6 @@ pub fn vortex_array::Array::into_array(self) -> vortex_array::ArrayRef impl vortex_array::TypedArrayRef for vortex_array::Array -pub fn vortex_array::Array::slots_ref(&self) -> &[core::option::Option] - pub struct vortex_array::ArrayParts pub vortex_array::ArrayParts::data: ::ArrayData @@ -22256,6 +22080,10 @@ pub fn vortex_array::ArrayRef::from(value: vortex_array::Array) -> vortex_arr pub struct vortex_array::ArrayView<'a, V: vortex_array::VTable> +impl vortex_array::ArrayView<'_, vortex_array::arrays::Bool> + +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Bool>::to_bit_buffer(&self) -> vortex_buffer::bit::buf::BitBuffer + impl vortex_array::ArrayView<'_, vortex_array::arrays::Chunked> pub fn vortex_array::ArrayView<'_, vortex_array::arrays::Chunked>::chunk(&self, idx: usize) -> &vortex_array::ArrayRef @@ -22412,6 +22240,8 @@ pub fn vortex_array::ArrayView<'_, vortex_array::arrays::scalar_fn::ScalarFnVTab pub fn vortex_array::ArrayView<'_, vortex_array::arrays::scalar_fn::ScalarFnVTable>::nchildren(&self) -> usize +pub fn vortex_array::ArrayView<'_, vortex_array::arrays::scalar_fn::ScalarFnVTable>::scalar_fn(&self) -> &vortex_array::scalar_fn::ScalarFnRef + impl<'a, V: vortex_array::VTable> vortex_array::ArrayView<'a, V> pub fn vortex_array::ArrayView<'a, V>::array(&self) -> &'a vortex_array::ArrayRef @@ -22456,8 +22286,6 @@ pub fn vortex_array::ArrayView<'_, V>::deref(&self) -> & vortex_array::TypedArrayRef for vortex_array::ArrayView<'_, V> -pub fn vortex_array::ArrayView<'_, V>::slots_ref(&self) -> &[core::option::Option] - pub struct vortex_array::CanonicalValidity(pub vortex_array::Canonical) impl vortex_array::Executable for vortex_array::CanonicalValidity @@ -22638,6 +22466,90 @@ impl vortex_array::ArrayEq for vortex_array::ArrayRef pub fn vortex_array::ArrayRef::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool +impl vortex_array::ArrayEq for vortex_array::arrays::bool::BoolData + +pub fn vortex_array::arrays::bool::BoolData::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::chunked::ChunkedData + +pub fn vortex_array::arrays::chunked::ChunkedData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::constant::ConstantData + +pub fn vortex_array::arrays::constant::ConstantData::array_eq(&self, other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::decimal::DecimalData + +pub fn vortex_array::arrays::decimal::DecimalData::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::dict::DictData + +pub fn vortex_array::arrays::dict::DictData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::extension::ExtensionData + +pub fn vortex_array::arrays::extension::ExtensionData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::filter::FilterData + +pub fn vortex_array::arrays::filter::FilterData::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::fixed_size_list::FixedSizeListData + +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::list::ListData + +pub fn vortex_array::arrays::list::ListData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::listview::ListViewData + +pub fn vortex_array::arrays::listview::ListViewData::array_eq(&self, other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::masked::MaskedData + +pub fn vortex_array::arrays::masked::MaskedData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::null::NullData + +pub fn vortex_array::arrays::null::NullData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::patched::PatchedData + +pub fn vortex_array::arrays::patched::PatchedData::array_eq(&self, other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::primitive::PrimitiveData + +pub fn vortex_array::arrays::primitive::PrimitiveData::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::scalar_fn::ScalarFnData + +pub fn vortex_array::arrays::scalar_fn::ScalarFnData::array_eq(&self, other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::shared::SharedData + +pub fn vortex_array::arrays::shared::SharedData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::slice::SliceData + +pub fn vortex_array::arrays::slice::SliceData::array_eq(&self, other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::struct_::StructData + +pub fn vortex_array::arrays::struct_::StructData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::varbin::VarBinData + +pub fn vortex_array::arrays::varbin::VarBinData::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::varbinview::VarBinViewData + +pub fn vortex_array::arrays::varbinview::VarBinViewData::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayEq for vortex_array::arrays::variant::VariantData + +pub fn vortex_array::arrays::variant::VariantData::array_eq(&self, _other: &Self, _precision: vortex_array::Precision) -> bool + impl vortex_array::ArrayEq for vortex_array::buffer::BufferHandle pub fn vortex_array::buffer::BufferHandle::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool @@ -22674,6 +22586,90 @@ impl vortex_array::ArrayHash for vortex_array::ArrayRef pub fn vortex_array::ArrayRef::array_hash(&self, state: &mut H, precision: vortex_array::Precision) +impl vortex_array::ArrayHash for vortex_array::arrays::bool::BoolData + +pub fn vortex_array::arrays::bool::BoolData::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::chunked::ChunkedData + +pub fn vortex_array::arrays::chunked::ChunkedData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::constant::ConstantData + +pub fn vortex_array::arrays::constant::ConstantData::array_hash(&self, state: &mut H, _precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::decimal::DecimalData + +pub fn vortex_array::arrays::decimal::DecimalData::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::dict::DictData + +pub fn vortex_array::arrays::dict::DictData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::extension::ExtensionData + +pub fn vortex_array::arrays::extension::ExtensionData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::filter::FilterData + +pub fn vortex_array::arrays::filter::FilterData::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::fixed_size_list::FixedSizeListData + +pub fn vortex_array::arrays::fixed_size_list::FixedSizeListData::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::list::ListData + +pub fn vortex_array::arrays::list::ListData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::listview::ListViewData + +pub fn vortex_array::arrays::listview::ListViewData::array_hash(&self, state: &mut H, _precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::masked::MaskedData + +pub fn vortex_array::arrays::masked::MaskedData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::null::NullData + +pub fn vortex_array::arrays::null::NullData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::patched::PatchedData + +pub fn vortex_array::arrays::patched::PatchedData::array_hash(&self, state: &mut H, _precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::primitive::PrimitiveData + +pub fn vortex_array::arrays::primitive::PrimitiveData::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::scalar_fn::ScalarFnData + +pub fn vortex_array::arrays::scalar_fn::ScalarFnData::array_hash(&self, state: &mut H, _precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::shared::SharedData + +pub fn vortex_array::arrays::shared::SharedData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::slice::SliceData + +pub fn vortex_array::arrays::slice::SliceData::array_hash(&self, state: &mut H, _precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::struct_::StructData + +pub fn vortex_array::arrays::struct_::StructData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::varbin::VarBinData + +pub fn vortex_array::arrays::varbin::VarBinData::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::varbinview::VarBinViewData + +pub fn vortex_array::arrays::varbinview::VarBinViewData::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + +impl vortex_array::ArrayHash for vortex_array::arrays::variant::VariantData + +pub fn vortex_array::arrays::variant::VariantData::array_hash(&self, _state: &mut H, _precision: vortex_array::Precision) + impl vortex_array::ArrayHash for vortex_array::buffer::BufferHandle pub fn vortex_array::buffer::BufferHandle::array_hash(&self, state: &mut H, precision: vortex_array::Precision) @@ -22704,7 +22700,7 @@ pub fn core::option::Option::array_hash(&self, state: pub trait vortex_array::ArrayVTable: 'static + core::clone::Clone + core::marker::Sized + core::marker::Send + core::marker::Sync + core::fmt::Debug -pub type vortex_array::ArrayVTable::ArrayData: 'static + core::marker::Send + core::marker::Sync + core::clone::Clone + core::fmt::Debug +pub type vortex_array::ArrayVTable::ArrayData: 'static + core::marker::Send + core::marker::Sync + core::clone::Clone + core::fmt::Debug + vortex_array::ArrayHash + vortex_array::ArrayEq pub type vortex_array::ArrayVTable::OperationsVTable: vortex_array::OperationsVTable @@ -22712,10 +22708,6 @@ pub type vortex_array::ArrayVTable::ValidityVTable: vortex_array::ValidityVTable pub fn vortex_array::ArrayVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::ArrayVTable::array_eq(data: &Self::ArrayData, other: &Self::ArrayData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::ArrayVTable::array_hash(data: &Self::ArrayData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::ArrayVTable::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::ArrayVTable::buffer_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -22758,10 +22750,6 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(data: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Bool::array_hash(data: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Bool::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -22804,10 +22792,6 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(_data: &vortex_array::arrays::chunked::ChunkedData, _other: &vortex_array::arrays::chunked::ChunkedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Chunked::array_hash(_data: &vortex_array::arrays::chunked::ChunkedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Chunked::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -22850,10 +22834,6 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(data: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Constant::array_hash(data: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Constant::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -22896,10 +22876,6 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(data: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Decimal::array_hash(data: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Decimal::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -22942,10 +22918,6 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(_data: &vortex_array::arrays::extension::ExtensionData, _other: &vortex_array::arrays::extension::ExtensionData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Extension::array_hash(_data: &vortex_array::arrays::extension::ExtensionData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Extension::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -22988,10 +22960,6 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(data: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Filter::array_hash(data: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Filter::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -23034,10 +23002,6 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::FixedSizeList::array_hash(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::FixedSizeList::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -23080,10 +23044,6 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(_data: &vortex_array::arrays::list::ListData, _other: &vortex_array::arrays::list::ListData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::List::array_hash(_data: &vortex_array::arrays::list::ListData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::List::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -23126,10 +23086,6 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(data: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::ListView::array_hash(data: &vortex_array::arrays::listview::ListViewData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::ListView::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -23172,10 +23128,6 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(_data: &vortex_array::arrays::masked::MaskedData, _other: &vortex_array::arrays::masked::MaskedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Masked::array_hash(_data: &vortex_array::arrays::masked::MaskedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Masked::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -23218,10 +23170,6 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(data: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Primitive::array_hash(data: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Primitive::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -23264,10 +23212,6 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(_data: &vortex_array::arrays::shared::SharedData, _other: &vortex_array::arrays::shared::SharedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Shared::array_hash(_data: &vortex_array::arrays::shared::SharedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Shared::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -23310,10 +23254,6 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(_data: &vortex_array::arrays::struct_::StructData, _other: &vortex_array::arrays::struct_::StructData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Struct::array_hash(_data: &vortex_array::arrays::struct_::StructData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Struct::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -23356,10 +23296,6 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(data: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::VarBin::array_hash(data: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::VarBin::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -23402,10 +23338,6 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(data: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::VarBinView::array_hash(data: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::VarBinView::buffer_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -23448,10 +23380,6 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(_data: &vortex_array::arrays::variant::VariantData, _other: &vortex_array::arrays::variant::VariantData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Variant::array_hash(_data: &vortex_array::arrays::variant::VariantData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Variant::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -23494,10 +23422,6 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(_data: &vortex_array::arrays::dict::DictData, _other: &vortex_array::arrays::dict::DictData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::dict::Dict::array_hash(_data: &vortex_array::arrays::dict::DictData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -23540,10 +23464,6 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_data: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::null::Null::array_hash(_data: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::null::Null::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -23586,10 +23506,6 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(data: &vortex_array::arrays::patched::PatchedData, other: &vortex_array::arrays::patched::PatchedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::patched::Patched::array_hash(data: &vortex_array::arrays::patched::PatchedData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::patched::Patched::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -23632,10 +23548,6 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(data: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(data: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -23678,10 +23590,6 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(data: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::slice::Slice::array_hash(data: &vortex_array::arrays::slice::SliceData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::slice::Slice::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -24076,19 +23984,13 @@ pub fn vortex_array::ArrayRef::to_varbinview(&self) -> vortex_array::arrays::Var pub trait vortex_array::TypedArrayRef: core::convert::AsRef + core::ops::deref::Deref::ArrayData> -pub fn vortex_array::TypedArrayRef::slots_ref(&self) -> &[core::option::Option] - impl vortex_array::TypedArrayRef for vortex_array::Array -pub fn vortex_array::Array::slots_ref(&self) -> &[core::option::Option] - impl vortex_array::TypedArrayRef for vortex_array::ArrayView<'_, V> -pub fn vortex_array::ArrayView<'_, V>::slots_ref(&self) -> &[core::option::Option] - pub trait vortex_array::VTable: 'static + core::clone::Clone + core::marker::Sized + core::marker::Send + core::marker::Sync + core::fmt::Debug -pub type vortex_array::VTable::ArrayData: 'static + core::marker::Send + core::marker::Sync + core::clone::Clone + core::fmt::Debug +pub type vortex_array::VTable::ArrayData: 'static + core::marker::Send + core::marker::Sync + core::clone::Clone + core::fmt::Debug + vortex_array::ArrayHash + vortex_array::ArrayEq pub type vortex_array::VTable::OperationsVTable: vortex_array::OperationsVTable @@ -24096,10 +23998,6 @@ pub type vortex_array::VTable::ValidityVTable: vortex_array::ValidityVTable, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::VTable::array_eq(data: &Self::ArrayData, other: &Self::ArrayData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::VTable::array_hash(data: &Self::ArrayData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::VTable::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::VTable::buffer_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -24142,10 +24040,6 @@ pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(data: &vortex_array::arrays::bool::BoolData, other: &vortex_array::arrays::bool::BoolData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Bool::array_hash(data: &vortex_array::arrays::bool::BoolData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Bool::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Bool::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -24188,10 +24082,6 @@ pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::C pub fn vortex_array::arrays::Chunked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(_data: &vortex_array::arrays::chunked::ChunkedData, _other: &vortex_array::arrays::chunked::ChunkedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Chunked::array_hash(_data: &vortex_array::arrays::chunked::ChunkedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Chunked::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Chunked::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -24234,10 +24124,6 @@ pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::Constant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(data: &vortex_array::arrays::constant::ConstantData, other: &vortex_array::arrays::constant::ConstantData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Constant::array_hash(data: &vortex_array::arrays::constant::ConstantData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Constant::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Constant::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -24280,10 +24166,6 @@ pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::arrays::D pub fn vortex_array::arrays::Decimal::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(data: &vortex_array::arrays::decimal::DecimalData, other: &vortex_array::arrays::decimal::DecimalData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Decimal::array_hash(data: &vortex_array::arrays::decimal::DecimalData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Decimal::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Decimal::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -24326,10 +24208,6 @@ pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::Validit pub fn vortex_array::arrays::Extension::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(_data: &vortex_array::arrays::extension::ExtensionData, _other: &vortex_array::arrays::extension::ExtensionData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Extension::array_hash(_data: &vortex_array::arrays::extension::ExtensionData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Extension::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Extension::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -24372,10 +24250,6 @@ pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Fi pub fn vortex_array::arrays::Filter::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(data: &vortex_array::arrays::filter::FilterData, other: &vortex_array::arrays::filter::FilterData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Filter::array_hash(data: &vortex_array::arrays::filter::FilterData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Filter::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Filter::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -24418,10 +24292,6 @@ pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::arr pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, other: &vortex_array::arrays::fixed_size_list::FixedSizeListData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::FixedSizeList::array_hash(data: &vortex_array::arrays::fixed_size_list::FixedSizeListData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::FixedSizeList::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::FixedSizeList::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -24464,10 +24334,6 @@ pub type vortex_array::arrays::List::ValidityVTable = vortex_array::arrays::List pub fn vortex_array::arrays::List::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(_data: &vortex_array::arrays::list::ListData, _other: &vortex_array::arrays::list::ListData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::List::array_hash(_data: &vortex_array::arrays::list::ListData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::List::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::List::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -24510,10 +24376,6 @@ pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::arrays:: pub fn vortex_array::arrays::ListView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(data: &vortex_array::arrays::listview::ListViewData, other: &vortex_array::arrays::listview::ListViewData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::ListView::array_hash(data: &vortex_array::arrays::listview::ListViewData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::ListView::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::ListView::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -24556,10 +24418,6 @@ pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::arrays::Ma pub fn vortex_array::arrays::Masked::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(_data: &vortex_array::arrays::masked::MaskedData, _other: &vortex_array::arrays::masked::MaskedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Masked::array_hash(_data: &vortex_array::arrays::masked::MaskedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Masked::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Masked::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -24602,10 +24460,6 @@ pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::arrays: pub fn vortex_array::arrays::Primitive::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(data: &vortex_array::arrays::primitive::PrimitiveData, other: &vortex_array::arrays::primitive::PrimitiveData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Primitive::array_hash(data: &vortex_array::arrays::primitive::PrimitiveData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::Primitive::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Primitive::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -24648,10 +24502,6 @@ pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Sh pub fn vortex_array::arrays::Shared::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(_data: &vortex_array::arrays::shared::SharedData, _other: &vortex_array::arrays::shared::SharedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Shared::array_hash(_data: &vortex_array::arrays::shared::SharedData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Shared::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Shared::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -24694,10 +24544,6 @@ pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::arrays::St pub fn vortex_array::arrays::Struct::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(_data: &vortex_array::arrays::struct_::StructData, _other: &vortex_array::arrays::struct_::StructData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Struct::array_hash(_data: &vortex_array::arrays::struct_::StructData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Struct::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Struct::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -24740,10 +24586,6 @@ pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::arrays::Va pub fn vortex_array::arrays::VarBin::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(data: &vortex_array::arrays::varbin::VarBinData, other: &vortex_array::arrays::varbin::VarBinData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::VarBin::array_hash(data: &vortex_array::arrays::varbin::VarBinData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::VarBin::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::VarBin::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -24786,10 +24628,6 @@ pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::VarBinView::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(data: &vortex_array::arrays::varbinview::VarBinViewData, other: &vortex_array::arrays::varbinview::VarBinViewData, precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::VarBinView::array_hash(data: &vortex_array::arrays::varbinview::VarBinViewData, state: &mut H, precision: vortex_array::Precision) - pub fn vortex_array::arrays::VarBinView::buffer(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::VarBinView::buffer_name(array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -24832,10 +24670,6 @@ pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::V pub fn vortex_array::arrays::Variant::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(_data: &vortex_array::arrays::variant::VariantData, _other: &vortex_array::arrays::variant::VariantData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::Variant::array_hash(_data: &vortex_array::arrays::variant::VariantData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::Variant::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::Variant::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -24878,10 +24712,6 @@ pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(_data: &vortex_array::arrays::dict::DictData, _other: &vortex_array::arrays::dict::DictData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::dict::Dict::array_hash(_data: &vortex_array::arrays::dict::DictData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::dict::Dict::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -24924,10 +24754,6 @@ pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays pub fn vortex_array::arrays::null::Null::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(_data: &vortex_array::arrays::null::NullData, _other: &vortex_array::arrays::null::NullData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::null::Null::array_hash(_data: &vortex_array::arrays::null::NullData, _state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::null::Null::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::null::Null::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -24970,10 +24796,6 @@ pub type vortex_array::arrays::patched::Patched::ValidityVTable = vortex_array:: pub fn vortex_array::arrays::patched::Patched::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::patched::Patched::array_eq(data: &vortex_array::arrays::patched::PatchedData, other: &vortex_array::arrays::patched::PatchedData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::patched::Patched::array_hash(data: &vortex_array::arrays::patched::PatchedData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::patched::Patched::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::patched::Patched::buffer_name(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> core::option::Option @@ -25016,10 +24838,6 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vorte pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(data: &vortex_array::arrays::scalar_fn::ScalarFnData, other: &vortex_array::arrays::scalar_fn::ScalarFnData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(data: &vortex_array::arrays::scalar_fn::ScalarFnData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: vortex_array::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option @@ -25062,10 +24880,6 @@ pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arra pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: vortex_array::ArrayView<'_, Self>, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(data: &vortex_array::arrays::slice::SliceData, other: &vortex_array::arrays::slice::SliceData, _precision: vortex_array::Precision) -> bool - -pub fn vortex_array::arrays::slice::Slice::array_hash(data: &vortex_array::arrays::slice::SliceData, state: &mut H, _precision: vortex_array::Precision) - pub fn vortex_array::arrays::slice::Slice::buffer(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_array::arrays::slice::Slice::buffer_name(_array: vortex_array::ArrayView<'_, Self>, _idx: usize) -> core::option::Option diff --git a/vortex-array/src/array/erased.rs b/vortex-array/src/array/erased.rs index 908fe13ee1a..56f113ac63a 100644 --- a/vortex-array/src/array/erased.rs +++ b/vortex-array/src/array/erased.rs @@ -113,14 +113,13 @@ impl Debug for ArrayRef { impl ArrayHash for ArrayRef { fn array_hash(&self, state: &mut H, precision: crate::Precision) { - self.0 - .dyn_array_hash(self, state as &mut dyn Hasher, precision); + self.0.dyn_array_hash(state as &mut dyn Hasher, precision); } } impl ArrayEq for ArrayRef { fn array_eq(&self, other: &Self, precision: crate::Precision) -> bool { - self.0.dyn_array_eq(self, other, precision) + self.0.dyn_array_eq(other, precision) } } diff --git a/vortex-array/src/array/mod.rs b/vortex-array/src/array/mod.rs index 39c89a08c67..c5bae039a18 100644 --- a/vortex-array/src/array/mod.rs +++ b/vortex-array/src/array/mod.rs @@ -132,10 +132,10 @@ pub(crate) trait DynArray: 'static + private::Sealed + Send + Sync + Debug { fn metadata_fmt(&self, this: &ArrayRef, f: &mut Formatter<'_>) -> std::fmt::Result; /// Hashes the array contents including len, dtype, and encoding id. - fn dyn_array_hash(&self, this: &ArrayRef, state: &mut dyn Hasher, precision: crate::Precision); + fn dyn_array_hash(&self, state: &mut dyn Hasher, precision: crate::Precision); /// Compares two arrays of the same concrete type for equality. - fn dyn_array_eq(&self, this: &ArrayRef, other: &ArrayRef, precision: crate::Precision) -> bool; + fn dyn_array_eq(&self, other: &ArrayRef, precision: crate::Precision) -> bool; } /// Trait for converting a type into a Vortex [`ArrayRef`]. @@ -321,12 +321,7 @@ impl DynArray for ArrayInner { V::fmt_metadata(view, f) } - fn dyn_array_hash( - &self, - _this: &ArrayRef, - state: &mut dyn Hasher, - precision: crate::Precision, - ) { + fn dyn_array_hash(&self, state: &mut dyn Hasher, precision: crate::Precision) { let mut wrapper = HasherWrapper(state); self.len.hash(&mut wrapper); self.dtype.hash(&mut wrapper); @@ -335,15 +330,10 @@ impl DynArray for ArrayInner { for slot in &self.slots { slot.array_hash(&mut wrapper, precision); } - V::array_hash(&self.data, &mut wrapper, precision); + self.data.array_hash(&mut wrapper, precision); } - fn dyn_array_eq( - &self, - _this: &ArrayRef, - other: &ArrayRef, - precision: crate::Precision, - ) -> bool { + fn dyn_array_eq(&self, other: &ArrayRef, precision: crate::Precision) -> bool { other .inner() .as_any() @@ -358,7 +348,7 @@ impl DynArray for ArrayInner { .iter() .zip(other_inner.slots.iter()) .all(|(slot, other_slot)| slot.array_eq(other_slot, precision)) - && V::array_eq(&self.data, &other_inner.data, precision) + && self.data.array_eq(&other_inner.data, precision) }) } } diff --git a/vortex-array/src/array/typed.rs b/vortex-array/src/array/typed.rs index 08b86a6b9f4..e3240e6a25e 100644 --- a/vortex-array/src/array/typed.rs +++ b/vortex-array/src/array/typed.rs @@ -51,21 +51,16 @@ impl ArrayParts { } } -pub trait TypedArrayRef: AsRef + Deref { - fn slots_ref(&self) -> &[Option]; -} +/// Shared bound for helpers that should work over both owned [`Array`] and borrowed +/// [`ArrayView`]. +/// +/// Extension traits use this to share typed array logic while still exposing the backing +/// [`ArrayRef`] and the encoding-specific [`VTable::ArrayData`]. +pub trait TypedArrayRef: AsRef + Deref {} -impl TypedArrayRef for Array { - fn slots_ref(&self) -> &[Option] { - self.slots() - } -} +impl TypedArrayRef for Array {} -impl TypedArrayRef for ArrayView<'_, V> { - fn slots_ref(&self) -> &[Option] { - self.slots() - } -} +impl TypedArrayRef for ArrayView<'_, V> {} // ============================================================================= // ArrayInner — the concrete type stored inside Arc // ============================================================================= diff --git a/vortex-array/src/array/vtable/mod.rs b/vortex-array/src/array/vtable/mod.rs index cc0797ac966..dcf3bcaac26 100644 --- a/vortex-array/src/array/vtable/mod.rs +++ b/vortex-array/src/array/vtable/mod.rs @@ -9,7 +9,6 @@ mod validity; use std::fmt::Debug; use std::fmt::Formatter; -use std::hash::Hasher; pub use dyn_::*; pub use operations::*; @@ -25,7 +24,6 @@ use crate::ArrayView; use crate::Canonical; use crate::ExecutionResult; use crate::IntoArray; -use crate::Precision; use crate::arrays::ConstantArray; use crate::arrays::constant::Constant; use crate::buffer::BufferHandle; @@ -33,6 +31,8 @@ use crate::builders::ArrayBuilder; use crate::dtype::DType; use crate::dtype::Nullability; use crate::executor::ExecutionCtx; +use crate::hash::ArrayEq; +use crate::hash::ArrayHash; use crate::patches::Patches; use crate::scalar::ScalarValue; use crate::serde::ArrayChildren; @@ -52,7 +52,7 @@ use crate::validity::Validity; /// out of bounds). Post-conditions are validated after invocation of the vtable function and will /// panic if violated. pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { - type ArrayData: 'static + Send + Sync + Clone + Debug; + type ArrayData: 'static + Send + Sync + Clone + Debug + ArrayHash + ArrayEq; type OperationsVTable: OperationsVTable; type ValidityVTable: ValidityVTable; @@ -69,12 +69,6 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { slots: &[Option], ) -> VortexResult<()>; - /// Hashes the array contents. - fn array_hash(data: &Self::ArrayData, state: &mut H, precision: Precision); - - /// Compares two arrays of the same type for equality. - fn array_eq(data: &Self::ArrayData, other: &Self::ArrayData, precision: Precision) -> bool; - /// Returns the number of buffers in the array. fn nbuffers(array: ArrayView<'_, Self>) -> usize; diff --git a/vortex-array/src/arrays/bool/array.rs b/vortex-array/src/arrays/bool/array.rs index f6edd3d0ce7..dda361ce337 100644 --- a/vortex-array/src/arrays/bool/array.rs +++ b/vortex-array/src/arrays/bool/array.rs @@ -13,6 +13,7 @@ use crate::ArrayRef; use crate::IntoArray; use crate::array::Array; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::array::TypedArrayRef; use crate::array::child_to_validity; use crate::array::validity_to_child; @@ -63,7 +64,6 @@ pub(super) const SLOT_NAMES: [&str; NUM_SLOTS] = ["validity"]; pub struct BoolData { pub(super) bits: BufferHandle, pub(super) offset: usize, - pub(super) len: usize, } pub struct BoolDataParts { @@ -81,11 +81,16 @@ pub trait BoolArrayExt: TypedArrayRef { } fn validity(&self) -> Validity { - child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.nullability()) + child_to_validity(&self.as_ref().slots()[VALIDITY_SLOT], self.nullability()) } fn bool_validity_mask(&self) -> Mask { - self.validity().to_mask(self.len) + self.validity().to_mask(self.as_ref().len()) + } + + fn to_bit_buffer(&self) -> BitBuffer { + let buffer = self.bits.as_host().clone(); + BitBuffer::new_with_offset(buffer, self.as_ref().len(), self.offset) } fn maybe_to_mask(&self) -> VortexResult> { @@ -107,7 +112,7 @@ pub trait BoolArrayExt: TypedArrayRef { let validity_mask = self.bool_validity_mask(); let buffer = match validity_mask { Mask::AllTrue(_) => self.to_bit_buffer(), - Mask::AllFalse(_) => return Mask::new_false(self.len), + Mask::AllFalse(_) => return Mask::new_false(self.as_ref().len()), Mask::Values(validity) => validity.bit_buffer() & self.to_bit_buffer(), }; Mask::from_buffer(buffer) @@ -117,35 +122,13 @@ impl> BoolArrayExt for T {} /// Field accessors and non-consuming methods on the inner bool data. impl BoolData { - /// Returns the length of this array. - pub fn len(&self) -> usize { - self.len - } - - /// Returns `true` if this array is empty. - pub fn is_empty(&self) -> bool { - self.len() == 0 - } - - /// Returns the underlying [`BitBuffer`] of the array. - pub fn to_bit_buffer(&self) -> BitBuffer { - let buffer = self.bits.as_host().clone(); - BitBuffer::new_with_offset(buffer, self.len, self.offset) - } - - /// Returns the underlying [`BitBuffer`] of the array - pub fn into_bit_buffer(self) -> BitBuffer { - let buffer = self.bits.unwrap_host(); - BitBuffer::new_with_offset(buffer, self.len, self.offset) - } - /// Splits into owned parts #[inline] - pub fn into_parts(self) -> BoolDataParts { + pub fn into_parts(self, len: usize) -> BoolDataParts { BoolDataParts { bits: self.bits, offset: self.offset, - len: self.len, + len, } } @@ -240,9 +223,17 @@ impl Array { Self::new(buffer.freeze(), validity) } + /// Returns the underlying [`BitBuffer`] of the array, consuming self. + pub fn to_bit_buffer(&self) -> BitBuffer { + BoolArrayExt::to_bit_buffer(self) + } + /// Returns the underlying [`BitBuffer`] of the array, consuming self. pub fn into_bit_buffer(self) -> BitBuffer { - self.into_data().into_bit_buffer() + let len = self.len(); + let data = self.into_data(); + let buffer = data.bits.unwrap_host(); + BitBuffer::new_with_offset(buffer, len, data.offset) } pub fn maybe_to_mask(&self) -> VortexResult> { BoolArrayExt::maybe_to_mask(self) @@ -257,18 +248,23 @@ impl Array { } } +impl ArrayView<'_, Bool> { + pub fn to_bit_buffer(&self) -> BitBuffer { + BoolArrayExt::to_bit_buffer(self) + } +} + /// Internal constructors on BoolData (used by Array constructors and VTable::build). impl BoolData { pub(super) fn try_new(bits: BitBuffer, validity: Validity) -> VortexResult { let bits = bits.shrink_offset(); Self::validate(&bits, &validity)?; - let (offset, len, buffer) = bits.into_inner(); + let (offset, _len, buffer) = bits.into_inner(); Ok(Self { bits: BufferHandle::new_host(buffer), offset, - len, }) } @@ -293,19 +289,18 @@ impl BoolData { bits.len() * 8, ); - Ok(Self { bits, offset, len }) + Ok(Self { bits, offset }) } pub(super) unsafe fn new_unchecked(bits: BitBuffer, validity: Validity) -> Self { if cfg!(debug_assertions) { Self::try_new(bits, validity).vortex_expect("Failed to create BoolData") } else { - let (offset, len, buffer) = bits.into_inner(); + let (offset, _len, buffer) = bits.into_inner(); Self { bits: BufferHandle::new_host(buffer), offset, - len, } } } diff --git a/vortex-array/src/arrays/bool/vtable/mod.rs b/vortex-array/src/arrays/bool/vtable/mod.rs index 82759e116e0..b722022071c 100644 --- a/vortex-array/src/arrays/bool/vtable/mod.rs +++ b/vortex-array/src/arrays/bool/vtable/mod.rs @@ -2,6 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use std::fmt::Formatter; +use std::hash::Hash; +use std::hash::Hasher; use kernel::PARENT_KERNELS; use prost::Message; @@ -45,6 +47,19 @@ pub struct BoolMetadata { pub offset: u32, } +impl ArrayHash for BoolData { + fn array_hash(&self, state: &mut H, precision: Precision) { + self.bits.array_hash(state, precision); + self.offset.hash(state); + } +} + +impl ArrayEq for BoolData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + self.offset == other.offset && self.bits.array_eq(&other.bits, precision) + } +} + impl VTable for Bool { type ArrayData = BoolData; @@ -55,15 +70,6 @@ impl VTable for Bool { Self::ID } - fn array_hash(data: &BoolData, state: &mut H, precision: Precision) { - data.to_bit_buffer().array_hash(state, precision); - } - - fn array_eq(data: &BoolData, other: &BoolData, precision: Precision) -> bool { - data.to_bit_buffer() - .array_eq(&other.to_bit_buffer(), precision) - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 1 } @@ -107,10 +113,11 @@ impl VTable for Bool { vortex_bail!("Expected bool dtype, got {dtype:?}"); }; vortex_ensure!( - data.len() == len, - "BoolArray length {} does not match outer length {}", - data.len(), - len + data.bits.len() * 8 >= data.offset + len, + "BoolArray buffer with offset {} cannot back outer length {} (buffer bits = {})", + data.offset, + len, + data.bits.len() * 8 ); let validity = crate::array::child_to_validity(&slots[0], *nullability); diff --git a/vortex-array/src/arrays/chunked/array.rs b/vortex-array/src/arrays/chunked/array.rs index d3bbbe4c328..06be53a51ba 100644 --- a/vortex-array/src/arrays/chunked/array.rs +++ b/vortex-array/src/arrays/chunked/array.rs @@ -42,24 +42,24 @@ pub struct ChunkedData; pub trait ChunkedArrayExt: TypedArrayRef { fn chunk_offsets_array(&self) -> &ArrayRef { - self.slots_ref()[CHUNK_OFFSETS_SLOT] + self.as_ref().slots()[CHUNK_OFFSETS_SLOT] .as_ref() .vortex_expect("validated chunk offsets slot") } fn nchunks(&self) -> usize { - self.slots_ref().len().saturating_sub(CHUNKS_OFFSET) + self.as_ref().slots().len().saturating_sub(CHUNKS_OFFSET) } fn chunk(&self, idx: usize) -> &ArrayRef { - self.slots_ref()[CHUNKS_OFFSET + idx] + self.as_ref().slots()[CHUNKS_OFFSET + idx] .as_ref() .vortex_expect("validated chunk slot") } fn iter_chunks<'a>(&'a self) -> Box + 'a> { Box::new( - self.slots_ref()[CHUNKS_OFFSET..] + self.as_ref().slots()[CHUNKS_OFFSET..] .iter() .map(|slot| slot.as_ref().vortex_expect("validated chunk slot")), ) @@ -219,12 +219,10 @@ impl ChunkedData { /// # Safety /// /// All chunks must have exactly the same [`DType`] as the provided `dtype`. - pub unsafe fn new_unchecked(chunks: Vec, dtype: DType) -> Self { + pub unsafe fn new_unchecked(_chunks: Vec, _dtype: DType) -> Self { #[cfg(debug_assertions)] - Self::validate(&chunks, &dtype) + Self::validate(&_chunks, &_dtype) .vortex_expect("[Debug Assertion]: Invalid `ChunkedArray` parameters"); - drop(chunks); - drop(dtype); Self } diff --git a/vortex-array/src/arrays/chunked/paired_chunks.rs b/vortex-array/src/arrays/chunked/paired_chunks.rs index 2a468aa65db..1c3a933dd0c 100644 --- a/vortex-array/src/arrays/chunked/paired_chunks.rs +++ b/vortex-array/src/arrays/chunked/paired_chunks.rs @@ -273,6 +273,6 @@ mod tests { let right = ChunkedArray::try_new(vec![buffer![10i32, 20, 30].into_array()], i32_dtype()).unwrap(); - drop(left.paired_chunks(&right).collect::>()); + left.paired_chunks(&right).for_each(drop); } } diff --git a/vortex-array/src/arrays/chunked/vtable/mod.rs b/vortex-array/src/arrays/chunked/vtable/mod.rs index 78c12ec5f00..98b2d9424ec 100644 --- a/vortex-array/src/arrays/chunked/vtable/mod.rs +++ b/vortex-array/src/arrays/chunked/vtable/mod.rs @@ -1,6 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::hash::Hasher; + use itertools::Itertools; use vortex_error::VortexExpect; use vortex_error::VortexResult; @@ -10,6 +12,8 @@ use vortex_error::vortex_err; use vortex_error::vortex_panic; use vortex_session::VortexSession; +use crate::ArrayEq; +use crate::ArrayHash; use crate::ArrayRef; use crate::Canonical; use crate::ExecutionCtx; @@ -48,6 +52,16 @@ impl Chunked { pub const ID: ArrayId = ArrayId::new_ref("vortex.chunked"); } +impl ArrayHash for ChunkedData { + fn array_hash(&self, _state: &mut H, _precision: Precision) {} +} + +impl ArrayEq for ChunkedData { + fn array_eq(&self, _other: &Self, _precision: Precision) -> bool { + true + } +} + impl VTable for Chunked { type ArrayData = ChunkedData; @@ -58,17 +72,6 @@ impl VTable for Chunked { Self::ID } - fn array_hash( - _data: &ChunkedData, - _state: &mut H, - _precision: Precision, - ) { - } - - fn array_eq(_data: &ChunkedData, _other: &ChunkedData, _precision: Precision) -> bool { - true - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/arrays/constant/vtable/mod.rs b/vortex-array/src/arrays/constant/vtable/mod.rs index 842bb0f7230..a41972a2557 100644 --- a/vortex-array/src/arrays/constant/vtable/mod.rs +++ b/vortex-array/src/arrays/constant/vtable/mod.rs @@ -3,6 +3,7 @@ use std::fmt::Debug; use std::hash::Hash; +use std::hash::Hasher; use vortex_buffer::ByteBufferMut; use vortex_error::VortexExpect; @@ -11,6 +12,8 @@ use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; +use crate::ArrayEq; +use crate::ArrayHash; use crate::ArrayRef; use crate::ExecutionCtx; use crate::ExecutionResult; @@ -52,6 +55,18 @@ impl Constant { pub const ID: ArrayId = ArrayId::new_ref("vortex.constant"); } +impl ArrayHash for ConstantData { + fn array_hash(&self, state: &mut H, _precision: Precision) { + self.scalar.hash(state); + } +} + +impl ArrayEq for ConstantData { + fn array_eq(&self, other: &Self, _precision: Precision) -> bool { + self.scalar == other.scalar + } +} + impl VTable for Constant { type ArrayData = ConstantData; @@ -76,14 +91,6 @@ impl VTable for Constant { Ok(()) } - fn array_hash(data: &ConstantData, state: &mut H, _precision: Precision) { - data.scalar.hash(state); - } - - fn array_eq(data: &ConstantData, other: &ConstantData, _precision: Precision) -> bool { - data.scalar == other.scalar - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 1 } diff --git a/vortex-array/src/arrays/decimal/array.rs b/vortex-array/src/arrays/decimal/array.rs index 5c069219c11..36a717e8995 100644 --- a/vortex-array/src/arrays/decimal/array.rs +++ b/vortex-array/src/arrays/decimal/array.rs @@ -128,11 +128,31 @@ pub trait DecimalArrayExt: TypedArrayRef { } fn validity_child(&self) -> Option<&ArrayRef> { - self.slots_ref()[VALIDITY_SLOT].as_ref() + self.as_ref().slots()[VALIDITY_SLOT].as_ref() } fn validity(&self) -> Validity { - child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.nullability()) + child_to_validity(&self.as_ref().slots()[VALIDITY_SLOT], self.nullability()) + } + + fn values_type(&self) -> DecimalType { + self.values_type + } + + fn precision(&self) -> u8 { + self.decimal_dtype().precision() + } + + fn scale(&self) -> i8 { + self.decimal_dtype().scale() + } + + fn buffer_handle(&self) -> &BufferHandle { + &self.values + } + + fn buffer(&self) -> Buffer { + DecimalData::buffer::(self) } } impl> DecimalArrayExt for T {} @@ -327,12 +347,6 @@ impl DecimalData { self.len() == 0 } - pub fn into_parts(self) -> DecimalDataParts { - vortex_panic!( - "DecimalData::into_parts requires outer dtype; use Array::into_data_parts" - ) - } - /// Returns the underlying [`ByteBuffer`] of the array. pub fn buffer_handle(&self) -> &BufferHandle { &self.values @@ -617,23 +631,23 @@ impl Array { } pub fn values_type(&self) -> DecimalType { - self.data().values_type + DecimalArrayExt::values_type(self) } pub fn precision(&self) -> u8 { - self.decimal_dtype().precision() + DecimalArrayExt::precision(self) } pub fn scale(&self) -> i8 { - self.decimal_dtype().scale() + DecimalArrayExt::scale(self) } pub fn buffer_handle(&self) -> &BufferHandle { - &self.data().values + DecimalArrayExt::buffer_handle(self) } pub fn buffer(&self) -> Buffer { - self.data().buffer::() + DecimalArrayExt::buffer(self) } } @@ -643,23 +657,23 @@ impl ArrayView<'_, Decimal> { } pub fn values_type(&self) -> DecimalType { - self.data().values_type + DecimalArrayExt::values_type(self) } pub fn precision(&self) -> u8 { - self.decimal_dtype().precision() + DecimalArrayExt::precision(self) } pub fn scale(&self) -> i8 { - self.decimal_dtype().scale() + DecimalArrayExt::scale(self) } pub fn buffer_handle(&self) -> &BufferHandle { - &self.data().values + DecimalArrayExt::buffer_handle(self) } pub fn buffer(&self) -> Buffer { - self.data().buffer::() + DecimalArrayExt::buffer(self) } } diff --git a/vortex-array/src/arrays/decimal/vtable/mod.rs b/vortex-array/src/arrays/decimal/vtable/mod.rs index 0c4c6004b2e..418d790b703 100644 --- a/vortex-array/src/arrays/decimal/vtable/mod.rs +++ b/vortex-array/src/arrays/decimal/vtable/mod.rs @@ -1,6 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::hash::Hasher; + use kernel::PARENT_KERNELS; use prost::Message; use vortex_buffer::Alignment; @@ -46,6 +48,19 @@ pub struct DecimalMetadata { pub(super) values_type: i32, } +impl ArrayHash for DecimalData { + fn array_hash(&self, state: &mut H, precision: Precision) { + self.values.array_hash(state, precision); + std::mem::discriminant(&self.values_type).hash(state); + } +} + +impl ArrayEq for DecimalData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + self.values.array_eq(&other.values, precision) && self.values_type == other.values_type + } +} + impl VTable for Decimal { type ArrayData = DecimalData; @@ -56,15 +71,6 @@ impl VTable for Decimal { Self::ID } - fn array_hash(data: &DecimalData, state: &mut H, precision: Precision) { - data.values.array_hash(state, precision); - std::mem::discriminant(&data.values_type).hash(state); - } - - fn array_eq(data: &DecimalData, other: &DecimalData, precision: Precision) -> bool { - data.values.array_eq(&other.values, precision) && data.values_type == other.values_type - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 1 } diff --git a/vortex-array/src/arrays/dict/array.rs b/vortex-array/src/arrays/dict/array.rs index e786f01a238..7db610308df 100644 --- a/vortex-array/src/arrays/dict/array.rs +++ b/vortex-array/src/arrays/dict/array.rs @@ -108,13 +108,13 @@ impl DictData { pub trait DictArrayExt: TypedArrayRef { fn codes(&self) -> &ArrayRef { - self.slots_ref()[CODES_SLOT] + self.as_ref().slots()[CODES_SLOT] .as_ref() .vortex_expect("DictArray codes slot") } fn values(&self) -> &ArrayRef { - self.slots_ref()[VALUES_SLOT] + self.as_ref().slots()[VALUES_SLOT] .as_ref() .vortex_expect("DictArray values slot") } diff --git a/vortex-array/src/arrays/dict/vtable/mod.rs b/vortex-array/src/arrays/dict/vtable/mod.rs index 6b4892db248..c2ad6e8fcd4 100644 --- a/vortex-array/src/arrays/dict/vtable/mod.rs +++ b/vortex-array/src/arrays/dict/vtable/mod.rs @@ -1,6 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::hash::Hasher; + use kernel::PARENT_KERNELS; use prost::Message; use vortex_error::VortexExpect; @@ -18,6 +20,8 @@ use super::array::SLOT_NAMES; use super::array::VALUES_SLOT; use super::take_canonical; use crate::AnyCanonical; +use crate::ArrayEq; +use crate::ArrayHash; use crate::ArrayRef; use crate::Canonical; use crate::Precision; @@ -51,6 +55,16 @@ impl Dict { pub const ID: ArrayId = ArrayId::new_ref("vortex.dict"); } +impl ArrayHash for DictData { + fn array_hash(&self, _state: &mut H, _precision: Precision) {} +} + +impl ArrayEq for DictData { + fn array_eq(&self, _other: &Self, _precision: Precision) -> bool { + true + } +} + impl VTable for Dict { type ArrayData = DictData; @@ -86,12 +100,6 @@ impl VTable for Dict { Ok(()) } - fn array_hash(_data: &DictData, _state: &mut H, _precision: Precision) {} - - fn array_eq(_data: &DictData, _other: &DictData, _precision: Precision) -> bool { - true - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/arrays/extension/array.rs b/vortex-array/src/arrays/extension/array.rs index 09456447de0..2a22c00737c 100644 --- a/vortex-array/src/arrays/extension/array.rs +++ b/vortex-array/src/arrays/extension/array.rs @@ -120,7 +120,7 @@ impl ExtensionData { pub trait ExtensionArrayExt: TypedArrayRef { fn storage_array(&self) -> &ArrayRef { - self.slots_ref()[STORAGE_SLOT] + self.as_ref().slots()[STORAGE_SLOT] .as_ref() .vortex_expect("ExtensionArray storage slot") } diff --git a/vortex-array/src/arrays/extension/vtable/mod.rs b/vortex-array/src/arrays/extension/vtable/mod.rs index 3cf2afd642c..5976e267740 100644 --- a/vortex-array/src/arrays/extension/vtable/mod.rs +++ b/vortex-array/src/arrays/extension/vtable/mod.rs @@ -5,6 +5,8 @@ mod kernel; mod operations; mod validity; +use std::hash::Hasher; + use kernel::PARENT_KERNELS; use vortex_error::VortexExpect; use vortex_error::VortexResult; @@ -13,6 +15,8 @@ use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; +use crate::ArrayEq; +use crate::ArrayHash; use crate::ArrayRef; use crate::ExecutionCtx; use crate::ExecutionResult; @@ -33,6 +37,16 @@ use crate::vtable; vtable!(Extension, Extension, ExtensionData); +impl ArrayHash for ExtensionData { + fn array_hash(&self, _state: &mut H, _precision: Precision) {} +} + +impl ArrayEq for ExtensionData { + fn array_eq(&self, _other: &Self, _precision: Precision) -> bool { + true + } +} + impl VTable for Extension { type ArrayData = ExtensionData; @@ -43,17 +57,6 @@ impl VTable for Extension { Self::ID } - fn array_hash( - _data: &ExtensionData, - _state: &mut H, - _precision: Precision, - ) { - } - - fn array_eq(_data: &ExtensionData, _other: &ExtensionData, _precision: Precision) -> bool { - true - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/arrays/filter/array.rs b/vortex-array/src/arrays/filter/array.rs index c160b1440f7..b2909c7cad6 100644 --- a/vortex-array/src/arrays/filter/array.rs +++ b/vortex-array/src/arrays/filter/array.rs @@ -34,7 +34,7 @@ pub struct FilterDataParts { pub trait FilterArrayExt: TypedArrayRef { fn child(&self) -> &ArrayRef { - self.slots_ref()[CHILD_SLOT] + self.as_ref().slots()[CHILD_SLOT] .as_ref() .vortex_expect("validated filter child slot") } diff --git a/vortex-array/src/arrays/filter/vtable.rs b/vortex-array/src/arrays/filter/vtable.rs index e5609e10e3c..75258f542e5 100644 --- a/vortex-array/src/arrays/filter/vtable.rs +++ b/vortex-array/src/arrays/filter/vtable.rs @@ -48,6 +48,18 @@ impl Filter { pub const ID: ArrayId = ArrayId::new_ref("vortex.filter"); } +impl ArrayHash for FilterData { + fn array_hash(&self, state: &mut H, precision: Precision) { + self.mask.array_hash(state, precision); + } +} + +impl ArrayEq for FilterData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + self.mask.array_eq(&other.mask, precision) + } +} + impl VTable for Filter { type ArrayData = FilterData; type OperationsVTable = Self; @@ -92,14 +104,6 @@ impl VTable for Filter { Ok(()) } - fn array_hash(data: &FilterData, state: &mut H, precision: Precision) { - data.mask.array_hash(state, precision); - } - - fn array_eq(data: &FilterData, other: &FilterData, precision: Precision) -> bool { - data.mask.array_eq(&other.mask, precision) - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/arrays/fixed_size_list/array.rs b/vortex-array/src/arrays/fixed_size_list/array.rs index 0a246d5af78..52fbb600d46 100644 --- a/vortex-array/src/arrays/fixed_size_list/array.rs +++ b/vortex-array/src/arrays/fixed_size_list/array.rs @@ -217,7 +217,7 @@ pub trait FixedSizeListArrayExt: TypedArrayRef { } fn elements(&self) -> &ArrayRef { - self.slots_ref()[ELEMENTS_SLOT] + self.as_ref().slots()[ELEMENTS_SLOT] .as_ref() .vortex_expect("FixedSizeListArray elements slot") } @@ -229,7 +229,7 @@ pub trait FixedSizeListArrayExt: TypedArrayRef { fn fixed_size_list_validity(&self) -> Validity { let (_, _, nullability) = self.dtype_parts(); - child_to_validity(&self.slots_ref()[VALIDITY_SLOT], nullability) + child_to_validity(&self.as_ref().slots()[VALIDITY_SLOT], nullability) } fn fixed_size_list_validity_mask(&self) -> vortex_mask::Mask { 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 febf3ef612e..8699ce51a19 100644 --- a/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs +++ b/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs @@ -2,6 +2,7 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use std::hash::Hash; +use std::hash::Hasher; use std::sync::Arc; use vortex_error::VortexExpect; @@ -11,6 +12,8 @@ use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; +use crate::ArrayEq; +use crate::ArrayHash; use crate::ArrayRef; use crate::ExecutionCtx; use crate::ExecutionResult; @@ -41,6 +44,20 @@ impl FixedSizeList { pub const ID: ArrayId = ArrayId::new_ref("vortex.fixed_size_list"); } +impl ArrayHash for FixedSizeListData { + fn array_hash(&self, state: &mut H, precision: Precision) { + let _precision = precision; + self.degenerate_len.hash(state); + } +} + +impl ArrayEq for FixedSizeListData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + let _precision = precision; + self.degenerate_len == other.degenerate_len + } +} + impl VTable for FixedSizeList { type ArrayData = FixedSizeListData; @@ -51,22 +68,6 @@ impl VTable for FixedSizeList { Self::ID } - fn array_hash( - data: &FixedSizeListData, - state: &mut H, - _precision: Precision, - ) { - data.degenerate_len.hash(state); - } - - fn array_eq( - data: &FixedSizeListData, - other: &FixedSizeListData, - _precision: Precision, - ) -> bool { - data.degenerate_len == other.degenerate_len - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/arrays/list/array.rs b/vortex-array/src/arrays/list/array.rs index 616b338ec39..c5cdf281049 100644 --- a/vortex-array/src/arrays/list/array.rs +++ b/vortex-array/src/arrays/list/array.rs @@ -162,12 +162,14 @@ impl ListData { /// - All offset values must be non-negative. /// - The maximum offset must not exceed `elements.len()`. /// - If validity is an array, its length must equal `offsets.len() - 1`. - pub unsafe fn new_unchecked(elements: ArrayRef, offsets: ArrayRef, validity: Validity) -> Self { + pub unsafe fn new_unchecked( + elements: ArrayRef, + offsets: ArrayRef, + _validity: Validity, + ) -> Self { #[cfg(debug_assertions)] - Self::validate(&elements, &offsets, &validity) + Self::validate(&elements, &offsets, &_validity) .vortex_expect("[Debug Assertion]: Invalid `ListViewArray` parameters"); - - drop(validity); Self } @@ -270,19 +272,19 @@ pub trait ListArrayExt: TypedArrayRef { } fn elements(&self) -> &ArrayRef { - self.slots_ref()[ELEMENTS_SLOT] + self.as_ref().slots()[ELEMENTS_SLOT] .as_ref() .vortex_expect("ListArray elements slot") } fn offsets(&self) -> &ArrayRef { - self.slots_ref()[OFFSETS_SLOT] + self.as_ref().slots()[OFFSETS_SLOT] .as_ref() .vortex_expect("ListArray offsets slot") } fn list_validity(&self) -> Validity { - child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.nullability()) + child_to_validity(&self.as_ref().slots()[VALIDITY_SLOT], self.nullability()) } fn list_validity_mask(&self) -> vortex_mask::Mask { diff --git a/vortex-array/src/arrays/list/vtable/mod.rs b/vortex-array/src/arrays/list/vtable/mod.rs index 339df50d234..5fa365ecbd7 100644 --- a/vortex-array/src/arrays/list/vtable/mod.rs +++ b/vortex-array/src/arrays/list/vtable/mod.rs @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::hash::Hasher; use std::sync::Arc; use prost::Message; @@ -11,6 +12,8 @@ use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; +use crate::ArrayEq; +use crate::ArrayHash; use crate::ArrayRef; use crate::ExecutionCtx; use crate::ExecutionResult; @@ -45,6 +48,16 @@ pub struct ListMetadata { offset_ptype: i32, } +impl ArrayHash for ListData { + fn array_hash(&self, _state: &mut H, _precision: Precision) {} +} + +impl ArrayEq for ListData { + fn array_eq(&self, _other: &Self, _precision: Precision) -> bool { + true + } +} + impl VTable for List { type ArrayData = ListData; @@ -55,12 +68,6 @@ impl VTable for List { Self::ID } - fn array_hash(_data: &ListData, _state: &mut H, _precision: Precision) {} - - fn array_eq(_data: &ListData, _other: &ListData, _precision: Precision) -> bool { - true - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/arrays/listview/array.rs b/vortex-array/src/arrays/listview/array.rs index aea20a5f9d9..d4bc7c3260c 100644 --- a/vortex-array/src/arrays/listview/array.rs +++ b/vortex-array/src/arrays/listview/array.rs @@ -319,25 +319,25 @@ pub trait ListViewArrayExt: TypedArrayRef { } fn elements(&self) -> &ArrayRef { - self.slots_ref()[ELEMENTS_SLOT] + self.as_ref().slots()[ELEMENTS_SLOT] .as_ref() .vortex_expect("ListViewArray elements slot") } fn offsets(&self) -> &ArrayRef { - self.slots_ref()[OFFSETS_SLOT] + self.as_ref().slots()[OFFSETS_SLOT] .as_ref() .vortex_expect("ListViewArray offsets slot") } fn sizes(&self) -> &ArrayRef { - self.slots_ref()[SIZES_SLOT] + self.as_ref().slots()[SIZES_SLOT] .as_ref() .vortex_expect("ListViewArray sizes slot") } fn listview_validity(&self) -> Validity { - child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.nullability()) + child_to_validity(&self.as_ref().slots()[VALIDITY_SLOT], self.nullability()) } fn listview_validity_mask(&self) -> vortex_mask::Mask { diff --git a/vortex-array/src/arrays/listview/vtable/mod.rs b/vortex-array/src/arrays/listview/vtable/mod.rs index 6e914bed841..d927828f411 100644 --- a/vortex-array/src/arrays/listview/vtable/mod.rs +++ b/vortex-array/src/arrays/listview/vtable/mod.rs @@ -2,6 +2,7 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use std::hash::Hash; +use std::hash::Hasher; use std::sync::Arc; use prost::Message; @@ -12,6 +13,8 @@ use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; +use crate::ArrayEq; +use crate::ArrayHash; use crate::ArrayRef; use crate::ExecutionCtx; use crate::ExecutionResult; @@ -52,6 +55,18 @@ pub struct ListViewMetadata { size_ptype: i32, } +impl ArrayHash for ListViewData { + fn array_hash(&self, state: &mut H, _precision: Precision) { + self.is_zero_copy_to_list().hash(state); + } +} + +impl ArrayEq for ListViewData { + fn array_eq(&self, other: &Self, _precision: Precision) -> bool { + self.is_zero_copy_to_list() == other.is_zero_copy_to_list() + } +} + impl VTable for ListView { type ArrayData = ListViewData; @@ -62,14 +77,6 @@ impl VTable for ListView { Self::ID } - fn array_hash(data: &ListViewData, state: &mut H, _precision: Precision) { - data.is_zero_copy_to_list().hash(state); - } - - fn array_eq(data: &ListViewData, other: &ListViewData, _precision: Precision) -> bool { - data.is_zero_copy_to_list() == other.is_zero_copy_to_list() - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/arrays/masked/array.rs b/vortex-array/src/arrays/masked/array.rs index d0977ecf30a..10444703a9f 100644 --- a/vortex-array/src/arrays/masked/array.rs +++ b/vortex-array/src/arrays/masked/array.rs @@ -26,18 +26,18 @@ pub struct MaskedData; pub trait MaskedArrayExt: TypedArrayRef { fn child(&self) -> &ArrayRef { - self.slots_ref()[CHILD_SLOT] + self.as_ref().slots()[CHILD_SLOT] .as_ref() .vortex_expect("validated masked child slot") } fn validity_child(&self) -> Option<&ArrayRef> { - self.slots_ref()[VALIDITY_SLOT].as_ref() + self.as_ref().slots()[VALIDITY_SLOT].as_ref() } fn masked_validity(&self) -> Validity { child_to_validity( - &self.slots_ref()[VALIDITY_SLOT], + &self.as_ref().slots()[VALIDITY_SLOT], self.as_ref().dtype().nullability(), ) } diff --git a/vortex-array/src/arrays/masked/vtable/mod.rs b/vortex-array/src/arrays/masked/vtable/mod.rs index 09129892dc4..762c05ec6c9 100644 --- a/vortex-array/src/arrays/masked/vtable/mod.rs +++ b/vortex-array/src/arrays/masked/vtable/mod.rs @@ -4,6 +4,8 @@ mod canonical; mod operations; mod validity; +use std::hash::Hasher; + use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; @@ -11,6 +13,8 @@ use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; +use crate::ArrayEq; +use crate::ArrayHash; use crate::ArrayRef; use crate::Canonical; use crate::IntoArray; @@ -44,6 +48,16 @@ impl Masked { pub const ID: ArrayId = ArrayId::new_ref("vortex.masked"); } +impl ArrayHash for MaskedData { + fn array_hash(&self, _state: &mut H, _precision: Precision) {} +} + +impl ArrayEq for MaskedData { + fn array_eq(&self, _other: &Self, _precision: Precision) -> bool { + true + } +} + impl VTable for Masked { type ArrayData = MaskedData; @@ -76,13 +90,6 @@ impl VTable for Masked { Ok(()) } - fn array_hash(_data: &MaskedData, _state: &mut H, _precision: Precision) { - } - - fn array_eq(_data: &MaskedData, _other: &MaskedData, _precision: Precision) -> bool { - true - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/arrays/null/mod.rs b/vortex-array/src/arrays/null/mod.rs index 94711016092..e2935a49116 100644 --- a/vortex-array/src/arrays/null/mod.rs +++ b/vortex-array/src/arrays/null/mod.rs @@ -1,11 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::hash::Hasher; + use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; +use crate::ArrayEq; +use crate::ArrayHash; use crate::ArrayRef; use crate::ExecutionCtx; use crate::ExecutionResult; @@ -29,6 +33,19 @@ pub(crate) mod compute; vtable!(Null, Null, NullData); +impl ArrayHash for NullData { + fn array_hash(&self, _state: &mut H, _precision: Precision) { + // len and dtype are hashed by ArrayInner; NullData has no additional fields. + } +} + +impl ArrayEq for NullData { + fn array_eq(&self, _other: &Self, _precision: Precision) -> bool { + // len, dtype, and slots are compared by ArrayInner; NullData has no additional fields. + true + } +} + impl VTable for Null { type ArrayData = NullData; @@ -50,15 +67,6 @@ impl VTable for Null { Ok(()) } - fn array_hash(_data: &NullData, _state: &mut H, _precision: Precision) { - // len and dtype are hashed by ArrayInner; NullData has no additional fields. - } - - fn array_eq(_data: &NullData, _other: &NullData, _precision: Precision) -> bool { - // len, dtype, and slots are compared by ArrayInner; NullData has no additional fields. - true - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/arrays/patched/array.rs b/vortex-array/src/arrays/patched/array.rs index f8168375997..f7b5cddfd5f 100644 --- a/vortex-array/src/arrays/patched/array.rs +++ b/vortex-array/src/arrays/patched/array.rs @@ -118,22 +118,22 @@ fn patch_values_from_slots(slots: &[Option]) -> &ArrayRef { pub trait PatchedArrayExt: TypedArrayRef { #[inline] fn base_array(&self) -> &ArrayRef { - base_array_from_slots(self.slots_ref()) + base_array_from_slots(self.as_ref().slots()) } #[inline] fn lane_offsets(&self) -> &ArrayRef { - lane_offsets_from_slots(self.slots_ref()) + lane_offsets_from_slots(self.as_ref().slots()) } #[inline] fn patch_indices(&self) -> &ArrayRef { - patch_indices_from_slots(self.slots_ref()) + patch_indices_from_slots(self.as_ref().slots()) } #[inline] fn patch_values(&self) -> &ArrayRef { - patch_values_from_slots(self.slots_ref()) + patch_values_from_slots(self.as_ref().slots()) } #[inline] @@ -327,6 +327,7 @@ fn transpose( offset: usize, array_len: usize, ) -> TransposedPatches { + // Total number of slots is number of chunks times number of lanes. let n_chunks = array_len.div_ceil(1024); assert!( n_chunks <= u32::MAX as usize, @@ -335,10 +336,14 @@ fn transpose( let n_lanes = patch_lanes::(); + // We know upfront how many indices and values we'll have. let mut indices_buffer = BufferMut::with_capacity(indices_in.len()); let mut values_buffer = BufferMut::with_capacity(values_in.len()); + + // Number of patches in each chunk/lane. let mut lane_offsets: BufferMut = BufferMut::zeroed(n_chunks * n_lanes + 1); + // Scan the index/value pairs once to get chunk/lane counts. for index in indices_in { let index = index.as_() - offset; let chunk = index / 1024; @@ -351,6 +356,7 @@ fn transpose( lane_offsets[index] += lane_offsets[index - 1]; } + // Loop over patches, writing them to final positions. let indices_out = indices_buffer.spare_capacity_mut(); let values_out = values_buffer.spare_capacity_mut(); for (index, &value) in std::iter::zip(indices_in, values_in) { diff --git a/vortex-array/src/arrays/patched/compute/compare.rs b/vortex-array/src/arrays/patched/compute/compare.rs index 889b41a198e..0c3c6ede097 100644 --- a/vortex-array/src/arrays/patched/compute/compare.rs +++ b/vortex-array/src/arrays/patched/compute/compare.rs @@ -53,7 +53,8 @@ impl CompareKernel for Patched { .into_bool(); let validity = child_to_validity(&result.slots()[0], result.dtype().nullability()); - let BoolDataParts { bits, offset, len } = result.into_data().into_parts(); + let len = result.len(); + let BoolDataParts { bits, offset, len } = result.into_data().into_parts(len); let mut bits = BitBufferMut::from_buffer(bits.unwrap_host().into_mut(), offset, len); diff --git a/vortex-array/src/arrays/patched/vtable/mod.rs b/vortex-array/src/arrays/patched/vtable/mod.rs index d0b472a192b..684ffa252f6 100644 --- a/vortex-array/src/arrays/patched/vtable/mod.rs +++ b/vortex-array/src/arrays/patched/vtable/mod.rs @@ -2,6 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use prost::Message; + +use crate::ArrayEq; +use crate::ArrayHash; mod kernels; mod operations; mod slice; @@ -73,6 +76,19 @@ pub struct PatchedMetadata { pub(crate) offset: u32, } +impl ArrayHash for PatchedData { + fn array_hash(&self, state: &mut H, _precision: Precision) { + self.offset.hash(state); + self.n_lanes.hash(state); + } +} + +impl ArrayEq for PatchedData { + fn array_eq(&self, other: &Self, _precision: Precision) -> bool { + self.offset == other.offset && self.n_lanes == other.n_lanes + } +} + impl VTable for Patched { type ArrayData = PatchedData; type OperationsVTable = Self; @@ -82,15 +98,6 @@ impl VTable for Patched { ArrayId::new_ref("vortex.patched") } - fn array_hash(data: &PatchedData, state: &mut H, _precision: Precision) { - data.offset.hash(state); - data.n_lanes.hash(state); - } - - fn array_eq(data: &PatchedData, other: &PatchedData, _precision: Precision) -> bool { - data.offset == other.offset && data.n_lanes == other.n_lanes - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/arrays/primitive/array/cast.rs b/vortex-array/src/arrays/primitive/array/cast.rs index e5f85b37a2d..9c7e3eb8550 100644 --- a/vortex-array/src/arrays/primitive/array/cast.rs +++ b/vortex-array/src/arrays/primitive/array/cast.rs @@ -44,22 +44,6 @@ impl PrimitiveData { // SAFETY: alignment of Buffer is checked on construction unsafe { std::slice::from_raw_parts(raw_slice.cast(), byte_buffer.len() / size_of::()) } } - - pub fn reinterpret_cast(&self, ptype: PType) -> Self { - if self.ptype() == ptype { - return self.clone(); - } - - assert_eq!( - self.ptype().byte_width(), - ptype.byte_width(), - "can't reinterpret cast between integers of two different widths" - ); - - vortex_panic!( - "PrimitiveData::reinterpret_cast requires outer validity; use PrimitiveArray::reinterpret_cast" - ) - } } impl PrimitiveArray { diff --git a/vortex-array/src/arrays/primitive/array/mod.rs b/vortex-array/src/arrays/primitive/array/mod.rs index 0af637e21b5..66d4279465d 100644 --- a/vortex-array/src/arrays/primitive/array/mod.rs +++ b/vortex-array/src/arrays/primitive/array/mod.rs @@ -104,16 +104,20 @@ pub trait PrimitiveArrayExt: TypedArrayRef { } fn validity_child(&self) -> Option<&ArrayRef> { - self.slots_ref()[VALIDITY_SLOT].as_ref() + self.as_ref().slots()[VALIDITY_SLOT].as_ref() } fn validity(&self) -> Validity { - child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.nullability()) + child_to_validity(&self.as_ref().slots()[VALIDITY_SLOT], self.nullability()) } fn validity_mask(&self) -> vortex_mask::Mask { self.validity().to_mask(self.as_ref().len()) } + + fn buffer_handle(&self) -> &BufferHandle { + &self.buffer + } } impl> PrimitiveArrayExt for T {} @@ -181,12 +185,11 @@ impl PrimitiveData { /// /// - If `validity` is [`Validity::Array`], its length must exactly equal `buffer.len()`. #[inline] - pub unsafe fn new_unchecked(buffer: Buffer, validity: Validity) -> Self { + pub unsafe fn new_unchecked(buffer: Buffer, _validity: Validity) -> Self { #[cfg(debug_assertions)] - Self::validate(&buffer, &validity) + Self::validate(&buffer, &_validity) .vortex_expect("[Debug Assertion]: Invalid `PrimitiveArray` parameters"); - drop(validity); Self { ptype: T::PTYPE, buffer: BufferHandle::new_host(buffer.into_byte_buffer()), @@ -382,15 +385,6 @@ impl Array { } } -impl PrimitiveData { - /// Consume the primitive array and returns its component parts. - pub fn into_parts(self) -> PrimitiveDataParts { - vortex_panic!( - "PrimitiveData::into_parts requires outer dtype; use Array::into_data_parts" - ) - } -} - impl PrimitiveData { pub fn len(&self) -> usize { self.buffer.len() / self.ptype.byte_width() @@ -410,8 +404,7 @@ impl PrimitiveData { &self.buffer } - pub fn from_buffer_handle(handle: BufferHandle, ptype: PType, validity: Validity) -> Self { - drop(validity); + pub fn from_buffer_handle(handle: BufferHandle, ptype: PType, _validity: Validity) -> Self { Self { ptype, buffer: handle, @@ -465,33 +458,6 @@ impl PrimitiveData { Buffer::from_byte_buffer(self.buffer_handle().to_host_sync()) } - /// Map each element in the array to a new value. - /// - /// This ignores validity and maps over all maybe-null elements. - /// - /// TODO(ngates): we could be smarter here if validity is sparse and only run the function - /// over the valid elements. - pub fn map_each(self, f: F) -> Self - where - T: NativePType, - R: NativePType, - F: FnMut(T) -> R, - { - let _f = f; - vortex_panic!("PrimitiveData::map_each requires outer dtype; use Array helpers") - } - - pub fn map_each_with_validity(self, _f: F) -> VortexResult - where - T: NativePType, - R: NativePType, - F: FnMut((T, bool)) -> R, - { - vortex_panic!( - "PrimitiveData::map_each_with_validity requires outer dtype; use Array helpers" - ) - } - /// Consume the array and get a host Buffer containing the data values. pub fn into_buffer(self) -> Buffer { if T::PTYPE != self.ptype() { @@ -531,7 +497,7 @@ impl Array { } pub fn buffer_handle(&self) -> &BufferHandle { - &self.data().buffer + PrimitiveArrayExt::buffer_handle(self) } } @@ -541,6 +507,6 @@ impl ArrayView<'_, Primitive> { } pub fn buffer_handle(&self) -> &BufferHandle { - &self.data().buffer + PrimitiveArrayExt::buffer_handle(self) } } diff --git a/vortex-array/src/arrays/primitive/vtable/mod.rs b/vortex-array/src/arrays/primitive/vtable/mod.rs index 907429e65c9..180d01e8c35 100644 --- a/vortex-array/src/arrays/primitive/vtable/mod.rs +++ b/vortex-array/src/arrays/primitive/vtable/mod.rs @@ -38,6 +38,18 @@ use crate::hash::ArrayHash; vtable!(Primitive, Primitive, PrimitiveData); +impl ArrayHash for PrimitiveData { + fn array_hash(&self, state: &mut H, precision: Precision) { + self.buffer.array_hash(state, precision); + } +} + +impl ArrayEq for PrimitiveData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + self.buffer.array_eq(&other.buffer, precision) + } +} + impl VTable for Primitive { type ArrayData = PrimitiveData; @@ -48,14 +60,6 @@ impl VTable for Primitive { Self::ID } - fn array_hash(data: &PrimitiveData, state: &mut H, precision: Precision) { - data.buffer.array_hash(state, precision); - } - - fn array_eq(data: &PrimitiveData, other: &PrimitiveData, precision: Precision) -> bool { - data.buffer.array_eq(&other.buffer, precision) - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 1 } diff --git a/vortex-array/src/arrays/scalar_fn/array.rs b/vortex-array/src/arrays/scalar_fn/array.rs index 00a4cd4b2aa..def2420f270 100644 --- a/vortex-array/src/arrays/scalar_fn/array.rs +++ b/vortex-array/src/arrays/scalar_fn/array.rs @@ -9,6 +9,7 @@ use crate::ArrayRef; use crate::array::Array; use crate::array::ArrayParts; use crate::array::ArrayView; +use crate::array::TypedArrayRef; use crate::arrays::ScalarFnVTable; use crate::scalar_fn::ScalarFnRef; @@ -30,7 +31,6 @@ impl ScalarFnData { children.iter().all(|c| c.len() == len), "ScalarFnArray must have children equal to the array length" ); - drop(children); Ok(Self { scalar_fn }) } @@ -42,70 +42,58 @@ impl ScalarFnData { } } -pub trait ScalarFnArrayDataExt { - fn child_at(&self, idx: usize) -> &ArrayRef; - fn child_count(&self) -> usize; - - fn iter_children(&self) -> impl Iterator + '_ { - (0..self.child_count()).map(|idx| self.child_at(idx)) - } - - fn children(&self) -> Vec { - self.iter_children().cloned().collect() +pub trait ScalarFnArrayExt: TypedArrayRef { + fn scalar_fn(&self) -> &ScalarFnRef { + &self.scalar_fn } -} -impl ScalarFnArrayDataExt for Array { fn child_at(&self, idx: usize) -> &ArrayRef { - self.slots()[idx] + self.as_ref().slots()[idx] .as_ref() .vortex_expect("ScalarFnArray child slot") } fn child_count(&self) -> usize { - self.slots().len() + self.as_ref().slots().len() } -} -impl ScalarFnArrayDataExt for ArrayView<'_, ScalarFnVTable> { - fn child_at(&self, idx: usize) -> &ArrayRef { - self.slots()[idx] - .as_ref() - .vortex_expect("ScalarFnArray child slot") + fn iter_children(&self) -> impl Iterator + '_ { + (0..self.child_count()).map(|idx| self.child_at(idx)) } - fn child_count(&self) -> usize { - self.slots().len() + fn children(&self) -> Vec { + self.iter_children().cloned().collect() } } +impl> ScalarFnArrayExt for T {} impl Array { /// Get the scalar function bound to this array. #[allow(clippy::same_name_method)] #[inline(always)] pub fn scalar_fn(&self) -> &ScalarFnRef { - self.data().scalar_fn() + ScalarFnArrayExt::scalar_fn(self) } /// Get the children arrays of this scalar function array. #[allow(clippy::same_name_method)] pub fn children(&self) -> Vec { - ScalarFnArrayDataExt::children(self) + ScalarFnArrayExt::children(self) } #[allow(clippy::same_name_method)] pub fn get_child(&self, idx: usize) -> &ArrayRef { - ScalarFnArrayDataExt::child_at(self, idx) + ScalarFnArrayExt::child_at(self, idx) } #[allow(clippy::same_name_method)] pub fn nchildren(&self) -> usize { - ScalarFnArrayDataExt::child_count(self) + ScalarFnArrayExt::child_count(self) } #[allow(clippy::same_name_method)] pub fn iter_children(&self) -> impl Iterator + '_ { - (0..self.nchildren()).map(|idx| self.get_child(idx)) + ScalarFnArrayExt::iter_children(self) } /// Create a new ScalarFnArray from a scalar function and its children. @@ -128,23 +116,28 @@ impl Array { } impl ArrayView<'_, ScalarFnVTable> { + #[allow(clippy::same_name_method)] + pub fn scalar_fn(&self) -> &ScalarFnRef { + ScalarFnArrayExt::scalar_fn(self) + } + #[allow(clippy::same_name_method)] pub fn children(&self) -> Vec { - ScalarFnArrayDataExt::children(self) + ScalarFnArrayExt::children(self) } #[allow(clippy::same_name_method)] pub fn get_child(&self, idx: usize) -> &ArrayRef { - ScalarFnArrayDataExt::child_at(self, idx) + ScalarFnArrayExt::child_at(self, idx) } #[allow(clippy::same_name_method)] pub fn nchildren(&self) -> usize { - ScalarFnArrayDataExt::child_count(self) + ScalarFnArrayExt::child_count(self) } #[allow(clippy::same_name_method)] pub fn iter_children(&self) -> impl Iterator + '_ { - (0..self.nchildren()).map(|idx| self.get_child(idx)) + ScalarFnArrayExt::iter_children(self) } } diff --git a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs index a7d01689f88..429af3188e4 100644 --- a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs +++ b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs @@ -16,6 +16,8 @@ use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; +use crate::ArrayEq; +use crate::ArrayHash; use crate::ArrayRef; use crate::IntoArray; use crate::Precision; @@ -51,6 +53,18 @@ pub struct ScalarFnVTable { pub(super) scalar_fn: ScalarFnRef, } +impl ArrayHash for ScalarFnData { + fn array_hash(&self, state: &mut H, _precision: Precision) { + self.scalar_fn().hash(state); + } +} + +impl ArrayEq for ScalarFnData { + fn array_eq(&self, other: &Self, _precision: Precision) -> bool { + self.scalar_fn() == other.scalar_fn() + } +} + impl VTable for ScalarFnVTable { type ArrayData = ScalarFnData; type OperationsVTable = Self; @@ -88,14 +102,6 @@ impl VTable for ScalarFnVTable { Ok(()) } - fn array_hash(data: &ScalarFnData, state: &mut H, _precision: Precision) { - data.scalar_fn().hash(state); - } - - fn array_eq(data: &ScalarFnData, other: &ScalarFnData, _precision: Precision) -> bool { - data.scalar_fn() == other.scalar_fn() - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/arrays/shared/array.rs b/vortex-array/src/arrays/shared/array.rs index 4836d5eb73c..3a212cf74df 100644 --- a/vortex-array/src/arrays/shared/array.rs +++ b/vortex-array/src/arrays/shared/array.rs @@ -36,7 +36,7 @@ pub struct SharedData { #[allow(async_fn_in_trait)] pub trait SharedArrayExt: TypedArrayRef { fn source(&self) -> &ArrayRef { - self.slots_ref()[SOURCE_SLOT] + self.as_ref().slots()[SOURCE_SLOT] .as_ref() .vortex_expect("validated shared source slot") } diff --git a/vortex-array/src/arrays/shared/vtable.rs b/vortex-array/src/arrays/shared/vtable.rs index d57dd5be6d4..a368d74226b 100644 --- a/vortex-array/src/arrays/shared/vtable.rs +++ b/vortex-array/src/arrays/shared/vtable.rs @@ -1,11 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::hash::Hasher; + use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_panic; use vortex_session::VortexSession; +use crate::ArrayEq; +use crate::ArrayHash; use crate::ArrayRef; use crate::Canonical; use crate::ExecutionCtx; @@ -37,6 +41,16 @@ impl Shared { pub const ID: ArrayId = ArrayId::new_ref("vortex.shared"); } +impl ArrayHash for SharedData { + fn array_hash(&self, _state: &mut H, _precision: Precision) {} +} + +impl ArrayEq for SharedData { + fn array_eq(&self, _other: &Self, _precision: Precision) -> bool { + true + } +} + impl VTable for Shared { type ArrayData = SharedData; type OperationsVTable = Self; @@ -61,13 +75,6 @@ impl VTable for Shared { Ok(()) } - fn array_hash(_data: &SharedData, _state: &mut H, _precision: Precision) { - } - - fn array_eq(_data: &SharedData, _other: &SharedData, _precision: Precision) -> bool { - true - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/arrays/slice/array.rs b/vortex-array/src/arrays/slice/array.rs index 12deeba11de..dd00950a9d0 100644 --- a/vortex-array/src/arrays/slice/array.rs +++ b/vortex-array/src/arrays/slice/array.rs @@ -29,7 +29,7 @@ pub struct SliceDataParts { pub trait SliceArrayExt: TypedArrayRef { fn child(&self) -> &ArrayRef { - self.slots_ref()[CHILD_SLOT] + self.as_ref().slots()[CHILD_SLOT] .as_ref() .vortex_expect("validated slice child slot") } diff --git a/vortex-array/src/arrays/slice/vtable.rs b/vortex-array/src/arrays/slice/vtable.rs index 1ff36050ffa..b5552cdec3c 100644 --- a/vortex-array/src/arrays/slice/vtable.rs +++ b/vortex-array/src/arrays/slice/vtable.rs @@ -15,6 +15,8 @@ use vortex_error::vortex_panic; use vortex_session::VortexSession; use crate::AnyCanonical; +use crate::ArrayEq; +use crate::ArrayHash; use crate::ArrayRef; use crate::Canonical; use crate::IntoArray; @@ -48,6 +50,19 @@ impl Slice { pub const ID: ArrayId = ArrayId::new_ref("vortex.slice"); } +impl ArrayHash for SliceData { + fn array_hash(&self, state: &mut H, _precision: Precision) { + self.range.start.hash(state); + self.range.end.hash(state); + } +} + +impl ArrayEq for SliceData { + fn array_eq(&self, other: &Self, _precision: Precision) -> bool { + self.range == other.range + } +} + impl VTable for Slice { type ArrayData = SliceData; type OperationsVTable = Self; @@ -92,15 +107,6 @@ impl VTable for Slice { Ok(()) } - fn array_hash(data: &SliceData, state: &mut H, _precision: Precision) { - data.range.start.hash(state); - data.range.end.hash(state); - } - - fn array_eq(data: &SliceData, other: &SliceData, _precision: Precision) -> bool { - data.range == other.range - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/arrays/struct_/array.rs b/vortex-array/src/arrays/struct_/array.rs index 3952541d406..9f8b0d7f4a9 100644 --- a/vortex-array/src/arrays/struct_/array.rs +++ b/vortex-array/src/arrays/struct_/array.rs @@ -350,11 +350,11 @@ pub trait StructArrayExt: TypedArrayRef { } fn struct_validity(&self) -> Validity { - child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.nullability()) + child_to_validity(&self.as_ref().slots()[VALIDITY_SLOT], self.nullability()) } fn iter_unmasked_fields(&self) -> impl Iterator + '_ { - self.slots_ref()[FIELDS_OFFSET..] + self.as_ref().slots()[FIELDS_OFFSET..] .iter() .map(|s| s.as_ref().vortex_expect("StructArray field slot")) } @@ -364,7 +364,7 @@ pub trait StructArrayExt: TypedArrayRef { } fn unmasked_field(&self, idx: usize) -> &ArrayRef { - self.slots_ref()[FIELDS_OFFSET + idx] + self.as_ref().slots()[FIELDS_OFFSET + idx] .as_ref() .vortex_expect("StructArray field slot") } diff --git a/vortex-array/src/arrays/struct_/vtable/mod.rs b/vortex-array/src/arrays/struct_/vtable/mod.rs index 91693465b59..629e115f6d0 100644 --- a/vortex-array/src/arrays/struct_/vtable/mod.rs +++ b/vortex-array/src/arrays/struct_/vtable/mod.rs @@ -1,6 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::hash::Hasher; + use itertools::Itertools; use kernel::PARENT_KERNELS; use vortex_error::VortexExpect; @@ -9,6 +11,8 @@ use vortex_error::vortex_bail; use vortex_error::vortex_panic; use vortex_session::VortexSession; +use crate::ArrayEq; +use crate::ArrayHash; use crate::ArrayRef; use crate::ExecutionCtx; use crate::ExecutionResult; @@ -34,6 +38,16 @@ use crate::array::ArrayId; vtable!(Struct, Struct, StructData); +impl ArrayHash for StructData { + fn array_hash(&self, _state: &mut H, _precision: Precision) {} +} + +impl ArrayEq for StructData { + fn array_eq(&self, _other: &Self, _precision: Precision) -> bool { + true + } +} + impl VTable for Struct { type ArrayData = StructData; @@ -44,13 +58,6 @@ impl VTable for Struct { Self::ID } - fn array_hash(_data: &StructData, _state: &mut H, _precision: Precision) { - } - - fn array_eq(_data: &StructData, _other: &StructData, _precision: Precision) -> bool { - true - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/arrays/varbin/array.rs b/vortex-array/src/arrays/varbin/array.rs index 29f5fb3fbec..632cabf8be2 100644 --- a/vortex-array/src/arrays/varbin/array.rs +++ b/vortex-array/src/arrays/varbin/array.rs @@ -307,13 +307,13 @@ impl VarBinData { pub trait VarBinArrayExt: TypedArrayRef { fn offsets(&self) -> &ArrayRef { - self.slots_ref()[OFFSETS_SLOT] + self.as_ref().slots()[OFFSETS_SLOT] .as_ref() .vortex_expect("VarBinArray offsets slot") } fn validity_child(&self) -> Option<&ArrayRef> { - self.slots_ref()[VALIDITY_SLOT].as_ref() + self.as_ref().slots()[VALIDITY_SLOT].as_ref() } fn dtype_parts(&self) -> (bool, Nullability) { @@ -333,7 +333,7 @@ pub trait VarBinArrayExt: TypedArrayRef { } fn varbin_validity(&self) -> Validity { - child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.nullability()) + child_to_validity(&self.as_ref().slots()[VALIDITY_SLOT], self.nullability()) } fn varbin_validity_mask(&self) -> Mask { diff --git a/vortex-array/src/arrays/varbin/vtable/mod.rs b/vortex-array/src/arrays/varbin/vtable/mod.rs index b6515eba8b0..c2270ac7cdb 100644 --- a/vortex-array/src/arrays/varbin/vtable/mod.rs +++ b/vortex-array/src/arrays/varbin/vtable/mod.rs @@ -1,6 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::hash::Hasher; + use prost::Message; use vortex_error::VortexExpect; use vortex_error::VortexResult; @@ -48,6 +50,18 @@ pub struct VarBinMetadata { pub(crate) offsets_ptype: i32, } +impl ArrayHash for VarBinData { + fn array_hash(&self, state: &mut H, precision: Precision) { + self.bytes().array_hash(state, precision); + } +} + +impl ArrayEq for VarBinData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + self.bytes().array_eq(other.bytes(), precision) + } +} + impl VTable for VarBin { type ArrayData = VarBinData; @@ -58,14 +72,6 @@ impl VTable for VarBin { Self::ID } - fn array_hash(data: &VarBinData, state: &mut H, precision: Precision) { - data.bytes().array_hash(state, precision); - } - - fn array_eq(data: &VarBinData, other: &VarBinData, precision: Precision) -> bool { - data.bytes().array_eq(other.bytes(), precision) - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 1 } diff --git a/vortex-array/src/arrays/varbinview/array.rs b/vortex-array/src/arrays/varbinview/array.rs index a17ee33fa76..dcff786545a 100644 --- a/vortex-array/src/arrays/varbinview/array.rs +++ b/vortex-array/src/arrays/varbinview/array.rs @@ -535,7 +535,7 @@ pub trait VarBinViewArrayExt: TypedArrayRef { } fn varbinview_validity(&self) -> Validity { - child_to_validity(&self.slots_ref()[VALIDITY_SLOT], self.dtype_parts().1) + child_to_validity(&self.as_ref().slots()[VALIDITY_SLOT], self.dtype_parts().1) } fn varbinview_validity_mask(&self) -> Mask { diff --git a/vortex-array/src/arrays/varbinview/vtable/mod.rs b/vortex-array/src/arrays/varbinview/vtable/mod.rs index 89050a4fc7f..102d7365be5 100644 --- a/vortex-array/src/arrays/varbinview/vtable/mod.rs +++ b/vortex-array/src/arrays/varbinview/vtable/mod.rs @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::hash::Hasher; use std::mem::size_of; use std::sync::Arc; @@ -45,35 +46,35 @@ impl VarBinView { pub const ID: ArrayId = ArrayId::new_ref("vortex.varbinview"); } -impl VTable for VarBinView { - type ArrayData = VarBinViewData; - - type OperationsVTable = Self; - type ValidityVTable = Self; - - fn id(&self) -> ArrayId { - Self::ID - } - - fn array_hash( - data: &VarBinViewData, - state: &mut H, - precision: Precision, - ) { - for buffer in data.buffers.iter() { +impl ArrayHash for VarBinViewData { + fn array_hash(&self, state: &mut H, precision: Precision) { + for buffer in self.buffers.iter() { buffer.array_hash(state, precision); } - data.views.array_hash(state, precision); + self.views.array_hash(state, precision); } +} - fn array_eq(data: &VarBinViewData, other: &VarBinViewData, precision: Precision) -> bool { - data.buffers.len() == other.buffers.len() - && data +impl ArrayEq for VarBinViewData { + fn array_eq(&self, other: &Self, precision: Precision) -> bool { + self.buffers.len() == other.buffers.len() + && self .buffers .iter() .zip(other.buffers.iter()) .all(|(a, b)| a.array_eq(b, precision)) - && data.views.array_eq(&other.views, precision) + && self.views.array_eq(&other.views, precision) + } +} + +impl VTable for VarBinView { + type ArrayData = VarBinViewData; + + type OperationsVTable = Self; + type ValidityVTable = Self; + + fn id(&self) -> ArrayId { + Self::ID } fn nbuffers(array: ArrayView<'_, Self>) -> usize { diff --git a/vortex-array/src/arrays/variant/mod.rs b/vortex-array/src/arrays/variant/mod.rs index f5f433f0db4..9ab2723a073 100644 --- a/vortex-array/src/arrays/variant/mod.rs +++ b/vortex-array/src/arrays/variant/mod.rs @@ -30,7 +30,7 @@ pub struct VariantData; pub trait VariantArrayExt: TypedArrayRef { fn child(&self) -> &ArrayRef { - self.slots_ref()[0] + self.as_ref().slots()[0] .as_ref() .vortex_expect("validated variant child slot") } diff --git a/vortex-array/src/arrays/variant/vtable/mod.rs b/vortex-array/src/arrays/variant/vtable/mod.rs index e8b3b0d9d89..a38629399de 100644 --- a/vortex-array/src/arrays/variant/vtable/mod.rs +++ b/vortex-array/src/arrays/variant/vtable/mod.rs @@ -11,6 +11,8 @@ use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_panic; +use crate::ArrayEq; +use crate::ArrayHash; use crate::ArrayRef; use crate::ExecutionCtx; use crate::ExecutionResult; @@ -35,6 +37,16 @@ impl Variant { pub const ID: ArrayId = ArrayId::new_ref("vortex.variant"); } +impl ArrayHash for VariantData { + fn array_hash(&self, _state: &mut H, _precision: Precision) {} +} + +impl ArrayEq for VariantData { + fn array_eq(&self, _other: &Self, _precision: Precision) -> bool { + true + } +} + impl VTable for Variant { type ArrayData = VariantData; @@ -79,12 +91,6 @@ impl VTable for Variant { Ok(()) } - fn array_hash(_data: &VariantData, _state: &mut H, _precision: Precision) {} - - fn array_eq(_data: &VariantData, _other: &VariantData, _precision: Precision) -> bool { - true - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } diff --git a/vortex-array/src/canonical.rs b/vortex-array/src/canonical.rs index ca0acc2f434..3c602d7e816 100644 --- a/vortex-array/src/canonical.rs +++ b/vortex-array/src/canonical.rs @@ -546,7 +546,8 @@ impl Executable for CanonicalValidity { n @ Canonical::Null(_) => Ok(CanonicalValidity(n)), Canonical::Bool(b) => { let validity = child_to_validity(&b.slots()[0], b.dtype().nullability()); - let BoolDataParts { bits, offset, len } = b.into_data().into_parts(); + let len = b.len(); + let BoolDataParts { bits, offset, len } = b.into_data().into_parts(len); Ok(CanonicalValidity(Canonical::Bool( BoolArray::try_new_from_handle(bits, offset, len, validity.execute(ctx)?)?, ))) @@ -664,7 +665,8 @@ impl Executable for RecursiveCanonical { n @ Canonical::Null(_) => Ok(RecursiveCanonical(n)), Canonical::Bool(b) => { let validity = child_to_validity(&b.slots()[0], b.dtype().nullability()); - let BoolDataParts { bits, offset, len } = b.into_data().into_parts(); + let len = b.len(); + let BoolDataParts { bits, offset, len } = b.into_data().into_parts(len); Ok(RecursiveCanonical(Canonical::Bool( BoolArray::try_new_from_handle(bits, offset, len, validity.execute(ctx)?)?, ))) diff --git a/vortex-btrblocks/src/schemes/integer.rs b/vortex-btrblocks/src/schemes/integer.rs index 05e407217c8..552cf7f2b36 100644 --- a/vortex-btrblocks/src/schemes/integer.rs +++ b/vortex-btrblocks/src/schemes/integer.rs @@ -854,7 +854,7 @@ mod tests { .into_array(); let btr = BtrBlocksCompressor::default(); - drop(btr.compress(&prim)?); + btr.compress(&prim)?; Ok(()) } diff --git a/vortex-cuda/src/arrow/canonical.rs b/vortex-cuda/src/arrow/canonical.rs index f28c18ed7a4..a960c24f7fc 100644 --- a/vortex-cuda/src/arrow/canonical.rs +++ b/vortex-cuda/src/arrow/canonical.rs @@ -128,10 +128,11 @@ fn export_canonical( export_fixed_size(buffer, len, 0, ctx) } Canonical::Bool(bool_array) => { + let len = bool_array.len(); let validity = bool_array.validity()?; let BoolDataParts { bits, offset, len, .. - } = bool_array.into_data().into_parts(); + } = bool_array.into_data().into_parts(len); check_validity_empty(&validity)?; @@ -262,7 +263,6 @@ unsafe extern "C" fn release_array(array: *mut ArrowArray) { for child in children { release_array(child); } - drop(private_data); } // update the release function to NULL to avoid any possibility of double-frees. diff --git a/vortex-cuda/src/canonical.rs b/vortex-cuda/src/canonical.rs index a738e0c0e54..2bfb78242d6 100644 --- a/vortex-cuda/src/canonical.rs +++ b/vortex-cuda/src/canonical.rs @@ -63,10 +63,11 @@ impl CanonicalCudaExt for Canonical { Canonical::Bool(bool) => { // NOTE: update to copy to host when adding buffer handle. // Also update other method to copy validity to host. + let len = bool.len(); let validity = bool.validity()?; let BoolDataParts { bits, offset, len, .. - } = bool.into_data().into_parts(); + } = bool.into_data().into_parts(len); let bits = BitBuffer::new_with_offset(bits.try_into_host()?.await?, offset, len); Ok(Canonical::Bool(BoolArray::new(bits, validity))) diff --git a/vortex-cuda/src/executor.rs b/vortex-cuda/src/executor.rs index b20a3060773..3180f53452d 100644 --- a/vortex-cuda/src/executor.rs +++ b/vortex-cuda/src/executor.rs @@ -127,9 +127,6 @@ impl CudaExecutionCtx { let events = launch_cuda_kernel_impl(&mut launcher, self.strategy.event_flags(), len)?; self.strategy.on_complete(&events, len)?; - - drop(events); - Ok(()) } @@ -151,9 +148,6 @@ impl CudaExecutionCtx { let events = launch_cuda_kernel_with_config(&mut launcher, cfg, self.strategy.event_flags())?; self.strategy.on_complete(&events, len)?; - - drop(events); - Ok(()) } diff --git a/vortex-cuda/src/hybrid_dispatch/mod.rs b/vortex-cuda/src/hybrid_dispatch/mod.rs index e81309db88e..61708c8248a 100644 --- a/vortex-cuda/src/hybrid_dispatch/mod.rs +++ b/vortex-cuda/src/hybrid_dispatch/mod.rs @@ -87,7 +87,7 @@ pub async fn try_gpu_dispatch( // TODO(0ax1): execute subtrees concurrently using separate CUDA streams. for subtree in &pending_subtrees { let canonical = subtree.clone().execute_cuda(ctx).await?; - subtree_buffers.push(canonical.into_primitive().into_data().into_parts().buffer); + subtree_buffers.push(canonical.into_primitive().into_data_parts().buffer); } let num_subtrees = subtree_buffers.len(); diff --git a/vortex-cuda/src/kernel/arrays/dict.rs b/vortex-cuda/src/kernel/arrays/dict.rs index 8722f19b326..28d0013328c 100644 --- a/vortex-cuda/src/kernel/arrays/dict.rs +++ b/vortex-cuda/src/kernel/arrays/dict.rs @@ -98,12 +98,12 @@ async fn execute_dict_prim_typed(values, mask, ctx).await?; diff --git a/vortex-cuda/src/kernel/patches/mod.rs b/vortex-cuda/src/kernel/patches/mod.rs index 3d611ee4759..206ac8bc1cd 100644 --- a/vortex-cuda/src/kernel/patches/mod.rs +++ b/vortex-cuda/src/kernel/patches/mod.rs @@ -70,12 +70,12 @@ pub(crate) async fn execute_patches< let PrimitiveDataParts { buffer: indices_buffer, .. - } = indices.into_data().into_parts(); + } = indices.into_data_parts(); let PrimitiveDataParts { buffer: values_buffer, .. - } = values.into_data().into_parts(); + } = values.into_data_parts(); let d_patch_indices = ctx.ensure_on_device(indices_buffer).await?; let d_patch_values = ctx.ensure_on_device(values_buffer).await?; @@ -170,7 +170,7 @@ mod tests { let PrimitiveDataParts { buffer: cuda_buffer, .. - } = values.into_data().into_parts(); + } = values.into_data_parts(); let handle = ctx.ensure_on_device(cuda_buffer).await.unwrap(); let device_buf = handle diff --git a/vortex-python/src/arrays/py/vtable.rs b/vortex-python/src/arrays/py/vtable.rs index 076e0327e49..e98135cff97 100644 --- a/vortex-python/src/arrays/py/vtable.rs +++ b/vortex-python/src/arrays/py/vtable.rs @@ -5,6 +5,8 @@ use std::hash::Hash; use std::sync::Arc; use vortex::array::Array; +use vortex::array::ArrayEq; +use vortex::array::ArrayHash; use vortex::array::ArrayId; use vortex::array::ArrayParts; use vortex::array::ArrayRef; @@ -36,6 +38,18 @@ pub struct PythonVTable { pub id: ArrayId, } +impl ArrayHash for PythonArray { + fn array_hash(&self, state: &mut H, _precision: Precision) { + Arc::as_ptr(&self.object).hash(state); + } +} + +impl ArrayEq for PythonArray { + fn array_eq(&self, other: &Self, _precision: Precision) -> bool { + Arc::ptr_eq(&self.object, &other.object) + } +} + impl VTable for PythonVTable { type ArrayData = PythonArray; @@ -59,14 +73,6 @@ impl VTable for PythonVTable { Ok(()) } - fn array_hash(data: &PythonArray, state: &mut H, _precision: Precision) { - Arc::as_ptr(&data.object).hash(state); - } - - fn array_eq(data: &PythonArray, other: &PythonArray, _precision: Precision) -> bool { - Arc::ptr_eq(&data.object, &other.object) - } - fn nbuffers(_array: ArrayView<'_, Self>) -> usize { 0 } From 9c707b9eee820aa67a56f03ca978dc7dbad08246 Mon Sep 17 00:00:00 2001 From: Nicholas Gates Date: Sun, 5 Apr 2026 16:20:30 -0400 Subject: [PATCH 08/10] Engine Signed-off-by: Nicholas Gates --- encodings/alp/src/alp/array.rs | 8 ++---- encodings/alp/src/alp_rd/array.rs | 17 ++---------- encodings/fastlanes/src/delta/array/mod.rs | 4 +-- vortex-array/public-api.lock | 6 +--- vortex-array/src/arrays/chunked/array.rs | 32 ---------------------- vortex-array/src/arrays/dict/array.rs | 8 +++--- vortex-array/src/arrays/dict/vtable/mod.rs | 3 +- 7 files changed, 12 insertions(+), 66 deletions(-) diff --git a/encodings/alp/src/alp/array.rs b/encodings/alp/src/alp/array.rs index 38c78dd71c6..d55b3300c80 100644 --- a/encodings/alp/src/alp/array.rs +++ b/encodings/alp/src/alp/array.rs @@ -432,11 +432,7 @@ impl ALPData { /// /// See [`ALPData::try_new`] for information about the preconditions that should be checked /// **before** calling this method. - pub(crate) unsafe fn new_unchecked( - _encoded: ArrayRef, - exponents: Exponents, - patches: Option, - ) -> Self { + pub(crate) unsafe fn new_unchecked(exponents: Exponents, patches: Option) -> Self { let (patch_offset, patch_offset_within_chunk) = match &patches { Some(p) => (Some(p.offset()), p.offset_within_chunk()), None => (None, None), @@ -488,7 +484,7 @@ impl ALP { let dtype = ALPData::logical_dtype(&encoded).vortex_expect("ALP encoded dtype"); let len = encoded.len(); let slots = ALPData::make_slots(&encoded, &patches); - let data = unsafe { ALPData::new_unchecked(encoded, exponents, patches) }; + let data = unsafe { ALPData::new_unchecked(exponents, patches) }; unsafe { Array::from_parts_unchecked(ArrayParts::new(ALP, dtype, len, data).with_slots(slots)) } diff --git a/encodings/alp/src/alp_rd/array.rs b/encodings/alp/src/alp_rd/array.rs index e646a7239c7..3330c239e56 100644 --- a/encodings/alp/src/alp_rd/array.rs +++ b/encodings/alp/src/alp_rd/array.rs @@ -373,22 +373,12 @@ impl ALPRD { left_parts_patches: Option, ) -> ALPRDArray { let len = left_parts.len(); - let logical_dtype = dtype.clone(); let slots = ALPRDData::make_slots(&left_parts, &right_parts, &left_parts_patches); let data = unsafe { - ALPRDData::new_unchecked( - dtype, - left_parts, - left_parts_dictionary, - right_parts, - right_bit_width, - left_parts_patches, - ) + ALPRDData::new_unchecked(left_parts_dictionary, right_bit_width, left_parts_patches) }; unsafe { - Array::from_parts_unchecked( - ArrayParts::new(ALPRD, logical_dtype, len, data).with_slots(slots), - ) + Array::from_parts_unchecked(ArrayParts::new(ALPRD, dtype, len, data).with_slots(slots)) } } } @@ -535,10 +525,7 @@ impl ALPRDData { /// Build a new `ALPRDArray` from components. This does not perform any validation, and instead /// it constructs it from parts. pub(crate) unsafe fn new_unchecked( - _dtype: DType, - _left_parts: ArrayRef, left_parts_dictionary: Buffer, - _right_parts: ArrayRef, right_bit_width: u8, left_parts_patches: Option, ) -> Self { diff --git a/encodings/fastlanes/src/delta/array/mod.rs b/encodings/fastlanes/src/delta/array/mod.rs index d479a726342..ae1f1b557d7 100644 --- a/encodings/fastlanes/src/delta/array/mod.rs +++ b/encodings/fastlanes/src/delta/array/mod.rs @@ -97,7 +97,7 @@ impl DeltaData { Self::validate_parts(&bases, &deltas, offset, len)?; // SAFETY: validation done above - Ok(unsafe { Self::new_unchecked(bases, deltas, offset) }) + Ok(unsafe { Self::new_unchecked(offset) }) } pub(crate) fn validate_against_slots( @@ -156,7 +156,7 @@ impl DeltaData { Ok(()) } - pub(crate) unsafe fn new_unchecked(_bases: ArrayRef, _deltas: ArrayRef, offset: usize) -> Self { + pub(crate) unsafe fn new_unchecked(offset: usize) -> Self { Self { offset } } } diff --git a/vortex-array/public-api.lock b/vortex-array/public-api.lock index 609672555e1..d0119c8e23b 100644 --- a/vortex-array/public-api.lock +++ b/vortex-array/public-api.lock @@ -1082,10 +1082,6 @@ pub struct vortex_array::arrays::chunked::ChunkedData impl vortex_array::arrays::chunked::ChunkedData -pub unsafe fn vortex_array::arrays::chunked::ChunkedData::new_unchecked(_chunks: alloc::vec::Vec, _dtype: vortex_array::dtype::DType) -> Self - -pub fn vortex_array::arrays::chunked::ChunkedData::try_new(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> vortex_error::VortexResult - pub fn vortex_array::arrays::chunked::ChunkedData::validate(chunks: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult<()> impl core::clone::Clone for vortex_array::arrays::chunked::ChunkedData @@ -1760,7 +1756,7 @@ impl vortex_array::arrays::dict::DictData pub fn vortex_array::arrays::dict::DictData::new(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self -pub unsafe fn vortex_array::arrays::dict::DictData::new_unchecked(_codes: vortex_array::ArrayRef, _values: vortex_array::ArrayRef) -> Self +pub unsafe fn vortex_array::arrays::dict::DictData::new_unchecked() -> Self pub unsafe fn vortex_array::arrays::dict::DictData::set_all_values_referenced(self, all_values_referenced: bool) -> Self diff --git a/vortex-array/src/arrays/chunked/array.rs b/vortex-array/src/arrays/chunked/array.rs index 06be53a51ba..e898693a848 100644 --- a/vortex-array/src/arrays/chunked/array.rs +++ b/vortex-array/src/arrays/chunked/array.rs @@ -198,34 +198,6 @@ impl ChunkedData { slots } - /// Constructs a new `ChunkedArray`. - /// - /// See `ChunkedArray::new_unchecked` for more information. - /// - /// # Errors - /// - /// Returns an error if the provided components do not satisfy the invariants documented in - /// `ChunkedArray::new_unchecked`. - pub fn try_new(chunks: Vec, dtype: DType) -> VortexResult { - Self::validate(&chunks, &dtype)?; - Ok(Self) - } - - /// Creates a new `ChunkedArray` without validation from these components: - /// - /// * `chunks` is a vector of arrays to be concatenated logically. - /// * `dtype` is the common data type of all chunks. - /// - /// # Safety - /// - /// All chunks must have exactly the same [`DType`] as the provided `dtype`. - pub unsafe fn new_unchecked(_chunks: Vec, _dtype: DType) -> Self { - #[cfg(debug_assertions)] - Self::validate(&_chunks, &_dtype) - .vortex_expect("[Debug Assertion]: Invalid `ChunkedArray` parameters"); - Self - } - /// Validates the components that would be used to create a `ChunkedArray`. /// /// This function checks all the invariants required by `ChunkedArray::new_unchecked`. @@ -302,10 +274,6 @@ impl Array { } /// Creates a new `ChunkedArray` without validation. - /// - /// # Safety - /// - /// See [`ChunkedData::new_unchecked`]. pub unsafe fn new_unchecked(chunks: Vec, dtype: DType) -> Self { let len = chunks.iter().map(|chunk| chunk.len()).sum(); unsafe { diff --git a/vortex-array/src/arrays/dict/array.rs b/vortex-array/src/arrays/dict/array.rs index 7db610308df..99d121d56c2 100644 --- a/vortex-array/src/arrays/dict/array.rs +++ b/vortex-array/src/arrays/dict/array.rs @@ -58,7 +58,7 @@ impl DictData { /// This should be called only when you can guarantee the invariants checked /// by the safe `DictArray::try_new` constructor are valid, for example when /// you are filtering or slicing an existing valid `DictArray`. - pub unsafe fn new_unchecked(_codes: ArrayRef, _values: ArrayRef) -> Self { + pub unsafe fn new_unchecked() -> Self { Self { all_values_referenced: false, } @@ -97,12 +97,12 @@ impl DictData { /// of the `values` array. Otherwise, this constructor returns an error. /// /// It is an error to provide a nullable `codes` with non-nullable `values`. - pub(crate) fn try_new(codes: ArrayRef, values: ArrayRef) -> VortexResult { + pub(crate) fn try_new(codes: ArrayRef, _values: ArrayRef) -> VortexResult { if !codes.dtype().is_int() { vortex_bail!(MismatchedTypes: "int", codes.dtype()); } - Ok(unsafe { Self::new_unchecked(codes, values) }) + Ok(unsafe { Self::new_unchecked() }) } } @@ -249,7 +249,7 @@ impl Array { .dtype() .union_nullability(codes.dtype().nullability()); let len = codes.len(); - let data = unsafe { DictData::new_unchecked(codes.clone(), values.clone()) }; + let data = unsafe { DictData::new_unchecked() }; unsafe { Array::from_parts_unchecked( ArrayParts::new(Dict, dtype, len, data).with_slots(vec![Some(codes), Some(values)]), diff --git a/vortex-array/src/arrays/dict/vtable/mod.rs b/vortex-array/src/arrays/dict/vtable/mod.rs index c2ad6e8fcd4..8150ddb4b99 100644 --- a/vortex-array/src/arrays/dict/vtable/mod.rs +++ b/vortex-array/src/arrays/dict/vtable/mod.rs @@ -159,8 +159,7 @@ impl VTable for Dict { Ok( crate::array::ArrayParts::new(self.clone(), dtype.clone(), len, unsafe { - DictData::new_unchecked(codes.clone(), values.clone()) - .set_all_values_referenced(all_values_referenced) + DictData::new_unchecked().set_all_values_referenced(all_values_referenced) }) .with_slots(vec![Some(codes), Some(values)]), ) From e48e936ea1ac6ad56647859ee26b596c44e755f9 Mon Sep 17 00:00:00 2001 From: Nicholas Gates Date: Sun, 5 Apr 2026 17:00:47 -0400 Subject: [PATCH 09/10] Engine Signed-off-by: Nicholas Gates --- vortex-array/src/arrays/chunked/array.rs | 4 + .../bin/sqllogictests-runner.rs | 187 ++++++++++-------- 2 files changed, 106 insertions(+), 85 deletions(-) diff --git a/vortex-array/src/arrays/chunked/array.rs b/vortex-array/src/arrays/chunked/array.rs index e898693a848..4bba1e0899b 100644 --- a/vortex-array/src/arrays/chunked/array.rs +++ b/vortex-array/src/arrays/chunked/array.rs @@ -274,6 +274,10 @@ impl Array { } /// Creates a new `ChunkedArray` without validation. + /// + /// # Safety + /// + /// All chunks must have exactly the same [`DType`] as the provided `dtype`. pub unsafe fn new_unchecked(chunks: Vec, dtype: DType) -> Self { let len = chunks.iter().map(|chunk| chunk.len()).sum(); unsafe { diff --git a/vortex-sqllogictest/bin/sqllogictests-runner.rs b/vortex-sqllogictest/bin/sqllogictests-runner.rs index 987bc2bb210..d20b851677f 100644 --- a/vortex-sqllogictest/bin/sqllogictests-runner.rs +++ b/vortex-sqllogictest/bin/sqllogictests-runner.rs @@ -46,103 +46,120 @@ async fn main() -> anyhow::Result<()> { let crate_path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")); let path = crate_path.join("slt/"); - - let all_errors = futures::stream::iter(list_files(path)?) - .map(|path| { - let mpb = mpb.clone(); - - async move { - let path = path.canonicalize()?; - - let mut errors = vec![]; - let factory = Arc::new(VortexFormatFactory::new()); - let session_state_builder = SessionStateBuilder::new() - .with_default_features() - .with_table_factory( - factory.get_ext().to_uppercase(), - Arc::new(DefaultTableFactory::new()), - ) - .with_file_formats(vec![factory]); - - let session = SessionContext::new_with_state(session_state_builder.build()) - .enable_url_table(); - - let filename = path - .file_name() - .vortex_expect("must be file") - .to_string_lossy(); - let records = parse_file(path.as_path())?; - - if !path.components().any(|comp| comp.as_os_str() == "duckdb") { - let df_pb = mpb.add(ProgressBar::new(records.len() as u64)); - df_pb.set_message(format!("DF {filename}")); - df_pb.set_style(ProgressStyle::default_spinner()); - - let mut df_runner = Runner::new(|| async { - Ok(DataFusion::new( - session.clone(), - path.clone(), - df_pb.clone(), - )) - }); - - df_runner.add_label("datafusion"); - df_runner.with_column_validator(strict_column_validator); - df_runner.with_normalizer(value_normalizer); - df_runner.with_validator(df_value_validator); - - for record in records.iter() { - if let Record::Halt { .. } = record { - break; - } - - if let Err(e) = df_runner.run_async(record.clone()).await { - errors.push(format!("DF Failure: {e}")); - } + let has_tpch_data = crate_path.join("slt/tpch/data/lineitem.vortex").exists(); + + let all_errors = futures::stream::iter( + list_files(path)? + .into_iter() + .filter(|path| { + has_tpch_data || !path.components().any(|comp| comp.as_os_str() == "tpch") + }) + .collect::>(), + ) + .map(|path| { + let mpb = mpb.clone(); + + async move { + let path = path.canonicalize()?; + + let mut errors = vec![]; + let factory = Arc::new(VortexFormatFactory::new()); + let session_state_builder = SessionStateBuilder::new() + .with_default_features() + .with_table_factory( + factory.get_ext().to_uppercase(), + Arc::new(DefaultTableFactory::new()), + ) + .with_file_formats(vec![factory]); + + let session = + SessionContext::new_with_state(session_state_builder.build()).enable_url_table(); + + let filename = path + .file_name() + .vortex_expect("must be file") + .to_string_lossy(); + let records = parse_file(path.as_path())?; + + if !path.components().any(|comp| comp.as_os_str() == "duckdb") { + let df_pb = mpb.add(ProgressBar::new(records.len() as u64)); + df_pb.set_message(format!("DF {filename}")); + df_pb.set_style(ProgressStyle::default_spinner()); + + let mut df_runner = Runner::new(|| async { + Ok(DataFusion::new( + session.clone(), + path.clone(), + df_pb.clone(), + )) + }); + + df_runner.add_label("datafusion"); + df_runner.with_column_validator(strict_column_validator); + df_runner.with_normalizer(value_normalizer); + df_runner.with_validator(df_value_validator); + + for record in records.iter() { + if let Record::Halt { .. } = record { + break; } - df_pb.finish_and_clear(); + if let Err(e) = df_runner.run_async(record.clone()).await { + errors.push(format!("DF Failure: {e}")); + } } - if !path - .components() - .any(|comp| comp.as_os_str() == "datafusion") - { - let duckdb_pb = mpb.add(ProgressBar::new(records.len() as u64)); - duckdb_pb.set_message(format!("DuckDB {filename}")); - - let mut duckdb_runner = Runner::new(|| async { - DuckDB::try_new(duckdb_pb.clone()) - .map_err(|e| DuckDBTestError::Other(e.to_string())) - }); - - duckdb_runner.add_label("duckdb"); - duckdb_runner.with_column_validator(strict_column_validator); - duckdb_runner.with_normalizer(value_normalizer); - - for record in records.iter() { - if let Record::Halt { .. } = record { - break; - } - - if let Err(e) = duckdb_runner.run_async(record.clone()).await { - errors.push(format!("DuckDB Failure: {e}")); - } + df_pb.finish_and_clear(); + } + + if !path + .components() + .any(|comp| comp.as_os_str() == "datafusion") + { + let duckdb_pb = mpb.add(ProgressBar::new(records.len() as u64)); + duckdb_pb.set_message(format!("DuckDB {filename}")); + + let mut duckdb_runner = Runner::new(|| async { + DuckDB::try_new(duckdb_pb.clone()) + .map_err(|e| DuckDBTestError::Other(e.to_string())) + }); + + duckdb_runner.add_label("duckdb"); + duckdb_runner.with_column_validator(strict_column_validator); + duckdb_runner.with_normalizer(value_normalizer); + + for record in records.iter() { + if let Record::Halt { .. } = record { + break; } - duckdb_pb.finish_and_clear(); + if let Err(e) = duckdb_runner.run_async(record.clone()).await { + errors.push(format!("DuckDB Failure: {e}")); + } } - anyhow::Ok(errors) + duckdb_pb.finish_and_clear(); } - }) - .buffer_unordered(args.test_threads) - .try_collect::>() - .await?; - for err in all_errors.into_iter().flatten() { + anyhow::Ok(errors) + } + }) + .buffer_unordered(args.test_threads) + .try_collect::>() + .await?; + + let errors = all_errors.into_iter().flatten().collect::>(); + for err in &errors { eprintln!("Failure: {err}"); } + if !has_tpch_data { + eprintln!("Skipping TPC-H sqllogictests because slt/tpch/data is not present."); + } + + if !errors.is_empty() { + anyhow::bail!("{} sqllogictest failure(s)", errors.len()); + } + Ok(()) } From 931c1a39c2e2ac59bddaecf0b68ce0f19a7d3c27 Mon Sep 17 00:00:00 2001 From: Nicholas Gates Date: Sun, 5 Apr 2026 17:36:07 -0400 Subject: [PATCH 10/10] Engine Signed-off-by: Nicholas Gates --- vortex-tensor/public-api.lock | 62 +++++--- .../src/encodings/turboquant/array/data.rs | 146 ++++++++++++------ .../turboquant/compute/cosine_similarity.rs | 1 + .../src/encodings/turboquant/compute/slice.rs | 1 + .../src/encodings/turboquant/compute/take.rs | 1 + .../src/encodings/turboquant/decompress.rs | 1 + vortex-tensor/src/encodings/turboquant/mod.rs | 1 + .../src/encodings/turboquant/tests.rs | 1 + .../src/encodings/turboquant/vtable.rs | 136 ++++++---------- vortex-tensor/src/scalar_fns/l2_norm.rs | 1 + 10 files changed, 198 insertions(+), 153 deletions(-) diff --git a/vortex-tensor/public-api.lock b/vortex-tensor/public-api.lock index 349d65144f9..ce737b6cbfb 100644 --- a/vortex-tensor/public-api.lock +++ b/vortex-tensor/public-api.lock @@ -32,15 +32,11 @@ pub type vortex_tensor::encodings::turboquant::TurboQuant::OperationsVTable = vo pub type vortex_tensor::encodings::turboquant::TurboQuant::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild -pub fn vortex_tensor::encodings::turboquant::TurboQuant::array_eq(array: &vortex_tensor::encodings::turboquant::TurboQuantData, other: &vortex_tensor::encodings::turboquant::TurboQuantData, precision: vortex_array::hash::Precision) -> bool - -pub fn vortex_tensor::encodings::turboquant::TurboQuant::array_hash(array: &vortex_tensor::encodings::turboquant::TurboQuantData, state: &mut H, precision: vortex_array::hash::Precision) - pub fn vortex_tensor::encodings::turboquant::TurboQuant::buffer(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> vortex_array::buffer::BufferHandle pub fn vortex_tensor::encodings::turboquant::TurboQuant::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, _idx: usize) -> core::option::Option -pub fn vortex_tensor::encodings::turboquant::TurboQuant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult +pub fn vortex_tensor::encodings::turboquant::TurboQuant::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_tensor::encodings::turboquant::TurboQuant::execute(array: vortex_array::array::typed::Array, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -56,11 +52,7 @@ pub fn vortex_tensor::encodings::turboquant::TurboQuant::serialize(array: vortex pub fn vortex_tensor::encodings::turboquant::TurboQuant::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String -pub fn vortex_tensor::encodings::turboquant::TurboQuant::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option] - -pub fn vortex_tensor::encodings::turboquant::TurboQuant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()> - -pub fn vortex_tensor::encodings::turboquant::TurboQuant::with_slots(array: &mut vortex_tensor::encodings::turboquant::TurboQuantData, slots: alloc::vec::Vec>) -> vortex_error::VortexResult<()> +pub fn vortex_tensor::encodings::turboquant::TurboQuant::validate(&self, data: &Self::ArrayData, dtype: &vortex_array::dtype::DType, len: usize, slots: &[core::option::Option]) -> vortex_error::VortexResult<()> impl vortex_array::array::vtable::operations::OperationsVTable for vortex_tensor::encodings::turboquant::TurboQuant @@ -68,7 +60,7 @@ pub fn vortex_tensor::encodings::turboquant::TurboQuant::scalar_at(array: vortex impl vortex_array::array::vtable::validity::ValidityChild for vortex_tensor::encodings::turboquant::TurboQuant -pub fn vortex_tensor::encodings::turboquant::TurboQuant::validity_child(array: &vortex_tensor::encodings::turboquant::TurboQuantData) -> &vortex_array::array::erased::ArrayRef +pub fn vortex_tensor::encodings::turboquant::TurboQuant::validity_child(array: vortex_array::array::view::ArrayView<'_, vortex_tensor::encodings::turboquant::TurboQuant>) -> vortex_array::array::erased::ArrayRef impl vortex_array::arrays::dict::take::TakeExecute for vortex_tensor::encodings::turboquant::TurboQuant @@ -102,20 +94,12 @@ impl vortex_tensor::encodings::turboquant::TurboQuantData pub fn vortex_tensor::encodings::turboquant::TurboQuantData::bit_width(&self) -> u8 -pub fn vortex_tensor::encodings::turboquant::TurboQuantData::centroids(&self) -> &vortex_array::array::erased::ArrayRef - -pub fn vortex_tensor::encodings::turboquant::TurboQuantData::codes(&self) -> &vortex_array::array::erased::ArrayRef - pub fn vortex_tensor::encodings::turboquant::TurboQuantData::dimension(&self) -> u32 pub unsafe fn vortex_tensor::encodings::turboquant::TurboQuantData::new_unchecked(dtype: &vortex_array::dtype::DType, codes: vortex_array::array::erased::ArrayRef, norms: vortex_array::array::erased::ArrayRef, centroids: vortex_array::array::erased::ArrayRef, rotation_signs: vortex_array::array::erased::ArrayRef) -> Self -pub fn vortex_tensor::encodings::turboquant::TurboQuantData::norms(&self) -> &vortex_array::array::erased::ArrayRef - pub fn vortex_tensor::encodings::turboquant::TurboQuantData::padded_dim(&self) -> u32 -pub fn vortex_tensor::encodings::turboquant::TurboQuantData::rotation_signs(&self) -> &vortex_array::array::erased::ArrayRef - pub fn vortex_tensor::encodings::turboquant::TurboQuantData::try_new(dtype: &vortex_array::dtype::DType, codes: vortex_array::array::erased::ArrayRef, norms: vortex_array::array::erased::ArrayRef, centroids: vortex_array::array::erased::ArrayRef, rotation_signs: vortex_array::array::erased::ArrayRef) -> vortex_error::VortexResult pub fn vortex_tensor::encodings::turboquant::TurboQuantData::validate(dtype: &vortex_array::dtype::DType, codes: &vortex_array::array::erased::ArrayRef, norms: &vortex_array::array::erased::ArrayRef, centroids: &vortex_array::array::erased::ArrayRef, rotation_signs: &vortex_array::array::erased::ArrayRef) -> vortex_error::VortexResult<()> @@ -128,6 +112,14 @@ impl core::fmt::Debug for vortex_tensor::encodings::turboquant::TurboQuantData pub fn vortex_tensor::encodings::turboquant::TurboQuantData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::hash::ArrayEq for vortex_tensor::encodings::turboquant::TurboQuantData + +pub fn vortex_tensor::encodings::turboquant::TurboQuantData::array_eq(&self, other: &Self, _precision: vortex_array::hash::Precision) -> bool + +impl vortex_array::hash::ArrayHash for vortex_tensor::encodings::turboquant::TurboQuantData + +pub fn vortex_tensor::encodings::turboquant::TurboQuantData::array_hash(&self, state: &mut H, _precision: vortex_array::hash::Precision) + pub struct vortex_tensor::encodings::turboquant::TurboQuantScheme impl core::clone::Clone for vortex_tensor::encodings::turboquant::TurboQuantScheme @@ -158,6 +150,38 @@ pub fn vortex_tensor::encodings::turboquant::TurboQuantScheme::matches(&self, ca pub fn vortex_tensor::encodings::turboquant::TurboQuantScheme::scheme_name(&self) -> &'static str +pub trait vortex_tensor::encodings::turboquant::TurboQuantArrayExt: vortex_array::array::typed::TypedArrayRef + +pub fn vortex_tensor::encodings::turboquant::TurboQuantArrayExt::bit_width(&self) -> u8 + +pub fn vortex_tensor::encodings::turboquant::TurboQuantArrayExt::centroids(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_tensor::encodings::turboquant::TurboQuantArrayExt::codes(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_tensor::encodings::turboquant::TurboQuantArrayExt::dimension(&self) -> u32 + +pub fn vortex_tensor::encodings::turboquant::TurboQuantArrayExt::norms(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn vortex_tensor::encodings::turboquant::TurboQuantArrayExt::padded_dim(&self) -> u32 + +pub fn vortex_tensor::encodings::turboquant::TurboQuantArrayExt::rotation_signs(&self) -> &vortex_array::array::erased::ArrayRef + +impl> vortex_tensor::encodings::turboquant::TurboQuantArrayExt for T + +pub fn T::bit_width(&self) -> u8 + +pub fn T::centroids(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn T::codes(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn T::dimension(&self) -> u32 + +pub fn T::norms(&self) -> &vortex_array::array::erased::ArrayRef + +pub fn T::padded_dim(&self) -> u32 + +pub fn T::rotation_signs(&self) -> &vortex_array::array::erased::ArrayRef + pub fn vortex_tensor::encodings::turboquant::turboquant_encode(ext: &vortex_array::arrays::extension::vtable::ExtensionArray, config: &vortex_tensor::encodings::turboquant::TurboQuantConfig, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult pub type vortex_tensor::encodings::turboquant::TurboQuantArray = vortex_array::array::typed::Array diff --git a/vortex-tensor/src/encodings/turboquant/array/data.rs b/vortex-tensor/src/encodings/turboquant/array/data.rs index 289271d15f1..a4cac4c94e5 100644 --- a/vortex-tensor/src/encodings/turboquant/array/data.rs +++ b/vortex-tensor/src/encodings/turboquant/array/data.rs @@ -4,6 +4,7 @@ use std::sync::Arc; use vortex_array::ArrayRef; +use vortex_array::TypedArrayRef; use vortex_array::dtype::DType; use vortex_array::dtype::Nullability; use vortex_array::dtype::PType; @@ -28,28 +29,6 @@ use crate::utils::extension_list_size; /// A degenerate TurboQuant array has zero rows and `bit_width == 0`, with all slots empty. #[derive(Clone, Debug)] pub struct TurboQuantData { - /// Child arrays stored as slots. See [`Slot`] for positions: - /// - /// - [`Codes`](Slot::Codes): Non-nullable `FixedSizeListArray` with - /// `list_size == padded_dim`. Each row holds one u8 centroid index per padded coordinate. - /// Null vectors are represented by all-zero codes. The cascade compressor handles packing - /// to the actual `bit_width` on disk. - /// - /// - [`Norms`](Slot::Norms): Per-vector L2 norms, one per row. The dtype matches the element - /// type of the Vector (e.g., f64 norms for f64 vectors) and carries the nullability of the - /// parent dtype. Null vectors have null norms. This child determines the validity of the - /// entire TurboQuant array, enabling O(1) L2 norm readthrough without decompression. - /// - /// - [`Centroids`](Slot::Centroids): `PrimitiveArray` codebook with `2^bit_width` entries - /// that is shared across all rows. We always store these as f32 regardless of the input - /// element type because quantization itself introduces far more error than f32 precision - /// loss, and f16 inputs can be upcast to f32 before quantization. - /// - /// - [`RotationSigns`](Slot::RotationSigns): `BitPackedArray` of `3 * padded_dim` 1-bit sign - /// values for the 3-round SRHT rotation, stored in inverse application order, and shared - /// across all rows. - pub(crate) slots: Vec>, - /// The vector dimension `d`, cached from the `FixedSizeList` storage dtype's list size. /// /// Stored as a convenience field to avoid repeatedly extracting it from `dtype`. @@ -130,14 +109,7 @@ impl TurboQuantData { } }; - let mut slots = vec![None; Slot::COUNT]; - slots[Slot::Codes as usize] = Some(codes); - slots[Slot::Norms as usize] = Some(norms); - slots[Slot::Centroids as usize] = Some(centroids); - slots[Slot::RotationSigns as usize] = Some(rotation_signs); - Self { - slots, dimension, bit_width, } @@ -235,6 +207,73 @@ impl TurboQuantData { Ok(()) } + pub(crate) fn validate_against_outer( + &self, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { + vortex_ensure_eq!( + slots.len(), + Slot::COUNT, + "TurboQuantArray expects {} slots, got {}", + Slot::COUNT, + slots.len() + ); + + let codes = slots[Slot::Codes as usize] + .as_ref() + .vortex_expect("TurboQuantArray codes slot"); + let norms = slots[Slot::Norms as usize] + .as_ref() + .vortex_expect("TurboQuantArray norms slot"); + let centroids = slots[Slot::Centroids as usize] + .as_ref() + .vortex_expect("TurboQuantArray centroids slot"); + let rotation_signs = slots[Slot::RotationSigns as usize] + .as_ref() + .vortex_expect("TurboQuantArray rotation_signs slot"); + + Self::validate(dtype, codes, norms, centroids, rotation_signs)?; + vortex_ensure_eq!( + norms.len(), + len, + "TurboQuant norms length does not match outer length", + ); + vortex_ensure_eq!( + self.dimension, + extension_list_size(TurboQuant::validate_dtype(dtype)?)? + ); + + let expected_bit_width = if centroids.is_empty() { + 0 + } else { + u8::try_from(centroids.len().trailing_zeros()) + .vortex_expect("centroids bit_width fits in u8") + }; + vortex_ensure_eq!( + self.bit_width, + expected_bit_width, + "TurboQuant bit_width does not match centroids slot", + ); + + Ok(()) + } + + pub(crate) fn make_slots( + codes: ArrayRef, + norms: ArrayRef, + centroids: ArrayRef, + rotation_signs: ArrayRef, + ) -> Vec> { + let mut slots = vec![None; Slot::COUNT]; + slots[Slot::Codes as usize] = Some(codes); + slots[Slot::Norms as usize] = Some(norms); + slots[Slot::Centroids as usize] = Some(centroids); + slots[Slot::RotationSigns as usize] = Some(rotation_signs); + slots + } + /// The vector dimension `d`, as stored in the [`Vector`](crate::vector::Vector) extension /// dtype's `FixedSizeList` storage. pub fn dimension(&self) -> u32 { @@ -253,35 +292,44 @@ impl TurboQuantData { pub fn padded_dim(&self) -> u32 { self.dimension.next_power_of_two() } +} - /// The quantized codes child (`FixedSizeListArray`, one row per vector). - pub fn codes(&self) -> &ArrayRef { - self.slot(Slot::Codes as usize) +pub trait TurboQuantArrayExt: TypedArrayRef { + fn dimension(&self) -> u32 { + std::ops::Deref::deref(self).dimension() } - /// Per-vector L2 norms. The dtype matches the Vector's element type (f16, f32, or f64). - pub fn norms(&self) -> &ArrayRef { - self.slot(Slot::Norms as usize) + fn bit_width(&self) -> u8 { + std::ops::Deref::deref(self).bit_width() } - /// The codebook centroids (`PrimitiveArray`, length `2^bit_width`). - /// - /// Always f32 regardless of input element type: quantization noise dominates f32 - /// precision loss, and f16 inputs are upcast before quantization anyway. - pub fn centroids(&self) -> &ArrayRef { - self.slot(Slot::Centroids as usize) + fn padded_dim(&self) -> u32 { + std::ops::Deref::deref(self).padded_dim() } - /// The SRHT rotation signs (`BitPackedArray`, `3 * padded_dim` 1-bit values). - /// - /// Stored in inverse application order for efficient decode. - pub fn rotation_signs(&self) -> &ArrayRef { - self.slot(Slot::RotationSigns as usize) + fn codes(&self) -> &ArrayRef { + self.as_ref().slots()[Slot::Codes as usize] + .as_ref() + .vortex_expect("TurboQuantArray codes slot") } - fn slot(&self, idx: usize) -> &ArrayRef { - self.slots[idx] + fn norms(&self) -> &ArrayRef { + self.as_ref().slots()[Slot::Norms as usize] .as_ref() - .vortex_expect("required slot is None") + .vortex_expect("TurboQuantArray norms slot") + } + + fn centroids(&self) -> &ArrayRef { + self.as_ref().slots()[Slot::Centroids as usize] + .as_ref() + .vortex_expect("TurboQuantArray centroids slot") + } + + fn rotation_signs(&self) -> &ArrayRef { + self.as_ref().slots()[Slot::RotationSigns as usize] + .as_ref() + .vortex_expect("TurboQuantArray rotation_signs slot") } } + +impl> TurboQuantArrayExt for T {} diff --git a/vortex-tensor/src/encodings/turboquant/compute/cosine_similarity.rs b/vortex-tensor/src/encodings/turboquant/compute/cosine_similarity.rs index e9bcd17ce96..54858ca0244 100644 --- a/vortex-tensor/src/encodings/turboquant/compute/cosine_similarity.rs +++ b/vortex-tensor/src/encodings/turboquant/compute/cosine_similarity.rs @@ -42,6 +42,7 @@ use vortex_error::VortexResult; use vortex_error::vortex_ensure_eq; use crate::encodings::turboquant::TurboQuant; +use crate::encodings::turboquant::TurboQuantArrayExt; use crate::encodings::turboquant::array::float_from_f32; use crate::utils::extension_element_ptype; diff --git a/vortex-tensor/src/encodings/turboquant/compute/slice.rs b/vortex-tensor/src/encodings/turboquant/compute/slice.rs index a8daef6466b..c857bbabad0 100644 --- a/vortex-tensor/src/encodings/turboquant/compute/slice.rs +++ b/vortex-tensor/src/encodings/turboquant/compute/slice.rs @@ -10,6 +10,7 @@ use vortex_array::arrays::slice::SliceReduce; use vortex_error::VortexResult; use crate::encodings::turboquant::TurboQuant; +use crate::encodings::turboquant::TurboQuantArrayExt; impl SliceReduce for TurboQuant { fn slice( diff --git a/vortex-tensor/src/encodings/turboquant/compute/take.rs b/vortex-tensor/src/encodings/turboquant/compute/take.rs index 7614f1577a7..25f43acad41 100644 --- a/vortex-tensor/src/encodings/turboquant/compute/take.rs +++ b/vortex-tensor/src/encodings/turboquant/compute/take.rs @@ -9,6 +9,7 @@ use vortex_array::arrays::dict::TakeExecute; use vortex_error::VortexResult; use crate::encodings::turboquant::TurboQuant; +use crate::encodings::turboquant::TurboQuantArrayExt; impl TakeExecute for TurboQuant { fn take( diff --git a/vortex-tensor/src/encodings/turboquant/decompress.rs b/vortex-tensor/src/encodings/turboquant/decompress.rs index b4b9fbaccfd..5aa76578bd8 100644 --- a/vortex-tensor/src/encodings/turboquant/decompress.rs +++ b/vortex-tensor/src/encodings/turboquant/decompress.rs @@ -20,6 +20,7 @@ use vortex_buffer::BufferMut; use vortex_error::VortexResult; use crate::encodings::turboquant::TurboQuant; +use crate::encodings::turboquant::TurboQuantArrayExt; use crate::encodings::turboquant::array::float_from_f32; use crate::encodings::turboquant::array::rotation::RotationMatrix; use crate::utils::extension_element_ptype; diff --git a/vortex-tensor/src/encodings/turboquant/mod.rs b/vortex-tensor/src/encodings/turboquant/mod.rs index 59554f398d2..72e1c0714b7 100644 --- a/vortex-tensor/src/encodings/turboquant/mod.rs +++ b/vortex-tensor/src/encodings/turboquant/mod.rs @@ -91,6 +91,7 @@ //! ``` mod array; +pub use array::data::TurboQuantArrayExt; pub use array::data::TurboQuantData; pub use array::scheme::TurboQuantScheme; diff --git a/vortex-tensor/src/encodings/turboquant/tests.rs b/vortex-tensor/src/encodings/turboquant/tests.rs index ef77bb9e3ec..4f35c20ad44 100644 --- a/vortex-tensor/src/encodings/turboquant/tests.rs +++ b/vortex-tensor/src/encodings/turboquant/tests.rs @@ -22,6 +22,7 @@ use vortex_error::VortexResult; use vortex_session::VortexSession; use crate::encodings::turboquant::TurboQuant; +use crate::encodings::turboquant::TurboQuantArrayExt; use crate::encodings::turboquant::TurboQuantConfig; use crate::encodings::turboquant::array::rotation::RotationMatrix; use crate::encodings::turboquant::turboquant_encode; diff --git a/vortex-tensor/src/encodings/turboquant/vtable.rs b/vortex-tensor/src/encodings/turboquant/vtable.rs index 1510132863c..3a8136fb6e1 100644 --- a/vortex-tensor/src/encodings/turboquant/vtable.rs +++ b/vortex-tensor/src/encodings/turboquant/vtable.rs @@ -34,6 +34,7 @@ use vortex_error::vortex_err; use vortex_error::vortex_panic; use vortex_session::VortexSession; +use crate::encodings::turboquant::TurboQuantArrayExt; use crate::encodings::turboquant::TurboQuantData; use crate::encodings::turboquant::array::slots::Slot; use crate::encodings::turboquant::compute::rules::PARENT_KERNELS; @@ -86,9 +87,17 @@ impl TurboQuant { centroids: ArrayRef, rotation_signs: ArrayRef, ) -> VortexResult { - let data = TurboQuantData::try_new(&dtype, codes, norms, centroids, rotation_signs)?; - - let parts = ArrayParts::new(TurboQuant, dtype, data.norms().len(), data); + let len = norms.len(); + let data = TurboQuantData::try_new( + &dtype, + codes.clone(), + norms.clone(), + centroids.clone(), + rotation_signs.clone(), + )?; + let parts = ArrayParts::new(TurboQuant, dtype, len, data).with_slots( + TurboQuantData::make_slots(codes, norms, centroids, rotation_signs), + ); Array::try_from_parts(parts) } @@ -96,6 +105,19 @@ impl TurboQuant { vtable!(TurboQuant, TurboQuant, TurboQuantData); +impl ArrayHash for TurboQuantData { + fn array_hash(&self, state: &mut H, _precision: Precision) { + self.dimension.hash(state); + self.bit_width.hash(state); + } +} + +impl ArrayEq for TurboQuantData { + fn array_eq(&self, other: &Self, _precision: Precision) -> bool { + self.dimension == other.dimension && self.bit_width == other.bit_width + } +} + impl VTable for TurboQuant { type ArrayData = TurboQuantData; type OperationsVTable = TurboQuant; @@ -105,59 +127,14 @@ impl VTable for TurboQuant { Self::ID } - fn validate(&self, data: &Self::ArrayData, dtype: &DType, len: usize) -> VortexResult<()> { - let ext = dtype - .as_extension_opt() - .filter(|e| e.is::()) - .ok_or_else(|| { - vortex_err!("TurboQuant dtype must be a Vector extension type, got {dtype}") - })?; - - let dimension = extension_list_size(ext)?; - vortex_ensure!( - dimension >= Self::MIN_DIMENSION, - "TurboQuant requires dimension >= {}, got {dimension}", - Self::MIN_DIMENSION - ); - - vortex_ensure_eq!(data.dimension(), dimension); - - // TODO(connor): In the future, we may not need to validate `len` on the array data because - // the child arrays will be located somewhere else. - // bit_width == 0 is only valid for degenerate (empty) arrays. A non-empty array with - // bit_width == 0 would have zero centroids while codes reference centroid indices. - vortex_ensure!( - data.bit_width > 0 || len == 0, - "bit_width == 0 is only valid for empty arrays, got len={len}" - ); - - Ok(()) - } - - fn array_hash(array: &TurboQuantData, state: &mut H, precision: Precision) { - array.dimension.hash(state); - array.bit_width.hash(state); - for slot in &array.slots { - slot.is_some().hash(state); - if let Some(child) = slot { - child.array_hash(state, precision); - } - } - } - - fn array_eq(array: &TurboQuantData, other: &TurboQuantData, precision: Precision) -> bool { - array.dimension == other.dimension - && array.bit_width == other.bit_width - && array.slots.len() == other.slots.len() - && array - .slots - .iter() - .zip(other.slots.iter()) - .all(|(a, b)| match (a, b) { - (Some(a), Some(b)) => a.array_eq(b, precision), - (None, None) => true, - _ => false, - }) + fn validate( + &self, + data: &Self::ArrayData, + dtype: &DType, + len: usize, + slots: &[Option], + ) -> VortexResult<()> { + data.validate_against_outer(dtype, len, slots) } fn nbuffers(_array: ArrayView) -> usize { @@ -184,7 +161,7 @@ impl VTable for TurboQuant { _buffers: &[BufferHandle], children: &dyn ArrayChildren, _session: &VortexSession, - ) -> VortexResult { + ) -> VortexResult> { vortex_ensure_eq!( metadata.len(), 1, @@ -239,37 +216,26 @@ impl VTable for TurboQuant { let signs_dtype = DType::Primitive(PType::U8, Nullability::NonNullable); let rotation_signs = children.get(3, &signs_dtype, signs_len)?; - Ok(TurboQuantData { - slots: vec![ - Some(codes_array), - Some(norms_array), - Some(centroids), - Some(rotation_signs), - ], - dimension, - bit_width, - }) - } - - fn slots(array: ArrayView<'_, Self>) -> &[Option] { - &array.data().slots + Ok(ArrayParts::new( + TurboQuant, + dtype.clone(), + len, + TurboQuantData { + dimension, + bit_width, + }, + ) + .with_slots(TurboQuantData::make_slots( + codes_array, + norms_array, + centroids, + rotation_signs, + ))) } fn slot_name(_array: ArrayView, idx: usize) -> String { Slot::from_index(idx).name().to_string() } - - fn with_slots(array: &mut TurboQuantData, slots: Vec>) -> VortexResult<()> { - vortex_ensure!( - slots.len() == Slot::COUNT, - "TurboQuantArray expects {} slots, got {}", - Slot::COUNT, - slots.len() - ); - array.slots = slots; - Ok(()) - } - fn execute(array: Array, ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done(execute_decompress(array, ctx)?)) } @@ -293,7 +259,7 @@ impl VTable for TurboQuant { } impl ValidityChild for TurboQuant { - fn validity_child(array: &TurboQuantData) -> &ArrayRef { - array.norms() + fn validity_child(array: ArrayView<'_, TurboQuant>) -> ArrayRef { + array.norms().clone() } } diff --git a/vortex-tensor/src/scalar_fns/l2_norm.rs b/vortex-tensor/src/scalar_fns/l2_norm.rs index a4cb6cf00d1..29ccf8ddad1 100644 --- a/vortex-tensor/src/scalar_fns/l2_norm.rs +++ b/vortex-tensor/src/scalar_fns/l2_norm.rs @@ -30,6 +30,7 @@ use vortex_error::vortex_ensure; use vortex_error::vortex_err; use crate::encodings::turboquant::TurboQuant; +use crate::encodings::turboquant::TurboQuantArrayExt; use crate::matcher::AnyTensor; use crate::scalar_fns::ApproxOptions; use crate::utils::extension_element_ptype;