From 16110f336cbc446703aae2f38e42db0cc08be8c1 Mon Sep 17 00:00:00 2001 From: Robert Kruszewski Date: Fri, 1 May 2026 09:31:49 -0400 Subject: [PATCH 1/8] Introduce ParentRef and ArrayParts::optimize chain `ArrayRef::slice/filter/take` previously allocated a wrapper array (`SliceArray`, `FilterArray`, `DictArray`) and called `.optimize()` on the resulting `ArrayRef`, relying on a `reduce_parent` rule to throw the wrapper away. The wrapper allocation was always paid even when reduction ran in one shot. This change establishes the API surface for moving the wrapper onto the stack: - `ParentRef<'a>`: a parent representation that optionally borrows an `&ArrayRef` and otherwise carries the encoding-specific data, dtype, length, slots, and encoding id directly. `into_array_ref(self)` clones the underlying `Arc` when the parent is heap-backed. - `ParentView<'a, V>`: a typed view of a parent that derefs to `V::ArrayData` without holding an `&ArrayRef`. Used by the upcoming matcher path that accepts stack-allocated parents. - `DynArray::data_any` exposes the encoding-specific data so a matcher can downcast to `V::ArrayData` from a `ParentRef` regardless of whether the parent is heap- or stack-backed. - `ArrayParts::optimize`, `optimize_ctx(session)`, and `into_array`, plus `Optimized` with its own `into_array`. Callers chain `parts.optimize()?.into_array()` so reduction is an explicit, orthogonal step from materialization. - `ArrayRef::slice / filter / take` now build an `ArrayParts` and drive it through the chain. The internals of `ArrayParts::optimize` still materialize before running the existing `reduce_parent` chain, so this PR does not yet remove the `Arc>` allocation. Wiring `ParentRef` through `DynArray::reduce_parent`, `VTable::reduce_parent`, `ParentRuleSet`, `DynArrayParentReduceRule`, `ReduceParentFn`, the `Matcher` API, and the per-encoding rule bodies is the follow-up that delivers the allocation savings. - `cargo build --workspace` - `cargo nextest run -p vortex-array -p vortex-fastlanes -p vortex-fsst -p vortex-alp -p vortex-runend -p vortex-zigzag` (all 3078 pass; the 21 skipped are timezone-dependent and unrelated to this change) - `cargo clippy -p vortex-array --all-targets --all-features` - `cargo +nightly fmt --all -- --check` - `./scripts/public-api.sh` Signed-off-by: Robert Kruszewski --- vortex-array/public-api.lock | 94 ++++++++++ vortex-array/src/array/erased.rs | 39 +++-- vortex-array/src/array/mod.rs | 3 + vortex-array/src/array/parent.rs | 218 ++++++++++++++++++++++++ vortex-array/src/array/typed.rs | 74 ++++++++ vortex-array/src/arrays/filter/array.rs | 2 +- 6 files changed, 417 insertions(+), 13 deletions(-) create mode 100644 vortex-array/src/array/parent.rs diff --git a/vortex-array/public-api.lock b/vortex-array/public-api.lock index 87eca1bb0c2..f2adf6b4e57 100644 --- a/vortex-array/public-api.lock +++ b/vortex-array/public-api.lock @@ -2708,6 +2708,8 @@ pub fn vortex_array::arrays::filter::FilterData::len(&self) -> usize pub fn vortex_array::arrays::filter::FilterData::new(vortex_mask::Mask) -> Self +pub fn vortex_array::arrays::filter::FilterData::try_new(usize, vortex_mask::Mask) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_array::arrays::filter::FilterData pub fn vortex_array::arrays::filter::FilterData::clone(&self) -> vortex_array::arrays::filter::FilterData @@ -21946,6 +21948,18 @@ impl core::fmt::Debug for vortex_array::ExecutionStep pub fn vortex_array::ExecutionStep::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub enum vortex_array::Optimized + +pub vortex_array::Optimized::Reduced(vortex_array::ArrayRef) + +pub vortex_array::Optimized::Unchanged(vortex_array::ArrayParts) + +impl vortex_array::Optimized + +pub fn vortex_array::Optimized::into_array(self) -> vortex_error::VortexResult + +pub fn vortex_array::Optimized::is_reduced(&self) -> bool + pub enum vortex_array::Precision pub vortex_array::Precision::Ptr @@ -22452,7 +22466,17 @@ pub vortex_array::ArrayParts::vtable: V impl vortex_array::ArrayParts +<<<<<<< HEAD pub fn vortex_array::ArrayParts::new(V, vortex_array::dtype::DType, usize, ::TypedArrayData) -> Self +======= +pub fn vortex_array::ArrayParts::into_array(self) -> vortex_error::VortexResult + +pub fn vortex_array::ArrayParts::new(V, vortex_array::dtype::DType, usize, ::ArrayData) -> Self +>>>>>>> 72b237d24 (Introduce ParentRef and ArrayParts::optimize chain) + +pub fn vortex_array::ArrayParts::optimize(self) -> vortex_error::VortexResult> + +pub fn vortex_array::ArrayParts::optimize_ctx(self, &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::ArrayParts::with_slots(self, alloc::vec::Vec>) -> Self @@ -22896,6 +22920,10 @@ pub fn vortex_array::ArrayRef::index_len(&self) -> usize pub fn vortex_array::ArrayRef::index_lt(&self, usize, &V) -> vortex_error::VortexResult +impl<'a> core::convert::From<&'a vortex_array::ArrayRef> for vortex_array::ParentRef<'a> + +pub fn vortex_array::ParentRef<'a>::from(&'a vortex_array::ArrayRef) -> Self + impl vortex_array::arrow::FromArrowArray<&arrow_array::array::list_view_array::GenericListViewArray> for vortex_array::ArrayRef pub fn vortex_array::ArrayRef::from_arrow(&arrow_array::array::list_view_array::GenericListViewArray, bool) -> vortex_error::VortexResult @@ -23110,6 +23138,72 @@ impl vortex_array::OperationsVTable for vortex_array pub fn vortex_array::NotSupported::scalar_at(vortex_array::ArrayView<'_, V>, usize, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub struct vortex_array::ParentRef<'a> + +impl<'a> vortex_array::ParentRef<'a> + +pub fn vortex_array::ParentRef<'a>::array_ref(&self) -> core::option::Option<&'a vortex_array::ArrayRef> + +pub fn vortex_array::ParentRef<'a>::dtype(&self) -> &'a vortex_array::dtype::DType + +pub fn vortex_array::ParentRef<'a>::encoding_id(&self) -> vortex_array::ArrayId + +pub fn vortex_array::ParentRef<'a>::from_array_ref(&'a vortex_array::ArrayRef) -> Self + +pub fn vortex_array::ParentRef<'a>::from_parts(&'a vortex_array::ArrayParts) -> Self + +pub fn vortex_array::ParentRef<'a>::into_array_ref(self) -> core::option::Option + +pub fn vortex_array::ParentRef<'a>::is_empty(&self) -> bool + +pub fn vortex_array::ParentRef<'a>::len(&self) -> usize + +pub fn vortex_array::ParentRef<'a>::slots(&self) -> &'a [core::option::Option] + +impl core::fmt::Debug for vortex_array::ParentRef<'_> + +pub fn vortex_array::ParentRef<'_>::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +impl<'a> core::clone::Clone for vortex_array::ParentRef<'a> + +pub fn vortex_array::ParentRef<'a>::clone(&self) -> vortex_array::ParentRef<'a> + +impl<'a> core::convert::From<&'a vortex_array::ArrayRef> for vortex_array::ParentRef<'a> + +pub fn vortex_array::ParentRef<'a>::from(&'a vortex_array::ArrayRef) -> Self + +impl<'a> core::marker::Copy for vortex_array::ParentRef<'a> + +pub struct vortex_array::ParentView<'a, V: vortex_array::VTable> + +impl<'a, V: vortex_array::VTable> vortex_array::ParentView<'a, V> + +pub fn vortex_array::ParentView<'a, V>::data(&self) -> &'a ::ArrayData + +pub fn vortex_array::ParentView<'a, V>::dtype(&self) -> &'a vortex_array::dtype::DType + +pub fn vortex_array::ParentView<'a, V>::is_empty(&self) -> bool + +pub fn vortex_array::ParentView<'a, V>::len(&self) -> usize + +pub fn vortex_array::ParentView<'a, V>::slots(&self) -> &'a [core::option::Option] + +impl core::clone::Clone for vortex_array::ParentView<'_, V> + +pub fn vortex_array::ParentView<'_, V>::clone(&self) -> Self + +impl core::fmt::Debug for vortex_array::ParentView<'_, V> + +pub fn vortex_array::ParentView<'_, V>::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +impl core::marker::Copy for vortex_array::ParentView<'_, V> + +impl core::ops::deref::Deref for vortex_array::ParentView<'_, V> + +pub type vortex_array::ParentView<'_, V>::Target = ::ArrayData + +pub fn vortex_array::ParentView<'_, V>::deref(&self) -> &::ArrayData + pub struct vortex_array::ProstMetadata(pub M) impl core::fmt::Debug for vortex_array::ProstMetadata diff --git a/vortex-array/src/array/erased.rs b/vortex-array/src/array/erased.rs index cfc3e911c48..116e5c916b7 100644 --- a/vortex-array/src/array/erased.rs +++ b/vortex-array/src/array/erased.rs @@ -17,7 +17,7 @@ use vortex_error::vortex_err; use vortex_error::vortex_panic; use vortex_mask::Mask; -use crate::AnyCanonical; +use crate::{AnyCanonical, ArrayParts}; use crate::Array; use crate::ArrayEq; use crate::ArrayHash; @@ -36,13 +36,16 @@ use crate::array::ArrayInner; use crate::array::DynArrayData; use crate::arrays::Bool; use crate::arrays::Constant; -use crate::arrays::DictArray; -use crate::arrays::FilterArray; +use crate::arrays::Dict; +use crate::arrays::Filter; use crate::arrays::Null; use crate::arrays::Primitive; -use crate::arrays::SliceArray; +use crate::arrays::Slice; use crate::arrays::VarBin; use crate::arrays::VarBinView; +use crate::arrays::dict::DictData; +use crate::arrays::filter::FilterData; +use crate::arrays::slice::SliceData; use crate::buffer::BufferHandle; use crate::builders::ArrayBuilder; use crate::dtype::DType; @@ -51,7 +54,6 @@ use crate::expr::stats::Precision; use crate::expr::stats::Stat; use crate::expr::stats::StatsProviderExt; use crate::matcher::Matcher; -use crate::optimizer::ArrayOptimizer; use crate::scalar::Scalar; use crate::stats::StatsSetRef; use crate::validity::Validity; @@ -227,9 +229,12 @@ impl ArrayRef { return Ok(Canonical::empty(self.dtype()).into_array()); } - let sliced = SliceArray::try_new(self.clone(), range)? - .into_array() - .optimize()?; + let dtype = self.dtype().clone(); + let slice_len = range.len(); + let sliced = ArrayParts::new(Slice, dtype, slice_len, SliceData::new(range)) + .with_slots(vec![Some(self.clone())]) + .optimize()? + .into_array()?; // Propagate some stats from the original array to the sliced array. if !sliced.is::() { @@ -254,16 +259,26 @@ impl ArrayRef { /// Wraps the array in a [`FilterArray`] such that it is logically filtered by the given mask. pub fn filter(&self, mask: Mask) -> VortexResult { - FilterArray::try_new(self.clone(), mask)? + let dtype = self.dtype().clone(); + let len = mask.true_count(); + let data = FilterData::try_new(self.len(), mask)?; + ArrayParts::new(Filter, dtype, len, data) + .with_slots(vec![Some(self.clone())]) + .optimize()? .into_array() - .optimize() } /// Wraps the array in a [`DictArray`] such that it is logically taken by the given indices. pub fn take(&self, indices: ArrayRef) -> VortexResult { - DictArray::try_new(indices, self.clone())? + let dtype = self + .dtype() + .union_nullability(indices.dtype().nullability()); + let len = indices.len(); + let data = DictData::try_new(indices.dtype())?; + ArrayParts::new(Dict, dtype, len, data) + .with_slots(vec![Some(indices), Some(self.clone())]) + .optimize()? .into_array() - .optimize() } /// Fetch the scalar at the given index. diff --git a/vortex-array/src/array/mod.rs b/vortex-array/src/array/mod.rs index 4dc8607b1bc..cfe165bce71 100644 --- a/vortex-array/src/array/mod.rs +++ b/vortex-array/src/array/mod.rs @@ -34,6 +34,9 @@ pub use plugin::*; mod foreign; pub(crate) use foreign::*; +mod parent; +pub use parent::*; + mod typed; pub use typed::*; diff --git a/vortex-array/src/array/parent.rs b/vortex-array/src/array/parent.rs new file mode 100644 index 00000000000..e311cb66572 --- /dev/null +++ b/vortex-array/src/array/parent.rs @@ -0,0 +1,218 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright the Vortex contributors + +//! Stack-allocatable parent representation used by the `reduce_parent` dispatch chain. +//! +//! [`ParentRef`] either borrows an existing heap-allocated [`ArrayRef`], or borrows the +//! component parts of a parent that lives on the stack (typically inside an [`ArrayParts`] +//! that hasn't been materialized yet). Matchers and parent-reduce rules consume +//! `ParentRef` so that callers can attempt reduction without first allocating an +//! `Arc>`. + +use std::any::Any; +use std::fmt::Debug; +use std::fmt::Formatter; +use std::ops::Deref; + +use crate::ArrayRef; +use crate::array::ArrayId; +use crate::array::ArrayParts; +use crate::array::VTable; +use crate::dtype::DType; + +/// A parent array, possibly stack-allocated, used by the `reduce_parent` dispatch chain. +/// +/// Optionally holds an `&ArrayRef` when the parent is heap-allocated. The remaining +/// metadata (encoding id, dtype, length, encoding-specific data, slots) is always +/// available so matchers and rule bodies can dispatch without distinguishing the two +/// cases. +#[derive(Clone, Copy)] +pub struct ParentRef<'a> { + array_ref: Option<&'a ArrayRef>, + encoding_id: ArrayId, + dtype: &'a DType, + len: usize, + data: &'a dyn Any, + slots: &'a [Option], +} + +impl<'a> ParentRef<'a> { + /// Build a [`ParentRef`] borrowing a heap-allocated [`ArrayRef`]. + #[inline] + pub fn from_array_ref(array: &'a ArrayRef) -> Self { + let inner = array.inner(); + Self { + array_ref: Some(array), + encoding_id: inner.encoding_id(), + dtype: inner.dtype(), + len: inner.len(), + data: inner.data_any(), + slots: inner.slots(), + } + } + + /// Build a [`ParentRef`] borrowing stack-allocated parts of an array. + #[inline] + pub fn from_parts(parts: &'a ArrayParts) -> Self { + Self { + array_ref: None, + encoding_id: parts.vtable.id(), + dtype: &parts.dtype, + len: parts.len, + data: &parts.data, + slots: &parts.slots, + } + } + + /// Returns the encoding id of the parent. + #[inline] + pub fn encoding_id(&self) -> ArrayId { + self.encoding_id + } + + /// Returns the dtype of the parent. + #[inline] + pub fn dtype(&self) -> &'a DType { + self.dtype + } + + /// Returns the length of the parent. + #[inline] + pub fn len(&self) -> usize { + self.len + } + + /// Returns whether the parent is empty. + #[inline] + pub fn is_empty(&self) -> bool { + self.len == 0 + } + + /// Returns the slots of the parent. + #[inline] + pub fn slots(&self) -> &'a [Option] { + self.slots + } + + /// Returns the underlying [`ArrayRef`] if the parent is heap-allocated. + /// + /// Returns `None` when the parent only exists on the stack as an [`ArrayParts`]. + #[inline] + pub fn array_ref(&self) -> Option<&'a ArrayRef> { + self.array_ref + } + + /// Consume this [`ParentRef`] and return an owned [`ArrayRef`] if the parent is + /// heap-allocated. + /// + /// Clones the underlying `Arc` so the caller takes ownership without holding the + /// borrow that produced this `ParentRef`. Returns `None` when the parent only + /// exists on the stack. + #[inline] + pub fn into_array_ref(self) -> Option { + self.array_ref.cloned() + } + + /// Try to extract a [`ParentView`] for the parent's encoding `V`. + /// + /// Returns `None` if the parent's encoding is not `V`. + #[allow( + dead_code, + reason = "wired into the reduce_parent chain by upcoming work" + )] + pub(crate) fn try_view(&self) -> Option> { + let data = self.data.downcast_ref::()?; + Some(ParentView { + data, + dtype: self.dtype, + len: self.len, + slots: self.slots, + }) + } +} + +impl Debug for ParentRef<'_> { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("ParentRef") + .field("encoding", &self.encoding_id()) + .field("dtype", self.dtype()) + .field("len", &self.len()) + .field("heap_backed", &self.array_ref.is_some()) + .finish() + } +} + +impl<'a> From<&'a ArrayRef> for ParentRef<'a> { + fn from(array: &'a ArrayRef) -> Self { + Self::from_array_ref(array) + } +} + +/// A typed view of a parent array, possibly stack-allocated. +/// +/// Provides the same surface as [`ArrayView`](crate::array::ArrayView) for the parent +/// data — `Deref` to `V::ArrayData`, plus `slots`, `dtype`, `len` accessors — but does +/// not expose an underlying `&ArrayRef`, since the parent may not have one. +pub struct ParentView<'a, V: VTable> { + data: &'a V::ArrayData, + dtype: &'a DType, + len: usize, + slots: &'a [Option], +} + +impl Copy for ParentView<'_, V> {} + +impl Clone for ParentView<'_, V> { + fn clone(&self) -> Self { + *self + } +} + +impl<'a, V: VTable> ParentView<'a, V> { + /// Returns the encoding-specific data. + #[inline] + pub fn data(&self) -> &'a V::ArrayData { + self.data + } + + /// Returns the dtype of the parent. + #[inline] + pub fn dtype(&self) -> &'a DType { + self.dtype + } + + /// Returns the length of the parent. + #[inline] + pub fn len(&self) -> usize { + self.len + } + + /// Returns whether the parent is empty. + #[inline] + pub fn is_empty(&self) -> bool { + self.len == 0 + } + + /// Returns the parent's slots. + #[inline] + pub fn slots(&self) -> &'a [Option] { + self.slots + } +} + +impl Deref for ParentView<'_, V> { + type Target = V::ArrayData; + + fn deref(&self) -> &V::ArrayData { + self.data + } +} + +impl Debug for ParentView<'_, V> { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("ParentView") + .field("dtype", self.dtype) + .field("len", &self.len) + .finish() + } +} diff --git a/vortex-array/src/array/typed.rs b/vortex-array/src/array/typed.rs index 15dbb18a5f6..6bef78255e6 100644 --- a/vortex-array/src/array/typed.rs +++ b/vortex-array/src/array/typed.rs @@ -13,6 +13,7 @@ use std::ops::DerefMut; use std::sync::Arc; use vortex_error::VortexResult; +use vortex_session::VortexSession; use crate::ArrayRef; use crate::ExecutionCtx; @@ -23,6 +24,7 @@ use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::VTable; use crate::dtype::DType; +use crate::optimizer::ArrayOptimizer; use crate::stats::ArrayStats; use crate::stats::StatsSet; use crate::stats::StatsSetRef; @@ -69,6 +71,78 @@ impl ArrayParts { self.slots = slots; self } + + /// Try to apply parent-reduction rules to these parts using static rules only. + /// + /// Returns [`Optimized::Reduced`] when a `reduce_parent` rule rewrites the parts into a + /// different array, or [`Optimized::Unchanged`] when no rule applies. Use + /// [`Optimized::into_array`] to materialize whichever variant comes back. + /// + /// This is the construction-side counterpart to [`ArrayOptimizer::optimize`] for an + /// already-materialized [`ArrayRef`]. + pub fn optimize(self) -> VortexResult> { + self.optimize_inner(None) + } + + /// Try to apply parent-reduction rules using both static rules and any + /// session-registered [`ArrayKernels`](crate::optimizer::kernels::ArrayKernels). + /// + /// See [`ArrayParts::optimize`] for the static-only variant. + pub fn optimize_ctx(self, session: &VortexSession) -> VortexResult> { + self.optimize_inner(Some(session)) + } + + fn optimize_inner(self, session: Option<&VortexSession>) -> VortexResult> { + // The parent must briefly be addressable as an `ArrayRef` so the existing + // `reduce_parent` chain (which currently takes `&ArrayRef`) can dispatch through + // it. A follow-up will replace that chain with a `ParentRef`-driven dispatch so + // this fast path can avoid the `Arc>` allocation entirely and + // return [`Optimized::Unchanged`] when no rule applies; today this matches the + // cost of the previous `try_new(...)?.into_array().optimize()` pattern and + // always returns [`Optimized::Reduced`]. + let materialized = Array::::try_from_parts(self)?.into_array(); + let optimized = match session { + Some(session) => materialized.optimize_ctx(session)?, + None => materialized.optimize()?, + }; + Ok(Optimized::Reduced(optimized)) + } + + /// Materialize the parts into an [`ArrayRef`] without attempting reduction. + /// + /// Equivalent to `Array::::try_from_parts(parts)?.into_array()`. + pub fn into_array(self) -> VortexResult { + Ok(Array::::try_from_parts(self)?.into_array()) + } +} + +/// Outcome of applying parent-reduction rules to an [`ArrayParts`]. +/// +/// `Reduced` carries an `ArrayRef` produced by a rule that rewrote the parts into a +/// different array. `Unchanged` hands back the original parts, still on the stack, so +/// the caller can decide whether to materialize them or assemble them into a larger +/// expression first. +pub enum Optimized { + /// A parent-reduce rule rewrote the parts into a different array. + Reduced(ArrayRef), + /// No parent-reduce rule applied; the original parts are returned on the stack. + Unchanged(ArrayParts), +} + +impl Optimized { + /// Materialize the result into an [`ArrayRef`]. For `Reduced`, returns the + /// already-built `ArrayRef`; for `Unchanged`, calls [`ArrayParts::into_array`]. + pub fn into_array(self) -> VortexResult { + match self { + Self::Reduced(array) => Ok(array), + Self::Unchanged(parts) => parts.into_array(), + } + } + + /// Returns whether this result is the [`Optimized::Reduced`] variant. + pub fn is_reduced(&self) -> bool { + matches!(self, Self::Reduced(_)) + } } /// Shared bound for helpers that should work over both owned [`Array`] and borrowed diff --git a/vortex-array/src/arrays/filter/array.rs b/vortex-array/src/arrays/filter/array.rs index 8367c8009e9..bcf02fe39ec 100644 --- a/vortex-array/src/arrays/filter/array.rs +++ b/vortex-array/src/arrays/filter/array.rs @@ -55,7 +55,7 @@ impl FilterData { Self { mask } } - fn try_new(array_len: usize, mask: Mask) -> VortexResult { + pub fn try_new(array_len: usize, mask: Mask) -> VortexResult { vortex_ensure_eq!( array_len, mask.len(), From a22b80f5681633ce3689de6d9d1697ebbcd95dee Mon Sep 17 00:00:00 2001 From: Robert Kruszewski Date: Fri, 1 May 2026 10:34:54 -0400 Subject: [PATCH 2/8] Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds on the previous commit's `ArrayParts::optimize` chain by flipping the `reduce_parent` dispatch signatures to take `&ParentRef<'_>` and wiring the slice path through the stack-allocated parent so `ArrayRef::slice` never allocates a wrapper `Arc>` when the child encoding has a `SliceReduce` impl. The following all flip `parent: &ArrayRef` -> `parent: &ParentRef<'_>`: - `DynArray::reduce_parent`, `VTable::reduce_parent`, `ArrayRef::reduce_parent` delegate. - `DynArrayParentReduceRule::matches` / `::reduce_parent`, `ParentRuleSet::evaluate`, `ParentReduceRuleAdapter`. - `ReduceParentFn` (session-registered kernels). The lookup keys `(parent_id, child_id)` are unchanged. - All 34 `impl VTable::reduce_parent` overrides — mechanical change because every impl just delegates to `PARENT_RULES.evaluate(array, parent, idx)`. The optimizer's `try_optimize` and the executor's `walk` build a `ParentRef::from_array_ref(¤t_array)` once and reuse it across the slot loop. - `Matcher` gains a `try_match_parent` default that delegates to the existing `try_match` when the parent is heap-allocated and returns `None` otherwise. So existing matchers (`AnyArray`, `AnyCanonical`, `AnyTemporal`, `AnyScalarFn`, `ExactScalarFn`, plus the blanket `impl Matcher for V`) work unchanged for heap-backed parents. - `ArrayParentReduceRule` gains a `reduce_parent_ref` default that uses `try_match_parent` and delegates to `reduce_parent`. All 19 existing rule bodies keep their `Match<'_>` signature; the dispatch from `ParentReduceRuleAdapter` now goes through `reduce_parent_ref`. - `ArrayParts::optimize_inner` walks slots with a stack `ParentRef::from_parts` first; if no rule fires (e.g. the existing matchers don't match a stack parent), it falls back to materializing into an `Arc>` and running `ArrayRef::optimize`, preserving today's behaviour for filter, take, and any other rule that has not been migrated to the stack path. `SliceReduceAdaptor::reduce_parent_ref` is overridden to extract the parent via `ParentRef::try_view::` (which works for both heap- and stack-allocated parents). When `ArrayRef::slice` is called: 1. Builds `ArrayParts` on the stack with a `SliceData` and the single child slot. 2. `ArrayParts::optimize` walks the slot, calling the child's `reduce_parent` with a stack `ParentRef`. 3. `SliceReduceAdaptor::reduce_parent_ref` downcasts via `try_view::`, bypasses the default `try_match_parent` (which would have returned `None` for the stack parent), runs `precondition` and `::slice`, and returns the reduced array. No wrapper `Arc>` is allocated for the slice itself; the fallback only fires when the child encoding has no `SliceReduce` impl. - `cargo build --workspace` - `cargo nextest run -p vortex-array` (2487 pass, 21 skipped — same set of timezone-dependent skips as before; unrelated to this change) - `cargo nextest run -p vortex-fastlanes -p vortex-fsst -p vortex-alp -p vortex-runend -p vortex-zigzag -p vortex-pco -p vortex-datetime-parts -p vortex-decimal-byte-parts -p vortex-bytebool -p vortex-zstd -p vortex-sparse -p vortex-sequence` (893 pass) - `cargo clippy -p vortex-array --all-targets --all-features` - `cargo +nightly fmt --all` - `./scripts/public-api.sh` Signed-off-by: Robert Kruszewski Signed-off-by: Robert Kruszewski --- encodings/alp/public-api.lock | 4 +- encodings/alp/src/alp/array.rs | 3 +- encodings/alp/src/alp_rd/array.rs | 3 +- encodings/bytebool/public-api.lock | 2 +- encodings/bytebool/src/array.rs | 3 +- encodings/datetime-parts/public-api.lock | 2 +- encodings/datetime-parts/src/array.rs | 3 +- encodings/decimal-byte-parts/public-api.lock | 2 +- .../src/decimal_byte_parts/mod.rs | 3 +- encodings/fastlanes/public-api.lock | 8 +- .../fastlanes/src/bitpacking/compute/slice.rs | 5 +- .../fastlanes/src/bitpacking/vtable/mod.rs | 3 +- .../src/bitpacking/vtable/operations.rs | 5 +- encodings/fastlanes/src/delta/vtable/mod.rs | 3 +- encodings/fastlanes/src/for/vtable/mod.rs | 3 +- encodings/fastlanes/src/rle/vtable/mod.rs | 3 +- encodings/fsst/public-api.lock | 2 +- encodings/fsst/src/array.rs | 3 +- encodings/pco/public-api.lock | 2 +- encodings/pco/src/array.rs | 3 +- encodings/runend/public-api.lock | 2 +- encodings/runend/src/array.rs | 3 +- encodings/sequence/public-api.lock | 2 +- encodings/sequence/src/array.rs | 3 +- encodings/sparse/public-api.lock | 2 +- encodings/sparse/src/lib.rs | 3 +- encodings/zigzag/public-api.lock | 2 +- encodings/zigzag/src/array.rs | 3 +- encodings/zstd/public-api.lock | 2 +- encodings/zstd/src/array.rs | 3 +- vortex-array/public-api.lock | 428 ++++++++++++------ vortex-array/src/array/erased.rs | 6 +- vortex-array/src/array/mod.rs | 4 +- vortex-array/src/array/parent.rs | 19 +- vortex-array/src/array/typed.rs | 59 ++- vortex-array/src/array/vtable/mod.rs | 3 +- vortex-array/src/arrays/bool/vtable/mod.rs | 3 +- vortex-array/src/arrays/chunked/vtable/mod.rs | 3 +- .../src/arrays/constant/vtable/mod.rs | 3 +- vortex-array/src/arrays/decimal/vtable/mod.rs | 3 +- vortex-array/src/arrays/dict/vtable/mod.rs | 3 +- .../src/arrays/extension/vtable/mod.rs | 3 +- vortex-array/src/arrays/filter/vtable.rs | 3 +- .../src/arrays/fixed_size_list/vtable/mod.rs | 3 +- vortex-array/src/arrays/list/vtable/mod.rs | 3 +- .../src/arrays/listview/vtable/mod.rs | 3 +- vortex-array/src/arrays/masked/vtable/mod.rs | 3 +- vortex-array/src/arrays/null/mod.rs | 3 +- vortex-array/src/arrays/patched/vtable/mod.rs | 3 +- .../src/arrays/primitive/vtable/mod.rs | 3 +- .../src/arrays/scalar_fn/vtable/mod.rs | 3 +- vortex-array/src/arrays/slice/mod.rs | 20 + vortex-array/src/arrays/slice/vtable.rs | 3 +- vortex-array/src/arrays/struct_/vtable/mod.rs | 3 +- vortex-array/src/arrays/varbin/vtable/mod.rs | 3 +- .../src/arrays/varbinview/vtable/mod.rs | 3 +- vortex-array/src/executor.rs | 4 +- vortex-array/src/matcher.rs | 16 + vortex-array/src/optimizer/kernels.rs | 13 +- vortex-array/src/optimizer/mod.rs | 6 +- vortex-array/src/optimizer/rules.rs | 41 +- .../src/dynamic_dispatch/plan_builder.rs | 4 +- 62 files changed, 538 insertions(+), 232 deletions(-) diff --git a/encodings/alp/public-api.lock b/encodings/alp/public-api.lock index aff512e0406..6be499efce6 100644 --- a/encodings/alp/public-api.lock +++ b/encodings/alp/public-api.lock @@ -42,7 +42,7 @@ pub fn vortex_alp::ALP::id(&self) -> vortex_array::array::ArrayId pub fn vortex_alp::ALP::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_alp::ALP::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_alp::ALP::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_alp::ALP::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -178,7 +178,7 @@ pub fn vortex_alp::ALPRD::id(&self) -> vortex_array::array::ArrayId pub fn vortex_alp::ALPRD::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_alp::ALPRD::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_alp::ALPRD::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_alp::ALPRD::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> diff --git a/encodings/alp/src/alp/array.rs b/encodings/alp/src/alp/array.rs index 9bc9461f2bd..7928b11bc0b 100644 --- a/encodings/alp/src/alp/array.rs +++ b/encodings/alp/src/alp/array.rs @@ -18,6 +18,7 @@ use vortex_array::ArrayView; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::TypedArrayRef; use vortex_array::array_slots; @@ -191,7 +192,7 @@ impl VTable for ALP { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { RULES.evaluate(array, parent, child_idx) diff --git a/encodings/alp/src/alp_rd/array.rs b/encodings/alp/src/alp_rd/array.rs index 55e299172e0..e99af17512f 100644 --- a/encodings/alp/src/alp_rd/array.rs +++ b/encodings/alp/src/alp_rd/array.rs @@ -21,6 +21,7 @@ use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; use vortex_array::LEGACY_SESSION; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::TypedArrayRef; use vortex_array::VortexSessionExecute; @@ -306,7 +307,7 @@ impl VTable for ALPRD { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { RULES.evaluate(array, parent, child_idx) diff --git a/encodings/bytebool/public-api.lock b/encodings/bytebool/public-api.lock index 730db87d7d5..a8f890675f4 100644 --- a/encodings/bytebool/public-api.lock +++ b/encodings/bytebool/public-api.lock @@ -40,7 +40,7 @@ pub fn vortex_bytebool::ByteBool::id(&self) -> vortex_array::array::ArrayId pub fn vortex_bytebool::ByteBool::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_bytebool::ByteBool::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_bytebool::ByteBool::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_bytebool::ByteBool::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> diff --git a/encodings/bytebool/src/array.rs b/encodings/bytebool/src/array.rs index 610f0ae7f6c..12480bbf781 100644 --- a/encodings/bytebool/src/array.rs +++ b/encodings/bytebool/src/array.rs @@ -16,6 +16,7 @@ use vortex_array::ArrayView; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::TypedArrayRef; use vortex_array::arrays::BoolArray; @@ -142,7 +143,7 @@ impl VTable for ByteBool { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { crate::rules::RULES.evaluate(array, parent, child_idx) diff --git a/encodings/datetime-parts/public-api.lock b/encodings/datetime-parts/public-api.lock index f6845205964..0b0f4b43431 100644 --- a/encodings/datetime-parts/public-api.lock +++ b/encodings/datetime-parts/public-api.lock @@ -38,7 +38,7 @@ pub fn vortex_datetime_parts::DateTimeParts::id(&self) -> vortex_array::array::A pub fn vortex_datetime_parts::DateTimeParts::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_datetime_parts::DateTimeParts::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_datetime_parts::DateTimeParts::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_datetime_parts::DateTimeParts::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> diff --git a/encodings/datetime-parts/src/array.rs b/encodings/datetime-parts/src/array.rs index 133348290e2..6cd66c42ec8 100644 --- a/encodings/datetime-parts/src/array.rs +++ b/encodings/datetime-parts/src/array.rs @@ -18,6 +18,7 @@ use vortex_array::ArrayView; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::array_slots; use vortex_array::arrays::Primitive; @@ -194,7 +195,7 @@ impl VTable for DateTimeParts { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/encodings/decimal-byte-parts/public-api.lock b/encodings/decimal-byte-parts/public-api.lock index 985172de937..8c41e425d21 100644 --- a/encodings/decimal-byte-parts/public-api.lock +++ b/encodings/decimal-byte-parts/public-api.lock @@ -36,7 +36,7 @@ pub fn vortex_decimal_byte_parts::DecimalByteParts::id(&self) -> vortex_array::a pub fn vortex_decimal_byte_parts::DecimalByteParts::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_decimal_byte_parts::DecimalByteParts::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_decimal_byte_parts::DecimalByteParts::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_decimal_byte_parts::DecimalByteParts::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> 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 608f0a2d2bd..7f8d34ff5a9 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs @@ -20,6 +20,7 @@ use vortex_array::ArrayRef; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::TypedArrayRef; use vortex_array::arrays::DecimalArray; @@ -155,7 +156,7 @@ impl VTable for DecimalByteParts { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/encodings/fastlanes/public-api.lock b/encodings/fastlanes/public-api.lock index a3d3528eae2..233fe7f9084 100644 --- a/encodings/fastlanes/public-api.lock +++ b/encodings/fastlanes/public-api.lock @@ -158,7 +158,7 @@ pub fn vortex_fastlanes::BitPacked::id(&self) -> vortex_array::array::ArrayId pub fn vortex_fastlanes::BitPacked::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_fastlanes::BitPacked::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_fastlanes::BitPacked::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::BitPacked::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -314,7 +314,7 @@ pub fn vortex_fastlanes::Delta::id(&self) -> vortex_array::array::ArrayId pub fn vortex_fastlanes::Delta::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_fastlanes::Delta::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_fastlanes::Delta::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::Delta::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -402,7 +402,7 @@ pub fn vortex_fastlanes::FoR::id(&self) -> vortex_array::array::ArrayId pub fn vortex_fastlanes::FoR::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_fastlanes::FoR::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_fastlanes::FoR::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::FoR::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -508,7 +508,7 @@ pub fn vortex_fastlanes::RLE::id(&self) -> vortex_array::array::ArrayId pub fn vortex_fastlanes::RLE::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_fastlanes::RLE::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_fastlanes::RLE::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::RLE::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> diff --git a/encodings/fastlanes/src/bitpacking/compute/slice.rs b/encodings/fastlanes/src/bitpacking/compute/slice.rs index e6e51c57591..d2ccddbcca7 100644 --- a/encodings/fastlanes/src/bitpacking/compute/slice.rs +++ b/encodings/fastlanes/src/bitpacking/compute/slice.rs @@ -47,6 +47,7 @@ impl SliceReduce for BitPacked { mod tests { use vortex_array::IntoArray; use vortex_array::LEGACY_SESSION; + use vortex_array::ParentRef; use vortex_array::VortexSessionExecute; use vortex_array::arrays::PrimitiveArray; use vortex_array::arrays::SliceArray; @@ -61,11 +62,11 @@ mod tests { let values = PrimitiveArray::from_iter(0u32..2048); let bitpacked = bitpack_encode(&values, 11, None, &mut ctx)?; - let slice_array = SliceArray::new(bitpacked.clone().into_array(), 500..1500); + let slice_array = SliceArray::new(bitpacked.clone().into_array(), 500..1500).into_array(); let bitpacked_ref = bitpacked.into_array(); let reduced = bitpacked_ref - .reduce_parent(&slice_array.into_array(), 0)? + .reduce_parent(&ParentRef::from_array_ref(&slice_array), 0)? .expect("expected slice kernel to execute"); assert!(reduced.is::()); diff --git a/encodings/fastlanes/src/bitpacking/vtable/mod.rs b/encodings/fastlanes/src/bitpacking/vtable/mod.rs index ede4cfae5be..a9893bec7bf 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/mod.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/mod.rs @@ -15,6 +15,7 @@ use vortex_array::ArrayView; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::buffer::BufferHandle; use vortex_array::builders::ArrayBuilder; @@ -300,7 +301,7 @@ impl VTable for BitPacked { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { RULES.evaluate(array, parent, child_idx) diff --git a/encodings/fastlanes/src/bitpacking/vtable/operations.rs b/encodings/fastlanes/src/bitpacking/vtable/operations.rs index 6b82343d318..28c8a25de29 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/operations.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/operations.rs @@ -35,6 +35,7 @@ mod test { use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::LEGACY_SESSION; + use vortex_array::ParentRef; use vortex_array::VortexSessionExecute; use vortex_array::arrays::PrimitiveArray; use vortex_array::arrays::SliceArray; @@ -63,9 +64,9 @@ mod test { fn slice_via_reduce(array: &BitPackedArray, range: Range) -> BitPackedArray { let array_ref = array.clone().into_array(); - let slice_array = SliceArray::new(array_ref.clone(), range); + let slice_array = SliceArray::new(array_ref.clone(), range).into_array(); let sliced = array_ref - .reduce_parent(&slice_array.into_array(), 0) + .reduce_parent(&ParentRef::from_array_ref(&slice_array), 0) .expect("execute_parent failed") .expect("expected slice kernel to execute"); sliced.as_::().into_owned() diff --git a/encodings/fastlanes/src/delta/vtable/mod.rs b/encodings/fastlanes/src/delta/vtable/mod.rs index aafdd40b37f..72538d4f0c8 100644 --- a/encodings/fastlanes/src/delta/vtable/mod.rs +++ b/encodings/fastlanes/src/delta/vtable/mod.rs @@ -16,6 +16,7 @@ use vortex_array::ArrayView; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::arrays::PrimitiveArray; use vortex_array::buffer::BufferHandle; @@ -111,7 +112,7 @@ impl VTable for Delta { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { rules::RULES.evaluate(array, parent, child_idx) diff --git a/encodings/fastlanes/src/for/vtable/mod.rs b/encodings/fastlanes/src/for/vtable/mod.rs index 8c8eb9560a9..c0c5b5437ea 100644 --- a/encodings/fastlanes/src/for/vtable/mod.rs +++ b/encodings/fastlanes/src/for/vtable/mod.rs @@ -15,6 +15,7 @@ use vortex_array::ArrayView; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::arrays::PrimitiveArray; use vortex_array::buffer::BufferHandle; @@ -140,7 +141,7 @@ impl VTable for FoR { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/encodings/fastlanes/src/rle/vtable/mod.rs b/encodings/fastlanes/src/rle/vtable/mod.rs index d029f9b866d..4d84cd0e877 100644 --- a/encodings/fastlanes/src/rle/vtable/mod.rs +++ b/encodings/fastlanes/src/rle/vtable/mod.rs @@ -15,6 +15,7 @@ use vortex_array::ArrayView; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::arrays::Primitive; use vortex_array::buffer::BufferHandle; @@ -122,7 +123,7 @@ impl VTable for RLE { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { RULES.evaluate(array, parent, child_idx) diff --git a/encodings/fsst/public-api.lock b/encodings/fsst/public-api.lock index 44cf663fa39..e42db876d8e 100644 --- a/encodings/fsst/public-api.lock +++ b/encodings/fsst/public-api.lock @@ -38,7 +38,7 @@ pub fn vortex_fsst::FSST::id(&self) -> vortex_array::array::ArrayId pub fn vortex_fsst::FSST::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_fsst::FSST::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_fsst::FSST::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_fsst::FSST::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> diff --git a/encodings/fsst/src/array.rs b/encodings/fsst/src/array.rs index 93c62eeebf5..7152b22e873 100644 --- a/encodings/fsst/src/array.rs +++ b/encodings/fsst/src/array.rs @@ -24,6 +24,7 @@ use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; use vortex_array::LEGACY_SESSION; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::TypedArrayRef; use vortex_array::VortexSessionExecute; @@ -317,7 +318,7 @@ impl VTable for FSST { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { RULES.evaluate(array, parent, child_idx) diff --git a/encodings/pco/public-api.lock b/encodings/pco/public-api.lock index 655ca1d6ecc..1cd2ae6b0c8 100644 --- a/encodings/pco/public-api.lock +++ b/encodings/pco/public-api.lock @@ -34,7 +34,7 @@ pub fn vortex_pco::Pco::id(&self) -> vortex_array::array::ArrayId pub fn vortex_pco::Pco::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_pco::Pco::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_pco::Pco::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_pco::Pco::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> diff --git a/encodings/pco/src/array.rs b/encodings/pco/src/array.rs index 26b86555dec..51a809180c4 100644 --- a/encodings/pco/src/array.rs +++ b/encodings/pco/src/array.rs @@ -28,6 +28,7 @@ use vortex_array::ArrayView; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::arrays::Primitive; use vortex_array::arrays::PrimitiveArray; @@ -230,7 +231,7 @@ impl VTable for Pco { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { crate::rules::RULES.evaluate(array, parent, child_idx) diff --git a/encodings/runend/public-api.lock b/encodings/runend/public-api.lock index 0f95821ab08..cd64bb7c775 100644 --- a/encodings/runend/public-api.lock +++ b/encodings/runend/public-api.lock @@ -60,7 +60,7 @@ pub fn vortex_runend::RunEnd::id(&self) -> vortex_array::array::ArrayId pub fn vortex_runend::RunEnd::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_runend::RunEnd::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_runend::RunEnd::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_runend::RunEnd::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> diff --git a/encodings/runend/src/array.rs b/encodings/runend/src/array.rs index 291afb1b954..8d4ce483f24 100644 --- a/encodings/runend/src/array.rs +++ b/encodings/runend/src/array.rs @@ -19,6 +19,7 @@ use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; use vortex_array::LEGACY_SESSION; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::TypedArrayRef; use vortex_array::VortexSessionExecute; @@ -165,7 +166,7 @@ impl VTable for RunEnd { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { RULES.evaluate(array, parent, child_idx) diff --git a/encodings/sequence/public-api.lock b/encodings/sequence/public-api.lock index f7f0f4650de..30f7c0b0fa4 100644 --- a/encodings/sequence/public-api.lock +++ b/encodings/sequence/public-api.lock @@ -38,7 +38,7 @@ pub fn vortex_sequence::Sequence::id(&self) -> vortex_array::array::ArrayId pub fn vortex_sequence::Sequence::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_sequence::Sequence::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_sequence::Sequence::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_sequence::Sequence::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> diff --git a/encodings/sequence/src/array.rs b/encodings/sequence/src/array.rs index 74bebcc5510..63b63a9fdef 100644 --- a/encodings/sequence/src/array.rs +++ b/encodings/sequence/src/array.rs @@ -17,6 +17,7 @@ use vortex_array::ArrayRef; use vortex_array::ArrayView; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::buffer::BufferHandle; use vortex_array::dtype::DType; @@ -341,7 +342,7 @@ impl VTable for Sequence { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { RULES.evaluate(array, parent, child_idx) diff --git a/encodings/sparse/public-api.lock b/encodings/sparse/public-api.lock index 1c2e3c36fe6..5da4860d77e 100644 --- a/encodings/sparse/public-api.lock +++ b/encodings/sparse/public-api.lock @@ -40,7 +40,7 @@ pub fn vortex_sparse::Sparse::id(&self) -> vortex_array::array::ArrayId pub fn vortex_sparse::Sparse::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_sparse::Sparse::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_sparse::Sparse::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_sparse::Sparse::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> diff --git a/encodings/sparse/src/lib.rs b/encodings/sparse/src/lib.rs index 92d77ecd8a8..6877afda92d 100644 --- a/encodings/sparse/src/lib.rs +++ b/encodings/sparse/src/lib.rs @@ -20,6 +20,7 @@ use vortex_array::Canonical; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::arrays::BoolArray; use vortex_array::arrays::ConstantArray; @@ -191,7 +192,7 @@ impl VTable for Sparse { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { RULES.evaluate(array, parent, child_idx) diff --git a/encodings/zigzag/public-api.lock b/encodings/zigzag/public-api.lock index 3bbc2428ad1..af054a31af7 100644 --- a/encodings/zigzag/public-api.lock +++ b/encodings/zigzag/public-api.lock @@ -36,7 +36,7 @@ pub fn vortex_zigzag::ZigZag::id(&self) -> vortex_array::array::ArrayId pub fn vortex_zigzag::ZigZag::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_zigzag::ZigZag::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_zigzag::ZigZag::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_zigzag::ZigZag::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> diff --git a/encodings/zigzag/src/array.rs b/encodings/zigzag/src/array.rs index 10dee3c922d..a48b92d6222 100644 --- a/encodings/zigzag/src/array.rs +++ b/encodings/zigzag/src/array.rs @@ -15,6 +15,7 @@ use vortex_array::ArrayView; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::TypedArrayRef; use vortex_array::buffer::BufferHandle; @@ -137,7 +138,7 @@ impl VTable for ZigZag { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { RULES.evaluate(array, parent, child_idx) diff --git a/encodings/zstd/public-api.lock b/encodings/zstd/public-api.lock index 43c534a4169..03ad1a172ac 100644 --- a/encodings/zstd/public-api.lock +++ b/encodings/zstd/public-api.lock @@ -42,7 +42,7 @@ pub fn vortex_zstd::Zstd::id(&self) -> vortex_array::array::ArrayId pub fn vortex_zstd::Zstd::nbuffers(vortex_array::array::view::ArrayView<'_, Self>) -> usize -pub fn vortex_zstd::Zstd::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::erased::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_zstd::Zstd::reduce_parent(vortex_array::array::view::ArrayView<'_, Self>, &vortex_array::array::parent::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_zstd::Zstd::serialize(vortex_array::array::view::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> diff --git a/encodings/zstd/src/array.rs b/encodings/zstd/src/array.rs index 95206357e0a..82ea527cb08 100644 --- a/encodings/zstd/src/array.rs +++ b/encodings/zstd/src/array.rs @@ -21,6 +21,7 @@ use vortex_array::Canonical; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; +use vortex_array::ParentRef; use vortex_array::Precision; use vortex_array::accessor::ArrayAccessor; use vortex_array::arrays::ConstantArray; @@ -243,7 +244,7 @@ impl VTable for Zstd { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { crate::rules::RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/public-api.lock b/vortex-array/public-api.lock index f2adf6b4e57..bf3eb86fc68 100644 --- a/vortex-array/public-api.lock +++ b/vortex-array/public-api.lock @@ -1402,7 +1402,7 @@ pub fn vortex_array::arrays::Bool::nchildren(vortex_array::ArrayView<'_, Self>) pub fn vortex_array::arrays::Bool::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Bool::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Bool::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Bool::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -1432,6 +1432,8 @@ pub type vortex_array::arrays::bool::BoolMaskedValidityRule::Parent = vortex_arr pub fn vortex_array::arrays::bool::BoolMaskedValidityRule::reduce_parent(&self, vortex_array::ArrayView<'_, vortex_array::arrays::Bool>, vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::bool::BoolMaskedValidityRule::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::scalar_fn::fns::cast::CastKernel for vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::cast(vortex_array::ArrayView<'_, vortex_array::arrays::Bool>, &vortex_array::dtype::DType, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -1498,6 +1500,8 @@ pub type vortex_array::arrays::bool::BoolMaskedValidityRule::Parent = vortex_arr pub fn vortex_array::arrays::bool::BoolMaskedValidityRule::reduce_parent(&self, vortex_array::ArrayView<'_, vortex_array::arrays::Bool>, vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::bool::BoolMaskedValidityRule::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::arrays::bool::BoolArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::bool::BoolArrayExt::execute_mask(&self, &mut vortex_array::ExecutionCtx) -> vortex_mask::Mask @@ -1576,7 +1580,7 @@ pub fn vortex_array::arrays::Chunked::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Chunked::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Chunked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Chunked::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -1740,7 +1744,7 @@ pub fn vortex_array::arrays::Constant::nchildren(vortex_array::ArrayView<'_, Sel pub fn vortex_array::arrays::Constant::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Constant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Constant::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -1920,7 +1924,7 @@ pub fn vortex_array::arrays::Decimal::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Decimal::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Decimal::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Decimal::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -1946,6 +1950,8 @@ pub type vortex_array::arrays::decimal::DecimalMaskedValidityRule::Parent = vort pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent(&self, vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>, vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::scalar_fn::fns::between::BetweenKernel for vortex_array::arrays::Decimal pub fn vortex_array::arrays::Decimal::between(vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>, &vortex_array::ArrayRef, &vortex_array::ArrayRef, &vortex_array::scalar_fn::fns::between::BetweenOptions, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -2046,6 +2052,8 @@ pub type vortex_array::arrays::decimal::DecimalMaskedValidityRule::Parent = vort pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent(&self, vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>, vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::arrays::decimal::DecimalArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::decimal::DecimalArrayExt::buffer(&self) -> vortex_buffer::buffer::Buffer @@ -2140,7 +2148,7 @@ pub fn vortex_array::arrays::dict::Dict::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::dict::Dict::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::dict::Dict::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::Dict::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -2232,7 +2240,7 @@ pub fn vortex_array::arrays::dict::Dict::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::dict::Dict::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::dict::Dict::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::Dict::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -2418,6 +2426,8 @@ pub type vortex_array::arrays::dict::TakeReduceAdaptor::Parent = vortex_array pub fn vortex_array::arrays::dict::TakeReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::TakeReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::arrays::dict::DictArrayExt: vortex_array::TypedArrayRef + vortex_array::arrays::dict::DictArraySlotsExt pub fn vortex_array::arrays::dict::DictArrayExt::compute_referenced_values_mask(&self, bool) -> vortex_error::VortexResult @@ -2584,7 +2594,7 @@ pub fn vortex_array::arrays::Extension::nchildren(vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Extension::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Extension::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Extension::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -2682,7 +2692,7 @@ pub fn vortex_array::arrays::Filter::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Filter::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Filter::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Filter::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Filter::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -2766,6 +2776,8 @@ pub type vortex_array::arrays::filter::FilterReduceAdaptor::Parent = vortex_a pub fn vortex_array::arrays::filter::FilterReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::ArrayView<'_, vortex_array::arrays::Filter>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::filter::FilterReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::arrays::filter::FilterArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::filter::FilterArrayExt::child(&self) -> &vortex_array::ArrayRef @@ -2872,7 +2884,7 @@ pub fn vortex_array::arrays::FixedSizeList::nchildren(vortex_array::ArrayView<'_ pub fn vortex_array::arrays::FixedSizeList::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::FixedSizeList::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeList::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -3016,7 +3028,7 @@ pub fn vortex_array::arrays::List::nchildren(vortex_array::ArrayView<'_, Self>) pub fn vortex_array::arrays::List::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::List::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::List::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -3196,7 +3208,7 @@ pub fn vortex_array::arrays::ListView::nchildren(vortex_array::ArrayView<'_, Sel pub fn vortex_array::arrays::ListView::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::ListView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListView::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -3380,7 +3392,7 @@ pub fn vortex_array::arrays::Masked::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Masked::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Masked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Masked::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -3530,7 +3542,7 @@ pub fn vortex_array::arrays::null::Null::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::null::Null::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::null::Null::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::Null::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -3616,7 +3628,7 @@ pub fn vortex_array::arrays::patched::Patched::nchildren(vortex_array::ArrayView pub fn vortex_array::arrays::patched::Patched::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::patched::Patched::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::patched::Patched::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::patched::Patched::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -3902,7 +3914,7 @@ pub fn vortex_array::arrays::Primitive::nchildren(vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Primitive::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Primitive::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Primitive::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -3928,6 +3940,8 @@ pub type vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::Parent = pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_parent(&self, vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>, vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::scalar_fn::fns::between::BetweenKernel for vortex_array::arrays::Primitive pub fn vortex_array::arrays::Primitive::between(vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>, &vortex_array::ArrayRef, &vortex_array::ArrayRef, &vortex_array::scalar_fn::fns::between::BetweenOptions, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -4036,6 +4050,8 @@ pub type vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::Parent = pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_parent(&self, vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>, vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::arrays::primitive::PrimitiveArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::primitive::PrimitiveArrayExt::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle @@ -4118,8 +4134,12 @@ pub type vortex_array::arrays::scalar_fn::AnyScalarFn::Match<'a> = vortex_array: pub fn vortex_array::arrays::scalar_fn::AnyScalarFn::matches(&vortex_array::ArrayRef) -> bool +pub fn vortex_array::arrays::scalar_fn::AnyScalarFn::matches_parent(&vortex_array::ParentRef<'_>) -> bool + pub fn vortex_array::arrays::scalar_fn::AnyScalarFn::try_match(&vortex_array::ArrayRef) -> core::option::Option +pub fn vortex_array::arrays::scalar_fn::AnyScalarFn::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option + pub struct vortex_array::arrays::scalar_fn::ExactScalarFn(_) impl core::default::Default for vortex_array::arrays::scalar_fn::ExactScalarFn @@ -4136,8 +4156,12 @@ pub type vortex_array::arrays::scalar_fn::ExactScalarFn::Match<'a> = vortex_a pub fn vortex_array::arrays::scalar_fn::ExactScalarFn::matches(&vortex_array::ArrayRef) -> bool +pub fn vortex_array::arrays::scalar_fn::ExactScalarFn::matches_parent(&vortex_array::ParentRef<'_>) -> bool + pub fn vortex_array::arrays::scalar_fn::ExactScalarFn::try_match(&vortex_array::ArrayRef) -> core::option::Option +pub fn vortex_array::arrays::scalar_fn::ExactScalarFn::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option + pub struct vortex_array::arrays::scalar_fn::ScalarFn impl core::clone::Clone for vortex_array::arrays::scalar_fn::ScalarFn @@ -4184,7 +4208,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFn::nchildren(vortex_array::ArrayV pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFn::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -4306,7 +4330,7 @@ pub fn vortex_array::arrays::Shared::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Shared::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Shared::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Shared::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Shared::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -4418,7 +4442,7 @@ pub fn vortex_array::arrays::slice::Slice::nchildren(vortex_array::ArrayView<'_, pub fn vortex_array::arrays::slice::Slice::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::slice::Slice::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::Slice::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::Slice::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -4510,6 +4534,8 @@ pub type vortex_array::arrays::slice::SliceReduceAdaptor::Parent = vortex_arr pub fn vortex_array::arrays::slice::SliceReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, ::Match, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::SliceReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::arrays::slice::SliceArrayExt: vortex_array::TypedArrayRef pub fn vortex_array::arrays::slice::SliceArrayExt::child(&self) -> &vortex_array::ArrayRef @@ -4644,7 +4670,7 @@ pub fn vortex_array::arrays::Struct::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Struct::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Struct::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Struct::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -4800,7 +4826,7 @@ pub fn vortex_array::arrays::VarBin::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::VarBin::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::VarBin::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBin::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -5166,7 +5192,7 @@ pub fn vortex_array::arrays::VarBinView::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::VarBinView::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::VarBinView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinView::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -5352,7 +5378,7 @@ pub fn vortex_array::arrays::Variant::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Variant::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Variant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Variant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Variant::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -5420,7 +5446,7 @@ pub fn vortex_array::arrays::Bool::nchildren(vortex_array::ArrayView<'_, Self>) pub fn vortex_array::arrays::Bool::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Bool::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Bool::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Bool::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -5450,6 +5476,8 @@ pub type vortex_array::arrays::bool::BoolMaskedValidityRule::Parent = vortex_arr pub fn vortex_array::arrays::bool::BoolMaskedValidityRule::reduce_parent(&self, vortex_array::ArrayView<'_, vortex_array::arrays::Bool>, vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::bool::BoolMaskedValidityRule::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::scalar_fn::fns::cast::CastKernel for vortex_array::arrays::Bool pub fn vortex_array::arrays::Bool::cast(vortex_array::ArrayView<'_, vortex_array::arrays::Bool>, &vortex_array::dtype::DType, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -5512,7 +5540,7 @@ pub fn vortex_array::arrays::Chunked::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Chunked::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Chunked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Chunked::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -5602,7 +5630,7 @@ pub fn vortex_array::arrays::Constant::nchildren(vortex_array::ArrayView<'_, Sel pub fn vortex_array::arrays::Constant::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Constant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Constant::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -5688,7 +5716,7 @@ pub fn vortex_array::arrays::Decimal::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Decimal::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Decimal::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Decimal::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -5714,6 +5742,8 @@ pub type vortex_array::arrays::decimal::DecimalMaskedValidityRule::Parent = vort pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent(&self, vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>, vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::scalar_fn::fns::between::BetweenKernel for vortex_array::arrays::Decimal pub fn vortex_array::arrays::Decimal::between(vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>, &vortex_array::ArrayRef, &vortex_array::ArrayRef, &vortex_array::scalar_fn::fns::between::BetweenOptions, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -5780,7 +5810,7 @@ pub fn vortex_array::arrays::dict::Dict::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::dict::Dict::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::dict::Dict::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::Dict::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -5870,7 +5900,7 @@ pub fn vortex_array::arrays::Extension::nchildren(vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Extension::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Extension::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Extension::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -5952,7 +5982,7 @@ pub fn vortex_array::arrays::Filter::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Filter::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Filter::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Filter::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Filter::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -6010,7 +6040,7 @@ pub fn vortex_array::arrays::FixedSizeList::nchildren(vortex_array::ArrayView<'_ pub fn vortex_array::arrays::FixedSizeList::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::FixedSizeList::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeList::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -6088,7 +6118,7 @@ pub fn vortex_array::arrays::List::nchildren(vortex_array::ArrayView<'_, Self>) pub fn vortex_array::arrays::List::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::List::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::List::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -6170,7 +6200,7 @@ pub fn vortex_array::arrays::ListView::nchildren(vortex_array::ArrayView<'_, Sel pub fn vortex_array::arrays::ListView::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::ListView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListView::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -6252,7 +6282,7 @@ pub fn vortex_array::arrays::Masked::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Masked::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Masked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Masked::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -6330,7 +6360,7 @@ pub fn vortex_array::arrays::null::Null::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::null::Null::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::null::Null::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::Null::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -6412,7 +6442,7 @@ pub fn vortex_array::arrays::patched::Patched::nchildren(vortex_array::ArrayView pub fn vortex_array::arrays::patched::Patched::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::patched::Patched::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::patched::Patched::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::patched::Patched::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -6486,7 +6516,7 @@ pub fn vortex_array::arrays::Primitive::nchildren(vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Primitive::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Primitive::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Primitive::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -6512,6 +6542,8 @@ pub type vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::Parent = pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_parent(&self, vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>, vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::scalar_fn::fns::between::BetweenKernel for vortex_array::arrays::Primitive pub fn vortex_array::arrays::Primitive::between(vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>, &vortex_array::ArrayRef, &vortex_array::ArrayRef, &vortex_array::scalar_fn::fns::between::BetweenOptions, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -6578,7 +6610,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFn::nchildren(vortex_array::ArrayV pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFn::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -6636,7 +6668,7 @@ pub fn vortex_array::arrays::Shared::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Shared::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Shared::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Shared::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Shared::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -6694,7 +6726,7 @@ pub fn vortex_array::arrays::slice::Slice::nchildren(vortex_array::ArrayView<'_, pub fn vortex_array::arrays::slice::Slice::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::slice::Slice::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::Slice::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::Slice::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -6756,7 +6788,7 @@ pub fn vortex_array::arrays::Struct::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Struct::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Struct::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Struct::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -6834,7 +6866,7 @@ pub fn vortex_array::arrays::VarBin::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::VarBin::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::VarBin::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBin::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -6920,7 +6952,7 @@ pub fn vortex_array::arrays::VarBinView::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::VarBinView::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::VarBinView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinView::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -7002,7 +7034,7 @@ pub fn vortex_array::arrays::Variant::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Variant::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Variant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Variant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Variant::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -13380,15 +13412,27 @@ pub type vortex_array::matcher::AnyArray::Match<'a> = &'a vortex_array::ArrayRef pub fn vortex_array::matcher::AnyArray::matches(&vortex_array::ArrayRef) -> bool +pub fn vortex_array::matcher::AnyArray::matches_parent(&vortex_array::ParentRef<'_>) -> bool + pub fn vortex_array::matcher::AnyArray::try_match(&vortex_array::ArrayRef) -> core::option::Option +pub fn vortex_array::matcher::AnyArray::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option + pub trait vortex_array::matcher::Matcher pub type vortex_array::matcher::Matcher::Match<'a> pub fn vortex_array::matcher::Matcher::matches(&vortex_array::ArrayRef) -> bool +<<<<<<< HEAD pub fn vortex_array::matcher::Matcher::try_match(&vortex_array::ArrayRef) -> core::option::Option +======= +pub fn vortex_array::matcher::Matcher::matches_parent(&vortex_array::ParentRef<'_>) -> bool + +pub fn vortex_array::matcher::Matcher::try_match<'a>(&'a vortex_array::ArrayRef) -> core::option::Option +>>>>>>> 08c9f4ad5 (Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice) + +pub fn vortex_array::matcher::Matcher::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option impl vortex_array::matcher::Matcher for vortex_array::AnyCanonical @@ -13396,7 +13440,15 @@ pub type vortex_array::AnyCanonical::Match<'a> = vortex_array::CanonicalView<'a> pub fn vortex_array::AnyCanonical::matches(&vortex_array::ArrayRef) -> bool +<<<<<<< HEAD pub fn vortex_array::AnyCanonical::try_match(&vortex_array::ArrayRef) -> core::option::Option +======= +pub fn vortex_array::AnyCanonical::matches_parent(&vortex_array::ParentRef<'_>) -> bool + +pub fn vortex_array::AnyCanonical::try_match<'a>(&'a vortex_array::ArrayRef) -> core::option::Option +>>>>>>> 08c9f4ad5 (Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice) + +pub fn vortex_array::AnyCanonical::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option impl vortex_array::matcher::Matcher for vortex_array::AnyColumnar @@ -13404,7 +13456,15 @@ pub type vortex_array::AnyColumnar::Match<'a> = vortex_array::ColumnarView<'a> pub fn vortex_array::AnyColumnar::matches(&vortex_array::ArrayRef) -> bool +<<<<<<< HEAD pub fn vortex_array::AnyColumnar::try_match(&vortex_array::ArrayRef) -> core::option::Option +======= +pub fn vortex_array::AnyColumnar::matches_parent(&vortex_array::ParentRef<'_>) -> bool + +pub fn vortex_array::AnyColumnar::try_match<'a>(&'a vortex_array::ArrayRef) -> core::option::Option +>>>>>>> 08c9f4ad5 (Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice) + +pub fn vortex_array::AnyColumnar::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option impl vortex_array::matcher::Matcher for vortex_array::arrays::scalar_fn::AnyScalarFn @@ -13412,31 +13472,51 @@ pub type vortex_array::arrays::scalar_fn::AnyScalarFn::Match<'a> = vortex_array: pub fn vortex_array::arrays::scalar_fn::AnyScalarFn::matches(&vortex_array::ArrayRef) -> bool +pub fn vortex_array::arrays::scalar_fn::AnyScalarFn::matches_parent(&vortex_array::ParentRef<'_>) -> bool + pub fn vortex_array::arrays::scalar_fn::AnyScalarFn::try_match(&vortex_array::ArrayRef) -> core::option::Option +pub fn vortex_array::arrays::scalar_fn::AnyScalarFn::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option + impl vortex_array::matcher::Matcher for vortex_array::matcher::AnyArray pub type vortex_array::matcher::AnyArray::Match<'a> = &'a vortex_array::ArrayRef pub fn vortex_array::matcher::AnyArray::matches(&vortex_array::ArrayRef) -> bool +pub fn vortex_array::matcher::AnyArray::matches_parent(&vortex_array::ParentRef<'_>) -> bool + pub fn vortex_array::matcher::AnyArray::try_match(&vortex_array::ArrayRef) -> core::option::Option +pub fn vortex_array::matcher::AnyArray::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option + impl vortex_array::matcher::Matcher for vortex_array::arrays::scalar_fn::ExactScalarFn pub type vortex_array::arrays::scalar_fn::ExactScalarFn::Match<'a> = vortex_array::arrays::scalar_fn::ScalarFnArrayView<'a, F> pub fn vortex_array::arrays::scalar_fn::ExactScalarFn::matches(&vortex_array::ArrayRef) -> bool +pub fn vortex_array::arrays::scalar_fn::ExactScalarFn::matches_parent(&vortex_array::ParentRef<'_>) -> bool + pub fn vortex_array::arrays::scalar_fn::ExactScalarFn::try_match(&vortex_array::ArrayRef) -> core::option::Option +pub fn vortex_array::arrays::scalar_fn::ExactScalarFn::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option + impl vortex_array::matcher::Matcher for V pub type V::Match<'a> = vortex_array::ArrayView<'a, V> pub fn V::matches(&vortex_array::ArrayRef) -> bool +<<<<<<< HEAD pub fn V::try_match(&vortex_array::ArrayRef) -> core::option::Option> +======= +pub fn V::matches_parent(&vortex_array::ParentRef<'_>) -> bool + +pub fn V::try_match<'a>(&'a vortex_array::ArrayRef) -> core::option::Option> +>>>>>>> 08c9f4ad5 (Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice) + +pub fn V::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option pub mod vortex_array::memory @@ -13602,9 +13682,13 @@ impl vortex_array::optimizer::kernels::ArrayKerne pub fn S::kernels(&self) -> vortex_session::Ref<'_, vortex_array::optimizer::kernels::ArrayKernels> +<<<<<<< HEAD pub type vortex_array::optimizer::kernels::ExecuteParentFn = fn(&vortex_array::ArrayRef, &vortex_array::ArrayRef, usize, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub type vortex_array::optimizer::kernels::ReduceParentFn = fn(&vortex_array::ArrayRef, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +======= +pub type vortex_array::optimizer::kernels::ReduceParentFn = fn(&vortex_array::ArrayRef, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> +>>>>>>> 08c9f4ad5 (Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice) pub mod vortex_array::optimizer::rules @@ -13612,9 +13696,9 @@ pub struct vortex_array::optimizer::rules::ParentReduceRuleAdapter impl> vortex_array::optimizer::rules::DynArrayParentReduceRule for vortex_array::optimizer::rules::ParentReduceRuleAdapter -pub fn vortex_array::optimizer::rules::ParentReduceRuleAdapter::matches(&self, &vortex_array::ArrayRef) -> bool +pub fn vortex_array::optimizer::rules::ParentReduceRuleAdapter::matches(&self, &vortex_array::ParentRef<'_>) -> bool -pub fn vortex_array::optimizer::rules::ParentReduceRuleAdapter::reduce_parent(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::optimizer::rules::ParentReduceRuleAdapter::reduce_parent(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> impl> core::fmt::Debug for vortex_array::optimizer::rules::ParentReduceRuleAdapter @@ -13624,7 +13708,7 @@ pub struct vortex_array::optimizer::rules::ParentRuleSet vortex_array::optimizer::rules::ParentRuleSet -pub fn vortex_array::optimizer::rules::ParentRuleSet::evaluate(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::optimizer::rules::ParentRuleSet::evaluate(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub const fn vortex_array::optimizer::rules::ParentRuleSet::lift>(&'static R) -> &'static dyn vortex_array::optimizer::rules::DynArrayParentReduceRule @@ -13644,105 +13728,135 @@ pub type vortex_array::optimizer::rules::ArrayParentReduceRule::Parent: vortex_a pub fn vortex_array::optimizer::rules::ArrayParentReduceRule::reduce_parent(&self, vortex_array::ArrayView<'_, V>, ::Match, usize) -> vortex_error::VortexResult> +pub fn vortex_array::optimizer::rules::ArrayParentReduceRule::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::arrays::bool::BoolMaskedValidityRule pub type vortex_array::arrays::bool::BoolMaskedValidityRule::Parent = vortex_array::arrays::Masked pub fn vortex_array::arrays::bool::BoolMaskedValidityRule::reduce_parent(&self, vortex_array::ArrayView<'_, vortex_array::arrays::Bool>, vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::bool::BoolMaskedValidityRule::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::arrays::decimal::DecimalMaskedValidityRule pub type vortex_array::arrays::decimal::DecimalMaskedValidityRule::Parent = vortex_array::arrays::Masked pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent(&self, vortex_array::ArrayView<'_, vortex_array::arrays::Decimal>, vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::arrays::primitive::PrimitiveMaskedValidityRule pub type vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::Parent = vortex_array::arrays::Masked pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_parent(&self, vortex_array::ArrayView<'_, vortex_array::arrays::Primitive>, vortex_array::ArrayView<'_, vortex_array::arrays::Masked>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::arrays::dict::TakeReduceAdaptor where V: vortex_array::arrays::dict::TakeReduce pub type vortex_array::arrays::dict::TakeReduceAdaptor::Parent = vortex_array::arrays::dict::Dict pub fn vortex_array::arrays::dict::TakeReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::ArrayView<'_, vortex_array::arrays::dict::Dict>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::TakeReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::arrays::filter::FilterReduceAdaptor where V: vortex_array::arrays::filter::FilterReduce pub type vortex_array::arrays::filter::FilterReduceAdaptor::Parent = vortex_array::arrays::Filter pub fn vortex_array::arrays::filter::FilterReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::ArrayView<'_, vortex_array::arrays::Filter>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::filter::FilterReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::arrays::slice::SliceReduceAdaptor where V: vortex_array::arrays::slice::SliceReduce pub type vortex_array::arrays::slice::SliceReduceAdaptor::Parent = vortex_array::arrays::slice::Slice pub fn vortex_array::arrays::slice::SliceReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, ::Match, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::SliceReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::scalar_fn::fns::between::BetweenReduceAdaptor where V: vortex_array::scalar_fn::fns::between::BetweenReduce pub type vortex_array::scalar_fn::fns::between::BetweenReduceAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn pub fn vortex_array::scalar_fn::fns::between::BetweenReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::between::Between>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::between::BetweenReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::scalar_fn::fns::cast::CastReduceAdaptor where V: vortex_array::scalar_fn::fns::cast::CastReduce pub type vortex_array::scalar_fn::fns::cast::CastReduceAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn pub fn vortex_array::scalar_fn::fns::cast::CastReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::cast::Cast>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::cast::CastReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::scalar_fn::fns::fill_null::FillNullReduceAdaptor where V: vortex_array::scalar_fn::fns::fill_null::FillNullReduce pub type vortex_array::scalar_fn::fns::fill_null::FillNullReduceAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn pub fn vortex_array::scalar_fn::fns::fill_null::FillNullReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::fill_null::FillNull>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::fill_null::FillNullReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::scalar_fn::fns::like::LikeReduceAdaptor where V: vortex_array::scalar_fn::fns::like::LikeReduce pub type vortex_array::scalar_fn::fns::like::LikeReduceAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn pub fn vortex_array::scalar_fn::fns::like::LikeReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::like::Like>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::like::LikeReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduceAdaptor where V: vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduce pub type vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduceAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::list_contains::ListContains>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::scalar_fn::fns::mask::MaskReduceAdaptor where V: vortex_array::scalar_fn::fns::mask::MaskReduce pub type vortex_array::scalar_fn::fns::mask::MaskReduceAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn pub fn vortex_array::scalar_fn::fns::mask::MaskReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::mask::Mask>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::mask::MaskReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::scalar_fn::fns::not::NotReduceAdaptor where V: vortex_array::scalar_fn::fns::not::NotReduce pub type vortex_array::scalar_fn::fns::not::NotReduceAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn pub fn vortex_array::scalar_fn::fns::not::NotReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::not::Not>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::not::NotReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::scalar_fn::fns::zip::ZipReduceAdaptor where V: vortex_array::scalar_fn::fns::zip::ZipReduce pub type vortex_array::scalar_fn::fns::zip::ZipReduceAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn pub fn vortex_array::scalar_fn::fns::zip::ZipReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::zip::Zip>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::zip::ZipReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::optimizer::rules::ArrayReduceRule: core::fmt::Debug + core::marker::Send + core::marker::Sync + 'static pub fn vortex_array::optimizer::rules::ArrayReduceRule::reduce(&self, vortex_array::ArrayView<'_, V>) -> vortex_error::VortexResult> pub trait vortex_array::optimizer::rules::DynArrayParentReduceRule: core::fmt::Debug + core::marker::Send + core::marker::Sync -pub fn vortex_array::optimizer::rules::DynArrayParentReduceRule::matches(&self, &vortex_array::ArrayRef) -> bool +pub fn vortex_array::optimizer::rules::DynArrayParentReduceRule::matches(&self, &vortex_array::ParentRef<'_>) -> bool -pub fn vortex_array::optimizer::rules::DynArrayParentReduceRule::reduce_parent(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::optimizer::rules::DynArrayParentReduceRule::reduce_parent(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> impl> vortex_array::optimizer::rules::DynArrayParentReduceRule for vortex_array::optimizer::rules::ParentReduceRuleAdapter -pub fn vortex_array::optimizer::rules::ParentReduceRuleAdapter::matches(&self, &vortex_array::ArrayRef) -> bool +pub fn vortex_array::optimizer::rules::ParentReduceRuleAdapter::matches(&self, &vortex_array::ParentRef<'_>) -> bool -pub fn vortex_array::optimizer::rules::ParentReduceRuleAdapter::reduce_parent(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::optimizer::rules::ParentReduceRuleAdapter::reduce_parent(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub trait vortex_array::optimizer::ArrayOptimizer @@ -15936,6 +16050,8 @@ pub type vortex_array::scalar_fn::fns::between::BetweenReduceAdaptor::Parent pub fn vortex_array::scalar_fn::fns::between::BetweenReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::between::Between>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::between::BetweenReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::scalar_fn::fns::between::BetweenKernel: vortex_array::VTable pub fn vortex_array::scalar_fn::fns::between::BetweenKernel::between(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, &vortex_array::ArrayRef, &vortex_array::scalar_fn::fns::between::BetweenOptions, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -16206,6 +16322,8 @@ pub type vortex_array::scalar_fn::fns::cast::CastReduceAdaptor::Parent = vort pub fn vortex_array::scalar_fn::fns::cast::CastReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::cast::Cast>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::cast::CastReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::scalar_fn::fns::cast::CastKernel: vortex_array::VTable pub fn vortex_array::scalar_fn::fns::cast::CastKernel::cast(vortex_array::ArrayView<'_, Self>, &vortex_array::dtype::DType, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -16458,6 +16576,8 @@ pub type vortex_array::scalar_fn::fns::fill_null::FillNullReduceAdaptor::Pare pub fn vortex_array::scalar_fn::fns::fill_null::FillNullReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::fill_null::FillNull>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::fill_null::FillNullReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::scalar_fn::fns::fill_null::FillNullKernel: vortex_array::VTable pub fn vortex_array::scalar_fn::fns::fill_null::FillNullKernel::fill_null(vortex_array::ArrayView<'_, Self>, &vortex_array::scalar::Scalar, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -16742,6 +16862,8 @@ pub type vortex_array::scalar_fn::fns::like::LikeReduceAdaptor::Parent = vort pub fn vortex_array::scalar_fn::fns::like::LikeReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::like::Like>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::like::LikeReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::scalar_fn::fns::like::LikeKernel: vortex_array::VTable pub fn vortex_array::scalar_fn::fns::like::LikeKernel::like(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, vortex_array::scalar_fn::fns::like::LikeOptions, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -16832,6 +16954,8 @@ pub type vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduceA pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::list_contains::ListContains>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::scalar_fn::fns::list_contains::ListContainsElementKernel: vortex_array::VTable pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementKernel::list_contains(&vortex_array::ArrayRef, vortex_array::ArrayView<'_, Self>, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -16964,6 +17088,8 @@ pub type vortex_array::scalar_fn::fns::mask::MaskReduceAdaptor::Parent = vort pub fn vortex_array::scalar_fn::fns::mask::MaskReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::mask::Mask>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::mask::MaskReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::scalar_fn::fns::mask::MaskKernel: vortex_array::VTable pub fn vortex_array::scalar_fn::fns::mask::MaskKernel::mask(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -17188,6 +17314,8 @@ pub type vortex_array::scalar_fn::fns::not::NotReduceAdaptor::Parent = vortex pub fn vortex_array::scalar_fn::fns::not::NotReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::not::Not>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::not::NotReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::scalar_fn::fns::not::NotKernel: vortex_array::VTable pub fn vortex_array::scalar_fn::fns::not::NotKernel::invert(vortex_array::ArrayView<'_, Self>, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -17652,6 +17780,8 @@ pub type vortex_array::scalar_fn::fns::zip::ZipReduceAdaptor::Parent = vortex pub fn vortex_array::scalar_fn::fns::zip::ZipReduceAdaptor::reduce_parent(&self, vortex_array::ArrayView<'_, V>, vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::zip::Zip>, usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::zip::ZipReduceAdaptor::reduce_parent_ref(&self, vortex_array::ArrayView<'_, V>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> + pub trait vortex_array::scalar_fn::fns::zip::ZipKernel: vortex_array::VTable pub fn vortex_array::scalar_fn::fns::zip::ZipKernel::zip(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, &vortex_array::ArrayRef, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> @@ -19798,7 +19928,7 @@ pub fn vortex_array::vtable::ArrayVTable::nchildren(vortex_array::ArrayView<'_, pub fn vortex_array::vtable::ArrayVTable::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::vtable::ArrayVTable::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::vtable::ArrayVTable::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::vtable::ArrayVTable::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -19838,7 +19968,7 @@ pub fn vortex_array::arrays::Bool::nchildren(vortex_array::ArrayView<'_, Self>) pub fn vortex_array::arrays::Bool::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Bool::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Bool::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Bool::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -19878,7 +20008,7 @@ pub fn vortex_array::arrays::Chunked::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Chunked::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Chunked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Chunked::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -19918,7 +20048,7 @@ pub fn vortex_array::arrays::Constant::nchildren(vortex_array::ArrayView<'_, Sel pub fn vortex_array::arrays::Constant::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Constant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Constant::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -19958,7 +20088,7 @@ pub fn vortex_array::arrays::Decimal::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Decimal::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Decimal::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Decimal::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -19998,7 +20128,7 @@ pub fn vortex_array::arrays::Extension::nchildren(vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Extension::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Extension::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Extension::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20038,7 +20168,7 @@ pub fn vortex_array::arrays::Filter::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Filter::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Filter::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Filter::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Filter::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20078,7 +20208,7 @@ pub fn vortex_array::arrays::FixedSizeList::nchildren(vortex_array::ArrayView<'_ pub fn vortex_array::arrays::FixedSizeList::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::FixedSizeList::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeList::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20118,7 +20248,7 @@ pub fn vortex_array::arrays::List::nchildren(vortex_array::ArrayView<'_, Self>) pub fn vortex_array::arrays::List::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::List::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::List::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20158,7 +20288,7 @@ pub fn vortex_array::arrays::ListView::nchildren(vortex_array::ArrayView<'_, Sel pub fn vortex_array::arrays::ListView::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::ListView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListView::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20198,7 +20328,7 @@ pub fn vortex_array::arrays::Masked::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Masked::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Masked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Masked::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20238,7 +20368,7 @@ pub fn vortex_array::arrays::Primitive::nchildren(vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Primitive::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Primitive::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Primitive::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20278,7 +20408,7 @@ pub fn vortex_array::arrays::Shared::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Shared::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Shared::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Shared::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Shared::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20318,7 +20448,7 @@ pub fn vortex_array::arrays::Struct::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Struct::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Struct::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Struct::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20358,7 +20488,7 @@ pub fn vortex_array::arrays::VarBin::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::VarBin::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::VarBin::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBin::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20398,7 +20528,7 @@ pub fn vortex_array::arrays::VarBinView::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::VarBinView::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::VarBinView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinView::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20438,7 +20568,7 @@ pub fn vortex_array::arrays::Variant::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Variant::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Variant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Variant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Variant::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20478,7 +20608,7 @@ pub fn vortex_array::arrays::dict::Dict::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::dict::Dict::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::dict::Dict::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::Dict::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20518,7 +20648,7 @@ pub fn vortex_array::arrays::null::Null::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::null::Null::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::null::Null::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::Null::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20558,7 +20688,7 @@ pub fn vortex_array::arrays::patched::Patched::nchildren(vortex_array::ArrayView pub fn vortex_array::arrays::patched::Patched::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::patched::Patched::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::patched::Patched::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::patched::Patched::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20598,7 +20728,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFn::nchildren(vortex_array::ArrayV pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFn::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20638,7 +20768,7 @@ pub fn vortex_array::arrays::slice::Slice::nchildren(vortex_array::ArrayView<'_, pub fn vortex_array::arrays::slice::Slice::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::slice::Slice::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::Slice::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::Slice::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20770,7 +20900,7 @@ pub fn vortex_array::vtable::VTable::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::vtable::VTable::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::vtable::VTable::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::vtable::VTable::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::vtable::VTable::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20810,7 +20940,7 @@ pub fn vortex_array::arrays::Bool::nchildren(vortex_array::ArrayView<'_, Self>) pub fn vortex_array::arrays::Bool::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Bool::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Bool::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Bool::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20850,7 +20980,7 @@ pub fn vortex_array::arrays::Chunked::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Chunked::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Chunked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Chunked::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20890,7 +21020,7 @@ pub fn vortex_array::arrays::Constant::nchildren(vortex_array::ArrayView<'_, Sel pub fn vortex_array::arrays::Constant::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Constant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Constant::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20930,7 +21060,7 @@ pub fn vortex_array::arrays::Decimal::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Decimal::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Decimal::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Decimal::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -20970,7 +21100,7 @@ pub fn vortex_array::arrays::Extension::nchildren(vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Extension::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Extension::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Extension::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21010,7 +21140,7 @@ pub fn vortex_array::arrays::Filter::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Filter::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Filter::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Filter::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Filter::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21050,7 +21180,7 @@ pub fn vortex_array::arrays::FixedSizeList::nchildren(vortex_array::ArrayView<'_ pub fn vortex_array::arrays::FixedSizeList::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::FixedSizeList::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeList::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21090,7 +21220,7 @@ pub fn vortex_array::arrays::List::nchildren(vortex_array::ArrayView<'_, Self>) pub fn vortex_array::arrays::List::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::List::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::List::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21130,7 +21260,7 @@ pub fn vortex_array::arrays::ListView::nchildren(vortex_array::ArrayView<'_, Sel pub fn vortex_array::arrays::ListView::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::ListView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListView::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21170,7 +21300,7 @@ pub fn vortex_array::arrays::Masked::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Masked::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Masked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Masked::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21210,7 +21340,7 @@ pub fn vortex_array::arrays::Primitive::nchildren(vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Primitive::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Primitive::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Primitive::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21250,7 +21380,7 @@ pub fn vortex_array::arrays::Shared::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Shared::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Shared::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Shared::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Shared::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21290,7 +21420,7 @@ pub fn vortex_array::arrays::Struct::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Struct::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Struct::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Struct::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21330,7 +21460,7 @@ pub fn vortex_array::arrays::VarBin::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::VarBin::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::VarBin::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBin::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21370,7 +21500,7 @@ pub fn vortex_array::arrays::VarBinView::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::VarBinView::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::VarBinView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinView::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21410,7 +21540,7 @@ pub fn vortex_array::arrays::Variant::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Variant::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Variant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Variant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Variant::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21450,7 +21580,7 @@ pub fn vortex_array::arrays::dict::Dict::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::dict::Dict::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::dict::Dict::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::Dict::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21490,7 +21620,7 @@ pub fn vortex_array::arrays::null::Null::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::null::Null::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::null::Null::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::Null::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21530,7 +21660,7 @@ pub fn vortex_array::arrays::patched::Patched::nchildren(vortex_array::ArrayView pub fn vortex_array::arrays::patched::Patched::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::patched::Patched::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::patched::Patched::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::patched::Patched::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21570,7 +21700,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFn::nchildren(vortex_array::ArrayV pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFn::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21610,7 +21740,7 @@ pub fn vortex_array::arrays::slice::Slice::nchildren(vortex_array::ArrayView<'_, pub fn vortex_array::arrays::slice::Slice::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::slice::Slice::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::Slice::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::Slice::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -21984,7 +22114,15 @@ pub type vortex_array::AnyCanonical::Match<'a> = vortex_array::CanonicalView<'a> pub fn vortex_array::AnyCanonical::matches(&vortex_array::ArrayRef) -> bool +<<<<<<< HEAD pub fn vortex_array::AnyCanonical::try_match(&vortex_array::ArrayRef) -> core::option::Option +======= +pub fn vortex_array::AnyCanonical::matches_parent(&vortex_array::ParentRef<'_>) -> bool + +pub fn vortex_array::AnyCanonical::try_match<'a>(&'a vortex_array::ArrayRef) -> core::option::Option +>>>>>>> 08c9f4ad5 (Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice) + +pub fn vortex_array::AnyCanonical::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option pub struct vortex_array::AnyColumnar @@ -21994,7 +22132,15 @@ pub type vortex_array::AnyColumnar::Match<'a> = vortex_array::ColumnarView<'a> pub fn vortex_array::AnyColumnar::matches(&vortex_array::ArrayRef) -> bool +<<<<<<< HEAD pub fn vortex_array::AnyColumnar::try_match(&vortex_array::ArrayRef) -> core::option::Option +======= +pub fn vortex_array::AnyColumnar::matches_parent(&vortex_array::ParentRef<'_>) -> bool + +pub fn vortex_array::AnyColumnar::try_match<'a>(&'a vortex_array::ArrayRef) -> core::option::Option +>>>>>>> 08c9f4ad5 (Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice) + +pub fn vortex_array::AnyColumnar::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option pub struct vortex_array::Array @@ -22560,7 +22706,7 @@ pub fn vortex_array::ArrayRef::nth_child(&self, usize) -> core::option::Option vortex_error::VortexResult> -pub fn vortex_array::ArrayRef::reduce_parent(&self, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::ArrayRef::reduce_parent(&self, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::ArrayRef::scalar_at(&self, usize) -> vortex_error::VortexResult @@ -23160,6 +23306,10 @@ pub fn vortex_array::ParentRef<'a>::len(&self) -> usize pub fn vortex_array::ParentRef<'a>::slots(&self) -> &'a [core::option::Option] +pub fn vortex_array::ParentRef<'a>::try_array_view(&self) -> core::option::Option> + +pub fn vortex_array::ParentRef<'a>::try_view(&self) -> core::option::Option> + impl core::fmt::Debug for vortex_array::ParentRef<'_> pub fn vortex_array::ParentRef<'_>::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result @@ -23562,7 +23712,7 @@ pub fn vortex_array::ArrayVTable::nchildren(vortex_array::ArrayView<'_, Self>) - pub fn vortex_array::ArrayVTable::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::ArrayVTable::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::ArrayVTable::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::ArrayVTable::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -23602,7 +23752,7 @@ pub fn vortex_array::arrays::Bool::nchildren(vortex_array::ArrayView<'_, Self>) pub fn vortex_array::arrays::Bool::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Bool::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Bool::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Bool::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -23642,7 +23792,7 @@ pub fn vortex_array::arrays::Chunked::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Chunked::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Chunked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Chunked::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -23682,7 +23832,7 @@ pub fn vortex_array::arrays::Constant::nchildren(vortex_array::ArrayView<'_, Sel pub fn vortex_array::arrays::Constant::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Constant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Constant::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -23722,7 +23872,7 @@ pub fn vortex_array::arrays::Decimal::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Decimal::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Decimal::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Decimal::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -23762,7 +23912,7 @@ pub fn vortex_array::arrays::Extension::nchildren(vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Extension::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Extension::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Extension::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -23802,7 +23952,7 @@ pub fn vortex_array::arrays::Filter::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Filter::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Filter::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Filter::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Filter::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -23842,7 +23992,7 @@ pub fn vortex_array::arrays::FixedSizeList::nchildren(vortex_array::ArrayView<'_ pub fn vortex_array::arrays::FixedSizeList::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::FixedSizeList::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeList::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -23882,7 +24032,7 @@ pub fn vortex_array::arrays::List::nchildren(vortex_array::ArrayView<'_, Self>) pub fn vortex_array::arrays::List::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::List::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::List::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -23922,7 +24072,7 @@ pub fn vortex_array::arrays::ListView::nchildren(vortex_array::ArrayView<'_, Sel pub fn vortex_array::arrays::ListView::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::ListView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListView::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -23962,7 +24112,7 @@ pub fn vortex_array::arrays::Masked::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Masked::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Masked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Masked::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24002,7 +24152,7 @@ pub fn vortex_array::arrays::Primitive::nchildren(vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Primitive::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Primitive::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Primitive::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24042,7 +24192,7 @@ pub fn vortex_array::arrays::Shared::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Shared::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Shared::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Shared::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Shared::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24082,7 +24232,7 @@ pub fn vortex_array::arrays::Struct::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Struct::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Struct::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Struct::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24122,7 +24272,7 @@ pub fn vortex_array::arrays::VarBin::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::VarBin::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::VarBin::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBin::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24162,7 +24312,7 @@ pub fn vortex_array::arrays::VarBinView::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::VarBinView::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::VarBinView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinView::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24202,7 +24352,7 @@ pub fn vortex_array::arrays::Variant::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Variant::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Variant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Variant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Variant::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24242,7 +24392,7 @@ pub fn vortex_array::arrays::dict::Dict::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::dict::Dict::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::dict::Dict::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::Dict::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24282,7 +24432,7 @@ pub fn vortex_array::arrays::null::Null::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::null::Null::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::null::Null::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::Null::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24322,7 +24472,7 @@ pub fn vortex_array::arrays::patched::Patched::nchildren(vortex_array::ArrayView pub fn vortex_array::arrays::patched::Patched::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::patched::Patched::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::patched::Patched::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::patched::Patched::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24362,7 +24512,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFn::nchildren(vortex_array::ArrayV pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFn::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24402,7 +24552,7 @@ pub fn vortex_array::arrays::slice::Slice::nchildren(vortex_array::ArrayView<'_, pub fn vortex_array::arrays::slice::Slice::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::slice::Slice::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::Slice::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::Slice::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24782,7 +24932,7 @@ pub fn vortex_array::VTable::nchildren(vortex_array::ArrayView<'_, Self>) -> usi pub fn vortex_array::VTable::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::VTable::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::VTable::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::VTable::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24822,7 +24972,7 @@ pub fn vortex_array::arrays::Bool::nchildren(vortex_array::ArrayView<'_, Self>) pub fn vortex_array::arrays::Bool::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Bool::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Bool::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Bool::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24862,7 +25012,7 @@ pub fn vortex_array::arrays::Chunked::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Chunked::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Chunked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Chunked::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24902,7 +25052,7 @@ pub fn vortex_array::arrays::Constant::nchildren(vortex_array::ArrayView<'_, Sel pub fn vortex_array::arrays::Constant::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Constant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Constant::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24942,7 +25092,7 @@ pub fn vortex_array::arrays::Decimal::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Decimal::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Decimal::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Decimal::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -24982,7 +25132,7 @@ pub fn vortex_array::arrays::Extension::nchildren(vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Extension::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Extension::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Extension::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25022,7 +25172,7 @@ pub fn vortex_array::arrays::Filter::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Filter::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Filter::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Filter::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Filter::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25062,7 +25212,7 @@ pub fn vortex_array::arrays::FixedSizeList::nchildren(vortex_array::ArrayView<'_ pub fn vortex_array::arrays::FixedSizeList::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::FixedSizeList::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::FixedSizeList::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25102,7 +25252,7 @@ pub fn vortex_array::arrays::List::nchildren(vortex_array::ArrayView<'_, Self>) pub fn vortex_array::arrays::List::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::List::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::List::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25142,7 +25292,7 @@ pub fn vortex_array::arrays::ListView::nchildren(vortex_array::ArrayView<'_, Sel pub fn vortex_array::arrays::ListView::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::ListView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::ListView::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25182,7 +25332,7 @@ pub fn vortex_array::arrays::Masked::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Masked::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Masked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Masked::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25222,7 +25372,7 @@ pub fn vortex_array::arrays::Primitive::nchildren(vortex_array::ArrayView<'_, Se pub fn vortex_array::arrays::Primitive::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Primitive::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Primitive::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25262,7 +25412,7 @@ pub fn vortex_array::arrays::Shared::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Shared::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Shared::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Shared::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Shared::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25302,7 +25452,7 @@ pub fn vortex_array::arrays::Struct::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::Struct::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Struct::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Struct::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25342,7 +25492,7 @@ pub fn vortex_array::arrays::VarBin::nchildren(vortex_array::ArrayView<'_, Self> pub fn vortex_array::arrays::VarBin::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::VarBin::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBin::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25382,7 +25532,7 @@ pub fn vortex_array::arrays::VarBinView::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::VarBinView::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::VarBinView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::VarBinView::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25422,7 +25572,7 @@ pub fn vortex_array::arrays::Variant::nchildren(vortex_array::ArrayView<'_, Self pub fn vortex_array::arrays::Variant::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::Variant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Variant::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::Variant::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25462,7 +25612,7 @@ pub fn vortex_array::arrays::dict::Dict::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::dict::Dict::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::dict::Dict::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::Dict::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25502,7 +25652,7 @@ pub fn vortex_array::arrays::null::Null::nchildren(vortex_array::ArrayView<'_, S pub fn vortex_array::arrays::null::Null::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::null::Null::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::null::Null::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25542,7 +25692,7 @@ pub fn vortex_array::arrays::patched::Patched::nchildren(vortex_array::ArrayView pub fn vortex_array::arrays::patched::Patched::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::patched::Patched::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::patched::Patched::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::patched::Patched::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25582,7 +25732,7 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFn::nchildren(vortex_array::ArrayV pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::scalar_fn::ScalarFn::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::scalar_fn::ScalarFn::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> @@ -25622,7 +25772,7 @@ pub fn vortex_array::arrays::slice::Slice::nchildren(vortex_array::ArrayView<'_, pub fn vortex_array::arrays::slice::Slice::reduce(vortex_array::ArrayView<'_, Self>) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::slice::Slice::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::Slice::reduce_parent(vortex_array::ArrayView<'_, Self>, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::slice::Slice::serialize(vortex_array::ArrayView<'_, Self>, &vortex_session::VortexSession) -> vortex_error::VortexResult>> diff --git a/vortex-array/src/array/erased.rs b/vortex-array/src/array/erased.rs index 116e5c916b7..7eb57aa9eca 100644 --- a/vortex-array/src/array/erased.rs +++ b/vortex-array/src/array/erased.rs @@ -17,7 +17,7 @@ use vortex_error::vortex_err; use vortex_error::vortex_panic; use vortex_mask::Mask; -use crate::{AnyCanonical, ArrayParts}; +use crate::AnyCanonical; use crate::Array; use crate::ArrayEq; use crate::ArrayHash; @@ -33,7 +33,9 @@ use crate::aggregate_fn::fns::sum::sum; use crate::array::ArrayData; use crate::array::ArrayId; use crate::array::ArrayInner; +use crate::array::ArrayParts; use crate::array::DynArrayData; +use crate::array::ParentRef; use crate::arrays::Bool; use crate::arrays::Constant; use crate::arrays::Dict; @@ -611,7 +613,7 @@ impl ArrayRef { pub fn reduce_parent( &self, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { self.0.data.reduce_parent(self, parent, child_idx) diff --git a/vortex-array/src/array/mod.rs b/vortex-array/src/array/mod.rs index cfe165bce71..fbf50896403 100644 --- a/vortex-array/src/array/mod.rs +++ b/vortex-array/src/array/mod.rs @@ -148,7 +148,7 @@ pub(crate) trait DynArrayData: 'static + private::Sealed + Send + Sync + Debug { fn reduce_parent( &self, this: &ArrayRef, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult>; @@ -414,7 +414,7 @@ impl DynArrayData for ArrayData { fn reduce_parent( &self, this: &ArrayRef, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { let view = unsafe { ArrayView::new_unchecked(this, &self.data) }; diff --git a/vortex-array/src/array/parent.rs b/vortex-array/src/array/parent.rs index e311cb66572..18a1a058d99 100644 --- a/vortex-array/src/array/parent.rs +++ b/vortex-array/src/array/parent.rs @@ -17,6 +17,7 @@ use std::ops::Deref; use crate::ArrayRef; use crate::array::ArrayId; use crate::array::ArrayParts; +use crate::array::ArrayView; use crate::array::VTable; use crate::dtype::DType; @@ -115,12 +116,9 @@ impl<'a> ParentRef<'a> { /// Try to extract a [`ParentView`] for the parent's encoding `V`. /// - /// Returns `None` if the parent's encoding is not `V`. - #[allow( - dead_code, - reason = "wired into the reduce_parent chain by upcoming work" - )] - pub(crate) fn try_view(&self) -> Option> { + /// Returns `None` if the parent's encoding is not `V`. Works for both heap- + /// and stack-allocated parents. + pub fn try_view(&self) -> Option> { let data = self.data.downcast_ref::()?; Some(ParentView { data, @@ -129,6 +127,15 @@ impl<'a> ParentRef<'a> { slots: self.slots, }) } + + /// Try to extract an [`ArrayView`] for the parent's encoding `V`. + /// + /// Returns `None` if the parent is not heap-allocated, or if its encoding is not + /// `V`. Used by the default `Matcher::try_match_parent` to keep existing rule + /// bodies (which consume `ArrayView`) working over the new `ParentRef` dispatch. + pub fn try_array_view(&self) -> Option> { + self.array_ref?.as_typed::() + } } impl Debug for ParentRef<'_> { diff --git a/vortex-array/src/array/typed.rs b/vortex-array/src/array/typed.rs index 6bef78255e6..ce86c3ed038 100644 --- a/vortex-array/src/array/typed.rs +++ b/vortex-array/src/array/typed.rs @@ -13,6 +13,7 @@ use std::ops::DerefMut; use std::sync::Arc; use vortex_error::VortexResult; +use vortex_session::SessionExt; use vortex_session::VortexSession; use crate::ArrayRef; @@ -22,9 +23,11 @@ use crate::LEGACY_SESSION; use crate::VortexSessionExecute; use crate::array::ArrayId; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::dtype::DType; use crate::optimizer::ArrayOptimizer; +use crate::optimizer::kernels::ArrayKernels; use crate::stats::ArrayStats; use crate::stats::StatsSet; use crate::stats::StatsSetRef; @@ -93,16 +96,46 @@ impl ArrayParts { } fn optimize_inner(self, session: Option<&VortexSession>) -> VortexResult> { - // The parent must briefly be addressable as an `ArrayRef` so the existing - // `reduce_parent` chain (which currently takes `&ArrayRef`) can dispatch through - // it. A follow-up will replace that chain with a `ParentRef`-driven dispatch so - // this fast path can avoid the `Arc>` allocation entirely and - // return [`Optimized::Unchanged`] when no rule applies; today this matches the - // cost of the previous `try_new(...)?.into_array().optimize()` pattern and - // always returns [`Optimized::Reduced`]. + // Validate without materializing — `try_from_parts` would allocate, so we + // run the same validation the inner constructor would. Validation lives on the + // vtable. + self.vtable + .validate(&self.data, &self.dtype, self.len, &self.slots)?; + + // First pass: try stack-backed `reduce_parent` so encodings that override + // `Matcher::try_match_parent` (or `ArrayParentReduceRule` directly) can rewrite + // the parts without allocating a wrapper `Arc>`. + let kernels = session.and_then(|s| s.get_opt::()); + let parent_id = self.vtable.id(); + let parent_ref = ParentRef::from_parts(&self); + + for (slot_idx, slot) in self.slots.iter().enumerate() { + let Some(child) = slot else { continue }; + + // Session kernels take precedence over static `PARENT_RULES`, matching + // the existing optimizer's ordering. + if let Some(kernels) = &kernels + && let Some(plugins) = kernels.find_reduce_parent(parent_id, child.encoding_id()) + { + for plugin in plugins.as_ref() { + if let Some(reduced) = plugin(child, &parent_ref, slot_idx)? { + return Ok(Optimized::Reduced(cascade(reduced, session)?)); + } + } + } + + if let Some(reduced) = child.reduce_parent(&parent_ref, slot_idx)? { + return Ok(Optimized::Reduced(cascade(reduced, session)?)); + } + } + + // No stack-backed rule fired. Materialize so existing rules — whose default + // `try_match_parent` only matches a heap-backed `ArrayRef` — get a chance to + // run via `ArrayRef::optimize`. Encodings that override `try_match_parent` to + // handle stack parents will skip this fallback. let materialized = Array::::try_from_parts(self)?.into_array(); let optimized = match session { - Some(session) => materialized.optimize_ctx(session)?, + Some(s) => materialized.optimize_ctx(s)?, None => materialized.optimize()?, }; Ok(Optimized::Reduced(optimized)) @@ -145,6 +178,16 @@ impl Optimized { } } +/// Run the existing `ArrayRef`-level optimizer over a freshly-reduced array so any +/// cascading parent-reduce rules also fire — same fixpoint semantics as the +/// optimizer's outer loop. +fn cascade(array: ArrayRef, session: Option<&VortexSession>) -> VortexResult { + match session { + Some(s) => array.optimize_ctx(s), + None => array.optimize(), + } +} + /// Shared bound for helpers that should work over both owned [`Array`] and borrowed /// [`ArrayView`]. /// diff --git a/vortex-array/src/array/vtable/mod.rs b/vortex-array/src/array/vtable/mod.rs index 6c85bb79d05..a62fd2bfe62 100644 --- a/vortex-array/src/array/vtable/mod.rs +++ b/vortex-array/src/array/vtable/mod.rs @@ -25,6 +25,7 @@ use crate::Canonical; use crate::ExecutionResult; use crate::IntoArray; use crate::Precision; +use crate::array::ParentRef; pub use crate::array::plugin::*; use crate::arrays::ConstantArray; use crate::arrays::constant::Constant; @@ -205,7 +206,7 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { /// Attempt to perform a reduction of the parent of this array. fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { _ = (array, parent, child_idx); diff --git a/vortex-array/src/arrays/bool/vtable/mod.rs b/vortex-array/src/arrays/bool/vtable/mod.rs index 35261fa8d89..9cfa80ad4ca 100644 --- a/vortex-array/src/arrays/bool/vtable/mod.rs +++ b/vortex-array/src/arrays/bool/vtable/mod.rs @@ -19,6 +19,7 @@ use crate::ExecutionResult; use crate::array::Array; use crate::array::ArrayParts; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::array::child_to_validity; use crate::arrays::bool::BoolData; @@ -184,7 +185,7 @@ impl VTable for Bool { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/chunked/vtable/mod.rs b/vortex-array/src/arrays/chunked/vtable/mod.rs index 6acad15e2a6..9fc81d41f52 100644 --- a/vortex-array/src/arrays/chunked/vtable/mod.rs +++ b/vortex-array/src/arrays/chunked/vtable/mod.rs @@ -27,6 +27,7 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayParts; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::arrays::chunked::ChunkedArrayExt; use crate::arrays::chunked::ChunkedData; @@ -280,7 +281,7 @@ impl VTable for Chunked { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/constant/vtable/mod.rs b/vortex-array/src/arrays/constant/vtable/mod.rs index c130c28a95a..5ec1e3d9ef4 100644 --- a/vortex-array/src/arrays/constant/vtable/mod.rs +++ b/vortex-array/src/arrays/constant/vtable/mod.rs @@ -23,6 +23,7 @@ use crate::Precision; use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::arrays::constant::ConstantData; use crate::arrays::constant::compute::rules::PARENT_RULES; @@ -154,7 +155,7 @@ impl VTable for Constant { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/decimal/vtable/mod.rs b/vortex-array/src/arrays/decimal/vtable/mod.rs index dac24ecd95f..2351137b63a 100644 --- a/vortex-array/src/arrays/decimal/vtable/mod.rs +++ b/vortex-array/src/arrays/decimal/vtable/mod.rs @@ -17,6 +17,7 @@ use crate::ExecutionCtx; use crate::ExecutionResult; use crate::array::Array; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::arrays::decimal::DecimalData; use crate::buffer::BufferHandle; @@ -187,7 +188,7 @@ impl VTable for Decimal { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/dict/vtable/mod.rs b/vortex-array/src/arrays/dict/vtable/mod.rs index 4893be5c7ed..5c48c4ceaa8 100644 --- a/vortex-array/src/arrays/dict/vtable/mod.rs +++ b/vortex-array/src/arrays/dict/vtable/mod.rs @@ -29,6 +29,7 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayParts; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::arrays::ConstantArray; use crate::arrays::Primitive; @@ -198,7 +199,7 @@ impl VTable for Dict { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/extension/vtable/mod.rs b/vortex-array/src/arrays/extension/vtable/mod.rs index 1a25a1a9ef1..e035db649a0 100644 --- a/vortex-array/src/arrays/extension/vtable/mod.rs +++ b/vortex-array/src/arrays/extension/vtable/mod.rs @@ -19,6 +19,7 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayParts; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::array::ValidityVTableFromChild; use crate::arrays::extension::array::SLOT_NAMES; @@ -190,7 +191,7 @@ impl VTable for Extension { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/filter/vtable.rs b/vortex-array/src/arrays/filter/vtable.rs index 9f70e6e2614..634ffa7a0a5 100644 --- a/vortex-array/src/arrays/filter/vtable.rs +++ b/vortex-array/src/arrays/filter/vtable.rs @@ -24,6 +24,7 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::OperationsVTable; +use crate::array::ParentRef; use crate::array::VTable; use crate::array::ValidityVTable; use crate::arrays::filter::FilterArrayExt; @@ -164,7 +165,7 @@ impl VTable for Filter { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) 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 52b041794cd..5e4a70e6066 100644 --- a/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs +++ b/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs @@ -22,6 +22,7 @@ use crate::Precision; use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::arrays::fixed_size_list::FixedSizeListData; use crate::arrays::fixed_size_list::array::NUM_SLOTS; @@ -79,7 +80,7 @@ impl VTable for FixedSizeList { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/list/vtable/mod.rs b/vortex-array/src/arrays/list/vtable/mod.rs index 9f5e7014069..b1120743b09 100644 --- a/vortex-array/src/arrays/list/vtable/mod.rs +++ b/vortex-array/src/arrays/list/vtable/mod.rs @@ -24,6 +24,7 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayParts; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::arrays::list::ListArrayExt; use crate::arrays::list::ListData; @@ -85,7 +86,7 @@ impl VTable for List { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/listview/vtable/mod.rs b/vortex-array/src/arrays/listview/vtable/mod.rs index af2c8c05eb6..498b5ad9f2e 100644 --- a/vortex-array/src/arrays/listview/vtable/mod.rs +++ b/vortex-array/src/arrays/listview/vtable/mod.rs @@ -23,6 +23,7 @@ use crate::Precision; use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::arrays::listview::ListViewArrayExt; use crate::arrays::listview::ListViewData; @@ -211,7 +212,7 @@ impl VTable for ListView { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/masked/vtable/mod.rs b/vortex-array/src/arrays/masked/vtable/mod.rs index f244c322823..3aad45c0bea 100644 --- a/vortex-array/src/arrays/masked/vtable/mod.rs +++ b/vortex-array/src/arrays/masked/vtable/mod.rs @@ -26,6 +26,7 @@ use crate::VortexSessionExecute; use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::array::validity_to_child; use crate::arrays::ConstantArray; @@ -185,7 +186,7 @@ impl VTable for Masked { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/null/mod.rs b/vortex-array/src/arrays/null/mod.rs index dd31ef16853..dfd1a220f38 100644 --- a/vortex-array/src/arrays/null/mod.rs +++ b/vortex-array/src/arrays/null/mod.rs @@ -16,6 +16,7 @@ use crate::array::ArrayParts; use crate::array::ArrayView; use crate::array::EmptyArrayData; use crate::array::OperationsVTable; +use crate::array::ParentRef; use crate::array::VTable; use crate::array::ValidityVTable; use crate::arrays::null::compute::rules::PARENT_RULES; @@ -100,7 +101,7 @@ impl VTable for Null { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/patched/vtable/mod.rs b/vortex-array/src/arrays/patched/vtable/mod.rs index 531b89cd22e..0d2027caf23 100644 --- a/vortex-array/src/arrays/patched/vtable/mod.rs +++ b/vortex-array/src/arrays/patched/vtable/mod.rs @@ -29,6 +29,7 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayParts; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::array::ValidityChild; use crate::array::ValidityVTableFromChild; @@ -312,7 +313,7 @@ impl VTable for Patched { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/primitive/vtable/mod.rs b/vortex-array/src/arrays/primitive/vtable/mod.rs index 5130665cd30..aaaab6378c5 100644 --- a/vortex-array/src/arrays/primitive/vtable/mod.rs +++ b/vortex-array/src/arrays/primitive/vtable/mod.rs @@ -12,6 +12,7 @@ use crate::ExecutionCtx; use crate::ExecutionResult; use crate::array::Array; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::arrays::primitive::PrimitiveData; use crate::buffer::BufferHandle; @@ -186,7 +187,7 @@ impl VTable for Primitive { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { RULES.evaluate(array, parent, 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 f5d8089ee0b..976f4340541 100644 --- a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs +++ b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs @@ -25,6 +25,7 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayParts; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::arrays::scalar_fn::array::ScalarFnArrayExt; use crate::arrays::scalar_fn::array::ScalarFnData; @@ -158,7 +159,7 @@ impl VTable for ScalarFn { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/slice/mod.rs b/vortex-array/src/arrays/slice/mod.rs index 8eec9d85310..3fb8e94659b 100644 --- a/vortex-array/src/arrays/slice/mod.rs +++ b/vortex-array/src/arrays/slice/mod.rs @@ -26,6 +26,7 @@ use crate::Canonical; use crate::ExecutionCtx; use crate::IntoArray; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::kernel::ExecuteParentKernel; use crate::matcher::Matcher; @@ -96,6 +97,25 @@ where } ::slice(array, parent.range.clone()) } + + /// Override the default `try_match_parent`-driven dispatch so a `SliceArray` parent + /// living on the stack inside an [`ArrayParts`](crate::array::ArrayParts) can drive + /// reduction without first allocating an `Arc>`. + fn reduce_parent_ref( + &self, + array: ArrayView<'_, V>, + parent: &ParentRef<'_>, + child_idx: usize, + ) -> VortexResult> { + assert_eq!(child_idx, 0); + let Some(parent_view) = parent.try_view::() else { + return Ok(None); + }; + if let Some(result) = precondition::(array, &parent_view.range) { + return Ok(Some(result)); + } + ::slice(array, parent_view.range.clone()) + } } /// Adaptor that wraps a [`SliceKernel`] impl as an [`ExecuteParentKernel`]. diff --git a/vortex-array/src/arrays/slice/vtable.rs b/vortex-array/src/arrays/slice/vtable.rs index ac0ecc18039..8f45aa88994 100644 --- a/vortex-array/src/arrays/slice/vtable.rs +++ b/vortex-array/src/arrays/slice/vtable.rs @@ -24,6 +24,7 @@ use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; use crate::array::OperationsVTable; +use crate::array::ParentRef; use crate::array::VTable; use crate::array::ValidityVTable; use crate::arrays::slice::SliceArrayExt; @@ -153,7 +154,7 @@ impl VTable for Slice { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/struct_/vtable/mod.rs b/vortex-array/src/arrays/struct_/vtable/mod.rs index 0113535ad21..a6c9f1b139e 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::EmptyArrayData; +use crate::array::ParentRef; use crate::array::VTable; use crate::array::child_to_validity; use crate::arrays::struct_::array::FIELDS_OFFSET; @@ -189,7 +190,7 @@ impl VTable for Struct { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/varbin/vtable/mod.rs b/vortex-array/src/arrays/varbin/vtable/mod.rs index 86053613e50..066c285d1d0 100644 --- a/vortex-array/src/arrays/varbin/vtable/mod.rs +++ b/vortex-array/src/arrays/varbin/vtable/mod.rs @@ -18,6 +18,7 @@ use crate::IntoArray; use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::arrays::varbin::VarBinArrayExt; use crate::arrays::varbin::VarBinData; @@ -175,7 +176,7 @@ impl VTable for VarBin { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/arrays/varbinview/vtable/mod.rs b/vortex-array/src/arrays/varbinview/vtable/mod.rs index 45db5d904ac..fa541e2e839 100644 --- a/vortex-array/src/arrays/varbinview/vtable/mod.rs +++ b/vortex-array/src/arrays/varbinview/vtable/mod.rs @@ -22,6 +22,7 @@ use crate::Precision; use crate::array::Array; use crate::array::ArrayId; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::arrays::varbinview::BinaryView; use crate::arrays::varbinview::VarBinViewData; @@ -211,7 +212,7 @@ impl VTable for VarBinView { fn reduce_parent( array: ArrayView<'_, Self>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { PARENT_RULES.evaluate(array, parent, child_idx) diff --git a/vortex-array/src/executor.rs b/vortex-array/src/executor.rs index f6a2496335d..e7f064d04ce 100644 --- a/vortex-array/src/executor.rs +++ b/vortex-array/src/executor.rs @@ -31,6 +31,7 @@ use crate::ArrayRef; use crate::Canonical; use crate::IntoArray; use crate::array::ArrayId; +use crate::array::ParentRef; use crate::builders::ArrayBuilder; use crate::builders::builder_with_capacity_in; use crate::dtype::DType; @@ -406,9 +407,10 @@ impl Executable for ArrayRef { return Ok(reduced); } + let parent_ref = ParentRef::from_array_ref(&array); for (slot_idx, slot) in array.slots().iter().enumerate() { let Some(child) = slot else { continue }; - if let Some(reduced_parent) = child.reduce_parent(&array, slot_idx)? { + if let Some(reduced_parent) = child.reduce_parent(&parent_ref, slot_idx)? { ctx.log(format_args!( "reduce_parent: slot[{}]({}) rewrote {} -> {}", slot_idx, diff --git a/vortex-array/src/matcher.rs b/vortex-array/src/matcher.rs index 532931df083..4dcd46b9482 100644 --- a/vortex-array/src/matcher.rs +++ b/vortex-array/src/matcher.rs @@ -2,6 +2,7 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use crate::ArrayRef; +use crate::array::ParentRef; /// Trait for matching array types. pub trait Matcher { @@ -14,6 +15,21 @@ pub trait Matcher { /// Try to match the given array, returning the matched view type if successful. fn try_match(array: &ArrayRef) -> Option>; + + /// Try to match a [`ParentRef`]. + /// + /// The default delegates to [`Matcher::try_match`] when the parent is heap-allocated + /// and returns `None` otherwise. Implementations may override this to recognize + /// stack-allocated parents — typically by downcasting `parent` via + /// [`ParentRef::try_view`]. + fn try_match_parent(parent: &ParentRef) -> Option> { + Self::try_match(parent.array_ref()?) + } + + /// Check if the given parent matches this matcher type. + fn matches_parent(parent: &ParentRef<'_>) -> bool { + Self::try_match_parent(parent).is_some() + } } /// Matches any array type (wildcard matcher) diff --git a/vortex-array/src/optimizer/kernels.rs b/vortex-array/src/optimizer/kernels.rs index d38bc9402d1..a70136c4780 100644 --- a/vortex-array/src/optimizer/kernels.rs +++ b/vortex-array/src/optimizer/kernels.rs @@ -31,6 +31,7 @@ use std::sync::Arc; use std::sync::LazyLock; use arc_swap::ArcSwap; +use vortex_array::arrays::Struct; use vortex_error::VortexResult; use vortex_session::Ref; use vortex_session::SessionExt; @@ -39,13 +40,12 @@ use vortex_session::registry::Id; use vortex_utils::aliases::DefaultHashBuilder; use vortex_utils::aliases::hash_map::HashMap; +use crate::ArrayPlugin; use crate::ArrayRef; use crate::ExecutionCtx; -use crate::array::VTable; -use crate::arrays::Struct; +use crate::array::ParentRef; use crate::arrays::struct_::compute::cast::struct_cast_execute_parent; use crate::arrays::struct_::compute::rules::struct_cast_reduce_parent; -use crate::scalar_fn::ScalarFnVTable; use crate::scalar_fn::fns::cast::Cast; /// Shared hasher used to combine `(outer, child)` tuples into registry keys. @@ -59,8 +59,11 @@ static FN_HASHER: LazyLock = LazyLock::new(DefaultHashBuilde /// /// Implementations must preserve the parent's logical length and dtype, matching the invariant /// required of static parent-reduce rules. -pub type ReduceParentFn = - fn(child: &ArrayRef, parent: &ArrayRef, child_idx: usize) -> VortexResult>; +pub type ReduceParentFn = fn( + child: &ArrayRef, + parent: &ParentRef<'_>, + child_idx: usize, +) -> VortexResult>; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd)] #[repr(transparent)] diff --git a/vortex-array/src/optimizer/mod.rs b/vortex-array/src/optimizer/mod.rs index f991dbb2c1d..24ffbbe3ad6 100644 --- a/vortex-array/src/optimizer/mod.rs +++ b/vortex-array/src/optimizer/mod.rs @@ -21,6 +21,7 @@ use vortex_session::SessionExt; use vortex_session::VortexSession; use crate::ArrayRef; +use crate::array::ParentRef; use crate::optimizer::kernels::ArrayKernels; pub mod kernels; @@ -86,6 +87,7 @@ fn try_optimize( // Apply parent reduction rules to each slot in the context of the current array. // Its important to take all slots here, as `current_array` can change inside the loop. + let parent_ref = ParentRef::from_array_ref(¤t_array); for (slot_idx, slot) in current_array.slots().iter().enumerate() { let Some(child) = slot else { continue }; @@ -95,7 +97,7 @@ fn try_optimize( array_ref.find_reduce_parent(current_array.encoding_id(), child.encoding_id()) { for plugin in plugins.as_ref() { - if let Some(new_array) = plugin(child, ¤t_array, slot_idx)? { + if let Some(new_array) = plugin(child, &parent_ref, slot_idx)? { current_array = new_array; any_optimizations = true; continue 'outer; @@ -103,7 +105,7 @@ fn try_optimize( } } - if let Some(new_array) = child.reduce_parent(¤t_array, slot_idx)? { + if let Some(new_array) = child.reduce_parent(&parent_ref, slot_idx)? { // If the parent was replaced, then we attempt to reduce it again. current_array = new_array; any_optimizations = true; diff --git a/vortex-array/src/optimizer/rules.rs b/vortex-array/src/optimizer/rules.rs index e505b21a199..54c0c3f76e9 100644 --- a/vortex-array/src/optimizer/rules.rs +++ b/vortex-array/src/optimizer/rules.rs @@ -26,6 +26,7 @@ use vortex_error::VortexResult; use crate::ArrayRef; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::matcher::Matcher; @@ -64,17 +65,40 @@ pub trait ArrayParentReduceRule: Debug + Send + Sync + 'static { parent: ::Match<'_>, child_idx: usize, ) -> VortexResult>; + + /// Attempt to rewrite the child given a [`ParentRef`]. + /// + /// This is the dispatch entry point used by [`ParentRuleSet`]. The default + /// implementation extracts the parent's typed view via + /// [`Matcher::try_match_parent`] (which only matches heap-allocated parents) and + /// then delegates to [`reduce_parent`](Self::reduce_parent). + /// + /// Override this when the rule can rewrite a stack-allocated parent, typically by + /// extracting an encoding-specific view via [`ParentRef::try_view`]. Doing so lets + /// callers like [`ArrayParts::optimize`](crate::array::ArrayParts::optimize) avoid + /// the `Arc>` allocation when the rule fires. + fn reduce_parent_ref( + &self, + array: ArrayView<'_, V>, + parent: &ParentRef<'_>, + child_idx: usize, + ) -> VortexResult> { + let Some(parent_view) = ::try_match_parent(parent) else { + return Ok(None); + }; + self.reduce_parent(array, parent_view, child_idx) + } } /// Type-erased version of [`ArrayParentReduceRule`] used for dynamic dispatch within /// [`ParentRuleSet`]. pub trait DynArrayParentReduceRule: Debug + Send + Sync { - fn matches(&self, parent: &ArrayRef) -> bool; + fn matches(&self, parent: &ParentRef<'_>) -> bool; fn reduce_parent( &self, array: ArrayView<'_, V>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult>; } @@ -98,20 +122,17 @@ impl> Debug for ParentReduceRuleAdapter> DynArrayParentReduceRule for ParentReduceRuleAdapter { - fn matches(&self, parent: &ArrayRef) -> bool { - K::Parent::matches(parent) + fn matches(&self, parent: &ParentRef<'_>) -> bool { + K::Parent::matches_parent(parent) } fn reduce_parent( &self, child: ArrayView<'_, V>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { - let Some(parent_view) = K::Parent::try_match(parent) else { - return Ok(None); - }; - self.rule.reduce_parent(child, parent_view, child_idx) + self.rule.reduce_parent_ref(child, parent, child_idx) } } @@ -171,7 +192,7 @@ impl ParentRuleSet { pub fn evaluate( &self, child: ArrayView<'_, V>, - parent: &ArrayRef, + parent: &ParentRef<'_>, child_idx: usize, ) -> VortexResult> { for rule in self.rules.iter() { diff --git a/vortex-cuda/src/dynamic_dispatch/plan_builder.rs b/vortex-cuda/src/dynamic_dispatch/plan_builder.rs index e887f1ba53f..8b93794c182 100644 --- a/vortex-cuda/src/dynamic_dispatch/plan_builder.rs +++ b/vortex-cuda/src/dynamic_dispatch/plan_builder.rs @@ -10,6 +10,7 @@ use itertools::zip_eq; use tracing::trace; use vortex::array::ArrayRef; use vortex::array::ArrayVTable; +use vortex::array::ParentRef; use vortex::array::arrays::Dict; use vortex::array::arrays::Primitive; use vortex::array::arrays::Slice; @@ -500,7 +501,8 @@ impl FusedPlan { let slice_arr = array.as_::(); let child = slice_arr.child().clone(); - if let Some(reduced) = child.reduce_parent(&array, 0)? { + let parent_ref = ParentRef::from_array_ref(&array); + if let Some(reduced) = child.reduce_parent(&parent_ref, 0)? { return self.walk(reduced, pending_subtrees); } From b450238440255f4087ae805d626079374ffd3136 Mon Sep 17 00:00:00 2001 From: Robert Kruszewski Date: Fri, 1 May 2026 11:30:23 -0400 Subject: [PATCH 3/8] Borrow self in ArrayParts::optimize and add new_parts constructors - `ArrayParts::optimize` and `optimize_ctx` now take `&self` and return `Option` instead of consuming `self` and returning a custom `Optimized` enum. This drops `Optimized` from the public API and makes `optimize` follow the usual Rust convention of borrowing what it doesn't need to consume. - The materialize-and-then-heap-optimize fallback that used to live inside `optimize_inner` now lives at the call sites for `filter` and `take` (which haven't migrated their adaptors to the stack path yet). For `slice`, the fallback is unreachable because `SliceReduceAdaptor` already overrides `reduce_parent_ref`. - `Matcher::matches_parent` is overridden for the blanket `impl Matcher for V` to test by encoding-specific data downcast via `ParentRef::try_view`. Without this, `ParentRuleSet` skips the rule for stack-backed parents because the default `try_match_parent` returns `None`, so `SliceReduceAdaptor::reduce_parent_ref` was never invoked on the slice fast path. The override matches both heap- and stack-backed parents uniformly. - `SliceArray::try_new_parts` / `new_parts`, `FilterArray::try_new_parts` / `new_parts`, and `DictArray::try_new_parts` build the corresponding `ArrayParts` without materializing. The existing `try_new` / `new` constructors delegate. Call sites in `ArrayRef::slice` / `filter` / `take` use them directly: ```rust let parts = SliceArray::try_new_parts(self.clone(), range)?; let sliced = match parts.optimize()? { Some(reduced) => reduced, None => parts.into_array()?, }; ``` - `cargo build --workspace` - `cargo nextest run -p vortex-array` (2487 pass, 21 timezone-dependent skips) - `cargo clippy -p vortex-array --all-targets --all-features` - `cargo +nightly fmt --all` - `./scripts/public-api.sh` Signed-off-by: Robert Kruszewski --- vortex-array/public-api.lock | 26 +++++----- vortex-array/src/array/erased.rs | 60 +++++++++++----------- vortex-array/src/array/typed.rs | 66 ++++++------------------- vortex-array/src/arrays/dict/array.rs | 11 +++-- vortex-array/src/arrays/filter/array.rs | 31 +++++++----- vortex-array/src/arrays/slice/array.rs | 29 ++++++----- 6 files changed, 102 insertions(+), 121 deletions(-) diff --git a/vortex-array/public-api.lock b/vortex-array/public-api.lock index bf3eb86fc68..7d7de5ccb86 100644 --- a/vortex-array/public-api.lock +++ b/vortex-array/public-api.lock @@ -22078,18 +22078,6 @@ impl core::fmt::Debug for vortex_array::ExecutionStep pub fn vortex_array::ExecutionStep::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub enum vortex_array::Optimized - -pub vortex_array::Optimized::Reduced(vortex_array::ArrayRef) - -pub vortex_array::Optimized::Unchanged(vortex_array::ArrayParts) - -impl vortex_array::Optimized - -pub fn vortex_array::Optimized::into_array(self) -> vortex_error::VortexResult - -pub fn vortex_array::Optimized::is_reduced(&self) -> bool - pub enum vortex_array::Precision pub vortex_array::Precision::Ptr @@ -22214,8 +22202,12 @@ impl vortex_array::Array pub fn vortex_array::Array::new(vortex_array::ArrayRef, vortex_mask::Mask) -> Self +pub fn vortex_array::Array::new_parts(vortex_array::ArrayRef, vortex_mask::Mask) -> vortex_array::ArrayParts + pub fn vortex_array::Array::try_new(vortex_array::ArrayRef, vortex_mask::Mask) -> vortex_error::VortexResult +pub fn vortex_array::Array::try_new_parts(vortex_array::ArrayRef, vortex_mask::Mask) -> vortex_error::VortexResult> + impl vortex_array::Array pub fn vortex_array::Array::into_data_parts(self) -> vortex_array::arrays::fixed_size_list::FixedSizeListDataParts @@ -22408,6 +22400,8 @@ pub unsafe fn vortex_array::Array::set_all_val pub fn vortex_array::Array::try_new(vortex_array::ArrayRef, vortex_array::ArrayRef) -> vortex_error::VortexResult +pub fn vortex_array::Array::try_new_parts(vortex_array::ArrayRef, vortex_array::ArrayRef) -> vortex_error::VortexResult> + impl vortex_array::Array pub fn vortex_array::Array::new(usize) -> Self @@ -22420,8 +22414,12 @@ impl vortex_array::Array pub fn vortex_array::Array::new(vortex_array::ArrayRef, core::ops::range::Range) -> Self +pub fn vortex_array::Array::new_parts(vortex_array::ArrayRef, core::ops::range::Range) -> vortex_array::ArrayParts + pub fn vortex_array::Array::try_new(vortex_array::ArrayRef, core::ops::range::Range) -> vortex_error::VortexResult +pub fn vortex_array::Array::try_new_parts(vortex_array::ArrayRef, core::ops::range::Range) -> vortex_error::VortexResult> + impl vortex_array::Array pub fn vortex_array::Array::all_invalid(&self, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22620,9 +22618,9 @@ pub fn vortex_array::ArrayParts::into_array(self) -> vortex_error::VortexResu pub fn vortex_array::ArrayParts::new(V, vortex_array::dtype::DType, usize, ::ArrayData) -> Self >>>>>>> 72b237d24 (Introduce ParentRef and ArrayParts::optimize chain) -pub fn vortex_array::ArrayParts::optimize(self) -> vortex_error::VortexResult> +pub fn vortex_array::ArrayParts::optimize(&self) -> vortex_error::VortexResult> -pub fn vortex_array::ArrayParts::optimize_ctx(self, &vortex_session::VortexSession) -> vortex_error::VortexResult> +pub fn vortex_array::ArrayParts::optimize_ctx(&self, &vortex_session::VortexSession) -> vortex_error::VortexResult> pub fn vortex_array::ArrayParts::with_slots(self, alloc::vec::Vec>) -> Self diff --git a/vortex-array/src/array/erased.rs b/vortex-array/src/array/erased.rs index 7eb57aa9eca..7bc26b3c9d4 100644 --- a/vortex-array/src/array/erased.rs +++ b/vortex-array/src/array/erased.rs @@ -38,16 +38,13 @@ use crate::array::DynArrayData; use crate::array::ParentRef; use crate::arrays::Bool; use crate::arrays::Constant; -use crate::arrays::Dict; -use crate::arrays::Filter; +use crate::arrays::DictArray; +use crate::arrays::FilterArray; use crate::arrays::Null; use crate::arrays::Primitive; -use crate::arrays::Slice; +use crate::arrays::SliceArray; use crate::arrays::VarBin; use crate::arrays::VarBinView; -use crate::arrays::dict::DictData; -use crate::arrays::filter::FilterData; -use crate::arrays::slice::SliceData; use crate::buffer::BufferHandle; use crate::builders::ArrayBuilder; use crate::dtype::DType; @@ -56,6 +53,7 @@ use crate::expr::stats::Precision; use crate::expr::stats::Stat; use crate::expr::stats::StatsProviderExt; use crate::matcher::Matcher; +use crate::optimizer::ArrayOptimizer; use crate::scalar::Scalar; use crate::stats::StatsSetRef; use crate::validity::Validity; @@ -231,12 +229,11 @@ impl ArrayRef { return Ok(Canonical::empty(self.dtype()).into_array()); } - let dtype = self.dtype().clone(); - let slice_len = range.len(); - let sliced = ArrayParts::new(Slice, dtype, slice_len, SliceData::new(range)) - .with_slots(vec![Some(self.clone())]) - .optimize()? - .into_array()?; + let parts = SliceArray::try_new_parts(self.clone(), range)?; + let sliced = match parts.optimize()? { + Some(reduced) => reduced, + None => parts.into_array()?, + }; // Propagate some stats from the original array to the sliced array. if !sliced.is::() { @@ -261,26 +258,24 @@ impl ArrayRef { /// Wraps the array in a [`FilterArray`] such that it is logically filtered by the given mask. pub fn filter(&self, mask: Mask) -> VortexResult { - let dtype = self.dtype().clone(); - let len = mask.true_count(); - let data = FilterData::try_new(self.len(), mask)?; - ArrayParts::new(Filter, dtype, len, data) - .with_slots(vec![Some(self.clone())]) - .optimize()? - .into_array() + let parts = FilterArray::try_new_parts(self.clone(), mask)?; + match parts.optimize()? { + Some(reduced) => Ok(reduced), + // FilterReduceAdaptor still dispatches through the heap-only matcher path, + // so materialize and run the heap-side optimizer to fire the existing rules. + None => parts.into_array()?.optimize(), + } } /// Wraps the array in a [`DictArray`] such that it is logically taken by the given indices. pub fn take(&self, indices: ArrayRef) -> VortexResult { - let dtype = self - .dtype() - .union_nullability(indices.dtype().nullability()); - let len = indices.len(); - let data = DictData::try_new(indices.dtype())?; - ArrayParts::new(Dict, dtype, len, data) - .with_slots(vec![Some(indices), Some(self.clone())]) - .optimize()? - .into_array() + let parts = DictArray::try_new_parts(indices, self.clone())?; + match parts.optimize()? { + Some(reduced) => Ok(reduced), + // TakeReduceAdaptor still dispatches through the heap-only matcher path, + // so materialize and run the heap-side optimizer to fire the existing rules. + None => parts.into_array()?.optimize(), + } } /// Fetch the scalar at the given index. @@ -765,4 +760,13 @@ impl Matcher for V { // # Safety checked by `downcast_ref`. Some(unsafe { ArrayView::new_unchecked(array, &inner.data) }) } + + /// Match by encoding-specific data downcast, so [`ParentRuleSet`] still consults + /// rules whose [`reduce_parent_ref`](crate::optimizer::rules::ArrayParentReduceRule::reduce_parent_ref) + /// override handles stack-allocated parents (whose `array_ref()` is `None`). + /// + /// [`ParentRuleSet`]: crate::optimizer::rules::ParentRuleSet + fn matches_parent(parent: &ParentRef<'_>) -> bool { + parent.try_view::().is_some() + } } diff --git a/vortex-array/src/array/typed.rs b/vortex-array/src/array/typed.rs index ce86c3ed038..ffb4967cb26 100644 --- a/vortex-array/src/array/typed.rs +++ b/vortex-array/src/array/typed.rs @@ -77,13 +77,14 @@ impl ArrayParts { /// Try to apply parent-reduction rules to these parts using static rules only. /// - /// Returns [`Optimized::Reduced`] when a `reduce_parent` rule rewrites the parts into a - /// different array, or [`Optimized::Unchanged`] when no rule applies. Use - /// [`Optimized::into_array`] to materialize whichever variant comes back. + /// Returns `Some(reduced)` when a `reduce_parent` rule rewrites the parts into a + /// different array, or `None` when no rule applies. The parts are not consumed — + /// the caller is free to materialize them via [`ArrayParts::into_array`] if no + /// rule fired. /// /// This is the construction-side counterpart to [`ArrayOptimizer::optimize`] for an /// already-materialized [`ArrayRef`]. - pub fn optimize(self) -> VortexResult> { + pub fn optimize(&self) -> VortexResult> { self.optimize_inner(None) } @@ -91,23 +92,24 @@ impl ArrayParts { /// session-registered [`ArrayKernels`](crate::optimizer::kernels::ArrayKernels). /// /// See [`ArrayParts::optimize`] for the static-only variant. - pub fn optimize_ctx(self, session: &VortexSession) -> VortexResult> { + pub fn optimize_ctx(&self, session: &VortexSession) -> VortexResult> { self.optimize_inner(Some(session)) } - fn optimize_inner(self, session: Option<&VortexSession>) -> VortexResult> { + fn optimize_inner(&self, session: Option<&VortexSession>) -> VortexResult> { // Validate without materializing — `try_from_parts` would allocate, so we // run the same validation the inner constructor would. Validation lives on the // vtable. self.vtable .validate(&self.data, &self.dtype, self.len, &self.slots)?; - // First pass: try stack-backed `reduce_parent` so encodings that override - // `Matcher::try_match_parent` (or `ArrayParentReduceRule` directly) can rewrite - // the parts without allocating a wrapper `Arc>`. + // Try stack-backed `reduce_parent` so encodings that override + // `ArrayParentReduceRule::reduce_parent_ref` can rewrite the parts without + // allocating a wrapper `Arc>`. When no rule fires, return `None` + // and let the caller decide whether to materialize. let kernels = session.and_then(|s| s.get_opt::()); let parent_id = self.vtable.id(); - let parent_ref = ParentRef::from_parts(&self); + let parent_ref = ParentRef::from_parts(self); for (slot_idx, slot) in self.slots.iter().enumerate() { let Some(child) = slot else { continue }; @@ -119,26 +121,17 @@ impl ArrayParts { { for plugin in plugins.as_ref() { if let Some(reduced) = plugin(child, &parent_ref, slot_idx)? { - return Ok(Optimized::Reduced(cascade(reduced, session)?)); + return Ok(Some(cascade(reduced, session)?)); } } } if let Some(reduced) = child.reduce_parent(&parent_ref, slot_idx)? { - return Ok(Optimized::Reduced(cascade(reduced, session)?)); + return Ok(Some(cascade(reduced, session)?)); } } - // No stack-backed rule fired. Materialize so existing rules — whose default - // `try_match_parent` only matches a heap-backed `ArrayRef` — get a chance to - // run via `ArrayRef::optimize`. Encodings that override `try_match_parent` to - // handle stack parents will skip this fallback. - let materialized = Array::::try_from_parts(self)?.into_array(); - let optimized = match session { - Some(s) => materialized.optimize_ctx(s)?, - None => materialized.optimize()?, - }; - Ok(Optimized::Reduced(optimized)) + Ok(None) } /// Materialize the parts into an [`ArrayRef`] without attempting reduction. @@ -149,35 +142,6 @@ impl ArrayParts { } } -/// Outcome of applying parent-reduction rules to an [`ArrayParts`]. -/// -/// `Reduced` carries an `ArrayRef` produced by a rule that rewrote the parts into a -/// different array. `Unchanged` hands back the original parts, still on the stack, so -/// the caller can decide whether to materialize them or assemble them into a larger -/// expression first. -pub enum Optimized { - /// A parent-reduce rule rewrote the parts into a different array. - Reduced(ArrayRef), - /// No parent-reduce rule applied; the original parts are returned on the stack. - Unchanged(ArrayParts), -} - -impl Optimized { - /// Materialize the result into an [`ArrayRef`]. For `Reduced`, returns the - /// already-built `ArrayRef`; for `Unchanged`, calls [`ArrayParts::into_array`]. - pub fn into_array(self) -> VortexResult { - match self { - Self::Reduced(array) => Ok(array), - Self::Unchanged(parts) => parts.into_array(), - } - } - - /// Returns whether this result is the [`Optimized::Reduced`] variant. - pub fn is_reduced(&self) -> bool { - matches!(self, Self::Reduced(_)) - } -} - /// Run the existing `ArrayRef`-level optimizer over a freshly-reduced array so any /// cascading parent-reduce rules also fire — same fixpoint semantics as the /// optimizer's outer loop. diff --git a/vortex-array/src/arrays/dict/array.rs b/vortex-array/src/arrays/dict/array.rs index eafbc9f6642..695143d3db3 100644 --- a/vortex-array/src/arrays/dict/array.rs +++ b/vortex-array/src/arrays/dict/array.rs @@ -231,14 +231,19 @@ impl Array { /// Build a new `DictArray` from its components, `codes` and `values`. pub fn try_new(codes: ArrayRef, values: ArrayRef) -> VortexResult { + Array::try_from_parts(Self::try_new_parts(codes, values)?) + } + + /// Build the [`ArrayParts`] without materializing into an + /// `Arc>`. The parts can then be driven through + /// [`ArrayParts::optimize`] / [`ArrayParts::into_array`]. + pub fn try_new_parts(codes: ArrayRef, values: ArrayRef) -> VortexResult> { let dtype = values .dtype() .union_nullability(codes.dtype().nullability()); let len = codes.len(); let data = DictData::try_new(codes.dtype())?; - Array::try_from_parts( - ArrayParts::new(Dict, dtype, len, data).with_slots(vec![Some(codes), Some(values)]), - ) + Ok(ArrayParts::new(Dict, dtype, len, data).with_slots(vec![Some(codes), Some(values)])) } /// Build a new `DictArray` without validating the codes or values. diff --git a/vortex-array/src/arrays/filter/array.rs b/vortex-array/src/arrays/filter/array.rs index bcf02fe39ec..cc5c8a65c4f 100644 --- a/vortex-array/src/arrays/filter/array.rs +++ b/vortex-array/src/arrays/filter/array.rs @@ -90,25 +90,30 @@ impl FilterData { impl Array { /// Creates a new `FilterArray`. pub fn new(array: ArrayRef, mask: Mask) -> Self { - let dtype = array.dtype().clone(); - let len = mask.true_count(); - let data = FilterData::new(mask); - unsafe { - Array::from_parts_unchecked( - ArrayParts::new(Filter, dtype, len, data).with_slots(vec![Some(array)]), - ) - } + unsafe { Array::from_parts_unchecked(Self::new_parts(array, mask)) } } /// Constructs a new `FilterArray`. pub fn try_new(array: ArrayRef, mask: Mask) -> VortexResult { + Ok(unsafe { Array::from_parts_unchecked(Self::try_new_parts(array, mask)?) }) + } + + /// Builds the [`ArrayParts`] without materializing into an + /// `Arc>`. The parts can then be driven through + /// [`ArrayParts::optimize`] / [`ArrayParts::into_array`]. + pub fn try_new_parts(array: ArrayRef, mask: Mask) -> VortexResult> { let dtype = array.dtype().clone(); let len = mask.true_count(); let data = FilterData::try_new(array.len(), mask)?; - Ok(unsafe { - Array::from_parts_unchecked( - ArrayParts::new(Filter, dtype, len, data).with_slots(vec![Some(array)]), - ) - }) + Ok(ArrayParts::new(Filter, dtype, len, data).with_slots(vec![Some(array)])) + } + + /// Builds the [`ArrayParts`] without checking that the mask length matches + /// the array length. See [`Self::try_new_parts`] for the checked variant. + pub fn new_parts(array: ArrayRef, mask: Mask) -> ArrayParts { + let dtype = array.dtype().clone(); + let len = mask.true_count(); + let data = FilterData::new(mask); + ArrayParts::new(Filter, dtype, len, data).with_slots(vec![Some(array)]) } } diff --git a/vortex-array/src/arrays/slice/array.rs b/vortex-array/src/arrays/slice/array.rs index b1121e2604a..1a7873e0c5a 100644 --- a/vortex-array/src/arrays/slice/array.rs +++ b/vortex-array/src/arrays/slice/array.rs @@ -83,25 +83,30 @@ impl SliceData { impl Array { /// Constructs a new `SliceArray`. pub fn try_new(child: ArrayRef, range: Range) -> VortexResult { + Ok(unsafe { Array::from_parts_unchecked(Self::try_new_parts(child, range)?) }) + } + + /// Constructs a new `SliceArray`. + pub fn new(child: ArrayRef, range: Range) -> Self { + unsafe { Array::from_parts_unchecked(Self::new_parts(child, range)) } + } + + /// Builds the [`ArrayParts`] for a slice without materializing into an + /// `Arc>`. The parts can then be driven through + /// [`ArrayParts::optimize`] / [`ArrayParts::into_array`]. + pub fn try_new_parts(child: ArrayRef, range: Range) -> VortexResult> { let len = range.len(); let dtype = child.dtype().clone(); let data = SliceData::try_new(child.len(), range)?; - Ok(unsafe { - Array::from_parts_unchecked( - ArrayParts::new(Slice, dtype, len, data).with_slots(vec![Some(child)]), - ) - }) + Ok(ArrayParts::new(Slice, dtype, len, data).with_slots(vec![Some(child)])) } - /// Constructs a new `SliceArray`. - pub fn new(child: ArrayRef, range: Range) -> Self { + /// Builds the [`ArrayParts`] without bounds-checking the range. See + /// [`Self::try_new_parts`] for the checked variant. + pub fn new_parts(child: ArrayRef, range: Range) -> ArrayParts { let len = range.len(); let dtype = child.dtype().clone(); let data = SliceData::new(range); - unsafe { - Array::from_parts_unchecked( - ArrayParts::new(Slice, dtype, len, data).with_slots(vec![Some(child)]), - ) - } + ArrayParts::new(Slice, dtype, len, data).with_slots(vec![Some(child)]) } } From a2947256ff22e87f7ad8af7934789eef0066525a Mon Sep 17 00:00:00 2001 From: Robert Kruszewski Date: Fri, 1 May 2026 16:44:05 +0100 Subject: [PATCH 4/8] docs Signed-off-by: Robert Kruszewski --- vortex-array/src/matcher.rs | 28 ++++++++++++++++++++++++++-- vortex-array/src/optimizer/rules.rs | 23 +++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/vortex-array/src/matcher.rs b/vortex-array/src/matcher.rs index 4dcd46b9482..160c5718e12 100644 --- a/vortex-array/src/matcher.rs +++ b/vortex-array/src/matcher.rs @@ -8,12 +8,36 @@ use crate::array::ParentRef; pub trait Matcher { type Match<'a>; - /// Check if the given array matches this matcher type + /// Check if the given array matches this matcher type. + /// + /// # Deprecated + /// + /// Prefer [`Matcher::matches_parent`]. This method only sees a heap-allocated + /// [`ArrayRef`]; stack-allocated parents constructed by [`ArrayParts::optimize`] + /// flow through `matches_parent` instead. + /// + /// Existing implementations can stay; new matchers should override + /// [`Matcher::matches_parent`] (and [`Matcher::try_match_parent`]) directly so they + /// participate in the stack-backed `reduce_parent` dispatch. + /// + /// [`ArrayParts::optimize`]: crate::array::ArrayParts::optimize fn matches(array: &ArrayRef) -> bool { Self::try_match(array).is_some() } /// Try to match the given array, returning the matched view type if successful. + /// + /// # Deprecated + /// + /// Prefer [`Matcher::try_match_parent`]. This method only sees a heap-allocated + /// [`ArrayRef`]; stack-allocated parents constructed by [`ArrayParts::optimize`] + /// flow through `try_match_parent` instead. + /// + /// Existing implementations can stay; new matchers should override + /// [`Matcher::try_match_parent`] directly so they participate in the stack-backed + /// `reduce_parent` dispatch. + /// + /// [`ArrayParts::optimize`]: crate::array::ArrayParts::optimize fn try_match(array: &ArrayRef) -> Option>; /// Try to match a [`ParentRef`]. @@ -22,7 +46,7 @@ pub trait Matcher { /// and returns `None` otherwise. Implementations may override this to recognize /// stack-allocated parents — typically by downcasting `parent` via /// [`ParentRef::try_view`]. - fn try_match_parent(parent: &ParentRef) -> Option> { + fn try_match_parent<'a>(parent: &'a ParentRef) -> Option> { Self::try_match(parent.array_ref()?) } diff --git a/vortex-array/src/optimizer/rules.rs b/vortex-array/src/optimizer/rules.rs index 54c0c3f76e9..02db75913bb 100644 --- a/vortex-array/src/optimizer/rules.rs +++ b/vortex-array/src/optimizer/rules.rs @@ -49,6 +49,16 @@ pub trait ArrayReduceRule: Debug + Send + Sync + 'static { /// The child sees the parent's type via the associated `Parent` [`Matcher`] and can return /// a replacement for the parent. This enables optimizations like pushing operations through /// compression layers (e.g., pushing a scalar function into dictionary values). +/// +/// # Migration to `ParentRef` +/// +/// New rules should override [`ArrayParentReduceRule::reduce_parent_ref`] directly so +/// they participate in the stack-backed dispatch driven by +/// [`ArrayParts::optimize`](crate::array::ArrayParts::optimize). The default +/// `reduce_parent_ref` falls through to [`reduce_parent`](Self::reduce_parent) via +/// [`Matcher::try_match_parent`], which only matches heap-allocated parents — so +/// rules that only override `reduce_parent` will still fire on heap-backed parents +/// but will miss the stack-backed fast path. pub trait ArrayParentReduceRule: Debug + Send + Sync + 'static { /// The parent array type this rule matches against. type Parent: Matcher; @@ -59,6 +69,19 @@ pub trait ArrayParentReduceRule: Debug + Send + Sync + 'static { /// - `Ok(Some(new_array))` if the rule applied successfully /// - `Ok(None)` if the rule doesn't apply /// - `Err(e)` if an error occurred + /// + /// # Deprecated + /// + /// Prefer overriding [`ArrayParentReduceRule::reduce_parent_ref`]. This method + /// only sees the parent through [`Matcher::Match`], which for the blanket + /// `impl Matcher for V` is an [`ArrayView`] holding an `&ArrayRef` — + /// in other words it only fires when the parent is heap-allocated. Rules that + /// override `reduce_parent_ref` instead can rewrite stack-allocated parents + /// constructed by [`ArrayParts::optimize`](crate::array::ArrayParts::optimize) + /// without forcing an `Arc>` allocation. + /// + /// Existing implementations can stay; the default `reduce_parent_ref` continues + /// to delegate here for heap-backed parents. fn reduce_parent( &self, array: ArrayView<'_, V>, From 95ab510ef855cd1269cbcfb334aba0b1c98db715 Mon Sep 17 00:00:00 2001 From: Robert Kruszewski Date: Wed, 6 May 2026 14:30:32 +0100 Subject: [PATCH 5/8] notes Signed-off-by: Robert Kruszewski --- vortex-array/src/matcher.rs | 15 ++++++++++++++- vortex-array/src/optimizer/rules.rs | 6 ++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/vortex-array/src/matcher.rs b/vortex-array/src/matcher.rs index 160c5718e12..15400143bd1 100644 --- a/vortex-array/src/matcher.rs +++ b/vortex-array/src/matcher.rs @@ -46,11 +46,24 @@ pub trait Matcher { /// and returns `None` otherwise. Implementations may override this to recognize /// stack-allocated parents — typically by downcasting `parent` via /// [`ParentRef::try_view`]. - fn try_match_parent<'a>(parent: &'a ParentRef) -> Option> { + /// + /// # Stability + /// + /// **Unstable.** This is part of the [`ArrayParts::optimize`]-driven stack-backed + /// dispatch path and the signature is expected to change as more rules migrate to + /// `ParentRef`. Implementations should treat this as opt-in for now. + /// + /// [`ArrayParts::optimize`]: crate::array::ArrayParts::optimize + fn try_match_parent<'a>(parent: &ParentRef<'a>) -> Option> { Self::try_match(parent.array_ref()?) } /// Check if the given parent matches this matcher type. + /// + /// # Stability + /// + /// **Unstable.** Counterpart to [`Matcher::try_match_parent`]; expect changes as the + /// stack-backed `reduce_parent` dispatch lands more migrations. fn matches_parent(parent: &ParentRef<'_>) -> bool { Self::try_match_parent(parent).is_some() } diff --git a/vortex-array/src/optimizer/rules.rs b/vortex-array/src/optimizer/rules.rs index 02db75913bb..bfc00239cc8 100644 --- a/vortex-array/src/optimizer/rules.rs +++ b/vortex-array/src/optimizer/rules.rs @@ -100,6 +100,12 @@ pub trait ArrayParentReduceRule: Debug + Send + Sync + 'static { /// extracting an encoding-specific view via [`ParentRef::try_view`]. Doing so lets /// callers like [`ArrayParts::optimize`](crate::array::ArrayParts::optimize) avoid /// the `Arc>` allocation when the rule fires. + /// + /// # Stability + /// + /// **Unstable.** This is the new `ParentRef`-based dispatch entry; the signature + /// and contract are expected to change as more rules migrate off + /// [`reduce_parent`](Self::reduce_parent). Treat overrides as opt-in for now. fn reduce_parent_ref( &self, array: ArrayView<'_, V>, From 4aa7f7cf5d1487819aaef25adde16fb4db4acc91 Mon Sep 17 00:00:00 2001 From: Robert Kruszewski Date: Sat, 2 May 2026 01:16:05 +0100 Subject: [PATCH 6/8] docs Signed-off-by: Robert Kruszewski --- vortex-array/public-api.lock | 4 +++ vortex-array/src/array/erased.rs | 6 ++-- vortex-array/src/array/parent.rs | 58 ++++++++++++++++++++------------ vortex-array/src/array/typed.rs | 42 ++++++++++++----------- 4 files changed, 65 insertions(+), 45 deletions(-) diff --git a/vortex-array/public-api.lock b/vortex-array/public-api.lock index 7d7de5ccb86..698d4704e49 100644 --- a/vortex-array/public-api.lock +++ b/vortex-array/public-api.lock @@ -22610,10 +22610,14 @@ pub vortex_array::ArrayParts::vtable: V impl vortex_array::ArrayParts +<<<<<<< HEAD <<<<<<< HEAD pub fn vortex_array::ArrayParts::new(V, vortex_array::dtype::DType, usize, ::TypedArrayData) -> Self ======= pub fn vortex_array::ArrayParts::into_array(self) -> vortex_error::VortexResult +======= +pub fn vortex_array::ArrayParts::into_array(self) -> vortex_array::ArrayRef +>>>>>>> 9d611f705 (docs) pub fn vortex_array::ArrayParts::new(V, vortex_array::dtype::DType, usize, ::ArrayData) -> Self >>>>>>> 72b237d24 (Introduce ParentRef and ArrayParts::optimize chain) diff --git a/vortex-array/src/array/erased.rs b/vortex-array/src/array/erased.rs index 7bc26b3c9d4..84460292035 100644 --- a/vortex-array/src/array/erased.rs +++ b/vortex-array/src/array/erased.rs @@ -232,7 +232,7 @@ impl ArrayRef { let parts = SliceArray::try_new_parts(self.clone(), range)?; let sliced = match parts.optimize()? { Some(reduced) => reduced, - None => parts.into_array()?, + None => parts.into_array(), }; // Propagate some stats from the original array to the sliced array. @@ -263,7 +263,7 @@ impl ArrayRef { Some(reduced) => Ok(reduced), // FilterReduceAdaptor still dispatches through the heap-only matcher path, // so materialize and run the heap-side optimizer to fire the existing rules. - None => parts.into_array()?.optimize(), + None => parts.into_array().optimize(), } } @@ -274,7 +274,7 @@ impl ArrayRef { Some(reduced) => Ok(reduced), // TakeReduceAdaptor still dispatches through the heap-only matcher path, // so materialize and run the heap-side optimizer to fire the existing rules. - None => parts.into_array()?.optimize(), + None => parts.into_array().optimize(), } } diff --git a/vortex-array/src/array/parent.rs b/vortex-array/src/array/parent.rs index 18a1a058d99..b185b4f731b 100644 --- a/vortex-array/src/array/parent.rs +++ b/vortex-array/src/array/parent.rs @@ -8,6 +8,10 @@ //! that hasn't been materialized yet). Matchers and parent-reduce rules consume //! `ParentRef` so that callers can attempt reduction without first allocating an //! `Arc>`. +//! +//! Both cases expose the same borrowed metadata to rule dispatch. Heap-backed parents +//! also retain the original [`ArrayRef`] for compatibility with existing matchers that +//! still need an array allocation. use std::any::Any; use std::fmt::Debug; @@ -29,7 +33,13 @@ use crate::dtype::DType; /// cases. #[derive(Clone, Copy)] pub struct ParentRef<'a> { + inner: ParentRefInner<'a>, array_ref: Option<&'a ArrayRef>, +} + +/// Borrowed parent metadata shared by heap-backed and stack-backed [`ParentRef`]s. +#[derive(Clone, Copy)] +struct ParentRefInner<'a> { encoding_id: ArrayId, dtype: &'a DType, len: usize, @@ -44,11 +54,13 @@ impl<'a> ParentRef<'a> { let inner = array.inner(); Self { array_ref: Some(array), - encoding_id: inner.encoding_id(), - dtype: inner.dtype(), - len: inner.len(), - data: inner.data_any(), - slots: inner.slots(), + inner: ParentRefInner { + encoding_id: inner.encoding_id(), + dtype: inner.dtype(), + len: inner.len(), + data: inner.data_any(), + slots: inner.slots(), + }, } } @@ -57,42 +69,44 @@ impl<'a> ParentRef<'a> { pub fn from_parts(parts: &'a ArrayParts) -> Self { Self { array_ref: None, - encoding_id: parts.vtable.id(), - dtype: &parts.dtype, - len: parts.len, - data: &parts.data, - slots: &parts.slots, + inner: ParentRefInner { + encoding_id: parts.vtable.id(), + dtype: &parts.dtype, + len: parts.len, + data: &parts.data, + slots: &parts.slots, + }, } } /// Returns the encoding id of the parent. #[inline] pub fn encoding_id(&self) -> ArrayId { - self.encoding_id + self.inner.encoding_id } /// Returns the dtype of the parent. #[inline] pub fn dtype(&self) -> &'a DType { - self.dtype + self.inner.dtype } /// Returns the length of the parent. #[inline] pub fn len(&self) -> usize { - self.len + self.inner.len } /// Returns whether the parent is empty. #[inline] pub fn is_empty(&self) -> bool { - self.len == 0 + self.inner.len == 0 } /// Returns the slots of the parent. #[inline] pub fn slots(&self) -> &'a [Option] { - self.slots + self.inner.slots } /// Returns the underlying [`ArrayRef`] if the parent is heap-allocated. @@ -119,12 +133,12 @@ impl<'a> ParentRef<'a> { /// Returns `None` if the parent's encoding is not `V`. Works for both heap- /// and stack-allocated parents. pub fn try_view(&self) -> Option> { - let data = self.data.downcast_ref::()?; + let data = self.inner.data.downcast_ref::()?; Some(ParentView { data, - dtype: self.dtype, - len: self.len, - slots: self.slots, + dtype: self.inner.dtype, + len: self.inner.len, + slots: self.inner.slots, }) } @@ -157,9 +171,9 @@ impl<'a> From<&'a ArrayRef> for ParentRef<'a> { /// A typed view of a parent array, possibly stack-allocated. /// -/// Provides the same surface as [`ArrayView`](crate::array::ArrayView) for the parent -/// data — `Deref` to `V::ArrayData`, plus `slots`, `dtype`, `len` accessors — but does -/// not expose an underlying `&ArrayRef`, since the parent may not have one. +/// Provides the same surface as [`ArrayView`] for the parent data: `Deref` to +/// `V::ArrayData`, plus `slots`, `dtype`, and `len` accessors. It does not expose +/// an underlying `&ArrayRef`, since the parent may not have one. pub struct ParentView<'a, V: VTable> { data: &'a V::ArrayData, dtype: &'a DType, diff --git a/vortex-array/src/array/typed.rs b/vortex-array/src/array/typed.rs index ffb4967cb26..fb0de016a0a 100644 --- a/vortex-array/src/array/typed.rs +++ b/vortex-array/src/array/typed.rs @@ -52,8 +52,11 @@ pub(crate) struct ArrayInner { /// Construction parameters for typed arrays. pub struct ArrayParts { + /// Encoding vtable for the array. pub vtable: V, + /// Logical dtype of the array. pub dtype: DType, + /// Logical length of the array. pub len: usize, pub data: V::TypedArrayData, pub slots: Vec>, @@ -70,6 +73,10 @@ impl ArrayParts { } } + /// Attach child slots to these construction parts. + /// + /// This does not validate the resulting parts. Validation happens when the parts are passed + /// to [`Array::try_from_parts`]. pub fn with_slots(mut self, slots: Vec>) -> Self { self.slots = slots; self @@ -79,11 +86,12 @@ impl ArrayParts { /// /// Returns `Some(reduced)` when a `reduce_parent` rule rewrites the parts into a /// different array, or `None` when no rule applies. The parts are not consumed — - /// the caller is free to materialize them via [`ArrayParts::into_array`] if no - /// rule fired. + /// if no rule fired, the caller can materialize known-valid parts via + /// [`ArrayParts::into_array`] or use [`Array::try_from_parts`] when validation is + /// still required. /// - /// This is the construction-side counterpart to [`ArrayOptimizer::optimize`] for an - /// already-materialized [`ArrayRef`]. + /// This is a construction-side fast path for parent-reduction rules. It does not + /// validate the parts or allocate an `ArrayInner`. pub fn optimize(&self) -> VortexResult> { self.optimize_inner(None) } @@ -97,12 +105,6 @@ impl ArrayParts { } fn optimize_inner(&self, session: Option<&VortexSession>) -> VortexResult> { - // Validate without materializing — `try_from_parts` would allocate, so we - // run the same validation the inner constructor would. Validation lives on the - // vtable. - self.vtable - .validate(&self.data, &self.dtype, self.len, &self.slots)?; - // Try stack-backed `reduce_parent` so encodings that override // `ArrayParentReduceRule::reduce_parent_ref` can rewrite the parts without // allocating a wrapper `Arc>`. When no rule fires, return `None` @@ -134,21 +136,21 @@ impl ArrayParts { Ok(None) } - /// Materialize the parts into an [`ArrayRef`] without attempting reduction. + /// Materialize already-valid parts into an [`ArrayRef`] without attempting reduction. /// - /// Equivalent to `Array::::try_from_parts(parts)?.into_array()`. - pub fn into_array(self) -> VortexResult { - Ok(Array::::try_from_parts(self)?.into_array()) + /// This intentionally skips vtable validation. Use + /// `Array::::try_from_parts(parts)?.into_array()` when constructing parts from unchecked + /// inputs. + pub fn into_array(self) -> ArrayRef { + unsafe { Array::::from_parts_unchecked(self).into_array() } } } -/// Run the existing `ArrayRef`-level optimizer over a freshly-reduced array so any -/// cascading parent-reduce rules also fire — same fixpoint semantics as the -/// optimizer's outer loop. -fn cascade(array: ArrayRef, session: Option<&VortexSession>) -> VortexResult { +#[inline] +fn cascade(reduced: ArrayRef, session: Option<&VortexSession>) -> VortexResult { match session { - Some(s) => array.optimize_ctx(s), - None => array.optimize(), + Some(s) => reduced.optimize_ctx(s), + None => reduced.optimize(), } } From 869645632addfe05cdcd231fd0590058fae83557 Mon Sep 17 00:00:00 2001 From: Robert Kruszewski Date: Sat, 2 May 2026 01:29:54 +0100 Subject: [PATCH 7/8] more Signed-off-by: Robert Kruszewski --- vortex-array/src/array/erased.rs | 20 ++++----- vortex-array/src/arrays/dict/take.rs | 53 ++++++++++++++++++++++++ vortex-array/src/arrays/filter/kernel.rs | 43 +++++++++++++++++++ 3 files changed, 104 insertions(+), 12 deletions(-) diff --git a/vortex-array/src/array/erased.rs b/vortex-array/src/array/erased.rs index 84460292035..325be89c2a6 100644 --- a/vortex-array/src/array/erased.rs +++ b/vortex-array/src/array/erased.rs @@ -259,23 +259,19 @@ impl ArrayRef { /// Wraps the array in a [`FilterArray`] such that it is logically filtered by the given mask. pub fn filter(&self, mask: Mask) -> VortexResult { let parts = FilterArray::try_new_parts(self.clone(), mask)?; - match parts.optimize()? { - Some(reduced) => Ok(reduced), - // FilterReduceAdaptor still dispatches through the heap-only matcher path, - // so materialize and run the heap-side optimizer to fire the existing rules. - None => parts.into_array().optimize(), - } + parts + .optimize()? + .map(Ok) + .unwrap_or_else(|| parts.into_array().optimize()) } /// Wraps the array in a [`DictArray`] such that it is logically taken by the given indices. pub fn take(&self, indices: ArrayRef) -> VortexResult { let parts = DictArray::try_new_parts(indices, self.clone())?; - match parts.optimize()? { - Some(reduced) => Ok(reduced), - // TakeReduceAdaptor still dispatches through the heap-only matcher path, - // so materialize and run the heap-side optimizer to fire the existing rules. - None => parts.into_array().optimize(), - } + parts + .optimize()? + .map(Ok) + .unwrap_or_else(|| parts.into_array().optimize()) } /// Fetch the scalar at the given index. diff --git a/vortex-array/src/arrays/dict/take.rs b/vortex-array/src/arrays/dict/take.rs index b821af79fac..ec1a4c36bf9 100644 --- a/vortex-array/src/arrays/dict/take.rs +++ b/vortex-array/src/arrays/dict/take.rs @@ -9,9 +9,11 @@ use crate::Canonical; use crate::ExecutionCtx; use crate::IntoArray; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::arrays::ConstantArray; use crate::arrays::dict::DictArraySlotsExt; +use crate::arrays::dict::DictSlotsView; use crate::expr::stats::Precision; use crate::expr::stats::Stat; use crate::expr::stats::StatsProvider; @@ -105,6 +107,30 @@ where } Ok(result) } + + fn reduce_parent_ref( + &self, + array: ArrayView<'_, V>, + parent: &ParentRef<'_>, + child_idx: usize, + ) -> VortexResult> { + // Only handle the values child (index 1), not the codes child (index 0). + if child_idx != 1 { + return Ok(None); + } + let Some(parent) = parent.try_view::() else { + return Ok(None); + }; + let codes = DictSlotsView::from_slots(parent.slots()).codes; + if let Some(result) = precondition::(array, codes) { + return Ok(Some(result)); + } + let result = ::take(array, codes)?; + if let Some(taken) = &result { + propagate_take_stats(array.array(), taken, codes)?; + } + Ok(result) + } } #[derive(Default, Debug)] @@ -170,3 +196,30 @@ pub(crate) fn propagate_take_stats( ) }) } + +#[cfg(test)] +mod tests { + use vortex_error::VortexResult; + use vortex_error::vortex_bail; + + use crate::IntoArray; + use crate::arrays::Constant; + use crate::arrays::ConstantArray; + use crate::arrays::DictArray; + use crate::arrays::PrimitiveArray; + + #[test] + fn reduce_adaptor_handles_stack_backed_dict_parent() -> VortexResult<()> { + let indices = PrimitiveArray::from_iter([0u32, 0, 0]).into_array(); + let values = ConstantArray::new(7i32, 1).into_array(); + let parts = DictArray::try_new_parts(indices, values)?; + + let Some(reduced) = parts.optimize()? else { + vortex_bail!("take reduce adaptor should optimize stack-backed parent"); + }; + + assert!(reduced.is::()); + assert_eq!(reduced.len(), 3); + Ok(()) + } +} diff --git a/vortex-array/src/arrays/filter/kernel.rs b/vortex-array/src/arrays/filter/kernel.rs index ef8f8671eda..c8c40fb13d8 100644 --- a/vortex-array/src/arrays/filter/kernel.rs +++ b/vortex-array/src/arrays/filter/kernel.rs @@ -16,6 +16,7 @@ use crate::Canonical; use crate::ExecutionCtx; use crate::IntoArray; use crate::array::ArrayView; +use crate::array::ParentRef; use crate::array::VTable; use crate::arrays::Filter; use crate::kernel::ExecuteParentKernel; @@ -99,6 +100,22 @@ where } ::filter(array, parent.filter_mask()) } + + fn reduce_parent_ref( + &self, + array: ArrayView<'_, V>, + parent: &ParentRef<'_>, + child_idx: usize, + ) -> VortexResult> { + assert_eq!(child_idx, 0); + let Some(parent) = parent.try_view::() else { + return Ok(None); + }; + if let Some(result) = precondition::(array, parent.filter_mask()) { + return Ok(Some(result)); + } + ::filter(array, parent.filter_mask()) + } } /// Adaptor that wraps a [`FilterKernel`] impl as an [`ExecuteParentKernel`]. @@ -125,3 +142,29 @@ where ::filter(array, parent.filter_mask(), ctx) } } + +#[cfg(test)] +mod tests { + use vortex_error::VortexResult; + use vortex_error::vortex_bail; + use vortex_mask::Mask; + + use crate::IntoArray; + use crate::arrays::Constant; + use crate::arrays::ConstantArray; + use crate::arrays::FilterArray; + + #[test] + fn reduce_adaptor_handles_stack_backed_filter_parent() -> VortexResult<()> { + let child = ConstantArray::new(7i32, 4).into_array(); + let parts = FilterArray::try_new_parts(child, Mask::from_iter([true, false, true, false]))?; + + let Some(reduced) = parts.optimize()? else { + vortex_bail!("filter reduce adaptor should optimize stack-backed parent"); + }; + + assert!(reduced.is::()); + assert_eq!(reduced.len(), 2); + Ok(()) + } +} From 0b38af3b947e13c98eee25d7632cfbb704c2f523 Mon Sep 17 00:00:00 2001 From: Robert Kruszewski Date: Wed, 6 May 2026 14:42:25 +0100 Subject: [PATCH 8/8] rebase Signed-off-by: Robert Kruszewski --- vortex-array/public-api.lock | 56 ++++-------------- vortex-array/src/array/erased.rs | 6 +- vortex-array/src/array/parent.rs | 59 ++++++++----------- .../src/arrays/struct_/compute/rules.rs | 9 ++- vortex-array/src/optimizer/kernels.rs | 1 + 5 files changed, 47 insertions(+), 84 deletions(-) diff --git a/vortex-array/public-api.lock b/vortex-array/public-api.lock index 698d4704e49..9cad85dfaed 100644 --- a/vortex-array/public-api.lock +++ b/vortex-array/public-api.lock @@ -13424,13 +13424,9 @@ pub type vortex_array::matcher::Matcher::Match<'a> pub fn vortex_array::matcher::Matcher::matches(&vortex_array::ArrayRef) -> bool -<<<<<<< HEAD -pub fn vortex_array::matcher::Matcher::try_match(&vortex_array::ArrayRef) -> core::option::Option -======= pub fn vortex_array::matcher::Matcher::matches_parent(&vortex_array::ParentRef<'_>) -> bool -pub fn vortex_array::matcher::Matcher::try_match<'a>(&'a vortex_array::ArrayRef) -> core::option::Option ->>>>>>> 08c9f4ad5 (Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice) +pub fn vortex_array::matcher::Matcher::try_match(&vortex_array::ArrayRef) -> core::option::Option pub fn vortex_array::matcher::Matcher::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option @@ -13440,13 +13436,9 @@ pub type vortex_array::AnyCanonical::Match<'a> = vortex_array::CanonicalView<'a> pub fn vortex_array::AnyCanonical::matches(&vortex_array::ArrayRef) -> bool -<<<<<<< HEAD -pub fn vortex_array::AnyCanonical::try_match(&vortex_array::ArrayRef) -> core::option::Option -======= pub fn vortex_array::AnyCanonical::matches_parent(&vortex_array::ParentRef<'_>) -> bool -pub fn vortex_array::AnyCanonical::try_match<'a>(&'a vortex_array::ArrayRef) -> core::option::Option ->>>>>>> 08c9f4ad5 (Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice) +pub fn vortex_array::AnyCanonical::try_match(&vortex_array::ArrayRef) -> core::option::Option pub fn vortex_array::AnyCanonical::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option @@ -13456,13 +13448,9 @@ pub type vortex_array::AnyColumnar::Match<'a> = vortex_array::ColumnarView<'a> pub fn vortex_array::AnyColumnar::matches(&vortex_array::ArrayRef) -> bool -<<<<<<< HEAD -pub fn vortex_array::AnyColumnar::try_match(&vortex_array::ArrayRef) -> core::option::Option -======= pub fn vortex_array::AnyColumnar::matches_parent(&vortex_array::ParentRef<'_>) -> bool -pub fn vortex_array::AnyColumnar::try_match<'a>(&'a vortex_array::ArrayRef) -> core::option::Option ->>>>>>> 08c9f4ad5 (Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice) +pub fn vortex_array::AnyColumnar::try_match(&vortex_array::ArrayRef) -> core::option::Option pub fn vortex_array::AnyColumnar::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option @@ -13508,13 +13496,9 @@ pub type V::Match<'a> = vortex_array::ArrayView<'a, V> pub fn V::matches(&vortex_array::ArrayRef) -> bool -<<<<<<< HEAD -pub fn V::try_match(&vortex_array::ArrayRef) -> core::option::Option> -======= pub fn V::matches_parent(&vortex_array::ParentRef<'_>) -> bool -pub fn V::try_match<'a>(&'a vortex_array::ArrayRef) -> core::option::Option> ->>>>>>> 08c9f4ad5 (Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice) +pub fn V::try_match(&vortex_array::ArrayRef) -> core::option::Option> pub fn V::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option @@ -13682,13 +13666,9 @@ impl vortex_array::optimizer::kernels::ArrayKerne pub fn S::kernels(&self) -> vortex_session::Ref<'_, vortex_array::optimizer::kernels::ArrayKernels> -<<<<<<< HEAD pub type vortex_array::optimizer::kernels::ExecuteParentFn = fn(&vortex_array::ArrayRef, &vortex_array::ArrayRef, usize, &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> -pub type vortex_array::optimizer::kernels::ReduceParentFn = fn(&vortex_array::ArrayRef, &vortex_array::ArrayRef, usize) -> vortex_error::VortexResult> -======= pub type vortex_array::optimizer::kernels::ReduceParentFn = fn(&vortex_array::ArrayRef, &vortex_array::ParentRef<'_>, usize) -> vortex_error::VortexResult> ->>>>>>> 08c9f4ad5 (Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice) pub mod vortex_array::optimizer::rules @@ -22102,13 +22082,9 @@ pub type vortex_array::AnyCanonical::Match<'a> = vortex_array::CanonicalView<'a> pub fn vortex_array::AnyCanonical::matches(&vortex_array::ArrayRef) -> bool -<<<<<<< HEAD -pub fn vortex_array::AnyCanonical::try_match(&vortex_array::ArrayRef) -> core::option::Option -======= pub fn vortex_array::AnyCanonical::matches_parent(&vortex_array::ParentRef<'_>) -> bool -pub fn vortex_array::AnyCanonical::try_match<'a>(&'a vortex_array::ArrayRef) -> core::option::Option ->>>>>>> 08c9f4ad5 (Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice) +pub fn vortex_array::AnyCanonical::try_match(&vortex_array::ArrayRef) -> core::option::Option pub fn vortex_array::AnyCanonical::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option @@ -22120,13 +22096,9 @@ pub type vortex_array::AnyColumnar::Match<'a> = vortex_array::ColumnarView<'a> pub fn vortex_array::AnyColumnar::matches(&vortex_array::ArrayRef) -> bool -<<<<<<< HEAD -pub fn vortex_array::AnyColumnar::try_match(&vortex_array::ArrayRef) -> core::option::Option -======= pub fn vortex_array::AnyColumnar::matches_parent(&vortex_array::ParentRef<'_>) -> bool -pub fn vortex_array::AnyColumnar::try_match<'a>(&'a vortex_array::ArrayRef) -> core::option::Option ->>>>>>> 08c9f4ad5 (Flip reduce_parent dispatch onto ParentRef and skip the heap alloc for slice) +pub fn vortex_array::AnyColumnar::try_match(&vortex_array::ArrayRef) -> core::option::Option pub fn vortex_array::AnyColumnar::try_match_parent<'a>(&vortex_array::ParentRef<'a>) -> core::option::Option @@ -22610,17 +22582,9 @@ pub vortex_array::ArrayParts::vtable: V impl vortex_array::ArrayParts -<<<<<<< HEAD -<<<<<<< HEAD -pub fn vortex_array::ArrayParts::new(V, vortex_array::dtype::DType, usize, ::TypedArrayData) -> Self -======= -pub fn vortex_array::ArrayParts::into_array(self) -> vortex_error::VortexResult -======= pub fn vortex_array::ArrayParts::into_array(self) -> vortex_array::ArrayRef ->>>>>>> 9d611f705 (docs) -pub fn vortex_array::ArrayParts::new(V, vortex_array::dtype::DType, usize, ::ArrayData) -> Self ->>>>>>> 72b237d24 (Introduce ParentRef and ArrayParts::optimize chain) +pub fn vortex_array::ArrayParts::new(V, vortex_array::dtype::DType, usize, ::TypedArrayData) -> Self pub fn vortex_array::ArrayParts::optimize(&self) -> vortex_error::VortexResult> @@ -23330,7 +23294,7 @@ pub struct vortex_array::ParentView<'a, V: vortex_array::VTable> impl<'a, V: vortex_array::VTable> vortex_array::ParentView<'a, V> -pub fn vortex_array::ParentView<'a, V>::data(&self) -> &'a ::ArrayData +pub fn vortex_array::ParentView<'a, V>::data(&self) -> &'a ::TypedArrayData pub fn vortex_array::ParentView<'a, V>::dtype(&self) -> &'a vortex_array::dtype::DType @@ -23352,9 +23316,9 @@ impl core::marker::Copy for vortex_array::ParentView<'_ impl core::ops::deref::Deref for vortex_array::ParentView<'_, V> -pub type vortex_array::ParentView<'_, V>::Target = ::ArrayData +pub type vortex_array::ParentView<'_, V>::Target = ::TypedArrayData -pub fn vortex_array::ParentView<'_, V>::deref(&self) -> &::ArrayData +pub fn vortex_array::ParentView<'_, V>::deref(&self) -> &::TypedArrayData pub struct vortex_array::ProstMetadata(pub M) diff --git a/vortex-array/src/array/erased.rs b/vortex-array/src/array/erased.rs index 325be89c2a6..21ab49645de 100644 --- a/vortex-array/src/array/erased.rs +++ b/vortex-array/src/array/erased.rs @@ -33,7 +33,6 @@ use crate::aggregate_fn::fns::sum::sum; use crate::array::ArrayData; use crate::array::ArrayId; use crate::array::ArrayInner; -use crate::array::ArrayParts; use crate::array::DynArrayData; use crate::array::ParentRef; use crate::arrays::Bool; @@ -95,6 +94,11 @@ impl ArrayRef { &self.0.data } + #[inline(always)] + pub(crate) fn inner(&self) -> &ArrayInner { + &self.0 + } + /// Returns a mutable reference to the inner if this is the sole owner. #[inline(always)] pub(crate) fn inner_mut(&mut self) -> Option<&mut ArrayInner> { diff --git a/vortex-array/src/array/parent.rs b/vortex-array/src/array/parent.rs index b185b4f731b..d09512bff53 100644 --- a/vortex-array/src/array/parent.rs +++ b/vortex-array/src/array/parent.rs @@ -19,6 +19,7 @@ use std::fmt::Formatter; use std::ops::Deref; use crate::ArrayRef; +use crate::array::ArrayData; use crate::array::ArrayId; use crate::array::ArrayParts; use crate::array::ArrayView; @@ -33,18 +34,12 @@ use crate::dtype::DType; /// cases. #[derive(Clone, Copy)] pub struct ParentRef<'a> { - inner: ParentRefInner<'a>, - array_ref: Option<&'a ArrayRef>, -} - -/// Borrowed parent metadata shared by heap-backed and stack-backed [`ParentRef`]s. -#[derive(Clone, Copy)] -struct ParentRefInner<'a> { encoding_id: ArrayId, dtype: &'a DType, len: usize, data: &'a dyn Any, slots: &'a [Option], + array_ref: Option<&'a ArrayRef>, } impl<'a> ParentRef<'a> { @@ -54,13 +49,11 @@ impl<'a> ParentRef<'a> { let inner = array.inner(); Self { array_ref: Some(array), - inner: ParentRefInner { - encoding_id: inner.encoding_id(), - dtype: inner.dtype(), - len: inner.len(), - data: inner.data_any(), - slots: inner.slots(), - }, + encoding_id: inner.encoding_id, + dtype: &inner.dtype, + len: inner.len, + data: inner.data.as_any(), + slots: &inner.slots, } } @@ -69,44 +62,42 @@ impl<'a> ParentRef<'a> { pub fn from_parts(parts: &'a ArrayParts) -> Self { Self { array_ref: None, - inner: ParentRefInner { - encoding_id: parts.vtable.id(), - dtype: &parts.dtype, - len: parts.len, - data: &parts.data, - slots: &parts.slots, - }, + encoding_id: parts.vtable.id(), + dtype: &parts.dtype, + len: parts.len, + data: &parts.data, + slots: &parts.slots, } } /// Returns the encoding id of the parent. #[inline] pub fn encoding_id(&self) -> ArrayId { - self.inner.encoding_id + self.encoding_id } /// Returns the dtype of the parent. #[inline] pub fn dtype(&self) -> &'a DType { - self.inner.dtype + self.dtype } /// Returns the length of the parent. #[inline] pub fn len(&self) -> usize { - self.inner.len + self.len } /// Returns whether the parent is empty. #[inline] pub fn is_empty(&self) -> bool { - self.inner.len == 0 + self.len == 0 } /// Returns the slots of the parent. #[inline] pub fn slots(&self) -> &'a [Option] { - self.inner.slots + self.slots } /// Returns the underlying [`ArrayRef`] if the parent is heap-allocated. @@ -133,12 +124,12 @@ impl<'a> ParentRef<'a> { /// Returns `None` if the parent's encoding is not `V`. Works for both heap- /// and stack-allocated parents. pub fn try_view(&self) -> Option> { - let data = self.inner.data.downcast_ref::()?; + let data = self.data.downcast_ref::>()?; Some(ParentView { data, - dtype: self.inner.dtype, - len: self.inner.len, - slots: self.inner.slots, + dtype: self.dtype, + len: self.len, + slots: self.slots, }) } @@ -175,7 +166,7 @@ impl<'a> From<&'a ArrayRef> for ParentRef<'a> { /// `V::ArrayData`, plus `slots`, `dtype`, and `len` accessors. It does not expose /// an underlying `&ArrayRef`, since the parent may not have one. pub struct ParentView<'a, V: VTable> { - data: &'a V::ArrayData, + data: &'a V::TypedArrayData, dtype: &'a DType, len: usize, slots: &'a [Option], @@ -192,7 +183,7 @@ impl Clone for ParentView<'_, V> { impl<'a, V: VTable> ParentView<'a, V> { /// Returns the encoding-specific data. #[inline] - pub fn data(&self) -> &'a V::ArrayData { + pub fn data(&self) -> &'a V::TypedArrayData { self.data } @@ -222,9 +213,9 @@ impl<'a, V: VTable> ParentView<'a, V> { } impl Deref for ParentView<'_, V> { - type Target = V::ArrayData; + type Target = V::TypedArrayData; - fn deref(&self) -> &V::ArrayData { + fn deref(&self) -> &V::TypedArrayData { self.data } } diff --git a/vortex-array/src/arrays/struct_/compute/rules.rs b/vortex-array/src/arrays/struct_/compute/rules.rs index 99cfe819508..d1de0f1ca95 100644 --- a/vortex-array/src/arrays/struct_/compute/rules.rs +++ b/vortex-array/src/arrays/struct_/compute/rules.rs @@ -6,6 +6,7 @@ use vortex_error::vortex_err; use crate::ArrayRef; use crate::IntoArray; +use crate::ParentRef; use crate::array::ArrayView; use crate::arrays::ConstantArray; use crate::arrays::Struct; @@ -35,13 +36,13 @@ pub(crate) const PARENT_RULES: ParentRuleSet = ParentRuleSet::new(&[ pub(crate) fn struct_cast_reduce_parent( child: &ArrayRef, - parent: &ArrayRef, + parent: &ParentRef<'_>, _child_idx: usize, ) -> VortexResult> { let Some(array) = child.as_opt::() else { return Ok(None); }; - let Some(parent) = ExactScalarFn::::try_match(parent) else { + let Some(parent) = ExactScalarFn::::try_match_parent(parent) else { return Ok(None); }; @@ -131,6 +132,7 @@ mod tests { use crate::ArrayRef; use crate::IntoArray; + use crate::ParentRef; use crate::array::ArrayPlugin; use crate::arrays::ScalarFn; use crate::arrays::Struct; @@ -153,12 +155,13 @@ mod tests { use crate::scalar_fn::ScalarFnVTable; use crate::scalar_fn::fns::cast::Cast; use crate::validity::Validity; + static SESSION: LazyLock = LazyLock::new(|| VortexSession::empty().with::()); fn no_struct_cast_plugin( _child: &ArrayRef, - _parent: &ArrayRef, + _parent: &ParentRef<'_>, _child_idx: usize, ) -> VortexResult> { Ok(None) diff --git a/vortex-array/src/optimizer/kernels.rs b/vortex-array/src/optimizer/kernels.rs index a70136c4780..e86a3980288 100644 --- a/vortex-array/src/optimizer/kernels.rs +++ b/vortex-array/src/optimizer/kernels.rs @@ -46,6 +46,7 @@ use crate::ExecutionCtx; use crate::array::ParentRef; use crate::arrays::struct_::compute::cast::struct_cast_execute_parent; use crate::arrays::struct_::compute::rules::struct_cast_reduce_parent; +use crate::scalar_fn::ScalarFnPlugin; use crate::scalar_fn::fns::cast::Cast; /// Shared hasher used to combine `(outer, child)` tuples into registry keys.