diff --git a/Cargo.lock b/Cargo.lock index e19ace1f5b7..9300cf704ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10289,6 +10289,7 @@ dependencies = [ "vortex-array", "vortex-buffer", "vortex-error", + "vortex-mask", "vortex-session", ] diff --git a/benchmarks/compress-bench/src/vortex.rs b/benchmarks/compress-bench/src/vortex.rs index b2eb1a5d490..9d548fd60ec 100644 --- a/benchmarks/compress-bench/src/vortex.rs +++ b/benchmarks/compress-bench/src/vortex.rs @@ -12,6 +12,7 @@ use async_trait::async_trait; use bytes::Bytes; use futures::StreamExt; use futures::pin_mut; +use vortex::array::IntoArray; use vortex::file::OpenOptionsSessionExt; use vortex::file::WriteOptionsSessionExt; use vortex_bench::Format; @@ -37,7 +38,7 @@ impl Compressor for VortexCompressor { let mut cursor = Cursor::new(&mut buf); SESSION .write_options() - .write(&mut cursor, uncompressed.to_array_stream()) + .write(&mut cursor, uncompressed.into_array().to_array_stream()) .await?; let elapsed = start.elapsed(); @@ -51,7 +52,7 @@ impl Compressor for VortexCompressor { let mut cursor = Cursor::new(&mut buf); SESSION .write_options() - .write(&mut cursor, uncompressed.to_array_stream()) + .write(&mut cursor, uncompressed.into_array().to_array_stream()) .await?; // Now decompress diff --git a/encodings/alp/public-api.lock b/encodings/alp/public-api.lock index 0446871e200..e1117947bdc 100644 --- a/encodings/alp/public-api.lock +++ b/encodings/alp/public-api.lock @@ -8,6 +8,14 @@ impl vortex_alp::ALP pub const vortex_alp::ALP::ID: vortex_array::vtable::dyn_::ArrayId +impl vortex_alp::ALP + +pub fn vortex_alp::ALP::new(encoded: vortex_array::array::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option) -> vortex_alp::ALPArray + +pub unsafe fn vortex_alp::ALP::new_unchecked(encoded: vortex_array::array::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option, dtype: vortex_array::dtype::DType) -> vortex_alp::ALPArray + +pub fn vortex_alp::ALP::try_new(encoded: vortex_array::array::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_alp::ALP pub fn vortex_alp::ALP::clone(&self) -> vortex_alp::ALP @@ -26,7 +34,7 @@ pub fn vortex_alp::ALP::filter(array: &vortex_alp::ALPArray, mask: &vortex_mask: impl vortex_array::arrays::slice::SliceKernel for vortex_alp::ALP -pub fn vortex_alp::ALP::slice(array: &Self::Array, range: core::ops::range::Range, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_alp::ALP::slice(array: &vortex_array::vtable::typed::Array, range: core::ops::range::Range, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::between::kernel::BetweenReduce for vortex_alp::ALP @@ -50,7 +58,7 @@ pub fn vortex_alp::ALP::mask(array: &vortex_alp::ALPArray, mask: &vortex_array:: impl vortex_array::vtable::VTable for vortex_alp::ALP -pub type vortex_alp::ALP::Array = vortex_alp::ALPArray +pub type vortex_alp::ALP::ArrayData = vortex_alp::ALPData pub type vortex_alp::ALP::Metadata = vortex_array::metadata::ProstMetadata @@ -58,23 +66,23 @@ pub type vortex_alp::ALP::OperationsVTable = vortex_alp::ALP pub type vortex_alp::ALP::ValidityVTable = vortex_array::vtable::validity::ValidityVTableFromChild -pub fn vortex_alp::ALP::array_eq(array: &vortex_alp::ALPArray, other: &vortex_alp::ALPArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_alp::ALP::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_alp::ALP::array_hash(array: &vortex_alp::ALPArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_alp::ALP::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_alp::ALP::buffer(_array: &vortex_alp::ALPArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_alp::ALP::buffer(_array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_alp::ALP::buffer_name(_array: &vortex_alp::ALPArray, _idx: usize) -> core::option::Option +pub fn vortex_alp::ALP::buffer_name(_array: &vortex_array::vtable::typed::Array, _idx: usize) -> core::option::Option -pub fn vortex_alp::ALP::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_alp::ALP::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_alp::ALP::child(array: &vortex_alp::ALPArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_alp::ALP::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_alp::ALP::child_name(array: &vortex_alp::ALPArray, idx: usize) -> alloc::string::String +pub fn vortex_alp::ALP::child_name(array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_alp::ALP::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_alp::ALP::dtype(array: &vortex_alp::ALPArray) -> &vortex_array::dtype::DType +pub fn vortex_alp::ALP::dtype(array: &vortex_alp::ALPData) -> &vortex_array::dtype::DType pub fn vortex_alp::ALP::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -82,79 +90,73 @@ pub fn vortex_alp::ALP::execute_parent(array: &vortex_array::vtable::typed::Arra pub fn vortex_alp::ALP::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_alp::ALP::len(array: &vortex_alp::ALPArray) -> usize +pub fn vortex_alp::ALP::len(array: &vortex_alp::ALPData) -> usize -pub fn vortex_alp::ALP::metadata(array: &vortex_alp::ALPArray) -> vortex_error::VortexResult +pub fn vortex_alp::ALP::metadata(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_alp::ALP::nbuffers(_array: &vortex_alp::ALPArray) -> usize +pub fn vortex_alp::ALP::nbuffers(_array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_alp::ALP::nchildren(array: &vortex_alp::ALPArray) -> usize +pub fn vortex_alp::ALP::nchildren(array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_alp::ALP::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_alp::ALP::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_alp::ALP::stats(array: &vortex_alp::ALPArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_alp::ALP::stats(array: &vortex_alp::ALPData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_alp::ALP::vtable(_array: &Self::Array) -> &Self +pub fn vortex_alp::ALP::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_alp::ALP::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_alp::ALP::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_alp::ALP -pub fn vortex_alp::ALP::scalar_at(array: &vortex_alp::ALPArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_alp::ALP::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::validity::ValidityChild for vortex_alp::ALP -pub fn vortex_alp::ALP::validity_child(array: &vortex_alp::ALPArray) -> &vortex_array::array::ArrayRef +pub fn vortex_alp::ALP::validity_child(array: &vortex_alp::ALPData) -> &vortex_array::array::ArrayRef -pub struct vortex_alp::ALPArray +pub struct vortex_alp::ALPData -impl vortex_alp::ALPArray +impl vortex_alp::ALPData -pub fn vortex_alp::ALPArray::encoded(&self) -> &vortex_array::array::ArrayRef +pub fn vortex_alp::ALPData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_alp::ALPArray::exponents(&self) -> vortex_alp::Exponents +pub fn vortex_alp::ALPData::encoded(&self) -> &vortex_array::array::ArrayRef -pub fn vortex_alp::ALPArray::into_parts(self) -> (vortex_array::array::ArrayRef, vortex_alp::Exponents, core::option::Option, vortex_array::dtype::DType) +pub fn vortex_alp::ALPData::exponents(&self) -> vortex_alp::Exponents -pub fn vortex_alp::ALPArray::new(encoded: vortex_array::array::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option) -> Self +pub fn vortex_alp::ALPData::into_parts(self) -> (vortex_array::array::ArrayRef, vortex_alp::Exponents, core::option::Option, vortex_array::dtype::DType) -pub fn vortex_alp::ALPArray::patches(&self) -> core::option::Option<&vortex_array::patches::Patches> +pub fn vortex_alp::ALPData::is_empty(&self) -> bool -pub fn vortex_alp::ALPArray::ptype(&self) -> vortex_array::dtype::ptype::PType +pub fn vortex_alp::ALPData::len(&self) -> usize -pub fn vortex_alp::ALPArray::try_new(encoded: vortex_array::array::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option) -> vortex_error::VortexResult +pub fn vortex_alp::ALPData::patches(&self) -> core::option::Option<&vortex_array::patches::Patches> -impl vortex_alp::ALPArray +pub fn vortex_alp::ALPData::ptype(&self) -> vortex_array::dtype::ptype::PType -pub fn vortex_alp::ALPArray::to_array(&self) -> vortex_array::array::ArrayRef +impl vortex_alp::ALPData -impl core::clone::Clone for vortex_alp::ALPArray +pub fn vortex_alp::ALPData::new(encoded: vortex_array::array::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option) -> Self -pub fn vortex_alp::ALPArray::clone(&self) -> vortex_alp::ALPArray +pub fn vortex_alp::ALPData::try_new(encoded: vortex_array::array::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option) -> vortex_error::VortexResult -impl core::convert::AsRef for vortex_alp::ALPArray +impl core::clone::Clone for vortex_alp::ALPData -pub fn vortex_alp::ALPArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +pub fn vortex_alp::ALPData::clone(&self) -> vortex_alp::ALPData -impl core::convert::From for vortex_array::array::ArrayRef +impl core::convert::From for vortex_array::array::ArrayRef -pub fn vortex_array::array::ArrayRef::from(value: vortex_alp::ALPArray) -> vortex_array::array::ArrayRef +pub fn vortex_array::array::ArrayRef::from(value: vortex_alp::ALPData) -> vortex_array::array::ArrayRef -impl core::fmt::Debug for vortex_alp::ALPArray +impl core::fmt::Debug for vortex_alp::ALPData -pub fn vortex_alp::ALPArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_alp::ALPData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::ops::deref::Deref for vortex_alp::ALPArray +impl vortex_array::array::IntoArray for vortex_alp::ALPData -pub type vortex_alp::ALPArray::Target = dyn vortex_array::array::DynArray - -pub fn vortex_alp::ALPArray::deref(&self) -> &Self::Target - -impl vortex_array::array::IntoArray for vortex_alp::ALPArray - -pub fn vortex_alp::ALPArray::into_array(self) -> vortex_array::array::ArrayRef +pub fn vortex_alp::ALPData::into_array(self) -> vortex_array::array::ArrayRef pub struct vortex_alp::ALPMetadata @@ -182,6 +184,10 @@ impl vortex_alp::ALPRD pub const vortex_alp::ALPRD::ID: vortex_array::vtable::dyn_::ArrayId +pub unsafe fn vortex_alp::ALPRD::new_unchecked(dtype: vortex_array::dtype::DType, left_parts: vortex_array::array::ArrayRef, left_parts_dictionary: vortex_buffer::buffer::Buffer, right_parts: vortex_array::array::ArrayRef, right_bit_width: u8, left_parts_patches: core::option::Option) -> vortex_alp::ALPRDArray + +pub fn vortex_alp::ALPRD::try_new(dtype: vortex_array::dtype::DType, left_parts: vortex_array::array::ArrayRef, left_parts_dictionary: vortex_buffer::buffer::Buffer, right_parts: vortex_array::array::ArrayRef, right_bit_width: u8, left_parts_patches: core::option::Option) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_alp::ALPRD pub fn vortex_alp::ALPRD::clone(&self) -> vortex_alp::ALPRD @@ -200,7 +206,7 @@ pub fn vortex_alp::ALPRD::filter(array: &vortex_alp::ALPRDArray, mask: &vortex_m impl vortex_array::arrays::slice::SliceKernel for vortex_alp::ALPRD -pub fn vortex_alp::ALPRD::slice(array: &Self::Array, range: core::ops::range::Range, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_alp::ALPRD::slice(array: &vortex_array::vtable::typed::Array, range: core::ops::range::Range, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::kernel::CastReduce for vortex_alp::ALPRD @@ -212,7 +218,7 @@ pub fn vortex_alp::ALPRD::mask(array: &vortex_alp::ALPRDArray, mask: &vortex_arr impl vortex_array::vtable::VTable for vortex_alp::ALPRD -pub type vortex_alp::ALPRD::Array = vortex_alp::ALPRDArray +pub type vortex_alp::ALPRD::ArrayData = vortex_alp::ALPRDData pub type vortex_alp::ALPRD::Metadata = vortex_array::metadata::ProstMetadata @@ -220,23 +226,23 @@ pub type vortex_alp::ALPRD::OperationsVTable = vortex_alp::ALPRD pub type vortex_alp::ALPRD::ValidityVTable = vortex_array::vtable::validity::ValidityVTableFromChild -pub fn vortex_alp::ALPRD::array_eq(array: &vortex_alp::ALPRDArray, other: &vortex_alp::ALPRDArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_alp::ALPRD::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_alp::ALPRD::array_hash(array: &vortex_alp::ALPRDArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_alp::ALPRD::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_alp::ALPRD::buffer(_array: &vortex_alp::ALPRDArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_alp::ALPRD::buffer(_array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_alp::ALPRD::buffer_name(_array: &vortex_alp::ALPRDArray, _idx: usize) -> core::option::Option +pub fn vortex_alp::ALPRD::buffer_name(_array: &vortex_array::vtable::typed::Array, _idx: usize) -> core::option::Option -pub fn vortex_alp::ALPRD::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_alp::ALPRD::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_alp::ALPRD::child(array: &vortex_alp::ALPRDArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_alp::ALPRD::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_alp::ALPRD::child_name(array: &vortex_alp::ALPRDArray, idx: usize) -> alloc::string::String +pub fn vortex_alp::ALPRD::child_name(array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_alp::ALPRD::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_alp::ALPRD::dtype(array: &vortex_alp::ALPRDArray) -> &vortex_array::dtype::DType +pub fn vortex_alp::ALPRD::dtype(array: &vortex_alp::ALPRDData) -> &vortex_array::dtype::DType pub fn vortex_alp::ALPRD::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -244,103 +250,95 @@ pub fn vortex_alp::ALPRD::execute_parent(array: &vortex_array::vtable::typed::Ar pub fn vortex_alp::ALPRD::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_alp::ALPRD::len(array: &vortex_alp::ALPRDArray) -> usize +pub fn vortex_alp::ALPRD::len(array: &vortex_alp::ALPRDData) -> usize -pub fn vortex_alp::ALPRD::metadata(array: &vortex_alp::ALPRDArray) -> vortex_error::VortexResult +pub fn vortex_alp::ALPRD::metadata(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_alp::ALPRD::nbuffers(_array: &vortex_alp::ALPRDArray) -> usize +pub fn vortex_alp::ALPRD::nbuffers(_array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_alp::ALPRD::nchildren(array: &vortex_alp::ALPRDArray) -> usize +pub fn vortex_alp::ALPRD::nchildren(array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_alp::ALPRD::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_alp::ALPRD::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_alp::ALPRD::stats(array: &vortex_alp::ALPRDArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_alp::ALPRD::stats(array: &vortex_alp::ALPRDData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_alp::ALPRD::vtable(_array: &Self::Array) -> &Self +pub fn vortex_alp::ALPRD::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_alp::ALPRD::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_alp::ALPRD::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_alp::ALPRD -pub fn vortex_alp::ALPRD::scalar_at(array: &vortex_alp::ALPRDArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_alp::ALPRD::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::validity::ValidityChild for vortex_alp::ALPRD -pub fn vortex_alp::ALPRD::validity_child(array: &vortex_alp::ALPRDArray) -> &vortex_array::array::ArrayRef - -pub struct vortex_alp::ALPRDArray - -impl vortex_alp::ALPRDArray - -pub fn vortex_alp::ALPRDArray::into_parts(self) -> vortex_alp::ALPRDArrayParts - -pub fn vortex_alp::ALPRDArray::is_f32(&self) -> bool +pub fn vortex_alp::ALPRD::validity_child(array: &vortex_alp::ALPRDData) -> &vortex_array::array::ArrayRef -pub fn vortex_alp::ALPRDArray::left_parts(&self) -> &vortex_array::array::ArrayRef +pub struct vortex_alp::ALPRDArrayParts -pub fn vortex_alp::ALPRDArray::left_parts_dictionary(&self) -> &vortex_buffer::buffer::Buffer +pub vortex_alp::ALPRDArrayParts::dtype: vortex_array::dtype::DType -pub fn vortex_alp::ALPRDArray::left_parts_patches(&self) -> core::option::Option<&vortex_array::patches::Patches> +pub vortex_alp::ALPRDArrayParts::left_parts: vortex_array::array::ArrayRef -pub fn vortex_alp::ALPRDArray::replace_left_parts_patches(&mut self, patches: core::option::Option) +pub vortex_alp::ALPRDArrayParts::left_parts_dictionary: vortex_buffer::buffer::Buffer -pub fn vortex_alp::ALPRDArray::right_bit_width(&self) -> u8 +pub vortex_alp::ALPRDArrayParts::left_parts_patches: core::option::Option -pub fn vortex_alp::ALPRDArray::right_parts(&self) -> &vortex_array::array::ArrayRef +pub vortex_alp::ALPRDArrayParts::right_parts: vortex_array::array::ArrayRef -pub fn vortex_alp::ALPRDArray::try_new(dtype: vortex_array::dtype::DType, left_parts: vortex_array::array::ArrayRef, left_parts_dictionary: vortex_buffer::buffer::Buffer, right_parts: vortex_array::array::ArrayRef, right_bit_width: u8, left_parts_patches: core::option::Option) -> vortex_error::VortexResult +impl core::clone::Clone for vortex_alp::ALPRDArrayParts -impl vortex_alp::ALPRDArray +pub fn vortex_alp::ALPRDArrayParts::clone(&self) -> vortex_alp::ALPRDArrayParts -pub fn vortex_alp::ALPRDArray::to_array(&self) -> vortex_array::array::ArrayRef +impl core::fmt::Debug for vortex_alp::ALPRDArrayParts -impl core::clone::Clone for vortex_alp::ALPRDArray +pub fn vortex_alp::ALPRDArrayParts::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_alp::ALPRDArray::clone(&self) -> vortex_alp::ALPRDArray +pub struct vortex_alp::ALPRDData -impl core::convert::AsRef for vortex_alp::ALPRDArray +impl vortex_alp::ALPRDData -pub fn vortex_alp::ALPRDArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +pub fn vortex_alp::ALPRDData::dtype(&self) -> &vortex_array::dtype::DType -impl core::convert::From for vortex_array::array::ArrayRef +pub fn vortex_alp::ALPRDData::into_parts(self) -> vortex_alp::ALPRDArrayParts -pub fn vortex_array::array::ArrayRef::from(value: vortex_alp::ALPRDArray) -> vortex_array::array::ArrayRef +pub fn vortex_alp::ALPRDData::is_empty(&self) -> bool -impl core::fmt::Debug for vortex_alp::ALPRDArray +pub fn vortex_alp::ALPRDData::is_f32(&self) -> bool -pub fn vortex_alp::ALPRDArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_alp::ALPRDData::left_parts(&self) -> &vortex_array::array::ArrayRef -impl core::ops::deref::Deref for vortex_alp::ALPRDArray +pub fn vortex_alp::ALPRDData::left_parts_dictionary(&self) -> &vortex_buffer::buffer::Buffer -pub type vortex_alp::ALPRDArray::Target = dyn vortex_array::array::DynArray +pub fn vortex_alp::ALPRDData::left_parts_patches(&self) -> core::option::Option<&vortex_array::patches::Patches> -pub fn vortex_alp::ALPRDArray::deref(&self) -> &Self::Target +pub fn vortex_alp::ALPRDData::len(&self) -> usize -impl vortex_array::array::IntoArray for vortex_alp::ALPRDArray +pub fn vortex_alp::ALPRDData::replace_left_parts_patches(&mut self, patches: core::option::Option) -pub fn vortex_alp::ALPRDArray::into_array(self) -> vortex_array::array::ArrayRef +pub fn vortex_alp::ALPRDData::right_bit_width(&self) -> u8 -pub struct vortex_alp::ALPRDArrayParts +pub fn vortex_alp::ALPRDData::right_parts(&self) -> &vortex_array::array::ArrayRef -pub vortex_alp::ALPRDArrayParts::dtype: vortex_array::dtype::DType +pub fn vortex_alp::ALPRDData::try_new(dtype: vortex_array::dtype::DType, left_parts: vortex_array::array::ArrayRef, left_parts_dictionary: vortex_buffer::buffer::Buffer, right_parts: vortex_array::array::ArrayRef, right_bit_width: u8, left_parts_patches: core::option::Option) -> vortex_error::VortexResult -pub vortex_alp::ALPRDArrayParts::left_parts: vortex_array::array::ArrayRef +impl core::clone::Clone for vortex_alp::ALPRDData -pub vortex_alp::ALPRDArrayParts::left_parts_dictionary: vortex_buffer::buffer::Buffer +pub fn vortex_alp::ALPRDData::clone(&self) -> vortex_alp::ALPRDData -pub vortex_alp::ALPRDArrayParts::left_parts_patches: core::option::Option +impl core::convert::From for vortex_array::array::ArrayRef -pub vortex_alp::ALPRDArrayParts::right_parts: vortex_array::array::ArrayRef +pub fn vortex_array::array::ArrayRef::from(value: vortex_alp::ALPRDData) -> vortex_array::array::ArrayRef -impl core::clone::Clone for vortex_alp::ALPRDArrayParts +impl core::fmt::Debug for vortex_alp::ALPRDData -pub fn vortex_alp::ALPRDArrayParts::clone(&self) -> vortex_alp::ALPRDArrayParts +pub fn vortex_alp::ALPRDData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::fmt::Debug for vortex_alp::ALPRDArrayParts +impl vortex_array::array::IntoArray for vortex_alp::ALPRDData -pub fn vortex_alp::ALPRDArrayParts::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_alp::ALPRDData::into_array(self) -> vortex_array::array::ArrayRef pub struct vortex_alp::ALPRDMetadata @@ -404,7 +402,7 @@ pub struct vortex_alp::RDEncoder impl vortex_alp::RDEncoder -pub fn vortex_alp::RDEncoder::encode(&self, array: &vortex_array::arrays::primitive::array::PrimitiveArray) -> vortex_alp::ALPRDArray +pub fn vortex_alp::RDEncoder::encode(&self, array: &vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_alp::ALPRDArray pub fn vortex_alp::RDEncoder::from_parts(right_bit_width: u8, codes: alloc::vec::Vec) -> Self @@ -584,10 +582,14 @@ pub fn f64::to_bits(value: Self) -> Self::UINT pub fn f64::to_u16(bits: Self::UINT) -> u16 -pub fn vortex_alp::alp_encode(parray: &vortex_array::arrays::primitive::array::PrimitiveArray, exponents: core::option::Option) -> vortex_error::VortexResult +pub fn vortex_alp::alp_encode(parray: &vortex_array::arrays::primitive::vtable::PrimitiveArray, exponents: core::option::Option) -> vortex_error::VortexResult pub fn vortex_alp::alp_rd_decode(left_parts: vortex_buffer::buffer::Buffer, left_parts_dict: &[u16], right_bit_width: u8, right_parts: vortex_buffer::buffer::Buffer<::UINT>, left_parts_patches: core::option::Option, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult> -pub fn vortex_alp::decompress_into_array(array: vortex_alp::ALPArray, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_alp::decompress_into_array(array: vortex_alp::ALPArray, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult pub fn vortex_alp::initialize(session: &mut vortex_session::VortexSession) + +pub type vortex_alp::ALPArray = vortex_array::vtable::typed::Array + +pub type vortex_alp::ALPRDArray = vortex_array::vtable::typed::Array diff --git a/encodings/alp/src/alp/array.rs b/encodings/alp/src/alp/array.rs index 467ff3fdee1..9901a52fe60 100644 --- a/encodings/alp/src/alp/array.rs +++ b/encodings/alp/src/alp/array.rs @@ -23,7 +23,6 @@ use vortex_array::patches::Patches; use vortex_array::patches::PatchesMetadata; use vortex_array::serde::ArrayChildren; use vortex_array::stats::ArrayStats; -use vortex_array::stats::StatsSetRef; use vortex_array::vtable; use vortex_array::vtable::Array; use vortex_array::vtable::ArrayId; @@ -47,16 +46,16 @@ use crate::alp::decompress::execute_decompress; use crate::alp::rules::PARENT_KERNELS; use crate::alp::rules::RULES; -vtable!(ALP); +vtable!(ALP, ALP, ALPData); impl VTable for ALP { - type Array = ALPArray; + type ArrayData = ALPData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromChild; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &ALP } @@ -64,49 +63,49 @@ impl VTable for ALP { Self::ID } - fn len(array: &ALPArray) -> usize { + fn len(array: &ALPData) -> usize { array.encoded.len() } - fn dtype(array: &ALPArray) -> &DType { + fn dtype(array: &ALPData) -> &DType { &array.dtype } - fn stats(array: &ALPArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &ALPData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &ALPArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.encoded.array_hash(state, precision); array.exponents.hash(state); array.patches.array_hash(state, precision); } - fn array_eq(array: &ALPArray, other: &ALPArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.encoded.array_eq(&other.encoded, precision) && array.exponents == other.exponents && array.patches.array_eq(&other.patches, precision) } - fn nbuffers(_array: &ALPArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &ALPArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("ALPArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &ALPArray, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(array: &ALPArray) -> usize { + fn nchildren(array: &Array) -> usize { 1 + array.patches().map_or(0, patches_nchildren) } - fn child(array: &ALPArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.encoded().clone(), _ => { @@ -118,7 +117,7 @@ impl VTable for ALP { } } - fn child_name(array: &ALPArray, idx: usize) -> String { + fn child_name(array: &Array, idx: usize) -> String { match idx { 0 => "encoded".to_string(), _ => { @@ -130,7 +129,7 @@ impl VTable for ALP { } } - fn metadata(array: &ALPArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { let exponents = array.exponents(); Ok(ProstMetadata(ALPMetadata { exp_e: exponents.e as u32, @@ -164,7 +163,7 @@ impl VTable for ALP { metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let encoded_ptype = match &dtype { DType::Primitive(PType::F32, n) => DType::Primitive(PType::I32, *n), DType::Primitive(PType::F64, n) => DType::Primitive(PType::I64, *n), @@ -186,7 +185,7 @@ impl VTable for ALP { }) .transpose()?; - ALPArray::try_new( + ALPData::try_new( encoded, Exponents { e: u8::try_from(metadata.exp_e)?, @@ -196,7 +195,7 @@ impl VTable for ALP { ) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { // Children: encoded, patches (if present): indices, values, chunk_offsets (optional) let patches_info = array .patches @@ -243,7 +242,7 @@ impl VTable for ALP { fn execute(array: Arc>, ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done( - execute_decompress(Arc::unwrap_or_clone(array).into_inner(), ctx)?.into_array(), + execute_decompress(Arc::unwrap_or_clone(array), ctx)?.into_array(), )) } @@ -266,7 +265,7 @@ impl VTable for ALP { } #[derive(Clone, Debug)] -pub struct ALPArray { +pub struct ALPData { encoded: ArrayRef, patches: Option, dtype: DType, @@ -291,7 +290,7 @@ pub struct ALPMetadata { pub(crate) patches: Option, } -impl ALPArray { +impl ALPData { fn validate( encoded: &ArrayRef, exponents: Exponents, @@ -363,10 +362,10 @@ impl ALPArray { } } -impl ALPArray { +impl ALPData { /// Build a new `ALPArray` from components, panicking on validation failure. /// - /// See [`ALPArray::try_new`] for reference on preconditions that must pass before + /// See [`ALPData::try_new`] for reference on preconditions that must pass before /// calling this method. pub fn new(encoded: ArrayRef, exponents: Exponents, patches: Option) -> Self { Self::try_new(encoded, exponents, patches).vortex_expect("ALPArray new") @@ -394,12 +393,12 @@ impl ALPArray { /// # Examples /// /// ``` - /// # use vortex_alp::{ALPArray, Exponents}; + /// # use vortex_alp::{ALPData, ALPArray, Exponents}; /// # use vortex_array::IntoArray; /// # use vortex_buffer::buffer; /// /// // Returns error because buffer has wrong PType. - /// let result = ALPArray::try_new( + /// let result = ALPData::try_new( /// buffer![1i8].into_array(), /// Exponents { e: 1, f: 1 }, /// None @@ -407,7 +406,7 @@ impl ALPArray { /// assert!(result.is_err()); /// /// // Returns error because Exponents are out of bounds for f32 - /// let result = ALPArray::try_new( + /// let result = ALPData::try_new( /// buffer![1i32, 2i32].into_array(), /// Exponents { e: 100, f: 100 }, /// None @@ -415,11 +414,11 @@ impl ALPArray { /// assert!(result.is_err()); /// /// // Success! - /// let value = ALPArray::try_new( + /// let value = ALPArray::try_from_data(ALPData::try_new( /// buffer![0i32].into_array(), /// Exponents { e: 1, f: 1 }, /// None - /// ).unwrap(); + /// ).unwrap()).unwrap(); /// /// assert_eq!(value.scalar_at(0).unwrap(), 0f32.into()); /// ``` @@ -447,7 +446,7 @@ impl ALPArray { /// Build a new `ALPArray` from components without validation. /// - /// See [`ALPArray::try_new`] for information about the preconditions that should be checked + /// See [`ALPData::try_new`] for information about the preconditions that should be checked /// **before** calling this method. pub(crate) unsafe fn new_unchecked( encoded: ArrayRef, @@ -463,6 +462,51 @@ impl ALPArray { stats_set: Default::default(), } } +} + +/// Constructors for [`ALPArray`]. +impl ALP { + pub fn new(encoded: ArrayRef, exponents: Exponents, patches: Option) -> ALPArray { + Array::try_from_data(ALPData::new(encoded, exponents, patches)) + .vortex_expect("ALPData is always valid") + } + + pub fn try_new( + encoded: ArrayRef, + exponents: Exponents, + patches: Option, + ) -> VortexResult { + Array::try_from_data(ALPData::try_new(encoded, exponents, patches)?) + } + + /// # Safety + /// See [`ALPData::try_new`] for preconditions. + pub unsafe fn new_unchecked( + encoded: ArrayRef, + exponents: Exponents, + patches: Option, + dtype: DType, + ) -> ALPArray { + Array::try_from_data(unsafe { ALPData::new_unchecked(encoded, exponents, patches, dtype) }) + .vortex_expect("ALPData is always valid") + } +} + +impl ALPData { + /// Returns the number of elements in the array. + pub fn len(&self) -> usize { + self.encoded.len() + } + + /// Returns `true` if the array contains no elements. + pub fn is_empty(&self) -> bool { + self.encoded.len() == 0 + } + + /// Returns the logical data type of the array. + pub fn dtype(&self) -> &DType { + &self.dtype + } pub fn ptype(&self) -> PType { self.dtype.as_ptype() @@ -489,7 +533,7 @@ impl ALPArray { } impl ValidityChild for ALP { - fn validity_child(array: &ALPArray) -> &ArrayRef { + fn validity_child(array: &ALPData) -> &ArrayRef { array.encoded() } } @@ -508,7 +552,6 @@ mod tests { use vortex_array::arrays::PrimitiveArray; use vortex_array::assert_arrays_eq; use vortex_array::session::ArraySession; - use vortex_array::vtable::ValidityHelper; use vortex_session::VortexSession; use super::*; @@ -809,11 +852,12 @@ mod tests { .unwrap(); // Build a new ALPArray with the same encoded data but patches without chunk_offsets. - let alp_without_chunk_offsets = ALPArray::new( + let alp_without_chunk_offsets = ALPArray::try_from_data(ALPData::new( normally_encoded.encoded().clone(), normally_encoded.exponents(), Some(patches_without_chunk_offsets), - ); + )) + .vortex_expect("ALPData is always valid"); // The legacy decompress_into_array path should work correctly. let result_legacy = decompress_into_array( diff --git a/encodings/alp/src/alp/compress.rs b/encodings/alp/src/alp/compress.rs index 3759f354a22..cdd08f2ec05 100644 --- a/encodings/alp/src/alp/compress.rs +++ b/encodings/alp/src/alp/compress.rs @@ -8,13 +8,13 @@ use vortex_array::arrays::PrimitiveArray; use vortex_array::dtype::PType; use vortex_array::patches::Patches; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::Buffer; use vortex_buffer::BufferMut; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_mask::Mask; +use crate::ALP; use crate::Exponents; use crate::alp::ALPArray; use crate::alp::ALPFloat; @@ -48,7 +48,7 @@ pub fn alp_encode(parray: &PrimitiveArray, exponents: Option) -> Vort // SAFETY: alp_encode_components_typed must return well-formed components unsafe { - Ok(ALPArray::new_unchecked( + Ok(ALP::new_unchecked( encoded, exponents, patches, diff --git a/encodings/alp/src/alp/compute/cast.rs b/encodings/alp/src/alp/compute/cast.rs index 813f195c3b8..8a14520823d 100644 --- a/encodings/alp/src/alp/compute/cast.rs +++ b/encodings/alp/src/alp/compute/cast.rs @@ -45,13 +45,8 @@ impl CastReduce for ALP { // SAFETY: casting nullability doesn't alter the invariants unsafe { Ok(Some( - ALPArray::new_unchecked( - new_encoded, - array.exponents(), - new_patches, - dtype.clone(), - ) - .into_array(), + ALP::new_unchecked(new_encoded, array.exponents(), new_patches, dtype.clone()) + .into_array(), )) } } else { diff --git a/encodings/alp/src/alp/compute/filter.rs b/encodings/alp/src/alp/compute/filter.rs index cfe00c2e1ae..f14c7a6cfaf 100644 --- a/encodings/alp/src/alp/compute/filter.rs +++ b/encodings/alp/src/alp/compute/filter.rs @@ -26,7 +26,7 @@ impl FilterKernel for ALP { // SAFETY: filtering the values does not change correctness unsafe { Ok(Some( - ALPArray::new_unchecked( + ALP::new_unchecked( array.encoded().filter(mask.clone())?, array.exponents(), patches, diff --git a/encodings/alp/src/alp/compute/mask.rs b/encodings/alp/src/alp/compute/mask.rs index d4f63475c9e..d5b3ebeb745 100644 --- a/encodings/alp/src/alp/compute/mask.rs +++ b/encodings/alp/src/alp/compute/mask.rs @@ -21,7 +21,7 @@ impl MaskReduce for ALP { } let masked_encoded = array.encoded().clone().mask(mask.clone())?; Ok(Some( - ALPArray::new(masked_encoded, array.exponents(), None).into_array(), + ALP::new(masked_encoded, array.exponents(), None).into_array(), )) } } @@ -40,7 +40,7 @@ impl MaskKernel for ALP { .transpose()? .flatten(); Ok(Some( - ALPArray::new(masked_encoded, array.exponents(), masked_patches).into_array(), + ALP::new(masked_encoded, array.exponents(), masked_patches).into_array(), )) } } diff --git a/encodings/alp/src/alp/compute/slice.rs b/encodings/alp/src/alp/compute/slice.rs index f7e2a7bdfde..2b85ac0535e 100644 --- a/encodings/alp/src/alp/compute/slice.rs +++ b/encodings/alp/src/alp/compute/slice.rs @@ -7,18 +7,18 @@ use vortex_array::ArrayRef; use vortex_array::ExecutionCtx; use vortex_array::IntoArray; use vortex_array::arrays::slice::SliceKernel; +use vortex_array::vtable::Array; use vortex_error::VortexResult; use crate::ALP; -use crate::ALPArray; impl SliceKernel for ALP { fn slice( - array: &Self::Array, + array: &Array, range: Range, _ctx: &mut ExecutionCtx, ) -> VortexResult> { - let sliced_alp = ALPArray::new( + let sliced_alp = ALP::new( array.encoded().slice(range.clone())?, array.exponents(), array diff --git a/encodings/alp/src/alp/compute/take.rs b/encodings/alp/src/alp/compute/take.rs index 15d32a5acc0..d58b60c7fb5 100644 --- a/encodings/alp/src/alp/compute/take.rs +++ b/encodings/alp/src/alp/compute/take.rs @@ -32,7 +32,7 @@ impl TakeExecute for ALP { }) .transpose()?; Ok(Some( - ALPArray::new(taken_encoded, array.exponents(), taken_patches).into_array(), + ALP::new(taken_encoded, array.exponents(), taken_patches).into_array(), )) } } diff --git a/encodings/alp/src/alp/decompress.rs b/encodings/alp/src/alp/decompress.rs index d2a921dfaed..e64bde6206f 100644 --- a/encodings/alp/src/alp/decompress.rs +++ b/encodings/alp/src/alp/decompress.rs @@ -10,7 +10,6 @@ use vortex_array::arrays::primitive::patch_chunk; use vortex_array::dtype::DType; use vortex_array::match_each_unsigned_integer_ptype; use vortex_array::patches::Patches; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::BufferMut; use vortex_error::VortexResult; @@ -28,7 +27,7 @@ pub fn decompress_into_array( array: ALPArray, ctx: &mut ExecutionCtx, ) -> VortexResult { - let (encoded, exponents, patches, dtype) = array.into_parts(); + let (encoded, exponents, patches, dtype) = array.into_data().into_parts(); if let Some(ref patches) = patches && let Some(chunk_offsets) = patches.chunk_offsets() { @@ -60,7 +59,7 @@ pub fn decompress_into_array( /// /// A `PrimitiveArray` containing the decompressed floating-point values with all patches applied. pub fn execute_decompress(array: ALPArray, ctx: &mut ExecutionCtx) -> VortexResult { - let (encoded, exponents, patches, dtype) = array.into_parts(); + let (encoded, exponents, patches, dtype) = array.into_data().into_parts(); if let Some(ref patches) = patches && let Some(chunk_offsets) = patches.chunk_offsets() { diff --git a/encodings/alp/src/alp/ops.rs b/encodings/alp/src/alp/ops.rs index 2877e2cb264..cd637232112 100644 --- a/encodings/alp/src/alp/ops.rs +++ b/encodings/alp/src/alp/ops.rs @@ -3,17 +3,21 @@ use vortex_array::ExecutionCtx; use vortex_array::scalar::Scalar; +use vortex_array::vtable::Array; use vortex_array::vtable::OperationsVTable; use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::ALP; -use crate::ALPArray; use crate::ALPFloat; use crate::match_each_alp_float_ptype; impl OperationsVTable for ALP { - fn scalar_at(array: &ALPArray, index: usize, _ctx: &mut ExecutionCtx) -> VortexResult { + fn scalar_at( + array: &Array, + index: usize, + _ctx: &mut ExecutionCtx, + ) -> VortexResult { if let Some(patches) = array.patches() && let Some(patch) = patches.get_patched(index)? { diff --git a/encodings/alp/src/alp_rd/array.rs b/encodings/alp/src/alp_rd/array.rs index bc5bcde0a5b..a27ded9ce42 100644 --- a/encodings/alp/src/alp_rd/array.rs +++ b/encodings/alp/src/alp_rd/array.rs @@ -28,7 +28,6 @@ use vortex_array::patches::PatchesMetadata; use vortex_array::require_child; use vortex_array::serde::ArrayChildren; use vortex_array::stats::ArrayStats; -use vortex_array::stats::StatsSetRef; use vortex_array::validity::Validity; use vortex_array::vtable; use vortex_array::vtable::Array; @@ -52,7 +51,7 @@ use crate::alp_rd::kernel::PARENT_KERNELS; use crate::alp_rd::rules::RULES; use crate::alp_rd_decode; -vtable!(ALPRD); +vtable!(ALPRD, ALPRD, ALPRDData); #[derive(Clone, prost::Message)] pub struct ALPRDMetadata { @@ -69,13 +68,13 @@ pub struct ALPRDMetadata { } impl VTable for ALPRD { - type Array = ALPRDArray; + type ArrayData = ALPRDData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromChild; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &ALPRD } @@ -83,19 +82,19 @@ impl VTable for ALPRD { Self::ID } - fn len(array: &ALPRDArray) -> usize { + fn len(array: &ALPRDData) -> usize { array.left_parts.len() } - fn dtype(array: &ALPRDArray) -> &DType { + fn dtype(array: &ALPRDData) -> &DType { &array.dtype } - fn stats(array: &ALPRDArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &ALPRDData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &ALPRDArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.left_parts.array_hash(state, precision); array.left_parts_dictionary.array_hash(state, precision); @@ -104,7 +103,7 @@ impl VTable for ALPRD { array.left_parts_patches.array_hash(state, precision); } - fn array_eq(array: &ALPRDArray, other: &ALPRDArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.left_parts.array_eq(&other.left_parts, precision) && array @@ -117,23 +116,23 @@ impl VTable for ALPRD { .array_eq(&other.left_parts_patches, precision) } - fn nbuffers(_array: &ALPRDArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &ALPRDArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("ALPRDArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &ALPRDArray, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(array: &ALPRDArray) -> usize { + fn nchildren(array: &Array) -> usize { 2 + array.left_parts_patches().map_or(0, patches_nchildren) } - fn child(array: &ALPRDArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.left_parts().clone(), 1 => array.right_parts().clone(), @@ -146,7 +145,7 @@ impl VTable for ALPRD { } } - fn child_name(array: &ALPRDArray, idx: usize) -> String { + fn child_name(array: &Array, idx: usize) -> String { match idx { 0 => "left_parts".to_string(), 1 => "right_parts".to_string(), @@ -159,7 +158,7 @@ impl VTable for ALPRD { } } - fn metadata(array: &ALPRDArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { let dict = array .left_parts_dictionary() .iter() @@ -200,7 +199,7 @@ impl VTable for ALPRD { metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { if children.len() < 2 { vortex_bail!( "Expected at least 2 children for ALPRD encoding, found {}", @@ -248,7 +247,7 @@ impl VTable for ALPRD { }) .transpose()?; - ALPRDArray::try_new( + ALPRDData::try_new( dtype.clone(), left_parts, left_parts_dictionary, @@ -263,7 +262,7 @@ impl VTable for ALPRD { ) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { // Children: left_parts, right_parts, patches (if present): indices, values let patches_info = array .left_parts_patches @@ -316,7 +315,7 @@ impl VTable for ALPRD { left_parts_patches, dtype, .. - } = Arc::unwrap_or_clone(array).into_inner().into_parts(); + } = Arc::unwrap_or_clone(array).into_data().into_parts(); let ptype = dtype.as_ptype(); let left_parts = left_parts @@ -381,7 +380,7 @@ impl VTable for ALPRD { } #[derive(Clone, Debug)] -pub struct ALPRDArray { +pub struct ALPRDData { dtype: DType, left_parts: ArrayRef, left_parts_patches: Option, @@ -405,9 +404,50 @@ pub struct ALPRD; impl ALPRD { pub const ID: ArrayId = ArrayId::new_ref("vortex.alprd"); + + pub fn try_new( + dtype: DType, + left_parts: ArrayRef, + left_parts_dictionary: Buffer, + right_parts: ArrayRef, + right_bit_width: u8, + left_parts_patches: Option, + ) -> VortexResult { + Array::try_from_data(ALPRDData::try_new( + dtype, + left_parts, + left_parts_dictionary, + right_parts, + right_bit_width, + left_parts_patches, + )?) + } + + /// # Safety + /// See [`ALPRDData::try_new`] for preconditions. + pub unsafe fn new_unchecked( + dtype: DType, + left_parts: ArrayRef, + left_parts_dictionary: Buffer, + right_parts: ArrayRef, + right_bit_width: u8, + left_parts_patches: Option, + ) -> ALPRDArray { + Array::try_from_data(unsafe { + ALPRDData::new_unchecked( + dtype, + left_parts, + left_parts_dictionary, + right_parts, + right_bit_width, + left_parts_patches, + ) + }) + .vortex_expect("ALPRDData is always valid") + } } -impl ALPRDArray { +impl ALPRDData { /// Build a new `ALPRDArray` from components. pub fn try_new( dtype: DType, @@ -505,6 +545,21 @@ impl ALPRDArray { } } + /// Returns the number of elements in the array. + pub fn len(&self) -> usize { + self.left_parts.len() + } + + /// Returns `true` if the array contains no elements. + pub fn is_empty(&self) -> bool { + self.left_parts.len() == 0 + } + + /// Returns the logical data type of the array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + /// Returns true if logical type of the array values is f32. /// /// Returns false if the logical type of the array values is f64. @@ -548,7 +603,7 @@ impl ALPRDArray { } impl ValidityChild for ALPRD { - fn validity_child(array: &ALPRDArray) -> &ArrayRef { + fn validity_child(array: &ALPRDData) -> &ArrayRef { array.left_parts() } } diff --git a/encodings/alp/src/alp_rd/compute/cast.rs b/encodings/alp/src/alp_rd/compute/cast.rs index 9a2b4d73ec2..41048193e79 100644 --- a/encodings/alp/src/alp_rd/compute/cast.rs +++ b/encodings/alp/src/alp_rd/compute/cast.rs @@ -28,7 +28,7 @@ impl CastReduce for ALPRD { )?; return Ok(Some( - ALPRDArray::try_new( + ALPRD::try_new( dtype.clone(), new_left_parts, array.left_parts_dictionary().clone(), diff --git a/encodings/alp/src/alp_rd/compute/filter.rs b/encodings/alp/src/alp_rd/compute/filter.rs index f45740c9b4e..8b8ef7c9a97 100644 --- a/encodings/alp/src/alp_rd/compute/filter.rs +++ b/encodings/alp/src/alp_rd/compute/filter.rs @@ -24,7 +24,7 @@ impl FilterKernel for ALPRD { .flatten(); Ok(Some( - ALPRDArray::try_new( + ALPRD::try_new( array.dtype().clone(), array.left_parts().filter(mask.clone())?, array.left_parts_dictionary().clone(), diff --git a/encodings/alp/src/alp_rd/compute/mask.rs b/encodings/alp/src/alp_rd/compute/mask.rs index 4a6ad8a7b6a..ff36de3e24f 100644 --- a/encodings/alp/src/alp_rd/compute/mask.rs +++ b/encodings/alp/src/alp_rd/compute/mask.rs @@ -20,7 +20,7 @@ impl MaskReduce for ALPRD { [array.left_parts().clone(), mask.clone()], )?; Ok(Some( - ALPRDArray::try_new( + ALPRD::try_new( array.dtype().as_nullable(), masked_left_parts, array.left_parts_dictionary().clone(), diff --git a/encodings/alp/src/alp_rd/compute/take.rs b/encodings/alp/src/alp_rd/compute/take.rs index a7b8a85ece8..3df7b4af012 100644 --- a/encodings/alp/src/alp_rd/compute/take.rs +++ b/encodings/alp/src/alp_rd/compute/take.rs @@ -39,7 +39,7 @@ impl TakeExecute for ALPRD { .fill_null(Scalar::zero_value(array.right_parts().dtype()))?; Ok(Some( - ALPRDArray::try_new( + ALPRD::try_new( array .dtype() .with_nullability(taken_left_parts.dtype().nullability()), diff --git a/encodings/alp/src/alp_rd/mod.rs b/encodings/alp/src/alp_rd/mod.rs index 7521ff15b7c..c089cca7556 100644 --- a/encodings/alp/src/alp_rd/mod.rs +++ b/encodings/alp/src/alp_rd/mod.rs @@ -30,7 +30,6 @@ use vortex_array::arrays::PrimitiveArray; use vortex_array::dtype::DType; use vortex_array::dtype::NativePType; use vortex_array::match_each_integer_ptype; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::Buffer; use vortex_buffer::BufferMut; use vortex_error::VortexExpect; @@ -273,7 +272,7 @@ impl RDEncoder { .vortex_expect("Patches construction in encode") }); - ALPRDArray::try_new( + ALPRD::try_new( DType::Primitive(T::PTYPE, packed_left.dtype().nullability()), packed_left, Buffer::::copy_from(&self.codes), diff --git a/encodings/alp/src/alp_rd/ops.rs b/encodings/alp/src/alp_rd/ops.rs index e27434a7979..c906216cd44 100644 --- a/encodings/alp/src/alp_rd/ops.rs +++ b/encodings/alp/src/alp_rd/ops.rs @@ -4,16 +4,16 @@ use vortex_array::DynArray; use vortex_array::ExecutionCtx; use vortex_array::scalar::Scalar; +use vortex_array::vtable::Array; use vortex_array::vtable::OperationsVTable; use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::ALPRD; -use crate::ALPRDArray; impl OperationsVTable for ALPRD { fn scalar_at( - array: &ALPRDArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { diff --git a/encodings/alp/src/alp_rd/slice.rs b/encodings/alp/src/alp_rd/slice.rs index be6fc803be3..4d12a74dc7d 100644 --- a/encodings/alp/src/alp_rd/slice.rs +++ b/encodings/alp/src/alp_rd/slice.rs @@ -7,14 +7,14 @@ use vortex_array::ArrayRef; use vortex_array::ExecutionCtx; use vortex_array::IntoArray; use vortex_array::arrays::slice::SliceKernel; +use vortex_array::vtable::Array; use vortex_error::VortexResult; use crate::alp_rd::ALPRD; -use crate::alp_rd::ALPRDArray; impl SliceKernel for ALPRD { fn slice( - array: &Self::Array, + array: &Array, range: Range, _ctx: &mut ExecutionCtx, ) -> VortexResult> { @@ -26,7 +26,7 @@ impl SliceKernel for ALPRD { // SAFETY: slicing components does not change the encoded values Ok(Some(unsafe { - ALPRDArray::new_unchecked( + ALPRD::new_unchecked( array.dtype().clone(), array.left_parts().slice(range.clone())?, array.left_parts_dictionary().clone(), diff --git a/encodings/bytebool/Cargo.toml b/encodings/bytebool/Cargo.toml index 53197452ff5..bca2ed71aa9 100644 --- a/encodings/bytebool/Cargo.toml +++ b/encodings/bytebool/Cargo.toml @@ -21,6 +21,7 @@ num-traits = { workspace = true } vortex-array = { workspace = true } vortex-buffer = { workspace = true } vortex-error = { workspace = true } +vortex-mask = { workspace = true } vortex-session = { workspace = true } [dev-dependencies] diff --git a/encodings/bytebool/public-api.lock b/encodings/bytebool/public-api.lock index 287d87047ab..ddcb3c594d1 100644 --- a/encodings/bytebool/public-api.lock +++ b/encodings/bytebool/public-api.lock @@ -6,6 +6,8 @@ impl vortex_bytebool::ByteBool pub const vortex_bytebool::ByteBool::ID: vortex_array::vtable::dyn_::ArrayId +pub fn vortex_bytebool::ByteBool::from_vec>(data: alloc::vec::Vec, validity: V) -> vortex_bytebool::ByteBoolArray + impl core::clone::Clone for vortex_bytebool::ByteBool pub fn vortex_bytebool::ByteBool::clone(&self) -> vortex_bytebool::ByteBool @@ -32,7 +34,7 @@ pub fn vortex_bytebool::ByteBool::mask(array: &vortex_bytebool::ByteBoolArray, m impl vortex_array::vtable::VTable for vortex_bytebool::ByteBool -pub type vortex_bytebool::ByteBool::Array = vortex_bytebool::ByteBoolArray +pub type vortex_bytebool::ByteBool::ArrayData = vortex_bytebool::ByteBoolData pub type vortex_bytebool::ByteBool::Metadata = vortex_array::metadata::EmptyMetadata @@ -40,23 +42,23 @@ pub type vortex_bytebool::ByteBool::OperationsVTable = vortex_bytebool::ByteBool pub type vortex_bytebool::ByteBool::ValidityVTable = vortex_array::vtable::validity::ValidityVTableFromValidityHelper -pub fn vortex_bytebool::ByteBool::array_eq(array: &vortex_bytebool::ByteBoolArray, other: &vortex_bytebool::ByteBoolArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_bytebool::ByteBool::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_bytebool::ByteBool::array_hash(array: &vortex_bytebool::ByteBoolArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_bytebool::ByteBool::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_bytebool::ByteBool::buffer(array: &vortex_bytebool::ByteBoolArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_bytebool::ByteBool::buffer(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_bytebool::ByteBool::buffer_name(_array: &vortex_bytebool::ByteBoolArray, idx: usize) -> core::option::Option +pub fn vortex_bytebool::ByteBool::buffer_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> core::option::Option -pub fn vortex_bytebool::ByteBool::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_bytebool::ByteBool::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_bytebool::ByteBool::child(array: &vortex_bytebool::ByteBoolArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_bytebool::ByteBool::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_bytebool::ByteBool::child_name(_array: &vortex_bytebool::ByteBoolArray, idx: usize) -> alloc::string::String +pub fn vortex_bytebool::ByteBool::child_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_bytebool::ByteBool::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_bytebool::ByteBool::dtype(array: &vortex_bytebool::ByteBoolArray) -> &vortex_array::dtype::DType +pub fn vortex_bytebool::ByteBool::dtype(array: &vortex_bytebool::ByteBoolData) -> &vortex_array::dtype::DType pub fn vortex_bytebool::ByteBool::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -64,78 +66,74 @@ pub fn vortex_bytebool::ByteBool::execute_parent(array: &vortex_array::vtable::t pub fn vortex_bytebool::ByteBool::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_bytebool::ByteBool::len(array: &vortex_bytebool::ByteBoolArray) -> usize +pub fn vortex_bytebool::ByteBool::len(array: &vortex_bytebool::ByteBoolData) -> usize -pub fn vortex_bytebool::ByteBool::metadata(_array: &vortex_bytebool::ByteBoolArray) -> vortex_error::VortexResult +pub fn vortex_bytebool::ByteBool::metadata(_array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_bytebool::ByteBool::nbuffers(_array: &vortex_bytebool::ByteBoolArray) -> usize +pub fn vortex_bytebool::ByteBool::nbuffers(_array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_bytebool::ByteBool::nchildren(array: &vortex_bytebool::ByteBoolArray) -> usize +pub fn vortex_bytebool::ByteBool::nchildren(array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_bytebool::ByteBool::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_bytebool::ByteBool::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_bytebool::ByteBool::stats(array: &vortex_bytebool::ByteBoolArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_bytebool::ByteBool::stats(array: &vortex_bytebool::ByteBoolData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_bytebool::ByteBool::vtable(_array: &Self::Array) -> &Self +pub fn vortex_bytebool::ByteBool::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_bytebool::ByteBool::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_bytebool::ByteBool::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_bytebool::ByteBool -pub fn vortex_bytebool::ByteBool::scalar_at(array: &vortex_bytebool::ByteBoolArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult - -pub struct vortex_bytebool::ByteBoolArray - -impl vortex_bytebool::ByteBoolArray +pub fn vortex_bytebool::ByteBool::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_bytebool::ByteBoolArray::as_slice(&self) -> &[bool] +pub struct vortex_bytebool::ByteBoolData -pub fn vortex_bytebool::ByteBoolArray::buffer(&self) -> &vortex_array::buffer::BufferHandle +impl vortex_bytebool::ByteBoolData -pub fn vortex_bytebool::ByteBoolArray::from_vec>(data: alloc::vec::Vec, validity: V) -> Self +pub fn vortex_bytebool::ByteBoolData::as_slice(&self) -> &[bool] -pub fn vortex_bytebool::ByteBoolArray::new(buffer: vortex_array::buffer::BufferHandle, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_bytebool::ByteBoolData::buffer(&self) -> &vortex_array::buffer::BufferHandle -impl vortex_bytebool::ByteBoolArray +pub fn vortex_bytebool::ByteBoolData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_bytebool::ByteBoolArray::to_array(&self) -> vortex_array::array::ArrayRef +pub fn vortex_bytebool::ByteBoolData::from_vec>(data: alloc::vec::Vec, validity: V) -> Self -impl core::clone::Clone for vortex_bytebool::ByteBoolArray +pub fn vortex_bytebool::ByteBoolData::is_empty(&self) -> bool -pub fn vortex_bytebool::ByteBoolArray::clone(&self) -> vortex_bytebool::ByteBoolArray +pub fn vortex_bytebool::ByteBoolData::len(&self) -> usize -impl core::convert::AsRef for vortex_bytebool::ByteBoolArray +pub fn vortex_bytebool::ByteBoolData::new(buffer: vortex_array::buffer::BufferHandle, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_bytebool::ByteBoolArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +pub fn vortex_bytebool::ByteBoolData::validity_mask(&self) -> vortex_mask::Mask -impl core::convert::From> for vortex_bytebool::ByteBoolArray +impl core::clone::Clone for vortex_bytebool::ByteBoolData -pub fn vortex_bytebool::ByteBoolArray::from(value: alloc::vec::Vec) -> Self +pub fn vortex_bytebool::ByteBoolData::clone(&self) -> vortex_bytebool::ByteBoolData -impl core::convert::From>> for vortex_bytebool::ByteBoolArray +impl core::convert::From> for vortex_bytebool::ByteBoolData -pub fn vortex_bytebool::ByteBoolArray::from(value: alloc::vec::Vec>) -> Self +pub fn vortex_bytebool::ByteBoolData::from(value: alloc::vec::Vec) -> Self -impl core::convert::From for vortex_array::array::ArrayRef +impl core::convert::From>> for vortex_bytebool::ByteBoolData -pub fn vortex_array::array::ArrayRef::from(value: vortex_bytebool::ByteBoolArray) -> vortex_array::array::ArrayRef +pub fn vortex_bytebool::ByteBoolData::from(value: alloc::vec::Vec>) -> Self -impl core::fmt::Debug for vortex_bytebool::ByteBoolArray +impl core::convert::From for vortex_array::array::ArrayRef -pub fn vortex_bytebool::ByteBoolArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::array::ArrayRef::from(value: vortex_bytebool::ByteBoolData) -> vortex_array::array::ArrayRef -impl core::ops::deref::Deref for vortex_bytebool::ByteBoolArray +impl core::fmt::Debug for vortex_bytebool::ByteBoolData -pub type vortex_bytebool::ByteBoolArray::Target = dyn vortex_array::array::DynArray +pub fn vortex_bytebool::ByteBoolData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_bytebool::ByteBoolArray::deref(&self) -> &Self::Target +impl vortex_array::array::IntoArray for vortex_bytebool::ByteBoolData -impl vortex_array::array::IntoArray for vortex_bytebool::ByteBoolArray +pub fn vortex_bytebool::ByteBoolData::into_array(self) -> vortex_array::array::ArrayRef -pub fn vortex_bytebool::ByteBoolArray::into_array(self) -> vortex_array::array::ArrayRef +impl vortex_array::vtable::validity::ValidityHelper for vortex_bytebool::ByteBoolData -impl vortex_array::vtable::validity::ValidityHelper for vortex_bytebool::ByteBoolArray +pub fn vortex_bytebool::ByteBoolData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_bytebool::ByteBoolArray::validity(&self) -> &vortex_array::validity::Validity +pub type vortex_bytebool::ByteBoolArray = vortex_array::vtable::typed::Array diff --git a/encodings/bytebool/src/array.rs b/encodings/bytebool/src/array.rs index 93d55e6513a..eb797b2a970 100644 --- a/encodings/bytebool/src/array.rs +++ b/encodings/bytebool/src/array.rs @@ -19,7 +19,6 @@ use vortex_array::dtype::DType; use vortex_array::scalar::Scalar; use vortex_array::serde::ArrayChildren; use vortex_array::stats::ArrayStats; -use vortex_array::stats::StatsSetRef; use vortex_array::validity::Validity; use vortex_array::vtable; use vortex_array::vtable::Array; @@ -37,20 +36,21 @@ use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure; use vortex_error::vortex_panic; +use vortex_mask::Mask; use vortex_session::VortexSession; use crate::kernel::PARENT_KERNELS; -vtable!(ByteBool); +vtable!(ByteBool, ByteBool, ByteBoolData); impl VTable for ByteBool { - type Array = ByteBoolArray; + type ArrayData = ByteBoolData; type Metadata = EmptyMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValidityHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &ByteBool } @@ -58,57 +58,53 @@ impl VTable for ByteBool { Self::ID } - fn len(array: &ByteBoolArray) -> usize { + fn len(array: &ByteBoolData) -> usize { array.buffer.len() } - fn dtype(array: &ByteBoolArray) -> &DType { + fn dtype(array: &ByteBoolData) -> &DType { &array.dtype } - fn stats(array: &ByteBoolArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &ByteBoolData) -> &ArrayStats { + &array.stats_set } - fn array_hash( - array: &ByteBoolArray, - state: &mut H, - precision: Precision, - ) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.buffer.array_hash(state, precision); array.validity.array_hash(state, precision); } - fn array_eq(array: &ByteBoolArray, other: &ByteBoolArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.buffer.array_eq(&other.buffer, precision) && array.validity.array_eq(&other.validity, precision) } - fn nbuffers(_array: &ByteBoolArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 1 } - fn buffer(array: &ByteBoolArray, idx: usize) -> BufferHandle { + fn buffer(array: &Array, idx: usize) -> BufferHandle { match idx { 0 => array.buffer().clone(), _ => vortex_panic!("ByteBoolArray buffer index {idx} out of bounds"), } } - fn buffer_name(_array: &ByteBoolArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { match idx { 0 => Some("values".to_string()), _ => vortex_panic!("ByteBoolArray buffer_name index {idx} out of bounds"), } } - fn nchildren(array: &ByteBoolArray) -> usize { + fn nchildren(array: &Array) -> usize { validity_nchildren(array.validity()) } - fn child(array: &ByteBoolArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => validity_to_child(array.validity(), array.len()) .vortex_expect("ByteBoolArray validity child out of bounds"), @@ -116,14 +112,14 @@ impl VTable for ByteBool { } } - fn child_name(_array: &ByteBoolArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "validity".to_string(), _ => vortex_panic!("ByteBoolArray child_name index {idx} out of bounds"), } } - fn metadata(_array: &ByteBoolArray) -> VortexResult { + fn metadata(_array: &Array) -> VortexResult { Ok(EmptyMetadata) } @@ -147,7 +143,7 @@ impl VTable for ByteBool { _metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let validity = if children.is_empty() { Validity::from(dtype.nullability()) } else if children.len() == 1 { @@ -162,10 +158,10 @@ impl VTable for ByteBool { } let buffer = buffers[0].clone(); - Ok(ByteBoolArray::new(buffer, validity)) + Ok(ByteBoolData::new(buffer, validity)) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() <= 1, "ByteBoolArray expects at most 1 child (validity), got {}", @@ -208,7 +204,7 @@ impl VTable for ByteBool { } #[derive(Clone, Debug)] -pub struct ByteBoolArray { +pub struct ByteBoolData { dtype: DType, buffer: BufferHandle, validity: Validity, @@ -220,9 +216,15 @@ pub struct ByteBool; impl ByteBool { pub const ID: ArrayId = ArrayId::new_ref("vortex.bytebool"); + + /// Construct a [`ByteBoolArray`] from a `Vec` and validity. + pub fn from_vec>(data: Vec, validity: V) -> ByteBoolArray { + Array::try_from_data(ByteBoolData::from_vec(data, validity)) + .vortex_expect("ByteBoolData is always valid") + } } -impl ByteBoolArray { +impl ByteBoolData { pub fn new(buffer: BufferHandle, validity: Validity) -> Self { let length = buffer.len(); if let Some(vlen) = validity.maybe_len() @@ -242,6 +244,26 @@ impl ByteBoolArray { } } + /// Returns the number of elements in the array. + pub fn len(&self) -> usize { + self.buffer.len() + } + + /// Returns `true` if the array contains no elements. + pub fn is_empty(&self) -> bool { + self.buffer.len() == 0 + } + + /// Returns the logical data type of the array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns the validity mask for this array. + pub fn validity_mask(&self) -> Mask { + self.validity.to_mask(self.len()) + } + // TODO(ngates): deprecate construction from vec pub fn from_vec>(data: Vec, validity: V) -> Self { let validity = validity.into(); @@ -260,7 +282,7 @@ impl ByteBoolArray { } } -impl ValidityHelper for ByteBoolArray { +impl ValidityHelper for ByteBoolData { fn validity(&self) -> &Validity { &self.validity } @@ -268,7 +290,7 @@ impl ValidityHelper for ByteBoolArray { impl OperationsVTable for ByteBool { fn scalar_at( - array: &ByteBoolArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -279,13 +301,13 @@ impl OperationsVTable for ByteBool { } } -impl From> for ByteBoolArray { +impl From> for ByteBoolData { fn from(value: Vec) -> Self { Self::from_vec(value, Validity::AllValid) } } -impl From>> for ByteBoolArray { +impl From>> for ByteBoolData { fn from(value: Vec>) -> Self { let validity = Validity::from_iter(value.iter().map(|v| v.is_some())); @@ -305,7 +327,8 @@ mod tests { let v = vec![true, false]; let v_len = v.len(); - let arr = ByteBoolArray::from(v); + let arr = ByteBoolArray::try_from_data(ByteBoolData::from(v)) + .vortex_expect("ByteBoolData is always valid"); assert_eq!(v_len, arr.len()); for idx in 0..arr.len() { @@ -313,7 +336,8 @@ mod tests { } let v = vec![Some(true), None, Some(false)]; - let arr = ByteBoolArray::from(v); + let arr = ByteBoolArray::try_from_data(ByteBoolData::from(v)) + .vortex_expect("ByteBoolData is always valid"); assert!(arr.is_valid(0).unwrap()); assert!(!arr.is_valid(1).unwrap()); assert!(arr.is_valid(2).unwrap()); @@ -322,7 +346,8 @@ mod tests { let v: Vec> = vec![None, None]; let v_len = v.len(); - let arr = ByteBoolArray::from(v); + let arr = ByteBoolArray::try_from_data(ByteBoolData::from(v)) + .vortex_expect("ByteBoolData is always valid"); assert_eq!(v_len, arr.len()); for idx in 0..arr.len() { diff --git a/encodings/bytebool/src/compute.rs b/encodings/bytebool/src/compute.rs index b0583961638..4d1ed73a849 100644 --- a/encodings/bytebool/src/compute.rs +++ b/encodings/bytebool/src/compute.rs @@ -12,11 +12,11 @@ use vortex_array::match_each_integer_ptype; use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_array::scalar_fn::fns::mask::MaskReduce; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_error::VortexResult; use super::ByteBool; use super::ByteBoolArray; +use super::ByteBoolData; impl CastReduce for ByteBool { fn cast(array: &ByteBoolArray, dtype: &DType) -> VortexResult> { @@ -32,7 +32,7 @@ impl CastReduce for ByteBool { .cast_nullability(dtype.nullability(), array.len())?; return Ok(Some( - ByteBoolArray::new(array.buffer().clone(), new_validity).into_array(), + ByteBoolData::new(array.buffer().clone(), new_validity).into_array(), )); } @@ -44,7 +44,7 @@ impl CastReduce for ByteBool { impl MaskReduce for ByteBool { fn mask(array: &ByteBoolArray, mask: &ArrayRef) -> VortexResult> { Ok(Some( - ByteBoolArray::new( + ByteBoolData::new( array.buffer().clone(), array .validity() @@ -80,7 +80,7 @@ impl TakeExecute for ByteBool { }); Ok(Some( - ByteBoolArray::from_vec(taken_bools, validity).into_array(), + ByteBoolData::from_vec(taken_bools, validity).into_array(), )) } } @@ -98,97 +98,101 @@ mod tests { use vortex_array::dtype::DType; use vortex_array::dtype::Nullability; use vortex_array::scalar_fn::fns::operators::Operator; + use vortex_error::VortexExpect; use super::*; + fn bb(v: Vec) -> ByteBoolArray { + ByteBoolArray::try_from_data(ByteBoolData::from(v)) + .vortex_expect("ByteBoolData is always valid") + } + + fn bb_opt(v: Vec>) -> ByteBoolArray { + ByteBoolArray::try_from_data(ByteBoolData::from(v)) + .vortex_expect("ByteBoolData is always valid") + } + #[test] fn test_slice() { let original = vec![Some(true), Some(true), None, Some(false), None]; - let vortex_arr = ByteBoolArray::from(original); + let vortex_arr = bb_opt(original); let sliced_arr = vortex_arr.slice(1..4).unwrap(); - let expected = ByteBoolArray::from(vec![Some(true), None, Some(false)]); + let expected = bb_opt(vec![Some(true), None, Some(false)]); assert_arrays_eq!(sliced_arr, expected.into_array()); } #[test] fn test_compare_all_equal() { - let lhs = ByteBoolArray::from(vec![true; 5]); - let rhs = ByteBoolArray::from(vec![true; 5]); + let lhs = bb(vec![true; 5]); + let rhs = bb(vec![true; 5]); let arr = lhs .into_array() .binary(rhs.into_array(), Operator::Eq) .unwrap(); - let expected = ByteBoolArray::from(vec![true; 5]); + let expected = bb(vec![true; 5]); assert_arrays_eq!(arr, expected.into_array()); } #[test] fn test_compare_all_different() { - let lhs = ByteBoolArray::from(vec![false; 5]); - let rhs = ByteBoolArray::from(vec![true; 5]); + let lhs = bb(vec![false; 5]); + let rhs = bb(vec![true; 5]); let arr = lhs .into_array() .binary(rhs.into_array(), Operator::Eq) .unwrap(); - let expected = ByteBoolArray::from(vec![false; 5]); + let expected = bb(vec![false; 5]); assert_arrays_eq!(arr, expected.into_array()); } #[test] fn test_compare_with_nulls() { - let lhs = ByteBoolArray::from(vec![true; 5]); - let rhs = ByteBoolArray::from(vec![Some(true), Some(true), Some(true), Some(false), None]); + let lhs = bb(vec![true; 5]); + let rhs = bb_opt(vec![Some(true), Some(true), Some(true), Some(false), None]); let arr = lhs .into_array() .binary(rhs.into_array(), Operator::Eq) .unwrap(); - let expected = - ByteBoolArray::from(vec![Some(true), Some(true), Some(true), Some(false), None]); + let expected = bb_opt(vec![Some(true), Some(true), Some(true), Some(false), None]); assert_arrays_eq!(arr, expected.into_array()); } #[test] fn test_mask_byte_bool() { + test_mask_conformance(&bb(vec![true, false, true, true, false]).into_array()); test_mask_conformance( - &ByteBoolArray::from(vec![true, false, true, true, false]).into_array(), - ); - test_mask_conformance( - &ByteBoolArray::from(vec![Some(true), Some(true), None, Some(false), None]) - .into_array(), + &bb_opt(vec![Some(true), Some(true), None, Some(false), None]).into_array(), ); } #[test] fn test_filter_byte_bool() { + test_filter_conformance(&bb(vec![true, false, true, true, false]).into_array()); test_filter_conformance( - &ByteBoolArray::from(vec![true, false, true, true, false]).into_array(), - ); - test_filter_conformance( - &ByteBoolArray::from(vec![Some(true), Some(true), None, Some(false), None]) - .into_array(), + &bb_opt(vec![Some(true), Some(true), None, Some(false), None]).into_array(), ); } #[rstest] - #[case(ByteBoolArray::from(vec![true, false, true, true, false]))] - #[case(ByteBoolArray::from(vec![Some(true), Some(true), None, Some(false), None]))] - #[case(ByteBoolArray::from(vec![true, false]))] - #[case(ByteBoolArray::from(vec![true]))] + #[case(bb(vec![true, false, true, true, false]))] + #[case(bb_opt(vec![Some(true), Some(true), None, Some(false), None]))] + #[case(bb(vec![true, false]))] + #[case(bb(vec![true]))] fn test_take_byte_bool_conformance(#[case] array: ByteBoolArray) { test_take_conformance(&array.into_array()); } #[test] fn test_cast_bytebool_to_nullable() { - let array = ByteBoolArray::from(vec![true, false, true, false]); + let array = bb(vec![true, false, true, false]); let casted = array .into_array() .cast(DType::Bool(Nullability::Nullable)) @@ -198,24 +202,24 @@ mod tests { } #[rstest] - #[case(ByteBoolArray::from(vec![true, false, true, true, false]))] - #[case(ByteBoolArray::from(vec![Some(true), Some(false), None, Some(true), None]))] - #[case(ByteBoolArray::from(vec![false]))] - #[case(ByteBoolArray::from(vec![true]))] - #[case(ByteBoolArray::from(vec![Some(true), None]))] + #[case(bb(vec![true, false, true, true, false]))] + #[case(bb_opt(vec![Some(true), Some(false), None, Some(true), None]))] + #[case(bb(vec![false]))] + #[case(bb(vec![true]))] + #[case(bb_opt(vec![Some(true), None]))] fn test_cast_bytebool_conformance(#[case] array: ByteBoolArray) { test_cast_conformance(&array.into_array()); } #[rstest] - #[case::non_nullable(ByteBoolArray::from(vec![true, false, true, true, false]))] - #[case::nullable(ByteBoolArray::from(vec![Some(true), Some(false), None, Some(true), None]))] - #[case::all_true(ByteBoolArray::from(vec![true, true, true, true]))] - #[case::all_false(ByteBoolArray::from(vec![false, false, false, false]))] - #[case::single_true(ByteBoolArray::from(vec![true]))] - #[case::single_false(ByteBoolArray::from(vec![false]))] - #[case::single_null(ByteBoolArray::from(vec![None]))] - #[case::mixed_with_nulls(ByteBoolArray::from(vec![Some(true), None, Some(false), None, Some(true)]))] + #[case::non_nullable(bb(vec![true, false, true, true, false]))] + #[case::nullable(bb_opt(vec![Some(true), Some(false), None, Some(true), None]))] + #[case::all_true(bb(vec![true, true, true, true]))] + #[case::all_false(bb(vec![false, false, false, false]))] + #[case::single_true(bb(vec![true]))] + #[case::single_false(bb(vec![false]))] + #[case::single_null(bb_opt(vec![None]))] + #[case::mixed_with_nulls(bb_opt(vec![Some(true), None, Some(false), None, Some(true)]))] fn test_bytebool_consistency(#[case] array: ByteBoolArray) { test_array_consistency(&array.into_array()); } diff --git a/encodings/bytebool/src/slice.rs b/encodings/bytebool/src/slice.rs index c80be024fd1..dadb5c91640 100644 --- a/encodings/bytebool/src/slice.rs +++ b/encodings/bytebool/src/slice.rs @@ -6,16 +6,16 @@ use std::ops::Range; use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::arrays::slice::SliceReduce; -use vortex_array::vtable::ValidityHelper; use vortex_error::VortexResult; use crate::ByteBool; use crate::ByteBoolArray; +use crate::ByteBoolData; impl SliceReduce for ByteBool { fn slice(array: &ByteBoolArray, range: Range) -> VortexResult> { Ok(Some( - ByteBoolArray::new( + ByteBoolData::new( array.buffer().slice(range.clone()), array.validity().slice(range)?, ) diff --git a/encodings/datetime-parts/public-api.lock b/encodings/datetime-parts/public-api.lock index 039f980af1a..ff6be8037c4 100644 --- a/encodings/datetime-parts/public-api.lock +++ b/encodings/datetime-parts/public-api.lock @@ -6,6 +6,10 @@ impl vortex_datetime_parts::DateTimeParts pub const vortex_datetime_parts::DateTimeParts::ID: vortex_array::vtable::dyn_::ArrayId +pub fn vortex_datetime_parts::DateTimeParts::try_from_temporal(temporal: vortex_array::arrays::datetime::TemporalArray) -> vortex_error::VortexResult + +pub fn vortex_datetime_parts::DateTimeParts::try_new(dtype: vortex_array::dtype::DType, days: vortex_array::array::ArrayRef, seconds: vortex_array::array::ArrayRef, subseconds: vortex_array::array::ArrayRef) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_datetime_parts::DateTimeParts pub fn vortex_datetime_parts::DateTimeParts::clone(&self) -> vortex_datetime_parts::DateTimeParts @@ -24,7 +28,7 @@ pub fn vortex_datetime_parts::DateTimeParts::filter(array: &vortex_datetime_part impl vortex_array::arrays::slice::SliceReduce for vortex_datetime_parts::DateTimeParts -pub fn vortex_datetime_parts::DateTimeParts::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_datetime_parts::DateTimeParts::slice(array: &vortex_array::vtable::typed::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::binary::compare::CompareKernel for vortex_datetime_parts::DateTimeParts @@ -40,7 +44,7 @@ pub fn vortex_datetime_parts::DateTimeParts::mask(array: &vortex_datetime_parts: impl vortex_array::vtable::VTable for vortex_datetime_parts::DateTimeParts -pub type vortex_datetime_parts::DateTimeParts::Array = vortex_datetime_parts::DateTimePartsArray +pub type vortex_datetime_parts::DateTimeParts::ArrayData = vortex_datetime_parts::DateTimePartsData pub type vortex_datetime_parts::DateTimeParts::Metadata = vortex_array::metadata::ProstMetadata @@ -48,23 +52,23 @@ pub type vortex_datetime_parts::DateTimeParts::OperationsVTable = vortex_datetim pub type vortex_datetime_parts::DateTimeParts::ValidityVTable = vortex_array::vtable::validity::ValidityVTableFromChild -pub fn vortex_datetime_parts::DateTimeParts::array_eq(array: &vortex_datetime_parts::DateTimePartsArray, other: &vortex_datetime_parts::DateTimePartsArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_datetime_parts::DateTimeParts::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_datetime_parts::DateTimeParts::array_hash(array: &vortex_datetime_parts::DateTimePartsArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_datetime_parts::DateTimeParts::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_datetime_parts::DateTimeParts::buffer(_array: &vortex_datetime_parts::DateTimePartsArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_datetime_parts::DateTimeParts::buffer(_array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_datetime_parts::DateTimeParts::buffer_name(_array: &vortex_datetime_parts::DateTimePartsArray, idx: usize) -> core::option::Option +pub fn vortex_datetime_parts::DateTimeParts::buffer_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> core::option::Option -pub fn vortex_datetime_parts::DateTimeParts::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_datetime_parts::DateTimeParts::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_datetime_parts::DateTimeParts::child(array: &vortex_datetime_parts::DateTimePartsArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_datetime_parts::DateTimeParts::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_datetime_parts::DateTimeParts::child_name(_array: &vortex_datetime_parts::DateTimePartsArray, idx: usize) -> alloc::string::String +pub fn vortex_datetime_parts::DateTimeParts::child_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_datetime_parts::DateTimeParts::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_datetime_parts::DateTimeParts::dtype(array: &vortex_datetime_parts::DateTimePartsArray) -> &vortex_array::dtype::DType +pub fn vortex_datetime_parts::DateTimeParts::dtype(array: &vortex_datetime_parts::DateTimePartsData) -> &vortex_array::dtype::DType pub fn vortex_datetime_parts::DateTimeParts::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -72,99 +76,91 @@ pub fn vortex_datetime_parts::DateTimeParts::execute_parent(array: &vortex_array pub fn vortex_datetime_parts::DateTimeParts::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_datetime_parts::DateTimeParts::len(array: &vortex_datetime_parts::DateTimePartsArray) -> usize +pub fn vortex_datetime_parts::DateTimeParts::len(array: &vortex_datetime_parts::DateTimePartsData) -> usize -pub fn vortex_datetime_parts::DateTimeParts::metadata(array: &vortex_datetime_parts::DateTimePartsArray) -> vortex_error::VortexResult +pub fn vortex_datetime_parts::DateTimeParts::metadata(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_datetime_parts::DateTimeParts::nbuffers(_array: &vortex_datetime_parts::DateTimePartsArray) -> usize +pub fn vortex_datetime_parts::DateTimeParts::nbuffers(_array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_datetime_parts::DateTimeParts::nchildren(_array: &vortex_datetime_parts::DateTimePartsArray) -> usize +pub fn vortex_datetime_parts::DateTimeParts::nchildren(_array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_datetime_parts::DateTimeParts::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_datetime_parts::DateTimeParts::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_datetime_parts::DateTimeParts::stats(array: &vortex_datetime_parts::DateTimePartsArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_datetime_parts::DateTimeParts::stats(array: &vortex_datetime_parts::DateTimePartsData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_datetime_parts::DateTimeParts::vtable(_array: &Self::Array) -> &Self +pub fn vortex_datetime_parts::DateTimeParts::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_datetime_parts::DateTimeParts::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_datetime_parts::DateTimeParts::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_datetime_parts::DateTimeParts -pub fn vortex_datetime_parts::DateTimeParts::scalar_at(array: &vortex_datetime_parts::DateTimePartsArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_datetime_parts::DateTimeParts::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::validity::ValidityChild for vortex_datetime_parts::DateTimeParts -pub fn vortex_datetime_parts::DateTimeParts::validity_child(array: &vortex_datetime_parts::DateTimePartsArray) -> &vortex_array::array::ArrayRef - -pub struct vortex_datetime_parts::DateTimePartsArray - -impl vortex_datetime_parts::DateTimePartsArray +pub fn vortex_datetime_parts::DateTimeParts::validity_child(array: &vortex_datetime_parts::DateTimePartsData) -> &vortex_array::array::ArrayRef -pub fn vortex_datetime_parts::DateTimePartsArray::days(&self) -> &vortex_array::array::ArrayRef - -pub fn vortex_datetime_parts::DateTimePartsArray::into_parts(self) -> vortex_datetime_parts::DateTimePartsArrayParts - -pub fn vortex_datetime_parts::DateTimePartsArray::seconds(&self) -> &vortex_array::array::ArrayRef +pub struct vortex_datetime_parts::DateTimePartsArrayParts -pub fn vortex_datetime_parts::DateTimePartsArray::subseconds(&self) -> &vortex_array::array::ArrayRef +pub vortex_datetime_parts::DateTimePartsArrayParts::days: vortex_array::array::ArrayRef -pub fn vortex_datetime_parts::DateTimePartsArray::try_new(dtype: vortex_array::dtype::DType, days: vortex_array::array::ArrayRef, seconds: vortex_array::array::ArrayRef, subseconds: vortex_array::array::ArrayRef) -> vortex_error::VortexResult +pub vortex_datetime_parts::DateTimePartsArrayParts::dtype: vortex_array::dtype::DType -impl vortex_datetime_parts::DateTimePartsArray +pub vortex_datetime_parts::DateTimePartsArrayParts::seconds: vortex_array::array::ArrayRef -pub fn vortex_datetime_parts::DateTimePartsArray::to_array(&self) -> vortex_array::array::ArrayRef +pub vortex_datetime_parts::DateTimePartsArrayParts::subseconds: vortex_array::array::ArrayRef -impl core::clone::Clone for vortex_datetime_parts::DateTimePartsArray +impl core::clone::Clone for vortex_datetime_parts::DateTimePartsArrayParts -pub fn vortex_datetime_parts::DateTimePartsArray::clone(&self) -> vortex_datetime_parts::DateTimePartsArray +pub fn vortex_datetime_parts::DateTimePartsArrayParts::clone(&self) -> vortex_datetime_parts::DateTimePartsArrayParts -impl core::convert::AsRef for vortex_datetime_parts::DateTimePartsArray +impl core::fmt::Debug for vortex_datetime_parts::DateTimePartsArrayParts -pub fn vortex_datetime_parts::DateTimePartsArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +pub fn vortex_datetime_parts::DateTimePartsArrayParts::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::convert::From for vortex_array::array::ArrayRef +pub struct vortex_datetime_parts::DateTimePartsData -pub fn vortex_array::array::ArrayRef::from(value: vortex_datetime_parts::DateTimePartsArray) -> vortex_array::array::ArrayRef +impl vortex_datetime_parts::DateTimePartsData -impl core::convert::TryFrom for vortex_datetime_parts::DateTimePartsArray +pub fn vortex_datetime_parts::DateTimePartsData::days(&self) -> &vortex_array::array::ArrayRef -pub type vortex_datetime_parts::DateTimePartsArray::Error = vortex_error::VortexError +pub fn vortex_datetime_parts::DateTimePartsData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_datetime_parts::DateTimePartsArray::try_from(array: vortex_array::arrays::datetime::TemporalArray) -> core::result::Result +pub fn vortex_datetime_parts::DateTimePartsData::into_parts(self) -> vortex_datetime_parts::DateTimePartsArrayParts -impl core::fmt::Debug for vortex_datetime_parts::DateTimePartsArray +pub fn vortex_datetime_parts::DateTimePartsData::is_empty(&self) -> bool -pub fn vortex_datetime_parts::DateTimePartsArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_datetime_parts::DateTimePartsData::len(&self) -> usize -impl core::ops::deref::Deref for vortex_datetime_parts::DateTimePartsArray +pub fn vortex_datetime_parts::DateTimePartsData::seconds(&self) -> &vortex_array::array::ArrayRef -pub type vortex_datetime_parts::DateTimePartsArray::Target = dyn vortex_array::array::DynArray +pub fn vortex_datetime_parts::DateTimePartsData::subseconds(&self) -> &vortex_array::array::ArrayRef -pub fn vortex_datetime_parts::DateTimePartsArray::deref(&self) -> &Self::Target +pub fn vortex_datetime_parts::DateTimePartsData::try_new(dtype: vortex_array::dtype::DType, days: vortex_array::array::ArrayRef, seconds: vortex_array::array::ArrayRef, subseconds: vortex_array::array::ArrayRef) -> vortex_error::VortexResult -impl vortex_array::array::IntoArray for vortex_datetime_parts::DateTimePartsArray +impl core::clone::Clone for vortex_datetime_parts::DateTimePartsData -pub fn vortex_datetime_parts::DateTimePartsArray::into_array(self) -> vortex_array::array::ArrayRef +pub fn vortex_datetime_parts::DateTimePartsData::clone(&self) -> vortex_datetime_parts::DateTimePartsData -pub struct vortex_datetime_parts::DateTimePartsArrayParts +impl core::convert::From for vortex_array::array::ArrayRef -pub vortex_datetime_parts::DateTimePartsArrayParts::days: vortex_array::array::ArrayRef +pub fn vortex_array::array::ArrayRef::from(value: vortex_datetime_parts::DateTimePartsData) -> vortex_array::array::ArrayRef -pub vortex_datetime_parts::DateTimePartsArrayParts::dtype: vortex_array::dtype::DType +impl core::convert::TryFrom for vortex_datetime_parts::DateTimePartsData -pub vortex_datetime_parts::DateTimePartsArrayParts::seconds: vortex_array::array::ArrayRef +pub type vortex_datetime_parts::DateTimePartsData::Error = vortex_error::VortexError -pub vortex_datetime_parts::DateTimePartsArrayParts::subseconds: vortex_array::array::ArrayRef +pub fn vortex_datetime_parts::DateTimePartsData::try_from(array: vortex_array::arrays::datetime::TemporalArray) -> core::result::Result -impl core::clone::Clone for vortex_datetime_parts::DateTimePartsArrayParts +impl core::fmt::Debug for vortex_datetime_parts::DateTimePartsData -pub fn vortex_datetime_parts::DateTimePartsArrayParts::clone(&self) -> vortex_datetime_parts::DateTimePartsArrayParts +pub fn vortex_datetime_parts::DateTimePartsData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::fmt::Debug for vortex_datetime_parts::DateTimePartsArrayParts +impl vortex_array::array::IntoArray for vortex_datetime_parts::DateTimePartsData -pub fn vortex_datetime_parts::DateTimePartsArrayParts::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_datetime_parts::DateTimePartsData::into_array(self) -> vortex_array::array::ArrayRef #[repr(C)] pub struct vortex_datetime_parts::DateTimePartsMetadata @@ -225,3 +221,5 @@ pub vortex_datetime_parts::TemporalParts::subseconds: vortex_array::array::Array pub fn vortex_datetime_parts::initialize(session: &mut vortex_session::VortexSession) pub fn vortex_datetime_parts::split_temporal(array: vortex_array::arrays::datetime::TemporalArray) -> vortex_error::VortexResult + +pub type vortex_datetime_parts::DateTimePartsArray = vortex_array::vtable::typed::Array diff --git a/encodings/datetime-parts/src/array.rs b/encodings/datetime-parts/src/array.rs index feed6b968a4..c6c80d1e3de 100644 --- a/encodings/datetime-parts/src/array.rs +++ b/encodings/datetime-parts/src/array.rs @@ -16,13 +16,13 @@ use vortex_array::IntoArray; use vortex_array::Precision; use vortex_array::ProstMetadata; use vortex_array::SerializeMetadata; +use vortex_array::arrays::TemporalArray; use vortex_array::buffer::BufferHandle; use vortex_array::dtype::DType; use vortex_array::dtype::Nullability; use vortex_array::dtype::PType; use vortex_array::serde::ArrayChildren; use vortex_array::stats::ArrayStats; -use vortex_array::stats::StatsSetRef; use vortex_array::vtable; use vortex_array::vtable::Array; use vortex_array::vtable::ArrayId; @@ -41,7 +41,7 @@ use crate::canonical::decode_to_temporal; use crate::compute::kernel::PARENT_KERNELS; use crate::compute::rules::PARENT_RULES; -vtable!(DateTimeParts); +vtable!(DateTimeParts, DateTimeParts, DateTimePartsData); #[derive(Clone, prost::Message)] #[repr(C)] @@ -74,13 +74,13 @@ impl DateTimePartsMetadata { } impl VTable for DateTimeParts { - type Array = DateTimePartsArray; + type ArrayData = DateTimePartsData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromChild; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &DateTimeParts } @@ -88,57 +88,49 @@ impl VTable for DateTimeParts { Self::ID } - fn len(array: &DateTimePartsArray) -> usize { + fn len(array: &DateTimePartsData) -> usize { array.days.len() } - fn dtype(array: &DateTimePartsArray) -> &DType { + fn dtype(array: &DateTimePartsData) -> &DType { &array.dtype } - fn stats(array: &DateTimePartsArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &DateTimePartsData) -> &ArrayStats { + &array.stats_set } - fn array_hash( - array: &DateTimePartsArray, - state: &mut H, - precision: Precision, - ) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.days.array_hash(state, precision); array.seconds.array_hash(state, precision); array.subseconds.array_hash(state, precision); } - fn array_eq( - array: &DateTimePartsArray, - other: &DateTimePartsArray, - precision: Precision, - ) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.days.array_eq(&other.days, precision) && array.seconds.array_eq(&other.seconds, precision) && array.subseconds.array_eq(&other.subseconds, precision) } - fn nbuffers(_array: &DateTimePartsArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &DateTimePartsArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("DateTimePartsArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &DateTimePartsArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { vortex_panic!("DateTimePartsArray buffer_name index {idx} out of bounds") } - fn nchildren(_array: &DateTimePartsArray) -> usize { + fn nchildren(_array: &Array) -> usize { 3 } - fn child(array: &DateTimePartsArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.days().clone(), 1 => array.seconds().clone(), @@ -147,7 +139,7 @@ impl VTable for DateTimeParts { } } - fn child_name(_array: &DateTimePartsArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "days".to_string(), 1 => "seconds".to_string(), @@ -156,7 +148,7 @@ impl VTable for DateTimeParts { } } - fn metadata(array: &DateTimePartsArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(DateTimePartsMetadata { days_ptype: PType::try_from(array.days().dtype())? as i32, seconds_ptype: PType::try_from(array.seconds().dtype())? as i32, @@ -186,7 +178,7 @@ impl VTable for DateTimeParts { metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { if children.len() != 3 { vortex_bail!( "Expected 3 children for datetime-parts encoding, found {}", @@ -210,10 +202,10 @@ impl VTable for DateTimeParts { len, )?; - DateTimePartsArray::try_new(dtype.clone(), days, seconds, subseconds) + DateTimePartsData::try_new(dtype.clone(), days, seconds, subseconds) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 3, "DateTimePartsArray expects exactly 3 children (days, seconds, subseconds), got {}", @@ -253,7 +245,7 @@ impl VTable for DateTimeParts { } #[derive(Clone, Debug)] -pub struct DateTimePartsArray { +pub struct DateTimePartsData { dtype: DType, days: ArrayRef, seconds: ArrayRef, @@ -274,9 +266,26 @@ pub struct DateTimeParts; impl DateTimeParts { pub const ID: ArrayId = ArrayId::new_ref("vortex.datetimeparts"); + + /// Construct a new [`DateTimePartsArray`] from its components. + pub fn try_new( + dtype: DType, + days: ArrayRef, + seconds: ArrayRef, + subseconds: ArrayRef, + ) -> VortexResult { + Array::try_from_data(DateTimePartsData::try_new( + dtype, days, seconds, subseconds, + )?) + } + + /// Construct a [`DateTimePartsArray`] from a [`TemporalArray`]. + pub fn try_from_temporal(temporal: TemporalArray) -> VortexResult { + Array::try_from_data(DateTimePartsData::try_from(temporal)?) + } } -impl DateTimePartsArray { +impl DateTimePartsData { pub fn try_new( dtype: DType, days: ArrayRef, @@ -340,6 +349,21 @@ impl DateTimePartsArray { } } + /// Returns the number of elements in the array. + pub fn len(&self) -> usize { + self.days.len() + } + + /// Returns `true` if the array contains no elements. + pub fn is_empty(&self) -> bool { + self.days.len() == 0 + } + + /// Returns the logical data type of the array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + pub fn days(&self) -> &ArrayRef { &self.days } @@ -354,7 +378,7 @@ impl DateTimePartsArray { } impl ValidityChild for DateTimeParts { - fn validity_child(array: &DateTimePartsArray) -> &ArrayRef { + fn validity_child(array: &DateTimePartsData) -> &ArrayRef { array.days() } } diff --git a/encodings/datetime-parts/src/canonical.rs b/encodings/datetime-parts/src/canonical.rs index f619dd70a40..14d33ec8771 100644 --- a/encodings/datetime-parts/src/canonical.rs +++ b/encodings/datetime-parts/src/canonical.rs @@ -108,6 +108,7 @@ pub fn decode_to_temporal( #[cfg(test)] mod test { use rstest::rstest; + use vortex_array::DynArray; use vortex_array::ExecutionCtx; use vortex_array::IntoArray; use vortex_array::arrays::PrimitiveArray; @@ -115,12 +116,12 @@ mod test { use vortex_array::assert_arrays_eq; use vortex_array::extension::datetime::TimeUnit; use vortex_array::validity::Validity; - use vortex_array::vtable::ValidityHelper; use vortex_buffer::buffer; use vortex_error::VortexResult; use vortex_session::VortexSession; use crate::DateTimePartsArray; + use crate::DateTimePartsData; use crate::canonical::decode_to_temporal; #[rstest] @@ -140,16 +141,18 @@ mod test { ], validity.clone(), ); - let date_times = DateTimePartsArray::try_from(TemporalArray::new_timestamp( - milliseconds.clone().into_array(), - TimeUnit::Milliseconds, - Some("UTC".into()), - )) - .unwrap(); + let date_times = DateTimePartsArray::try_from_data( + DateTimePartsData::try_from(TemporalArray::new_timestamp( + milliseconds.clone().into_array(), + TimeUnit::Milliseconds, + Some("UTC".into()), + )) + .unwrap(), + )?; let mut ctx = ExecutionCtx::new(VortexSession::empty()); - assert!(date_times.validity()?.mask_eq(&validity, &mut ctx)?); + assert!(DynArray::validity(&date_times)?.mask_eq(&validity, &mut ctx)?); let primitive_values = decode_to_temporal(&date_times, &mut ctx)? .temporal_values() diff --git a/encodings/datetime-parts/src/compress.rs b/encodings/datetime-parts/src/compress.rs index 6010f6adeaf..4bc0bad84de 100644 --- a/encodings/datetime-parts/src/compress.rs +++ b/encodings/datetime-parts/src/compress.rs @@ -9,14 +9,12 @@ use vortex_array::arrays::TemporalArray; use vortex_array::builtins::ArrayBuiltins; use vortex_array::dtype::DType; use vortex_array::dtype::PType; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::BufferMut; use vortex_error::VortexError; use vortex_error::VortexResult; -use crate::DateTimePartsArray; +use crate::DateTimePartsData; use crate::timestamp; - pub struct TemporalParts { pub days: ArrayRef, pub seconds: ArrayRef, @@ -59,7 +57,7 @@ pub fn split_temporal(array: TemporalArray) -> VortexResult { }) } -impl TryFrom for DateTimePartsArray { +impl TryFrom for DateTimePartsData { type Error = VortexError; fn try_from(array: TemporalArray) -> Result { @@ -69,7 +67,7 @@ impl TryFrom for DateTimePartsArray { seconds, subseconds, } = split_temporal(array)?; - DateTimePartsArray::try_new(DType::Extension(ext_dtype), days, seconds, subseconds) + DateTimePartsData::try_new(DType::Extension(ext_dtype), days, seconds, subseconds) } } @@ -84,7 +82,6 @@ mod tests { use vortex_array::arrays::TemporalArray; use vortex_array::extension::datetime::TimeUnit; use vortex_array::validity::Validity; - use vortex_array::vtable::ValidityHelper; use vortex_buffer::buffer; use crate::TemporalParts; diff --git a/encodings/datetime-parts/src/compute/cast.rs b/encodings/datetime-parts/src/compute/cast.rs index 916da53d619..c00bf5586fe 100644 --- a/encodings/datetime-parts/src/compute/cast.rs +++ b/encodings/datetime-parts/src/compute/cast.rs @@ -11,7 +11,7 @@ use vortex_error::VortexResult; use crate::DateTimeParts; use crate::DateTimePartsArray; - +use crate::DateTimePartsData; impl CastReduce for DateTimeParts { fn cast(array: &DateTimePartsArray, dtype: &DType) -> VortexResult> { if !array.dtype().eq_ignore_nullability(dtype) { @@ -19,7 +19,7 @@ impl CastReduce for DateTimeParts { }; Ok(Some( - DateTimePartsArray::try_new( + DateTimePartsData::try_new( dtype.clone(), array .days() @@ -48,9 +48,10 @@ mod tests { use vortex_buffer::buffer; use crate::DateTimePartsArray; + use crate::DateTimePartsData; fn date_time_array(validity: Validity) -> ArrayRef { - DateTimePartsArray::try_from(TemporalArray::new_timestamp( + DateTimePartsData::try_from(TemporalArray::new_timestamp( PrimitiveArray::new( buffer![ 86_400i64, // element with only day component @@ -105,7 +106,7 @@ mod tests { } #[rstest] - #[case(DateTimePartsArray::try_from(TemporalArray::new_timestamp( + #[case(DateTimePartsArray::try_from_data(DateTimePartsData::try_from(TemporalArray::new_timestamp( buffer![ 0i64, 86_400_000, // 1 day in ms @@ -115,8 +116,8 @@ mod tests { ].into_array(), TimeUnit::Milliseconds, Some("UTC".into()) - )).unwrap())] - #[case(DateTimePartsArray::try_from(TemporalArray::new_timestamp( + )).unwrap()).unwrap())] + #[case(DateTimePartsArray::try_from_data(DateTimePartsData::try_from(TemporalArray::new_timestamp( PrimitiveArray::from_option_iter([ Some(0i64), None, @@ -126,12 +127,12 @@ mod tests { ]).into_array(), TimeUnit::Milliseconds, Some("UTC".into()) - )).unwrap())] - #[case(DateTimePartsArray::try_from(TemporalArray::new_timestamp( + )).unwrap()).unwrap())] + #[case(DateTimePartsArray::try_from_data(DateTimePartsData::try_from(TemporalArray::new_timestamp( buffer![86_400_000_000_000i64].into_array(), // 1 day in ns TimeUnit::Nanoseconds, Some("UTC".into()) - )).unwrap())] + )).unwrap()).unwrap())] fn test_cast_datetime_parts_conformance(#[case] array: DateTimePartsArray) { use vortex_array::compute::conformance::cast::test_cast_conformance; test_cast_conformance(&array.into_array()); diff --git a/encodings/datetime-parts/src/compute/compare.rs b/encodings/datetime-parts/src/compute/compare.rs index c69fd3d1b93..c1f495595c4 100644 --- a/encodings/datetime-parts/src/compute/compare.rs +++ b/encodings/datetime-parts/src/compute/compare.rs @@ -206,12 +206,13 @@ mod test { use vortex_buffer::buffer; use super::*; + use crate::DateTimePartsData; fn dtp_array_from_timestamp( value: T, validity: Validity, - ) -> DateTimePartsArray { - DateTimePartsArray::try_from(TemporalArray::new_timestamp( + ) -> DateTimePartsData { + DateTimePartsData::try_from(TemporalArray::new_timestamp( PrimitiveArray::new(buffer![value], validity).into_array(), TimeUnit::Seconds, Some("UTC".into()), @@ -312,7 +313,7 @@ mod test { Some("UTC".into()), ); - let lhs = DateTimePartsArray::try_new( + let lhs = DateTimePartsData::try_new( DType::Extension(temporal_array.ext_dtype()), PrimitiveArray::new(buffer![0i32], lhs_validity).into_array(), PrimitiveArray::new(buffer![0u32], Validity::NonNullable).into_array(), diff --git a/encodings/datetime-parts/src/compute/filter.rs b/encodings/datetime-parts/src/compute/filter.rs index cc66bd75299..a90e5dd0bd0 100644 --- a/encodings/datetime-parts/src/compute/filter.rs +++ b/encodings/datetime-parts/src/compute/filter.rs @@ -9,11 +9,11 @@ use vortex_mask::Mask; use crate::DateTimeParts; use crate::DateTimePartsArray; - +use crate::DateTimePartsData; impl FilterReduce for DateTimeParts { fn filter(array: &DateTimePartsArray, mask: &Mask) -> VortexResult> { Ok(Some( - DateTimePartsArray::try_new( + DateTimePartsData::try_new( array.dtype().clone(), array.days().filter(mask.clone())?, array.seconds().filter(mask.clone())?, @@ -33,7 +33,7 @@ mod test { use vortex_array::extension::datetime::TimeUnit; use vortex_buffer::buffer; - use crate::DateTimePartsArray; + use crate::DateTimePartsData; #[test] fn test_filter_datetime_parts() { @@ -50,7 +50,7 @@ mod test { let temporal = TemporalArray::new_timestamp(timestamps, TimeUnit::Milliseconds, Some("UTC".into())); - let array = DateTimePartsArray::try_from(temporal).unwrap(); + let array = DateTimePartsData::try_from(temporal).unwrap(); test_filter_conformance(&array.into_array()); // Test with nullable values @@ -66,7 +66,7 @@ mod test { let temporal = TemporalArray::new_timestamp(timestamps, TimeUnit::Milliseconds, Some("UTC".into())); - let array = DateTimePartsArray::try_from(temporal).unwrap(); + let array = DateTimePartsData::try_from(temporal).unwrap(); test_filter_conformance(&array.into_array()); } } diff --git a/encodings/datetime-parts/src/compute/mask.rs b/encodings/datetime-parts/src/compute/mask.rs index 686d63ef1bd..7bb50c451f5 100644 --- a/encodings/datetime-parts/src/compute/mask.rs +++ b/encodings/datetime-parts/src/compute/mask.rs @@ -10,6 +10,7 @@ use vortex_error::VortexResult; use crate::DateTimeParts; use crate::DateTimePartsArray; use crate::DateTimePartsArrayParts; +use crate::DateTimePartsData; impl MaskReduce for DateTimeParts { fn mask(array: &DateTimePartsArray, mask: &ArrayRef) -> VortexResult> { @@ -18,10 +19,10 @@ impl MaskReduce for DateTimeParts { days, seconds, subseconds, - } = array.clone().into_parts(); + } = array.clone().into_data().into_parts(); let masked_days = days.mask(mask.clone())?; Ok(Some( - DateTimePartsArray::try_new(dtype.as_nullable(), masked_days, seconds, subseconds)? + DateTimePartsData::try_new(dtype.as_nullable(), masked_days, seconds, subseconds)? .into_array(), )) } diff --git a/encodings/datetime-parts/src/compute/mod.rs b/encodings/datetime-parts/src/compute/mod.rs index 46ce9cf89e3..4ca8398fd6b 100644 --- a/encodings/datetime-parts/src/compute/mod.rs +++ b/encodings/datetime-parts/src/compute/mod.rs @@ -22,53 +22,54 @@ mod tests { use vortex_buffer::buffer; use crate::DateTimePartsArray; + use crate::DateTimePartsData; #[rstest] // Basic datetime arrays - #[case::datetime_seconds(DateTimePartsArray::try_from(TemporalArray::new_timestamp( + #[case::datetime_seconds(DateTimePartsArray::try_from_data(DateTimePartsData::try_from(TemporalArray::new_timestamp( buffer![0i64, 86400, 172800, 259200, 345600].into_array(), TimeUnit::Seconds, Some("UTC".into()), - )).unwrap())] - #[case::datetime_millis(DateTimePartsArray::try_from(TemporalArray::new_timestamp( + )).unwrap()).unwrap())] + #[case::datetime_millis(DateTimePartsArray::try_from_data(DateTimePartsData::try_from(TemporalArray::new_timestamp( buffer![0i64, 86400000, 172800000].into_array(), TimeUnit::Milliseconds, Some("UTC".into()), - )).unwrap())] - #[case::datetime_micros(DateTimePartsArray::try_from(TemporalArray::new_timestamp( + )).unwrap()).unwrap())] + #[case::datetime_micros(DateTimePartsArray::try_from_data(DateTimePartsData::try_from(TemporalArray::new_timestamp( buffer![0i64, 86400000000, 172800000000].into_array(), TimeUnit::Microseconds, Some("UTC".into()), - )).unwrap())] - #[case::datetime_nanos(DateTimePartsArray::try_from(TemporalArray::new_timestamp( + )).unwrap()).unwrap())] + #[case::datetime_nanos(DateTimePartsArray::try_from_data(DateTimePartsData::try_from(TemporalArray::new_timestamp( buffer![0i64, 86400000000000].into_array(), TimeUnit::Nanoseconds, Some("UTC".into()), - )).unwrap())] + )).unwrap()).unwrap())] // Nullable arrays - #[case::datetime_nullable_seconds(DateTimePartsArray::try_from(TemporalArray::new_timestamp( + #[case::datetime_nullable_seconds(DateTimePartsArray::try_from_data(DateTimePartsData::try_from(TemporalArray::new_timestamp( PrimitiveArray::from_option_iter([Some(0i64), None, Some(86400), Some(172800), None]).into_array(), TimeUnit::Seconds, Some("UTC".into()), - )).unwrap())] + )).unwrap()).unwrap())] // Edge cases - #[case::datetime_single(DateTimePartsArray::try_from(TemporalArray::new_timestamp( + #[case::datetime_single(DateTimePartsArray::try_from_data(DateTimePartsData::try_from(TemporalArray::new_timestamp( buffer![1234567890i64].into_array(), TimeUnit::Seconds, Some("UTC".into()), - )).unwrap())] + )).unwrap()).unwrap())] // Large arrays (> 1024 elements) - #[case::datetime_large(DateTimePartsArray::try_from(TemporalArray::new_timestamp( + #[case::datetime_large(DateTimePartsArray::try_from_data(DateTimePartsData::try_from(TemporalArray::new_timestamp( PrimitiveArray::from_iter((0..1500).map(|i| i as i64 * 86400)).into_array(), TimeUnit::Seconds, Some("UTC".into()), - )).unwrap())] + )).unwrap()).unwrap())] // Different time patterns - #[case::datetime_with_subseconds(DateTimePartsArray::try_from(TemporalArray::new_timestamp( + #[case::datetime_with_subseconds(DateTimePartsArray::try_from_data(DateTimePartsData::try_from(TemporalArray::new_timestamp( buffer![123456789i64, 234567890, 345678901, 456789012, 567890123].into_array(), TimeUnit::Milliseconds, Some("UTC".into()), - )).unwrap())] + )).unwrap()).unwrap())] fn test_datetime_parts_consistency(#[case] array: DateTimePartsArray) { test_array_consistency(&array.into_array()); diff --git a/encodings/datetime-parts/src/compute/rules.rs b/encodings/datetime-parts/src/compute/rules.rs index 6ac0de3c290..d095060d6cb 100644 --- a/encodings/datetime-parts/src/compute/rules.rs +++ b/encodings/datetime-parts/src/compute/rules.rs @@ -27,8 +27,8 @@ use vortex_error::VortexResult; use crate::DateTimeParts; use crate::DateTimePartsArray; +use crate::DateTimePartsData; use crate::timestamp; - pub(crate) const PARENT_RULES: ParentRuleSet = ParentRuleSet::new(&[ ParentRuleSet::lift(&DTPFilterPushDownRule), ParentRuleSet::lift(&DTPComparisonPushDownRule), @@ -58,7 +58,7 @@ impl ArrayParentReduceRule for DTPFilterPushDownRule { return Ok(None); } - DateTimePartsArray::try_new( + DateTimePartsData::try_new( child.dtype().clone(), child.days().clone().filter(parent.filter_mask().clone())?, ConstantArray::new( @@ -216,7 +216,8 @@ mod tests { time_unit, None, ); - DateTimePartsArray::try_from(temporal).unwrap() + DateTimePartsArray::try_from_data(DateTimePartsData::try_from(temporal).unwrap()) + .vortex_expect("DateTimePartsData is always valid") } /// Create a constant timestamp scalar at midnight for the given day. @@ -348,7 +349,7 @@ mod tests { TimeUnit::Seconds, None, ); - let dtp = DateTimePartsArray::try_from(temporal).unwrap(); + let dtp = DateTimePartsData::try_from(temporal).unwrap(); let len = dtp.len(); // Compare against midnight constant diff --git a/encodings/datetime-parts/src/compute/slice.rs b/encodings/datetime-parts/src/compute/slice.rs index bc723bdc8ed..c73eda9388c 100644 --- a/encodings/datetime-parts/src/compute/slice.rs +++ b/encodings/datetime-parts/src/compute/slice.rs @@ -6,16 +6,17 @@ use std::ops::Range; use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::arrays::slice::SliceReduce; +use vortex_array::vtable::Array; use vortex_error::VortexResult; use crate::DateTimeParts; -use crate::DateTimePartsArray; +use crate::DateTimePartsData; impl SliceReduce for DateTimeParts { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { // SAFETY: slicing all components preserves values Ok(Some(unsafe { - DateTimePartsArray::new_unchecked( + DateTimePartsData::new_unchecked( array.dtype().clone(), array.days().slice(range.clone())?, array.seconds().slice(range.clone())?, diff --git a/encodings/datetime-parts/src/compute/take.rs b/encodings/datetime-parts/src/compute/take.rs index 8960cb1f41e..c2a3b418830 100644 --- a/encodings/datetime-parts/src/compute/take.rs +++ b/encodings/datetime-parts/src/compute/take.rs @@ -17,7 +17,7 @@ use vortex_error::vortex_panic; use crate::DateTimeParts; use crate::DateTimePartsArray; - +use crate::DateTimePartsData; fn take_datetime_parts(array: &DateTimePartsArray, indices: &ArrayRef) -> VortexResult { // we go ahead and canonicalize here to avoid worst-case canonicalizing 3 separate times let indices = indices.to_primitive(); @@ -36,13 +36,10 @@ fn take_datetime_parts(array: &DateTimePartsArray, indices: &ArrayRef) -> Vortex }; if !taken_seconds.dtype().is_nullable() && !taken_subseconds.dtype().is_nullable() { - return Ok(DateTimePartsArray::try_new( - dtype, - taken_days, - taken_seconds, - taken_subseconds, - )? - .into_array()); + return Ok( + DateTimePartsData::try_new(dtype, taken_days, taken_seconds, taken_subseconds)? + .into_array(), + ); } // DateTimePartsArray requires seconds and subseconds to be non-nullable. @@ -80,7 +77,7 @@ fn take_datetime_parts(array: &DateTimePartsArray, indices: &ArrayRef) -> Vortex let taken_subseconds = taken_subseconds.fill_null(subseconds_fill)?; Ok( - DateTimePartsArray::try_new(dtype, taken_days, taken_seconds, taken_subseconds)? + DateTimePartsData::try_new(dtype, taken_days, taken_seconds, taken_subseconds)? .into_array(), ) } @@ -106,9 +103,10 @@ mod tests { use vortex_buffer::buffer; use crate::DateTimePartsArray; + use crate::DateTimePartsData; #[rstest] - #[case(DateTimePartsArray::try_from(TemporalArray::new_timestamp( + #[case(DateTimePartsArray::try_from_data(DateTimePartsData::try_from(TemporalArray::new_timestamp( buffer![ 0i64, 86_400_000, // 1 day in ms @@ -118,8 +116,8 @@ mod tests { ].into_array(), TimeUnit::Milliseconds, Some("UTC".into()) - )).unwrap())] - #[case(DateTimePartsArray::try_from(TemporalArray::new_timestamp( + )).unwrap()).unwrap())] + #[case(DateTimePartsArray::try_from_data(DateTimePartsData::try_from(TemporalArray::new_timestamp( PrimitiveArray::from_option_iter([ Some(0i64), None, @@ -129,12 +127,12 @@ mod tests { ]).into_array(), TimeUnit::Milliseconds, Some("UTC".into()) - )).unwrap())] - #[case(DateTimePartsArray::try_from(TemporalArray::new_timestamp( + )).unwrap()).unwrap())] + #[case(DateTimePartsArray::try_from_data(DateTimePartsData::try_from(TemporalArray::new_timestamp( buffer![86_400_000i64].into_array(), TimeUnit::Milliseconds, Some("UTC".into()) - )).unwrap())] + )).unwrap()).unwrap())] fn test_take_datetime_parts_conformance(#[case] array: DateTimePartsArray) { test_take_conformance(&array.into_array()); } diff --git a/encodings/datetime-parts/src/ops.rs b/encodings/datetime-parts/src/ops.rs index 167829b2fe0..a0afddfc056 100644 --- a/encodings/datetime-parts/src/ops.rs +++ b/encodings/datetime-parts/src/ops.rs @@ -6,19 +6,19 @@ use vortex_array::ExecutionCtx; use vortex_array::dtype::DType; use vortex_array::extension::datetime::Timestamp; use vortex_array::scalar::Scalar; +use vortex_array::vtable::Array; use vortex_array::vtable::OperationsVTable; use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_panic; use crate::DateTimeParts; -use crate::DateTimePartsArray; use crate::timestamp; use crate::timestamp::TimestampParts; impl OperationsVTable for DateTimeParts { fn scalar_at( - array: &DateTimePartsArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { diff --git a/encodings/decimal-byte-parts/public-api.lock b/encodings/decimal-byte-parts/public-api.lock index cf5f0278275..38c1613ffc8 100644 --- a/encodings/decimal-byte-parts/public-api.lock +++ b/encodings/decimal-byte-parts/public-api.lock @@ -6,6 +6,8 @@ impl vortex_decimal_byte_parts::DecimalByteParts pub const vortex_decimal_byte_parts::DecimalByteParts::ID: vortex_array::vtable::dyn_::ArrayId +pub fn vortex_decimal_byte_parts::DecimalByteParts::try_new(msp: vortex_array::array::ArrayRef, decimal_dtype: vortex_array::dtype::decimal::DecimalDType) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_decimal_byte_parts::DecimalByteParts pub fn vortex_decimal_byte_parts::DecimalByteParts::clone(&self) -> vortex_decimal_byte_parts::DecimalByteParts @@ -28,7 +30,7 @@ pub fn vortex_decimal_byte_parts::DecimalByteParts::slice(array: &vortex_decimal impl vortex_array::scalar_fn::fns::binary::compare::CompareKernel for vortex_decimal_byte_parts::DecimalByteParts -pub fn vortex_decimal_byte_parts::DecimalByteParts::compare(lhs: &Self::Array, rhs: &vortex_array::array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_decimal_byte_parts::DecimalByteParts::compare(lhs: &vortex_array::vtable::typed::Array, rhs: &vortex_array::array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::kernel::CastReduce for vortex_decimal_byte_parts::DecimalByteParts @@ -40,7 +42,7 @@ pub fn vortex_decimal_byte_parts::DecimalByteParts::mask(array: &vortex_decimal_ impl vortex_array::vtable::VTable for vortex_decimal_byte_parts::DecimalByteParts -pub type vortex_decimal_byte_parts::DecimalByteParts::Array = vortex_decimal_byte_parts::DecimalBytePartsArray +pub type vortex_decimal_byte_parts::DecimalByteParts::ArrayData = vortex_decimal_byte_parts::DecimalBytePartsData pub type vortex_decimal_byte_parts::DecimalByteParts::Metadata = vortex_array::metadata::ProstMetadata @@ -48,23 +50,23 @@ pub type vortex_decimal_byte_parts::DecimalByteParts::OperationsVTable = vortex_ pub type vortex_decimal_byte_parts::DecimalByteParts::ValidityVTable = vortex_array::vtable::validity::ValidityVTableFromChild -pub fn vortex_decimal_byte_parts::DecimalByteParts::array_eq(array: &vortex_decimal_byte_parts::DecimalBytePartsArray, other: &vortex_decimal_byte_parts::DecimalBytePartsArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_decimal_byte_parts::DecimalByteParts::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_decimal_byte_parts::DecimalByteParts::array_hash(array: &vortex_decimal_byte_parts::DecimalBytePartsArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_decimal_byte_parts::DecimalByteParts::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_decimal_byte_parts::DecimalByteParts::buffer(_array: &vortex_decimal_byte_parts::DecimalBytePartsArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_decimal_byte_parts::DecimalByteParts::buffer(_array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_decimal_byte_parts::DecimalByteParts::buffer_name(_array: &vortex_decimal_byte_parts::DecimalBytePartsArray, idx: usize) -> core::option::Option +pub fn vortex_decimal_byte_parts::DecimalByteParts::buffer_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> core::option::Option -pub fn vortex_decimal_byte_parts::DecimalByteParts::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_decimal_byte_parts::DecimalByteParts::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_decimal_byte_parts::DecimalByteParts::child(array: &vortex_decimal_byte_parts::DecimalBytePartsArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_decimal_byte_parts::DecimalByteParts::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_decimal_byte_parts::DecimalByteParts::child_name(_array: &vortex_decimal_byte_parts::DecimalBytePartsArray, idx: usize) -> alloc::string::String +pub fn vortex_decimal_byte_parts::DecimalByteParts::child_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_decimal_byte_parts::DecimalByteParts::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_decimal_byte_parts::DecimalByteParts::dtype(array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> &vortex_array::dtype::DType +pub fn vortex_decimal_byte_parts::DecimalByteParts::dtype(array: &vortex_decimal_byte_parts::DecimalBytePartsData) -> &vortex_array::dtype::DType pub fn vortex_decimal_byte_parts::DecimalByteParts::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -72,77 +74,69 @@ pub fn vortex_decimal_byte_parts::DecimalByteParts::execute_parent(array: &vorte pub fn vortex_decimal_byte_parts::DecimalByteParts::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_decimal_byte_parts::DecimalByteParts::len(array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> usize +pub fn vortex_decimal_byte_parts::DecimalByteParts::len(array: &vortex_decimal_byte_parts::DecimalBytePartsData) -> usize -pub fn vortex_decimal_byte_parts::DecimalByteParts::metadata(array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> vortex_error::VortexResult +pub fn vortex_decimal_byte_parts::DecimalByteParts::metadata(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_decimal_byte_parts::DecimalByteParts::nbuffers(_array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> usize +pub fn vortex_decimal_byte_parts::DecimalByteParts::nbuffers(_array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_decimal_byte_parts::DecimalByteParts::nchildren(_array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> usize +pub fn vortex_decimal_byte_parts::DecimalByteParts::nchildren(_array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_decimal_byte_parts::DecimalByteParts::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_decimal_byte_parts::DecimalByteParts::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_decimal_byte_parts::DecimalByteParts::stats(array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_decimal_byte_parts::DecimalByteParts::stats(array: &vortex_decimal_byte_parts::DecimalBytePartsData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_decimal_byte_parts::DecimalByteParts::vtable(_array: &Self::Array) -> &Self +pub fn vortex_decimal_byte_parts::DecimalByteParts::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_decimal_byte_parts::DecimalByteParts::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_decimal_byte_parts::DecimalByteParts::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_decimal_byte_parts::DecimalByteParts -pub fn vortex_decimal_byte_parts::DecimalByteParts::scalar_at(array: &vortex_decimal_byte_parts::DecimalBytePartsArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_decimal_byte_parts::DecimalByteParts::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::validity::ValidityChild for vortex_decimal_byte_parts::DecimalByteParts -pub fn vortex_decimal_byte_parts::DecimalByteParts::validity_child(array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> &vortex_array::array::ArrayRef - -pub struct vortex_decimal_byte_parts::DecimalBytePartsArray - -impl vortex_decimal_byte_parts::DecimalBytePartsArray +pub fn vortex_decimal_byte_parts::DecimalByteParts::validity_child(array: &vortex_decimal_byte_parts::DecimalBytePartsData) -> &vortex_array::array::ArrayRef -pub fn vortex_decimal_byte_parts::DecimalBytePartsArray::decimal_dtype(&self) -> &vortex_array::dtype::decimal::DecimalDType - -pub fn vortex_decimal_byte_parts::DecimalBytePartsArray::into_parts(self) -> vortex_decimal_byte_parts::DecimalBytePartsArrayParts - -pub fn vortex_decimal_byte_parts::DecimalBytePartsArray::try_new(msp: vortex_array::array::ArrayRef, decimal_dtype: vortex_array::dtype::decimal::DecimalDType) -> vortex_error::VortexResult +pub struct vortex_decimal_byte_parts::DecimalBytePartsArrayParts -impl vortex_decimal_byte_parts::DecimalBytePartsArray +pub vortex_decimal_byte_parts::DecimalBytePartsArrayParts::dtype: vortex_array::dtype::DType -pub fn vortex_decimal_byte_parts::DecimalBytePartsArray::to_array(&self) -> vortex_array::array::ArrayRef +pub vortex_decimal_byte_parts::DecimalBytePartsArrayParts::msp: vortex_array::array::ArrayRef -impl core::clone::Clone for vortex_decimal_byte_parts::DecimalBytePartsArray +pub struct vortex_decimal_byte_parts::DecimalBytePartsData -pub fn vortex_decimal_byte_parts::DecimalBytePartsArray::clone(&self) -> vortex_decimal_byte_parts::DecimalBytePartsArray +impl vortex_decimal_byte_parts::DecimalBytePartsData -impl core::convert::AsRef for vortex_decimal_byte_parts::DecimalBytePartsArray +pub fn vortex_decimal_byte_parts::DecimalBytePartsData::decimal_dtype(&self) -> &vortex_array::dtype::decimal::DecimalDType -pub fn vortex_decimal_byte_parts::DecimalBytePartsArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +pub fn vortex_decimal_byte_parts::DecimalBytePartsData::dtype(&self) -> &vortex_array::dtype::DType -impl core::convert::From for vortex_array::array::ArrayRef +pub fn vortex_decimal_byte_parts::DecimalBytePartsData::into_parts(self) -> vortex_decimal_byte_parts::DecimalBytePartsArrayParts -pub fn vortex_array::array::ArrayRef::from(value: vortex_decimal_byte_parts::DecimalBytePartsArray) -> vortex_array::array::ArrayRef +pub fn vortex_decimal_byte_parts::DecimalBytePartsData::is_empty(&self) -> bool -impl core::fmt::Debug for vortex_decimal_byte_parts::DecimalBytePartsArray +pub fn vortex_decimal_byte_parts::DecimalBytePartsData::len(&self) -> usize -pub fn vortex_decimal_byte_parts::DecimalBytePartsArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_decimal_byte_parts::DecimalBytePartsData::try_new(msp: vortex_array::array::ArrayRef, decimal_dtype: vortex_array::dtype::decimal::DecimalDType) -> vortex_error::VortexResult -impl core::ops::deref::Deref for vortex_decimal_byte_parts::DecimalBytePartsArray +impl core::clone::Clone for vortex_decimal_byte_parts::DecimalBytePartsData -pub type vortex_decimal_byte_parts::DecimalBytePartsArray::Target = dyn vortex_array::array::DynArray +pub fn vortex_decimal_byte_parts::DecimalBytePartsData::clone(&self) -> vortex_decimal_byte_parts::DecimalBytePartsData -pub fn vortex_decimal_byte_parts::DecimalBytePartsArray::deref(&self) -> &Self::Target +impl core::convert::From for vortex_array::array::ArrayRef -impl vortex_array::array::IntoArray for vortex_decimal_byte_parts::DecimalBytePartsArray +pub fn vortex_array::array::ArrayRef::from(value: vortex_decimal_byte_parts::DecimalBytePartsData) -> vortex_array::array::ArrayRef -pub fn vortex_decimal_byte_parts::DecimalBytePartsArray::into_array(self) -> vortex_array::array::ArrayRef +impl core::fmt::Debug for vortex_decimal_byte_parts::DecimalBytePartsData -pub struct vortex_decimal_byte_parts::DecimalBytePartsArrayParts +pub fn vortex_decimal_byte_parts::DecimalBytePartsData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub vortex_decimal_byte_parts::DecimalBytePartsArrayParts::dtype: vortex_array::dtype::DType +impl vortex_array::array::IntoArray for vortex_decimal_byte_parts::DecimalBytePartsData -pub vortex_decimal_byte_parts::DecimalBytePartsArrayParts::msp: vortex_array::array::ArrayRef +pub fn vortex_decimal_byte_parts::DecimalBytePartsData::into_array(self) -> vortex_array::array::ArrayRef pub struct vortex_decimal_byte_parts::DecimalBytesPartsMetadata @@ -171,3 +165,5 @@ pub fn vortex_decimal_byte_parts::DecimalBytesPartsMetadata::clear(&mut self) pub fn vortex_decimal_byte_parts::DecimalBytesPartsMetadata::encoded_len(&self) -> usize pub fn vortex_decimal_byte_parts::initialize(session: &mut vortex_session::VortexSession) + +pub type vortex_decimal_byte_parts::DecimalBytePartsArray = vortex_array::vtable::typed::Array diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/cast.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/cast.rs index 04016fead44..86d9e156c04 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/cast.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/cast.rs @@ -11,7 +11,6 @@ use vortex_error::VortexResult; use crate::DecimalByteParts; use crate::DecimalBytePartsArray; - impl CastReduce for DecimalByteParts { fn cast(array: &DecimalBytePartsArray, dtype: &DType) -> VortexResult> { // DecimalBytePartsArray can only have Decimal dtype, so we only handle decimal-to-decimal casts @@ -30,7 +29,7 @@ impl CastReduce for DecimalByteParts { .cast(array.msp().dtype().with_nullability(*target_nullability))?; return Ok(Some( - DecimalBytePartsArray::try_new(new_msp, *target_decimal)?.into_array(), + DecimalByteParts::try_new(new_msp, *target_decimal)?.into_array(), )); } @@ -52,16 +51,15 @@ mod tests { use vortex_array::dtype::Nullability; use vortex_buffer::buffer; + use crate::DecimalByteParts; use crate::DecimalBytePartsArray; #[test] fn test_cast_decimal_byte_parts_nullability() { let decimal_dtype = DecimalDType::new(10, 2); - let array = DecimalBytePartsArray::try_new( - buffer![100i32, 200, 300, 400].into_array(), - decimal_dtype, - ) - .unwrap(); + let array = + DecimalByteParts::try_new(buffer![100i32, 200, 300, 400].into_array(), decimal_dtype) + .unwrap(); // Cast to nullable decimal let casted = array @@ -81,7 +79,7 @@ mod tests { #[test] fn test_cast_decimal_byte_parts_nullable_to_non_nullable() { let decimal_dtype = DecimalDType::new(10, 2); - let array = DecimalBytePartsArray::try_new( + let array = DecimalByteParts::try_new( PrimitiveArray::from_option_iter([Some(100i32), None, Some(300)]).into_array(), decimal_dtype, ) @@ -96,24 +94,24 @@ mod tests { } #[rstest] - #[case::i32(DecimalBytePartsArray::try_new( + #[case::i32(DecimalByteParts::try_new( buffer![100i32, 200, 300, 400, 500].into_array(), DecimalDType::new(10, 2), ).unwrap())] - #[case::i64(DecimalBytePartsArray::try_new( + #[case::i64(DecimalByteParts::try_new( buffer![1000i64, 2000, 3000, 4000].into_array(), DecimalDType::new(19, 4), ).unwrap())] - #[case::nullable(DecimalBytePartsArray::try_new( + #[case::nullable(DecimalByteParts::try_new( PrimitiveArray::from_option_iter([Some(100i32), None, Some(300), Some(400), None]) .into_array(), DecimalDType::new(10, 2), ).unwrap())] - #[case::single(DecimalBytePartsArray::try_new( + #[case::single(DecimalByteParts::try_new( buffer![42i32].into_array(), DecimalDType::new(5, 1), ).unwrap())] - #[case::negative(DecimalBytePartsArray::try_new( + #[case::negative(DecimalByteParts::try_new( buffer![-100i32, -200, 300, -400, 500].into_array(), DecimalDType::new(10, 2), ).unwrap())] diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/compare.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/compare.rs index 1c0c043f83f..6c78e3660be 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/compare.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/compare.rs @@ -21,6 +21,7 @@ use vortex_array::scalar::ScalarValue; use vortex_array::scalar_fn::fns::binary::CompareKernel; use vortex_array::scalar_fn::fns::operators::CompareOperator; use vortex_array::scalar_fn::fns::operators::Operator; +use vortex_array::vtable::Array; use vortex_error::VortexExpect; use vortex_error::VortexResult; @@ -29,7 +30,7 @@ use crate::decimal_byte_parts::compute::compare::Sign::Positive; impl CompareKernel for DecimalByteParts { fn compare( - lhs: &Self::Array, + lhs: &Array, rhs: &ArrayRef, operator: CompareOperator, _ctx: &mut ExecutionCtx, @@ -158,13 +159,13 @@ mod tests { use vortex_buffer::buffer; use vortex_error::VortexResult; - use crate::DecimalBytePartsArray; + use crate::DecimalByteParts; #[test] fn compare_decimal_const() { let decimal_dtype = DecimalDType::new(8, 2); let dtype = DType::Decimal(decimal_dtype, Nullability::Nullable); - let lhs = DecimalBytePartsArray::try_new( + let lhs = DecimalByteParts::try_new( PrimitiveArray::new(buffer![100i32, 200i32, 400i32], Validity::AllValid).into_array(), decimal_dtype, ) @@ -184,7 +185,7 @@ mod tests { #[test] fn test_byteparts_compare_nullable() -> VortexResult<()> { let decimal_type = DecimalDType::new(19, -11); - let lhs = DecimalBytePartsArray::try_new( + let lhs = DecimalByteParts::try_new( PrimitiveArray::new( buffer![1i64, 2i64, 3i64, 4i64], Validity::Array(BoolArray::from_iter([false, true, true, true]).into_array()), @@ -215,7 +216,7 @@ mod tests { fn compare_decimal_const_unconvertible_comparison() { let decimal_dtype = DecimalDType::new(40, 2); let dtype = DType::Decimal(decimal_dtype, Nullability::Nullable); - let lhs = DecimalBytePartsArray::try_new( + let lhs = DecimalByteParts::try_new( PrimitiveArray::new(buffer![100i32, 200i32, 400i32], Validity::AllValid).into_array(), decimal_dtype, ) diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/filter.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/filter.rs index a25521db8e7..b71bfc267fd 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/filter.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/filter.rs @@ -9,10 +9,9 @@ use vortex_mask::Mask; use crate::DecimalByteParts; use crate::DecimalBytePartsArray; - impl FilterReduce for DecimalByteParts { fn filter(array: &DecimalBytePartsArray, mask: &Mask) -> VortexResult> { - DecimalBytePartsArray::try_new(array.msp.filter(mask.clone())?, *array.decimal_dtype()) + DecimalByteParts::try_new(array.msp.filter(mask.clone())?, *array.decimal_dtype()) .map(|d| Some(d.into_array())) } } @@ -25,7 +24,7 @@ mod test { use vortex_array::dtype::DecimalDType; use vortex_buffer::buffer; - use crate::DecimalBytePartsArray; + use crate::DecimalByteParts; #[test] fn test_filter_decimal_byte_parts() { @@ -33,7 +32,7 @@ mod test { let msp = buffer![100i32, 200, 300, 400, 500].into_array(); let decimal_dtype = DecimalDType::new(8, 2); - let array = DecimalBytePartsArray::try_new(msp, decimal_dtype).unwrap(); + let array = DecimalByteParts::try_new(msp, decimal_dtype).unwrap(); test_filter_conformance(&array.into_array()); // Test with nullable values @@ -41,7 +40,7 @@ mod test { .into_array(); let decimal_dtype = DecimalDType::new(18, 4); - let array = DecimalBytePartsArray::try_new(msp, decimal_dtype).unwrap(); + let array = DecimalByteParts::try_new(msp, decimal_dtype).unwrap(); test_filter_conformance(&array.into_array()); } } diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/mask.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/mask.rs index 8bc05af2ff0..cef7c390575 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/mask.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/mask.rs @@ -9,6 +9,7 @@ use vortex_array::scalar_fn::fns::mask::Mask as MaskExpr; use vortex_array::scalar_fn::fns::mask::MaskReduce; use vortex_error::VortexResult; +use super::DecimalBytePartsData; use crate::DecimalByteParts; use crate::DecimalBytePartsArray; @@ -20,7 +21,7 @@ impl MaskReduce for DecimalByteParts { [array.msp.clone(), mask.clone()], )?; Ok(Some( - DecimalBytePartsArray::try_new(masked_msp, *array.decimal_dtype())?.into_array(), + DecimalBytePartsData::try_new(masked_msp, *array.decimal_dtype())?.into_array(), )) } } diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/mod.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/mod.rs index 77ede1a4563..ef271694aea 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/mod.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/mod.rs @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use super::DecimalBytePartsData; mod cast; mod compare; mod filter; @@ -18,51 +19,52 @@ mod tests { use vortex_array::dtype::DecimalDType; use vortex_buffer::buffer; + use crate::DecimalByteParts; use crate::DecimalBytePartsArray; #[rstest] // Basic decimal byte parts arrays - #[case::decimal_i32(DecimalBytePartsArray::try_new( + #[case::decimal_i32(DecimalByteParts::try_new( buffer![100i32, 200, 300, 400, 500].into_array(), DecimalDType::new(10, 2) ).unwrap())] - #[case::decimal_i64(DecimalBytePartsArray::try_new( + #[case::decimal_i64(DecimalByteParts::try_new( buffer![1000i64, 2000, 3000, 4000, 5000].into_array(), DecimalDType::new(19, 4) ).unwrap())] // Nullable arrays - #[case::decimal_nullable_i32(DecimalBytePartsArray::try_new( + #[case::decimal_nullable_i32(DecimalByteParts::try_new( PrimitiveArray::from_option_iter([Some(100i32), None, Some(300), Some(400), None]).into_array(), DecimalDType::new(10, 2) ).unwrap())] - #[case::decimal_nullable_i64(DecimalBytePartsArray::try_new( + #[case::decimal_nullable_i64(DecimalByteParts::try_new( PrimitiveArray::from_option_iter([Some(1000i64), None, Some(3000), Some(4000), None]).into_array(), DecimalDType::new(19, 4) ).unwrap())] // Different precision/scale combinations - #[case::decimal_high_precision(DecimalBytePartsArray::try_new( + #[case::decimal_high_precision(DecimalByteParts::try_new( buffer![123456789i32, 987654321, -123456789].into_array(), DecimalDType::new(38, 10) ).unwrap())] - #[case::decimal_zero_scale(DecimalBytePartsArray::try_new( + #[case::decimal_zero_scale(DecimalByteParts::try_new( buffer![100i32, 200, 300].into_array(), DecimalDType::new(10, 0) ).unwrap())] // Edge cases - #[case::decimal_single(DecimalBytePartsArray::try_new( + #[case::decimal_single(DecimalByteParts::try_new( buffer![42i32].into_array(), DecimalDType::new(5, 1) ).unwrap())] - #[case::decimal_negative(DecimalBytePartsArray::try_new( + #[case::decimal_negative(DecimalByteParts::try_new( buffer![-100i32, -200, 300, -400, 500].into_array(), DecimalDType::new(10, 2) ).unwrap())] // Large arrays - #[case::decimal_large(DecimalBytePartsArray::try_new( + #[case::decimal_large(DecimalByteParts::try_new( PrimitiveArray::from_iter((0..1500).map(|i| i * 100)).into_array(), DecimalDType::new(10, 2) ).unwrap())] - #[case::decimal_large_i64(DecimalBytePartsArray::try_new( + #[case::decimal_large_i64(DecimalByteParts::try_new( PrimitiveArray::from_iter((0..2000i64).map(|i| i * 1000000)).into_array(), DecimalDType::new(19, 6) ).unwrap())] diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/take.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/take.rs index 580fa514558..c18c21e4067 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/take.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/compute/take.rs @@ -8,6 +8,7 @@ use vortex_array::IntoArray; use vortex_array::arrays::dict::TakeExecute; use vortex_error::VortexResult; +use super::DecimalBytePartsData; use crate::DecimalByteParts; use crate::DecimalBytePartsArray; @@ -17,7 +18,7 @@ impl TakeExecute for DecimalByteParts { indices: &ArrayRef, _ctx: &mut ExecutionCtx, ) -> VortexResult> { - DecimalBytePartsArray::try_new(array.msp.take(indices.to_array())?, *array.decimal_dtype()) + DecimalBytePartsData::try_new(array.msp.take(indices.to_array())?, *array.decimal_dtype()) .map(|a| Some(a.into_array())) } } diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs index 6f14649bc91..677d4b15bee 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use vortex_array::vtable::Array; pub(crate) mod compute; mod rules; mod slice; @@ -31,14 +32,11 @@ use vortex_array::scalar::Scalar; use vortex_array::scalar::ScalarValue; use vortex_array::serde::ArrayChildren; use vortex_array::stats::ArrayStats; -use vortex_array::stats::StatsSetRef; use vortex_array::vtable; -use vortex_array::vtable::Array; use vortex_array::vtable::ArrayId; use vortex_array::vtable::OperationsVTable; use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityChild; -use vortex_array::vtable::ValidityHelper; use vortex_array::vtable::ValidityVTableFromChild; use vortex_error::VortexExpect; use vortex_error::VortexResult; @@ -50,7 +48,7 @@ use vortex_session::VortexSession; use crate::decimal_byte_parts::compute::kernel::PARENT_KERNELS; use crate::decimal_byte_parts::rules::PARENT_RULES; -vtable!(DecimalByteParts); +vtable!(DecimalByteParts, DecimalByteParts, DecimalBytePartsData); #[derive(Clone, prost::Message)] pub struct DecimalBytesPartsMetadata { @@ -61,13 +59,13 @@ pub struct DecimalBytesPartsMetadata { } impl VTable for DecimalByteParts { - type Array = DecimalBytePartsArray; + type ArrayData = DecimalBytePartsData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromChild; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &DecimalByteParts } @@ -75,66 +73,58 @@ impl VTable for DecimalByteParts { Self::ID } - fn len(array: &DecimalBytePartsArray) -> usize { + fn len(array: &DecimalBytePartsData) -> usize { array.msp.len() } - fn dtype(array: &DecimalBytePartsArray) -> &DType { + fn dtype(array: &DecimalBytePartsData) -> &DType { &array.dtype } - fn stats(array: &DecimalBytePartsArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &DecimalBytePartsData) -> &ArrayStats { + &array.stats_set } - fn array_hash( - array: &DecimalBytePartsArray, - state: &mut H, - precision: Precision, - ) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.msp.array_hash(state, precision); } - fn array_eq( - array: &DecimalBytePartsArray, - other: &DecimalBytePartsArray, - precision: Precision, - ) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.msp.array_eq(&other.msp, precision) } - fn nbuffers(_array: &DecimalBytePartsArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &DecimalBytePartsArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("DecimalBytePartsArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &DecimalBytePartsArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { vortex_panic!("DecimalBytePartsArray buffer_name index {idx} out of bounds") } - fn nchildren(_array: &DecimalBytePartsArray) -> usize { + fn nchildren(_array: &Array) -> usize { 1 } - fn child(array: &DecimalBytePartsArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.msp.clone(), _ => vortex_panic!("DecimalBytePartsArray child index {idx} out of bounds"), } } - fn child_name(_array: &DecimalBytePartsArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "msp".to_string(), _ => vortex_panic!("DecimalBytePartsArray child_name index {idx} out of bounds"), } } - fn metadata(array: &DecimalBytePartsArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(DecimalBytesPartsMetadata { zeroth_child_ptype: PType::try_from(array.msp.dtype())? as i32, lower_part_count: 0, @@ -161,7 +151,7 @@ impl VTable for DecimalByteParts { metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let Some(decimal_dtype) = dtype.as_decimal_opt() else { vortex_bail!("decoding decimal but given non decimal dtype {}", dtype) }; @@ -175,10 +165,10 @@ impl VTable for DecimalByteParts { "lower_part_count > 0 not currently supported" ); - DecimalBytePartsArray::try_new(msp, *decimal_dtype) + DecimalBytePartsData::try_new(msp, *decimal_dtype) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 1, "DecimalBytePartsArray expects exactly 1 child (msp), got {}", @@ -216,7 +206,7 @@ impl VTable for DecimalByteParts { /// /// e.g. for a decimal i128 \[ 127..64 | 64..0 \] msp = 127..64 and lower_part\[0\] = 64..0 #[derive(Clone, Debug)] -pub struct DecimalBytePartsArray { +pub struct DecimalBytePartsData { msp: ArrayRef, // NOTE: the lower_parts is currently unused, we reserve this field so that it is properly // read/written during serde, but provide no constructor to initialize this to anything @@ -232,7 +222,7 @@ pub struct DecimalBytePartsArrayParts { pub dtype: DType, } -impl DecimalBytePartsArray { +impl DecimalBytePartsData { pub fn try_new(msp: ArrayRef, decimal_dtype: DecimalDType) -> VortexResult { if !msp.dtype().is_signed_int() { vortex_bail!("decimal bytes parts, first part must be a signed array") @@ -265,6 +255,21 @@ impl DecimalBytePartsArray { } } + /// Returns the number of elements in the array. + pub fn len(&self) -> usize { + self.msp.len() + } + + /// Returns `true` if the array contains no elements. + pub fn is_empty(&self) -> bool { + self.msp.len() == 0 + } + + /// Returns the logical data type of the array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + pub fn decimal_dtype(&self) -> &DecimalDType { self.dtype .as_decimal_opt() @@ -281,6 +286,14 @@ pub struct DecimalByteParts; impl DecimalByteParts { pub const ID: ArrayId = ArrayId::new_ref("vortex.decimal_byte_parts"); + + /// Construct a new [`DecimalBytePartsArray`] from an MSP array and decimal dtype. + pub fn try_new( + msp: ArrayRef, + decimal_dtype: DecimalDType, + ) -> VortexResult { + Array::try_from_data(DecimalBytePartsData::try_new(msp, decimal_dtype)?) + } } /// Converts a DecimalBytePartsArray to its canonical DecimalArray representation. @@ -309,7 +322,7 @@ fn to_canonical_decimal( impl OperationsVTable for DecimalByteParts { fn scalar_at( - array: &DecimalBytePartsArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -328,7 +341,7 @@ impl OperationsVTable for DecimalByteParts { } impl ValidityChild for DecimalByteParts { - fn validity_child(array: &DecimalBytePartsArray) -> &ArrayRef { + fn validity_child(array: &DecimalBytePartsData) -> &ArrayRef { // validity stored in 0th child &array.msp } @@ -349,13 +362,13 @@ mod tests { use vortex_array::validity::Validity; use vortex_buffer::buffer; - use crate::DecimalBytePartsArray; + use crate::DecimalByteParts; #[test] fn test_scalar_at_decimal_parts() { let decimal_dtype = DecimalDType::new(8, 2); let dtype = DType::Decimal(decimal_dtype, Nullability::Nullable); - let array = DecimalBytePartsArray::try_new( + let array = DecimalByteParts::try_new( PrimitiveArray::new( buffer![100i32, 200i32, 400i32], Validity::Array(BoolArray::from_iter(vec![false, true, true]).into_array()), diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/rules.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/rules.rs index a658d15d1a4..c398cdb8ed4 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/rules.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/rules.rs @@ -14,6 +14,7 @@ use vortex_array::scalar_fn::fns::cast::CastReduceAdaptor; use vortex_array::scalar_fn::fns::mask::MaskReduceAdaptor; use vortex_error::VortexResult; +use super::DecimalBytePartsData; use crate::DecimalByteParts; use crate::DecimalBytePartsArray; @@ -45,7 +46,7 @@ impl ArrayParentReduceRule for DecimalBytePartsFilterPushDownR let new_msp = child.msp.filter(parent.filter_mask().clone())?; let new_child = - DecimalBytePartsArray::try_new(new_msp, *child.decimal_dtype())?.into_array(); + DecimalBytePartsData::try_new(new_msp, *child.decimal_dtype())?.into_array(); Ok(Some(new_child)) } } diff --git a/encodings/decimal-byte-parts/src/decimal_byte_parts/slice.rs b/encodings/decimal-byte-parts/src/decimal_byte_parts/slice.rs index 4f0d3ec36fb..70b3682606d 100644 --- a/encodings/decimal-byte-parts/src/decimal_byte_parts/slice.rs +++ b/encodings/decimal-byte-parts/src/decimal_byte_parts/slice.rs @@ -8,6 +8,7 @@ use vortex_array::IntoArray; use vortex_array::arrays::slice::SliceReduce; use vortex_error::VortexResult; +use super::DecimalBytePartsData; use crate::DecimalByteParts; use crate::DecimalBytePartsArray; @@ -15,7 +16,7 @@ impl SliceReduce for DecimalByteParts { fn slice(array: &DecimalBytePartsArray, range: Range) -> VortexResult> { // SAFETY: slicing encoded MSP does not change the encoded values Ok(Some(unsafe { - DecimalBytePartsArray::new_unchecked(array.msp().slice(range)?, *array.decimal_dtype()) + DecimalBytePartsData::new_unchecked(array.msp().slice(range)?, *array.decimal_dtype()) .into_array() })) } diff --git a/encodings/fastlanes/benches/bitpacking_take.rs b/encodings/fastlanes/benches/bitpacking_take.rs index 23e857777f7..409e6201f7d 100644 --- a/encodings/fastlanes/benches/bitpacking_take.rs +++ b/encodings/fastlanes/benches/bitpacking_take.rs @@ -16,8 +16,10 @@ use vortex_array::RecursiveCanonical; use vortex_array::VortexSessionExecute; use vortex_array::arrays::PrimitiveArray; use vortex_array::validity::Validity; +use vortex_array::vtable::Array; use vortex_buffer::Buffer; use vortex_buffer::buffer; +use vortex_fastlanes::BitPacked; use vortex_fastlanes::bitpack_compress::bitpack_to_best_bit_width; fn main() { @@ -28,7 +30,9 @@ fn main() { fn take_10_stratified(bencher: Bencher) { let values = fixture(65_536, 8); let uncompressed = PrimitiveArray::new(values, Validity::NonNullable); - let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); + let packed = + Array::::try_from_data(bitpack_to_best_bit_width(&uncompressed).unwrap()) + .unwrap(); let indices = PrimitiveArray::from_iter((0..10).map(|i| i * 6_553)); bencher @@ -46,7 +50,9 @@ fn take_10_stratified(bencher: Bencher) { fn take_10_contiguous(bencher: Bencher) { let values = fixture(65_536, 8); let uncompressed = PrimitiveArray::new(values, Validity::NonNullable); - let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); + let packed = + Array::::try_from_data(bitpack_to_best_bit_width(&uncompressed).unwrap()) + .unwrap(); let indices = buffer![0..10].into_array(); bencher @@ -65,7 +71,9 @@ fn take_10k_random(bencher: Bencher) { let values = fixture(65_536, 8); let range = Uniform::new(0, values.len()).unwrap(); let uncompressed = PrimitiveArray::new(values, Validity::NonNullable); - let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); + let packed = + Array::::try_from_data(bitpack_to_best_bit_width(&uncompressed).unwrap()) + .unwrap(); let rng = StdRng::seed_from_u64(0); let indices = PrimitiveArray::from_iter(rng.sample_iter(range).take(10_000).map(|i| i as u32)); @@ -85,7 +93,9 @@ fn take_10k_random(bencher: Bencher) { fn take_10k_contiguous(bencher: Bencher) { let values = fixture(65_536, 8); let uncompressed = PrimitiveArray::new(values, Validity::NonNullable); - let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); + let packed = + Array::::try_from_data(bitpack_to_best_bit_width(&uncompressed).unwrap()) + .unwrap(); let indices = PrimitiveArray::from_iter(0..10_000); bencher @@ -103,7 +113,9 @@ fn take_10k_contiguous(bencher: Bencher) { fn take_10k_dispersed(bencher: Bencher) { let values = fixture(65_536, 8); let uncompressed = PrimitiveArray::new(values.clone(), Validity::NonNullable); - let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); + let packed = + Array::::try_from_data(bitpack_to_best_bit_width(&uncompressed).unwrap()) + .unwrap(); let indices = PrimitiveArray::from_iter((0..10_000).map(|i| (i * 42) % values.len() as u64)); bencher @@ -121,7 +133,9 @@ fn take_10k_dispersed(bencher: Bencher) { fn take_10k_first_chunk_only(bencher: Bencher) { let values = fixture(65_536, 8); let uncompressed = PrimitiveArray::new(values, Validity::NonNullable); - let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); + let packed = + Array::::try_from_data(bitpack_to_best_bit_width(&uncompressed).unwrap()) + .unwrap(); let indices = PrimitiveArray::from_iter((0..10_000).map(|i| ((i * 42) % 1024) as u64)); bencher @@ -159,7 +173,9 @@ const NUM_EXCEPTIONS: u32 = 1024; fn patched_take_10_stratified(bencher: Bencher) { let values = (0u32..BIG_BASE2 + NUM_EXCEPTIONS).collect::>(); let uncompressed = PrimitiveArray::new(values, Validity::NonNullable); - let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); + let packed = + Array::::try_from_data(bitpack_to_best_bit_width(&uncompressed).unwrap()) + .unwrap(); assert!(packed.patches().is_some()); assert_eq!( @@ -184,7 +200,9 @@ fn patched_take_10_stratified(bencher: Bencher) { fn patched_take_10_contiguous(bencher: Bencher) { let values = (0u32..BIG_BASE2 + NUM_EXCEPTIONS).collect::>(); let uncompressed = PrimitiveArray::new(values, Validity::NonNullable); - let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); + let packed = + Array::::try_from_data(bitpack_to_best_bit_width(&uncompressed).unwrap()) + .unwrap(); assert!(packed.patches().is_some()); assert_eq!( @@ -209,7 +227,9 @@ fn patched_take_10_contiguous(bencher: Bencher) { fn patched_take_10k_random(bencher: Bencher) { let values = (0u32..BIG_BASE2 + NUM_EXCEPTIONS).collect::>(); let uncompressed = PrimitiveArray::new(values.clone(), Validity::NonNullable); - let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); + let packed = + Array::::try_from_data(bitpack_to_best_bit_width(&uncompressed).unwrap()) + .unwrap(); let rng = StdRng::seed_from_u64(0); let range = Uniform::new(0, values.len()).unwrap(); @@ -230,7 +250,9 @@ fn patched_take_10k_random(bencher: Bencher) { fn patched_take_10k_contiguous_not_patches(bencher: Bencher) { let values = (0u32..BIG_BASE2 + NUM_EXCEPTIONS).collect::>(); let uncompressed = PrimitiveArray::new(values, Validity::NonNullable); - let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); + let packed = + Array::::try_from_data(bitpack_to_best_bit_width(&uncompressed).unwrap()) + .unwrap(); let indices = PrimitiveArray::from_iter((0u32..NUM_EXCEPTIONS).cycle().take(10000)); bencher @@ -248,7 +270,9 @@ fn patched_take_10k_contiguous_not_patches(bencher: Bencher) { fn patched_take_10k_contiguous_patches(bencher: Bencher) { let values = (0u32..BIG_BASE2 + NUM_EXCEPTIONS).collect::>(); let uncompressed = PrimitiveArray::new(values, Validity::NonNullable); - let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); + let packed = + Array::::try_from_data(bitpack_to_best_bit_width(&uncompressed).unwrap()) + .unwrap(); assert!(packed.patches().is_some()); assert_eq!( @@ -274,7 +298,9 @@ fn patched_take_10k_contiguous_patches(bencher: Bencher) { fn patched_take_10k_dispersed(bencher: Bencher) { let values = (0u32..BIG_BASE2 + NUM_EXCEPTIONS).collect::>(); let uncompressed = PrimitiveArray::new(values.clone(), Validity::NonNullable); - let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); + let packed = + Array::::try_from_data(bitpack_to_best_bit_width(&uncompressed).unwrap()) + .unwrap(); let indices = PrimitiveArray::from_iter((0..10_000).map(|i| (i * 42) % values.len() as u64)); bencher @@ -292,7 +318,9 @@ fn patched_take_10k_dispersed(bencher: Bencher) { fn patched_take_10k_first_chunk_only(bencher: Bencher) { let values = (0u32..BIG_BASE2 + NUM_EXCEPTIONS).collect::>(); let uncompressed = PrimitiveArray::new(values, Validity::NonNullable); - let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); + let packed = + Array::::try_from_data(bitpack_to_best_bit_width(&uncompressed).unwrap()) + .unwrap(); let indices = PrimitiveArray::from_iter((0..10_000).map(|i| ((i * 42) % 1024) as u64)); bencher @@ -310,7 +338,9 @@ fn patched_take_10k_first_chunk_only(bencher: Bencher) { fn patched_take_10k_adversarial(bencher: Bencher) { let values = (0u32..BIG_BASE2 + NUM_EXCEPTIONS).collect::>(); let uncompressed = PrimitiveArray::new(values, Validity::NonNullable); - let packed = bitpack_to_best_bit_width(&uncompressed).unwrap(); + let packed = + Array::::try_from_data(bitpack_to_best_bit_width(&uncompressed).unwrap()) + .unwrap(); let per_chunk_count = 100; let indices = PrimitiveArray::from_iter( (0..(NUM_EXCEPTIONS + 1024) / 1024) diff --git a/encodings/fastlanes/benches/compute_between.rs b/encodings/fastlanes/benches/compute_between.rs index 48cbae73216..7ca38d54b17 100644 --- a/encodings/fastlanes/benches/compute_between.rs +++ b/encodings/fastlanes/benches/compute_between.rs @@ -5,7 +5,7 @@ use num_traits::NumCast; use rand::RngExt; use rand::rngs::StdRng; -use vortex_alp::ALPArray; +use vortex_alp::ALP; use vortex_alp::alp_encode; use vortex_array::ArrayRef; use vortex_array::IntoArray; @@ -54,7 +54,7 @@ fn generate_alp_bit_pack_primitive_array( let bp = bitpack_to_best_bit_width(&encoded) .vortex_expect("") .into_array(); - ALPArray::new(bp, alp.exponents(), None).into_array() + ALP::new(bp, alp.exponents(), None).into_array() } const BENCH_ARGS: &[usize] = &[2 << 10, 2 << 13, 2 << 14]; diff --git a/encodings/fastlanes/public-api.lock b/encodings/fastlanes/public-api.lock index 4f3d3a9451a..073c0ffec8b 100644 --- a/encodings/fastlanes/public-api.lock +++ b/encodings/fastlanes/public-api.lock @@ -16,21 +16,21 @@ pub fn vortex_fastlanes::bit_transpose::untranspose_validity(validity: &vortex_a pub mod vortex_fastlanes::bitpack_compress -pub fn vortex_fastlanes::bitpack_compress::bit_width_histogram(array: &vortex_array::arrays::primitive::array::PrimitiveArray) -> vortex_error::VortexResult> +pub fn vortex_fastlanes::bitpack_compress::bit_width_histogram(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_error::VortexResult> -pub fn vortex_fastlanes::bitpack_compress::bitpack_encode(array: &vortex_array::arrays::primitive::array::PrimitiveArray, bit_width: u8, bit_width_freq: core::option::Option<&[usize]>) -> vortex_error::VortexResult +pub fn vortex_fastlanes::bitpack_compress::bitpack_encode(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray, bit_width: u8, bit_width_freq: core::option::Option<&[usize]>) -> vortex_error::VortexResult -pub unsafe fn vortex_fastlanes::bitpack_compress::bitpack_encode_unchecked(array: vortex_array::arrays::primitive::array::PrimitiveArray, bit_width: u8) -> vortex_error::VortexResult +pub unsafe fn vortex_fastlanes::bitpack_compress::bitpack_encode_unchecked(array: vortex_array::arrays::primitive::vtable::PrimitiveArray, bit_width: u8) -> vortex_error::VortexResult pub fn vortex_fastlanes::bitpack_compress::bitpack_primitive(array: &[T], bit_width: u8) -> vortex_buffer::buffer::Buffer -pub fn vortex_fastlanes::bitpack_compress::bitpack_to_best_bit_width(array: &vortex_array::arrays::primitive::array::PrimitiveArray) -> vortex_error::VortexResult +pub fn vortex_fastlanes::bitpack_compress::bitpack_to_best_bit_width(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_error::VortexResult -pub unsafe fn vortex_fastlanes::bitpack_compress::bitpack_unchecked(parray: &vortex_array::arrays::primitive::array::PrimitiveArray, bit_width: u8) -> vortex_buffer::ByteBuffer +pub unsafe fn vortex_fastlanes::bitpack_compress::bitpack_unchecked(parray: &vortex_array::arrays::primitive::vtable::PrimitiveArray, bit_width: u8) -> vortex_buffer::ByteBuffer pub fn vortex_fastlanes::bitpack_compress::find_best_bit_width(ptype: vortex_array::dtype::ptype::PType, bit_width_freq: &[usize]) -> vortex_error::VortexResult -pub fn vortex_fastlanes::bitpack_compress::gather_patches(parray: &vortex_array::arrays::primitive::array::PrimitiveArray, bit_width: u8, num_exceptions_hint: usize) -> vortex_error::VortexResult> +pub fn vortex_fastlanes::bitpack_compress::gather_patches(parray: &vortex_array::arrays::primitive::vtable::PrimitiveArray, bit_width: u8, num_exceptions_hint: usize) -> vortex_error::VortexResult> pub mod vortex_fastlanes::bitpack_decompress @@ -40,9 +40,9 @@ pub fn vortex_fastlanes::bitpack_decompress::apply_patches_to_uninit_range_fn usize -pub fn vortex_fastlanes::bitpack_decompress::unpack_array(array: &vortex_fastlanes::BitPackedArray, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_fastlanes::bitpack_decompress::unpack_array(array: &vortex_fastlanes::BitPackedArray, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_fastlanes::bitpack_decompress::unpack_primitive_array(array: &vortex_fastlanes::BitPackedArray, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_fastlanes::bitpack_decompress::unpack_primitive_array(array: &vortex_fastlanes::BitPackedArray, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult pub fn vortex_fastlanes::bitpack_decompress::unpack_single(array: &vortex_fastlanes::BitPackedArray, index: usize) -> vortex_array::scalar::Scalar @@ -86,7 +86,7 @@ impl vortex_fastlanes::unpack_iter: pub fn vortex_fastlanes::unpack_iter::UnpackedChunks::full_chunks(&mut self) -> vortex_fastlanes::unpack_iter::BitUnpackIterator<'_, T> -pub fn vortex_fastlanes::unpack_iter::UnpackedChunks::new(array: &vortex_fastlanes::BitPackedArray) -> Self +pub fn vortex_fastlanes::unpack_iter::UnpackedChunks::new(array: &vortex_fastlanes::BitPackedData) -> Self pub trait vortex_fastlanes::unpack_iter::BitPacked: vortex_array::dtype::ptype::PhysicalPType @@ -122,6 +122,8 @@ impl vortex_fastlanes::BitPacked pub const vortex_fastlanes::BitPacked::ID: vortex_array::vtable::dyn_::ArrayId +pub fn vortex_fastlanes::BitPacked::encode(array: &vortex_array::array::ArrayRef, bit_width: u8) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_fastlanes::BitPacked pub fn vortex_fastlanes::BitPacked::clone(&self) -> vortex_fastlanes::BitPacked @@ -148,7 +150,7 @@ pub fn vortex_fastlanes::BitPacked::cast(array: &vortex_fastlanes::BitPackedArra impl vortex_array::vtable::VTable for vortex_fastlanes::BitPacked -pub type vortex_fastlanes::BitPacked::Array = vortex_fastlanes::BitPackedArray +pub type vortex_fastlanes::BitPacked::ArrayData = vortex_fastlanes::BitPackedData pub type vortex_fastlanes::BitPacked::Metadata = vortex_array::metadata::ProstMetadata @@ -156,25 +158,25 @@ pub type vortex_fastlanes::BitPacked::OperationsVTable = vortex_fastlanes::BitPa pub type vortex_fastlanes::BitPacked::ValidityVTable = vortex_array::vtable::validity::ValidityVTableFromValidityHelper -pub fn vortex_fastlanes::BitPacked::append_to_builder(array: &vortex_fastlanes::BitPackedArray, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::BitPacked::append_to_builder(array: &vortex_array::vtable::typed::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_fastlanes::BitPacked::array_eq(array: &vortex_fastlanes::BitPackedArray, other: &vortex_fastlanes::BitPackedArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fastlanes::BitPacked::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fastlanes::BitPacked::array_hash(array: &vortex_fastlanes::BitPackedArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fastlanes::BitPacked::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_fastlanes::BitPacked::buffer(array: &vortex_fastlanes::BitPackedArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_fastlanes::BitPacked::buffer(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_fastlanes::BitPacked::buffer_name(_array: &vortex_fastlanes::BitPackedArray, idx: usize) -> core::option::Option +pub fn vortex_fastlanes::BitPacked::buffer_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> core::option::Option -pub fn vortex_fastlanes::BitPacked::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_fastlanes::BitPacked::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_fastlanes::BitPacked::child(array: &vortex_fastlanes::BitPackedArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_fastlanes::BitPacked::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_fastlanes::BitPacked::child_name(array: &vortex_fastlanes::BitPackedArray, idx: usize) -> alloc::string::String +pub fn vortex_fastlanes::BitPacked::child_name(array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_fastlanes::BitPacked::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_fastlanes::BitPacked::dtype(array: &vortex_fastlanes::BitPackedArray) -> &vortex_array::dtype::DType +pub fn vortex_fastlanes::BitPacked::dtype(array: &vortex_fastlanes::BitPackedData) -> &vortex_array::dtype::DType pub fn vortex_fastlanes::BitPacked::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -182,103 +184,99 @@ pub fn vortex_fastlanes::BitPacked::execute_parent(array: &vortex_array::vtable: pub fn vortex_fastlanes::BitPacked::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_fastlanes::BitPacked::len(array: &vortex_fastlanes::BitPackedArray) -> usize +pub fn vortex_fastlanes::BitPacked::len(array: &vortex_fastlanes::BitPackedData) -> usize -pub fn vortex_fastlanes::BitPacked::metadata(array: &vortex_fastlanes::BitPackedArray) -> vortex_error::VortexResult +pub fn vortex_fastlanes::BitPacked::metadata(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_fastlanes::BitPacked::nbuffers(_array: &vortex_fastlanes::BitPackedArray) -> usize +pub fn vortex_fastlanes::BitPacked::nbuffers(_array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_fastlanes::BitPacked::nchildren(array: &vortex_fastlanes::BitPackedArray) -> usize +pub fn vortex_fastlanes::BitPacked::nchildren(array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_fastlanes::BitPacked::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::BitPacked::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_fastlanes::BitPacked::stats(array: &vortex_fastlanes::BitPackedArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_fastlanes::BitPacked::stats(array: &vortex_fastlanes::BitPackedData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_fastlanes::BitPacked::vtable(_array: &Self::Array) -> &Self +pub fn vortex_fastlanes::BitPacked::vtable(_array: &vortex_fastlanes::BitPackedData) -> &Self -pub fn vortex_fastlanes::BitPacked::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::BitPacked::with_children(array: &mut vortex_fastlanes::BitPackedData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_fastlanes::BitPacked -pub fn vortex_fastlanes::BitPacked::scalar_at(array: &vortex_fastlanes::BitPackedArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_fastlanes::BitPacked::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult -pub struct vortex_fastlanes::BitPackedArray +pub struct vortex_fastlanes::BitPackedArrayParts -impl vortex_fastlanes::BitPackedArray +pub vortex_fastlanes::BitPackedArrayParts::bit_width: u8 -pub fn vortex_fastlanes::BitPackedArray::bit_width(&self) -> u8 +pub vortex_fastlanes::BitPackedArrayParts::len: usize -pub fn vortex_fastlanes::BitPackedArray::encode(array: &vortex_array::array::ArrayRef, bit_width: u8) -> vortex_error::VortexResult +pub vortex_fastlanes::BitPackedArrayParts::offset: u16 -pub fn vortex_fastlanes::BitPackedArray::into_parts(self) -> vortex_fastlanes::BitPackedArrayParts +pub vortex_fastlanes::BitPackedArrayParts::packed: vortex_array::buffer::BufferHandle -pub fn vortex_fastlanes::BitPackedArray::max_packed_value(&self) -> usize +pub vortex_fastlanes::BitPackedArrayParts::patches: core::option::Option -pub fn vortex_fastlanes::BitPackedArray::offset(&self) -> u16 +pub vortex_fastlanes::BitPackedArrayParts::validity: vortex_array::validity::Validity -pub fn vortex_fastlanes::BitPackedArray::packed(&self) -> &vortex_array::buffer::BufferHandle +pub struct vortex_fastlanes::BitPackedData -pub fn vortex_fastlanes::BitPackedArray::packed_slice(&self) -> &[T] +impl vortex_fastlanes::BitPackedData -pub fn vortex_fastlanes::BitPackedArray::patches(&self) -> core::option::Option<&vortex_array::patches::Patches> +pub fn vortex_fastlanes::BitPackedData::bit_width(&self) -> u8 -pub fn vortex_fastlanes::BitPackedArray::ptype(&self) -> vortex_array::dtype::ptype::PType +pub fn vortex_fastlanes::BitPackedData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_fastlanes::BitPackedArray::replace_patches(&mut self, patches: core::option::Option) +pub fn vortex_fastlanes::BitPackedData::encode(array: &vortex_array::array::ArrayRef, bit_width: u8) -> vortex_error::VortexResult -pub fn vortex_fastlanes::BitPackedArray::try_new(packed: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::ptype::PType, validity: vortex_array::validity::Validity, patches: core::option::Option, bit_width: u8, length: usize, offset: u16) -> vortex_error::VortexResult +pub fn vortex_fastlanes::BitPackedData::into_parts(self) -> vortex_fastlanes::BitPackedArrayParts -pub fn vortex_fastlanes::BitPackedArray::unpacked_chunks(&self) -> vortex_fastlanes::unpack_iter::BitUnpackedChunks +pub fn vortex_fastlanes::BitPackedData::is_empty(&self) -> bool -impl vortex_fastlanes::BitPackedArray +pub fn vortex_fastlanes::BitPackedData::len(&self) -> usize -pub fn vortex_fastlanes::BitPackedArray::to_array(&self) -> vortex_array::array::ArrayRef +pub fn vortex_fastlanes::BitPackedData::max_packed_value(&self) -> usize -impl core::clone::Clone for vortex_fastlanes::BitPackedArray +pub fn vortex_fastlanes::BitPackedData::offset(&self) -> u16 -pub fn vortex_fastlanes::BitPackedArray::clone(&self) -> vortex_fastlanes::BitPackedArray +pub fn vortex_fastlanes::BitPackedData::packed(&self) -> &vortex_array::buffer::BufferHandle -impl core::convert::AsRef for vortex_fastlanes::BitPackedArray +pub fn vortex_fastlanes::BitPackedData::packed_slice(&self) -> &[T] -pub fn vortex_fastlanes::BitPackedArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +pub fn vortex_fastlanes::BitPackedData::patches(&self) -> core::option::Option<&vortex_array::patches::Patches> -impl core::convert::From for vortex_array::array::ArrayRef +pub fn vortex_fastlanes::BitPackedData::ptype(&self) -> vortex_array::dtype::ptype::PType -pub fn vortex_array::array::ArrayRef::from(value: vortex_fastlanes::BitPackedArray) -> vortex_array::array::ArrayRef +pub fn vortex_fastlanes::BitPackedData::replace_patches(&mut self, patches: core::option::Option) -impl core::fmt::Debug for vortex_fastlanes::BitPackedArray +pub fn vortex_fastlanes::BitPackedData::try_new(packed: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::ptype::PType, validity: vortex_array::validity::Validity, patches: core::option::Option, bit_width: u8, length: usize, offset: u16) -> vortex_error::VortexResult -pub fn vortex_fastlanes::BitPackedArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_fastlanes::BitPackedData::unpacked_chunks(&self) -> vortex_fastlanes::unpack_iter::BitUnpackedChunks -impl core::ops::deref::Deref for vortex_fastlanes::BitPackedArray +pub fn vortex_fastlanes::BitPackedData::validity(&self) -> &vortex_array::validity::Validity -pub type vortex_fastlanes::BitPackedArray::Target = dyn vortex_array::array::DynArray +pub fn vortex_fastlanes::BitPackedData::validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_fastlanes::BitPackedArray::deref(&self) -> &Self::Target +impl core::clone::Clone for vortex_fastlanes::BitPackedData -impl vortex_array::array::IntoArray for vortex_fastlanes::BitPackedArray +pub fn vortex_fastlanes::BitPackedData::clone(&self) -> vortex_fastlanes::BitPackedData -pub fn vortex_fastlanes::BitPackedArray::into_array(self) -> vortex_array::array::ArrayRef +impl core::convert::From for vortex_array::array::ArrayRef -impl vortex_array::vtable::validity::ValidityHelper for vortex_fastlanes::BitPackedArray +pub fn vortex_array::array::ArrayRef::from(value: vortex_fastlanes::BitPackedData) -> vortex_array::array::ArrayRef -pub fn vortex_fastlanes::BitPackedArray::validity(&self) -> &vortex_array::validity::Validity +impl core::fmt::Debug for vortex_fastlanes::BitPackedData -pub struct vortex_fastlanes::BitPackedArrayParts +pub fn vortex_fastlanes::BitPackedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub vortex_fastlanes::BitPackedArrayParts::bit_width: u8 +impl vortex_array::array::IntoArray for vortex_fastlanes::BitPackedData -pub vortex_fastlanes::BitPackedArrayParts::len: usize +pub fn vortex_fastlanes::BitPackedData::into_array(self) -> vortex_array::array::ArrayRef -pub vortex_fastlanes::BitPackedArrayParts::offset: u16 +impl vortex_array::vtable::validity::ValidityHelper for vortex_fastlanes::BitPackedData -pub vortex_fastlanes::BitPackedArrayParts::packed: vortex_array::buffer::BufferHandle - -pub vortex_fastlanes::BitPackedArrayParts::patches: core::option::Option - -pub vortex_fastlanes::BitPackedArrayParts::validity: vortex_array::validity::Validity +pub fn vortex_fastlanes::BitPackedData::validity(&self) -> &vortex_array::validity::Validity pub struct vortex_fastlanes::Delta @@ -286,6 +284,8 @@ impl vortex_fastlanes::Delta pub const vortex_fastlanes::Delta::ID: vortex_array::vtable::dyn_::ArrayId +pub fn vortex_fastlanes::Delta::try_from_primitive_array(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_fastlanes::Delta pub fn vortex_fastlanes::Delta::clone(&self) -> vortex_fastlanes::Delta @@ -296,7 +296,7 @@ pub fn vortex_fastlanes::Delta::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> impl vortex_array::arrays::slice::SliceReduce for vortex_fastlanes::Delta -pub fn vortex_fastlanes::Delta::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_fastlanes::Delta::slice(array: &vortex_array::vtable::typed::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::kernel::CastReduce for vortex_fastlanes::Delta @@ -304,7 +304,7 @@ pub fn vortex_fastlanes::Delta::cast(array: &vortex_fastlanes::DeltaArray, dtype impl vortex_array::vtable::VTable for vortex_fastlanes::Delta -pub type vortex_fastlanes::Delta::Array = vortex_fastlanes::DeltaArray +pub type vortex_fastlanes::Delta::ArrayData = vortex_fastlanes::DeltaData pub type vortex_fastlanes::Delta::Metadata = vortex_array::metadata::ProstMetadata @@ -312,103 +312,89 @@ pub type vortex_fastlanes::Delta::OperationsVTable = vortex_fastlanes::Delta pub type vortex_fastlanes::Delta::ValidityVTable = vortex_fastlanes::Delta -pub fn vortex_fastlanes::Delta::array_eq(array: &vortex_fastlanes::DeltaArray, other: &vortex_fastlanes::DeltaArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fastlanes::Delta::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fastlanes::Delta::array_hash(array: &vortex_fastlanes::DeltaArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fastlanes::Delta::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_fastlanes::Delta::buffer(_array: &vortex_fastlanes::DeltaArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_fastlanes::Delta::buffer(_array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_fastlanes::Delta::buffer_name(_array: &vortex_fastlanes::DeltaArray, _idx: usize) -> core::option::Option +pub fn vortex_fastlanes::Delta::buffer_name(_array: &vortex_array::vtable::typed::Array, _idx: usize) -> core::option::Option -pub fn vortex_fastlanes::Delta::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_fastlanes::Delta::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_fastlanes::Delta::child(array: &vortex_fastlanes::DeltaArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_fastlanes::Delta::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_fastlanes::Delta::child_name(_array: &vortex_fastlanes::DeltaArray, idx: usize) -> alloc::string::String +pub fn vortex_fastlanes::Delta::child_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_fastlanes::Delta::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_fastlanes::Delta::dtype(array: &vortex_fastlanes::DeltaArray) -> &vortex_array::dtype::DType +pub fn vortex_fastlanes::Delta::dtype(array: &vortex_fastlanes::DeltaData) -> &vortex_array::dtype::DType pub fn vortex_fastlanes::Delta::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult pub fn vortex_fastlanes::Delta::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_fastlanes::Delta::len(array: &vortex_fastlanes::DeltaArray) -> usize +pub fn vortex_fastlanes::Delta::len(array: &vortex_fastlanes::DeltaData) -> usize -pub fn vortex_fastlanes::Delta::metadata(array: &vortex_fastlanes::DeltaArray) -> vortex_error::VortexResult +pub fn vortex_fastlanes::Delta::metadata(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_fastlanes::Delta::nbuffers(_array: &vortex_fastlanes::DeltaArray) -> usize +pub fn vortex_fastlanes::Delta::nbuffers(_array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_fastlanes::Delta::nchildren(_array: &vortex_fastlanes::DeltaArray) -> usize +pub fn vortex_fastlanes::Delta::nchildren(_array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_fastlanes::Delta::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::Delta::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_fastlanes::Delta::stats(array: &vortex_fastlanes::DeltaArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_fastlanes::Delta::stats(array: &vortex_fastlanes::DeltaData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_fastlanes::Delta::vtable(_array: &Self::Array) -> &Self +pub fn vortex_fastlanes::Delta::vtable(_array: &vortex_fastlanes::DeltaData) -> &Self -pub fn vortex_fastlanes::Delta::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::Delta::with_children(array: &mut vortex_fastlanes::DeltaData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_fastlanes::Delta -pub fn vortex_fastlanes::Delta::scalar_at(array: &vortex_fastlanes::DeltaArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_fastlanes::Delta::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::validity::ValidityVTable for vortex_fastlanes::Delta -pub fn vortex_fastlanes::Delta::validity(array: &vortex_fastlanes::DeltaArray) -> vortex_error::VortexResult - -pub struct vortex_fastlanes::DeltaArray +pub fn vortex_fastlanes::Delta::validity(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -impl vortex_fastlanes::DeltaArray +pub struct vortex_fastlanes::DeltaData -pub fn vortex_fastlanes::DeltaArray::bases(&self) -> &vortex_array::array::ArrayRef +impl vortex_fastlanes::DeltaData -pub fn vortex_fastlanes::DeltaArray::deltas(&self) -> &vortex_array::array::ArrayRef +pub fn vortex_fastlanes::DeltaData::bases(&self) -> &vortex_array::array::ArrayRef -pub fn vortex_fastlanes::DeltaArray::dtype(&self) -> &vortex_array::dtype::DType +pub fn vortex_fastlanes::DeltaData::deltas(&self) -> &vortex_array::array::ArrayRef -pub fn vortex_fastlanes::DeltaArray::is_empty(&self) -> bool +pub fn vortex_fastlanes::DeltaData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_fastlanes::DeltaArray::len(&self) -> usize +pub fn vortex_fastlanes::DeltaData::is_empty(&self) -> bool -pub fn vortex_fastlanes::DeltaArray::offset(&self) -> usize +pub fn vortex_fastlanes::DeltaData::len(&self) -> usize -pub fn vortex_fastlanes::DeltaArray::try_from_primitive_array(array: &vortex_array::arrays::primitive::array::PrimitiveArray, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_fastlanes::DeltaData::offset(&self) -> usize -pub fn vortex_fastlanes::DeltaArray::try_new(bases: vortex_array::array::ArrayRef, deltas: vortex_array::array::ArrayRef, offset: usize, len: usize) -> vortex_error::VortexResult +pub fn vortex_fastlanes::DeltaData::try_from_primitive_array(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult -impl vortex_fastlanes::DeltaArray +pub fn vortex_fastlanes::DeltaData::try_new(bases: vortex_array::array::ArrayRef, deltas: vortex_array::array::ArrayRef, offset: usize, len: usize) -> vortex_error::VortexResult -pub fn vortex_fastlanes::DeltaArray::to_array(&self) -> vortex_array::array::ArrayRef +impl core::clone::Clone for vortex_fastlanes::DeltaData -impl core::clone::Clone for vortex_fastlanes::DeltaArray +pub fn vortex_fastlanes::DeltaData::clone(&self) -> vortex_fastlanes::DeltaData -pub fn vortex_fastlanes::DeltaArray::clone(&self) -> vortex_fastlanes::DeltaArray +impl core::convert::From for vortex_array::array::ArrayRef -impl core::convert::AsRef for vortex_fastlanes::DeltaArray +pub fn vortex_array::array::ArrayRef::from(value: vortex_fastlanes::DeltaData) -> vortex_array::array::ArrayRef -pub fn vortex_fastlanes::DeltaArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +impl core::fmt::Debug for vortex_fastlanes::DeltaData -impl core::convert::From for vortex_array::array::ArrayRef +pub fn vortex_fastlanes::DeltaData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::array::ArrayRef::from(value: vortex_fastlanes::DeltaArray) -> vortex_array::array::ArrayRef +impl vortex_array::array::IntoArray for vortex_fastlanes::DeltaData -impl core::fmt::Debug for vortex_fastlanes::DeltaArray - -pub fn vortex_fastlanes::DeltaArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result - -impl core::ops::deref::Deref for vortex_fastlanes::DeltaArray - -pub type vortex_fastlanes::DeltaArray::Target = dyn vortex_array::array::DynArray - -pub fn vortex_fastlanes::DeltaArray::deref(&self) -> &Self::Target - -impl vortex_array::array::IntoArray for vortex_fastlanes::DeltaArray - -pub fn vortex_fastlanes::DeltaArray::into_array(self) -> vortex_array::array::ArrayRef +pub fn vortex_fastlanes::DeltaData::into_array(self) -> vortex_array::array::ArrayRef pub struct vortex_fastlanes::FoR @@ -416,6 +402,10 @@ impl vortex_fastlanes::FoR pub const vortex_fastlanes::FoR::ID: vortex_array::vtable::dyn_::ArrayId +pub fn vortex_fastlanes::FoR::encode(array: vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_error::VortexResult + +pub fn vortex_fastlanes::FoR::try_new(encoded: vortex_array::array::ArrayRef, reference: vortex_array::scalar::Scalar) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_fastlanes::FoR pub fn vortex_fastlanes::FoR::clone(&self) -> vortex_fastlanes::FoR @@ -434,7 +424,7 @@ pub fn vortex_fastlanes::FoR::filter(array: &vortex_fastlanes::FoRArray, mask: & impl vortex_array::arrays::slice::SliceReduce for vortex_fastlanes::FoR -pub fn vortex_fastlanes::FoR::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_fastlanes::FoR::slice(array: &vortex_array::vtable::typed::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::binary::compare::CompareKernel for vortex_fastlanes::FoR @@ -446,7 +436,7 @@ pub fn vortex_fastlanes::FoR::cast(array: &vortex_fastlanes::FoRArray, dtype: &v impl vortex_array::vtable::VTable for vortex_fastlanes::FoR -pub type vortex_fastlanes::FoR::Array = vortex_fastlanes::FoRArray +pub type vortex_fastlanes::FoR::ArrayData = vortex_fastlanes::FoRData pub type vortex_fastlanes::FoR::Metadata = vortex_array::scalar::Scalar @@ -454,23 +444,23 @@ pub type vortex_fastlanes::FoR::OperationsVTable = vortex_fastlanes::FoR pub type vortex_fastlanes::FoR::ValidityVTable = vortex_array::vtable::validity::ValidityVTableFromChild -pub fn vortex_fastlanes::FoR::array_eq(array: &vortex_fastlanes::FoRArray, other: &vortex_fastlanes::FoRArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fastlanes::FoR::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fastlanes::FoR::array_hash(array: &vortex_fastlanes::FoRArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fastlanes::FoR::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_fastlanes::FoR::buffer(_array: &vortex_fastlanes::FoRArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_fastlanes::FoR::buffer(_array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_fastlanes::FoR::buffer_name(_array: &vortex_fastlanes::FoRArray, _idx: usize) -> core::option::Option +pub fn vortex_fastlanes::FoR::buffer_name(_array: &vortex_array::vtable::typed::Array, _idx: usize) -> core::option::Option -pub fn vortex_fastlanes::FoR::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_fastlanes::FoR::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_fastlanes::FoR::child(array: &vortex_fastlanes::FoRArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_fastlanes::FoR::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_fastlanes::FoR::child_name(_array: &vortex_fastlanes::FoRArray, idx: usize) -> alloc::string::String +pub fn vortex_fastlanes::FoR::child_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_fastlanes::FoR::deserialize(bytes: &[u8], dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_fastlanes::FoR::dtype(array: &vortex_fastlanes::FoRArray) -> &vortex_array::dtype::DType +pub fn vortex_fastlanes::FoR::dtype(array: &vortex_fastlanes::FoRData) -> &vortex_array::dtype::DType pub fn vortex_fastlanes::FoR::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -478,77 +468,69 @@ pub fn vortex_fastlanes::FoR::execute_parent(array: &vortex_array::vtable::typed pub fn vortex_fastlanes::FoR::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_fastlanes::FoR::len(array: &vortex_fastlanes::FoRArray) -> usize +pub fn vortex_fastlanes::FoR::len(array: &vortex_fastlanes::FoRData) -> usize -pub fn vortex_fastlanes::FoR::metadata(array: &vortex_fastlanes::FoRArray) -> vortex_error::VortexResult +pub fn vortex_fastlanes::FoR::metadata(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_fastlanes::FoR::nbuffers(_array: &vortex_fastlanes::FoRArray) -> usize +pub fn vortex_fastlanes::FoR::nbuffers(_array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_fastlanes::FoR::nchildren(_array: &vortex_fastlanes::FoRArray) -> usize +pub fn vortex_fastlanes::FoR::nchildren(_array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_fastlanes::FoR::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::FoR::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_fastlanes::FoR::stats(array: &vortex_fastlanes::FoRArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_fastlanes::FoR::stats(array: &vortex_fastlanes::FoRData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_fastlanes::FoR::vtable(_array: &Self::Array) -> &Self +pub fn vortex_fastlanes::FoR::vtable(_array: &vortex_fastlanes::FoRData) -> &Self -pub fn vortex_fastlanes::FoR::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::FoR::with_children(array: &mut vortex_fastlanes::FoRData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_fastlanes::FoR -pub fn vortex_fastlanes::FoR::scalar_at(array: &vortex_fastlanes::FoRArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_fastlanes::FoR::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::validity::ValidityChild for vortex_fastlanes::FoR -pub fn vortex_fastlanes::FoR::validity_child(array: &vortex_fastlanes::FoRArray) -> &vortex_array::array::ArrayRef - -pub struct vortex_fastlanes::FoRArray - -impl vortex_fastlanes::FoRArray +pub fn vortex_fastlanes::FoR::validity_child(array: &vortex_fastlanes::FoRData) -> &vortex_array::array::ArrayRef -pub fn vortex_fastlanes::FoRArray::encode(array: vortex_array::arrays::primitive::array::PrimitiveArray) -> vortex_error::VortexResult +pub struct vortex_fastlanes::FoRData -impl vortex_fastlanes::FoRArray +impl vortex_fastlanes::FoRData -pub fn vortex_fastlanes::FoRArray::encoded(&self) -> &vortex_array::array::ArrayRef +pub fn vortex_fastlanes::FoRData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_fastlanes::FoRArray::ptype(&self) -> vortex_array::dtype::ptype::PType +pub fn vortex_fastlanes::FoRData::encoded(&self) -> &vortex_array::array::ArrayRef -pub fn vortex_fastlanes::FoRArray::reference_scalar(&self) -> &vortex_array::scalar::Scalar +pub fn vortex_fastlanes::FoRData::is_empty(&self) -> bool -pub fn vortex_fastlanes::FoRArray::try_new(encoded: vortex_array::array::ArrayRef, reference: vortex_array::scalar::Scalar) -> vortex_error::VortexResult +pub fn vortex_fastlanes::FoRData::len(&self) -> usize -impl vortex_fastlanes::FoRArray +pub fn vortex_fastlanes::FoRData::ptype(&self) -> vortex_array::dtype::ptype::PType -pub fn vortex_fastlanes::FoRArray::to_array(&self) -> vortex_array::array::ArrayRef +pub fn vortex_fastlanes::FoRData::reference_scalar(&self) -> &vortex_array::scalar::Scalar -impl core::clone::Clone for vortex_fastlanes::FoRArray +pub fn vortex_fastlanes::FoRData::try_new(encoded: vortex_array::array::ArrayRef, reference: vortex_array::scalar::Scalar) -> vortex_error::VortexResult -pub fn vortex_fastlanes::FoRArray::clone(&self) -> vortex_fastlanes::FoRArray +impl vortex_fastlanes::FoRData -impl core::convert::AsRef for vortex_fastlanes::FoRArray +pub fn vortex_fastlanes::FoRData::encode(array: vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_error::VortexResult -pub fn vortex_fastlanes::FoRArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +impl core::clone::Clone for vortex_fastlanes::FoRData -impl core::convert::From for vortex_array::array::ArrayRef +pub fn vortex_fastlanes::FoRData::clone(&self) -> vortex_fastlanes::FoRData -pub fn vortex_array::array::ArrayRef::from(value: vortex_fastlanes::FoRArray) -> vortex_array::array::ArrayRef +impl core::convert::From for vortex_array::array::ArrayRef -impl core::fmt::Debug for vortex_fastlanes::FoRArray +pub fn vortex_array::array::ArrayRef::from(value: vortex_fastlanes::FoRData) -> vortex_array::array::ArrayRef -pub fn vortex_fastlanes::FoRArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::fmt::Debug for vortex_fastlanes::FoRData -impl core::ops::deref::Deref for vortex_fastlanes::FoRArray +pub fn vortex_fastlanes::FoRData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub type vortex_fastlanes::FoRArray::Target = dyn vortex_array::array::DynArray +impl vortex_array::array::IntoArray for vortex_fastlanes::FoRData -pub fn vortex_fastlanes::FoRArray::deref(&self) -> &Self::Target - -impl vortex_array::array::IntoArray for vortex_fastlanes::FoRArray - -pub fn vortex_fastlanes::FoRArray::into_array(self) -> vortex_array::array::ArrayRef +pub fn vortex_fastlanes::FoRData::into_array(self) -> vortex_array::array::ArrayRef pub struct vortex_fastlanes::RLE @@ -556,6 +538,10 @@ impl vortex_fastlanes::RLE pub const vortex_fastlanes::RLE::ID: vortex_array::vtable::dyn_::ArrayId +pub fn vortex_fastlanes::RLE::encode(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_error::VortexResult + +pub unsafe fn vortex_fastlanes::RLE::new_unchecked(values: vortex_array::array::ArrayRef, indices: vortex_array::array::ArrayRef, values_idx_offsets: vortex_array::array::ArrayRef, dtype: vortex_array::dtype::DType, offset: usize, length: usize) -> vortex_fastlanes::RLEArray + impl core::clone::Clone for vortex_fastlanes::RLE pub fn vortex_fastlanes::RLE::clone(&self) -> vortex_fastlanes::RLE @@ -574,7 +560,7 @@ pub fn vortex_fastlanes::RLE::cast(array: &vortex_fastlanes::RLEArray, dtype: &v impl vortex_array::vtable::VTable for vortex_fastlanes::RLE -pub type vortex_fastlanes::RLE::Array = vortex_fastlanes::RLEArray +pub type vortex_fastlanes::RLE::ArrayData = vortex_fastlanes::RLEData pub type vortex_fastlanes::RLE::Metadata = vortex_array::metadata::ProstMetadata @@ -582,23 +568,23 @@ pub type vortex_fastlanes::RLE::OperationsVTable = vortex_fastlanes::RLE pub type vortex_fastlanes::RLE::ValidityVTable = vortex_array::vtable::validity::ValidityVTableFromChildSliceHelper -pub fn vortex_fastlanes::RLE::array_eq(array: &vortex_fastlanes::RLEArray, other: &vortex_fastlanes::RLEArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fastlanes::RLE::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fastlanes::RLE::array_hash(array: &vortex_fastlanes::RLEArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fastlanes::RLE::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_fastlanes::RLE::buffer(_array: &vortex_fastlanes::RLEArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_fastlanes::RLE::buffer(_array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_fastlanes::RLE::buffer_name(_array: &vortex_fastlanes::RLEArray, _idx: usize) -> core::option::Option +pub fn vortex_fastlanes::RLE::buffer_name(_array: &vortex_array::vtable::typed::Array, _idx: usize) -> core::option::Option -pub fn vortex_fastlanes::RLE::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_fastlanes::RLE::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_fastlanes::RLE::child(array: &vortex_fastlanes::RLEArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_fastlanes::RLE::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_fastlanes::RLE::child_name(_array: &vortex_fastlanes::RLEArray, idx: usize) -> alloc::string::String +pub fn vortex_fastlanes::RLE::child_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_fastlanes::RLE::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_fastlanes::RLE::dtype(array: &vortex_fastlanes::RLEArray) -> &vortex_array::dtype::DType +pub fn vortex_fastlanes::RLE::dtype(array: &vortex_fastlanes::RLEData) -> &vortex_array::dtype::DType pub fn vortex_fastlanes::RLE::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -606,92 +592,86 @@ pub fn vortex_fastlanes::RLE::execute_parent(array: &vortex_array::vtable::typed pub fn vortex_fastlanes::RLE::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_fastlanes::RLE::len(array: &vortex_fastlanes::RLEArray) -> usize +pub fn vortex_fastlanes::RLE::len(array: &vortex_fastlanes::RLEData) -> usize -pub fn vortex_fastlanes::RLE::metadata(array: &vortex_fastlanes::RLEArray) -> vortex_error::VortexResult +pub fn vortex_fastlanes::RLE::metadata(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_fastlanes::RLE::nbuffers(_array: &vortex_fastlanes::RLEArray) -> usize +pub fn vortex_fastlanes::RLE::nbuffers(_array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_fastlanes::RLE::nchildren(_array: &vortex_fastlanes::RLEArray) -> usize +pub fn vortex_fastlanes::RLE::nchildren(_array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_fastlanes::RLE::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fastlanes::RLE::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_fastlanes::RLE::stats(array: &vortex_fastlanes::RLEArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_fastlanes::RLE::stats(array: &vortex_fastlanes::RLEData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_fastlanes::RLE::vtable(_array: &Self::Array) -> &Self +pub fn vortex_fastlanes::RLE::vtable(_array: &vortex_fastlanes::RLEData) -> &Self -pub fn vortex_fastlanes::RLE::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fastlanes::RLE::with_children(array: &mut vortex_fastlanes::RLEData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_fastlanes::RLE -pub fn vortex_fastlanes::RLE::scalar_at(array: &vortex_fastlanes::RLEArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_fastlanes::RLE::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::validity::ValidityChild for vortex_fastlanes::RLE -pub fn vortex_fastlanes::RLE::validity_child(array: &vortex_fastlanes::RLEArray) -> &vortex_array::array::ArrayRef - -pub struct vortex_fastlanes::RLEArray +pub fn vortex_fastlanes::RLE::validity_child(array: &vortex_fastlanes::RLEData) -> &vortex_array::array::ArrayRef -impl vortex_fastlanes::RLEArray +pub struct vortex_fastlanes::RLEData -pub fn vortex_fastlanes::RLEArray::dtype(&self) -> &vortex_array::dtype::DType +impl vortex_fastlanes::RLEData -pub fn vortex_fastlanes::RLEArray::indices(&self) -> &vortex_array::array::ArrayRef +pub fn vortex_fastlanes::RLEData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_fastlanes::RLEArray::is_empty(&self) -> bool +pub fn vortex_fastlanes::RLEData::indices(&self) -> &vortex_array::array::ArrayRef -pub fn vortex_fastlanes::RLEArray::len(&self) -> usize +pub fn vortex_fastlanes::RLEData::is_empty(&self) -> bool -pub unsafe fn vortex_fastlanes::RLEArray::new_unchecked(values: vortex_array::array::ArrayRef, indices: vortex_array::array::ArrayRef, values_idx_offsets: vortex_array::array::ArrayRef, dtype: vortex_array::dtype::DType, offset: usize, length: usize) -> Self +pub fn vortex_fastlanes::RLEData::len(&self) -> usize -pub fn vortex_fastlanes::RLEArray::offset(&self) -> usize +pub unsafe fn vortex_fastlanes::RLEData::new_unchecked(values: vortex_array::array::ArrayRef, indices: vortex_array::array::ArrayRef, values_idx_offsets: vortex_array::array::ArrayRef, dtype: vortex_array::dtype::DType, offset: usize, length: usize) -> Self -pub fn vortex_fastlanes::RLEArray::try_new(values: vortex_array::array::ArrayRef, indices: vortex_array::array::ArrayRef, values_idx_offsets: vortex_array::array::ArrayRef, offset: usize, length: usize) -> vortex_error::VortexResult +pub fn vortex_fastlanes::RLEData::offset(&self) -> usize -pub fn vortex_fastlanes::RLEArray::values(&self) -> &vortex_array::array::ArrayRef +pub fn vortex_fastlanes::RLEData::try_new(values: vortex_array::array::ArrayRef, indices: vortex_array::array::ArrayRef, values_idx_offsets: vortex_array::array::ArrayRef, offset: usize, length: usize) -> vortex_error::VortexResult -pub fn vortex_fastlanes::RLEArray::values_idx_offsets(&self) -> &vortex_array::array::ArrayRef +pub fn vortex_fastlanes::RLEData::values(&self) -> &vortex_array::array::ArrayRef -impl vortex_fastlanes::RLEArray +pub fn vortex_fastlanes::RLEData::values_idx_offsets(&self) -> &vortex_array::array::ArrayRef -pub fn vortex_fastlanes::RLEArray::encode(array: &vortex_array::arrays::primitive::array::PrimitiveArray) -> vortex_error::VortexResult +impl vortex_fastlanes::RLEData -impl vortex_fastlanes::RLEArray +pub fn vortex_fastlanes::RLEData::encode(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_error::VortexResult -pub fn vortex_fastlanes::RLEArray::to_array(&self) -> vortex_array::array::ArrayRef +impl core::clone::Clone for vortex_fastlanes::RLEData -impl core::clone::Clone for vortex_fastlanes::RLEArray +pub fn vortex_fastlanes::RLEData::clone(&self) -> vortex_fastlanes::RLEData -pub fn vortex_fastlanes::RLEArray::clone(&self) -> vortex_fastlanes::RLEArray +impl core::convert::From for vortex_array::array::ArrayRef -impl core::convert::AsRef for vortex_fastlanes::RLEArray +pub fn vortex_array::array::ArrayRef::from(value: vortex_fastlanes::RLEData) -> vortex_array::array::ArrayRef -pub fn vortex_fastlanes::RLEArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +impl core::fmt::Debug for vortex_fastlanes::RLEData -impl core::convert::From for vortex_array::array::ArrayRef +pub fn vortex_fastlanes::RLEData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::array::ArrayRef::from(value: vortex_fastlanes::RLEArray) -> vortex_array::array::ArrayRef +impl vortex_array::array::IntoArray for vortex_fastlanes::RLEData -impl core::fmt::Debug for vortex_fastlanes::RLEArray +pub fn vortex_fastlanes::RLEData::into_array(self) -> vortex_array::array::ArrayRef -pub fn vortex_fastlanes::RLEArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::vtable::validity::ValidityChildSliceHelper for vortex_fastlanes::RLEData -impl core::ops::deref::Deref for vortex_fastlanes::RLEArray +pub fn vortex_fastlanes::RLEData::unsliced_child_and_slice(&self) -> (&vortex_array::array::ArrayRef, usize, usize) -pub type vortex_fastlanes::RLEArray::Target = dyn vortex_array::array::DynArray +pub fn vortex_fastlanes::delta_compress(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<(vortex_array::arrays::primitive::vtable::PrimitiveArray, vortex_array::arrays::primitive::vtable::PrimitiveArray)> -pub fn vortex_fastlanes::RLEArray::deref(&self) -> &Self::Target - -impl vortex_array::array::IntoArray for vortex_fastlanes::RLEArray - -pub fn vortex_fastlanes::RLEArray::into_array(self) -> vortex_array::array::ArrayRef +pub fn vortex_fastlanes::initialize(session: &mut vortex_session::VortexSession) -impl vortex_array::vtable::validity::ValidityChildSliceHelper for vortex_fastlanes::RLEArray +pub type vortex_fastlanes::BitPackedArray = vortex_array::vtable::typed::Array -pub fn vortex_fastlanes::RLEArray::unsliced_child_and_slice(&self) -> (&vortex_array::array::ArrayRef, usize, usize) +pub type vortex_fastlanes::DeltaArray = vortex_array::vtable::typed::Array -pub fn vortex_fastlanes::delta_compress(array: &vortex_array::arrays::primitive::array::PrimitiveArray, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<(vortex_array::arrays::primitive::array::PrimitiveArray, vortex_array::arrays::primitive::array::PrimitiveArray)> +pub type vortex_fastlanes::FoRArray = vortex_array::vtable::typed::Array -pub fn vortex_fastlanes::initialize(session: &mut vortex_session::VortexSession) +pub type vortex_fastlanes::RLEArray = vortex_array::vtable::typed::Array diff --git a/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs b/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs index 6f29a72db0c..f2d2c8f0e26 100644 --- a/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs +++ b/encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs @@ -14,7 +14,6 @@ use vortex_array::match_each_integer_ptype; use vortex_array::match_each_unsigned_integer_ptype; use vortex_array::patches::Patches; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::Buffer; use vortex_buffer::BufferMut; use vortex_buffer::ByteBuffer; @@ -24,10 +23,10 @@ use vortex_error::vortex_bail; use vortex_mask::AllOr; use vortex_mask::Mask; -use crate::BitPackedArray; +use crate::BitPackedData; use crate::bitpack_decompress; -pub fn bitpack_to_best_bit_width(array: &PrimitiveArray) -> VortexResult { +pub fn bitpack_to_best_bit_width(array: &PrimitiveArray) -> VortexResult { let bit_width_freq = bit_width_histogram(array)?; let best_bit_width = find_best_bit_width(array.ptype(), &bit_width_freq)?; bitpack_encode(array, best_bit_width, Some(&bit_width_freq)) @@ -38,7 +37,7 @@ pub fn bitpack_encode( array: &PrimitiveArray, bit_width: u8, bit_width_freq: Option<&[usize]>, -) -> VortexResult { +) -> VortexResult { let bit_width_freq = match bit_width_freq { Some(freq) => freq, None => &bit_width_histogram(array)?, @@ -73,7 +72,7 @@ pub fn bitpack_encode( // SAFETY: all components validated above let bitpacked = unsafe { - BitPackedArray::new_unchecked( + BitPackedData::new_unchecked( BufferHandle::new_host(packed), array.dtype().clone(), array.validity().clone(), @@ -83,10 +82,13 @@ pub fn bitpack_encode( 0, ) }; - bitpacked - .stats_set - .to_ref(bitpacked.as_ref()) - .inherit_from(array.statistics()); + { + let bp_ref = bitpacked.clone().into_array(); + bitpacked + .stats_set + .to_ref(&*bp_ref) + .inherit_from(array.statistics()); + } Ok(bitpacked) } @@ -101,13 +103,13 @@ pub fn bitpack_encode( pub unsafe fn bitpack_encode_unchecked( array: PrimitiveArray, bit_width: u8, -) -> VortexResult { +) -> VortexResult { // SAFETY: non-negativity of input checked by caller. let packed = unsafe { bitpack_unchecked(&array, bit_width) }; // SAFETY: checked by bitpack_unchecked let bitpacked = unsafe { - BitPackedArray::new_unchecked( + BitPackedData::new_unchecked( BufferHandle::new_host(packed), array.dtype().clone(), array.validity().clone(), @@ -117,10 +119,14 @@ pub unsafe fn bitpack_encode_unchecked( 0, ) }; - bitpacked - .stats_set - .to_ref(bitpacked.as_ref()) - .inherit_from(array.statistics()); + { + let bp_ref = bitpacked.clone().into_array(); + let arr_ref = array.into_array(); + bitpacked + .stats_set + .to_ref(&*bp_ref) + .inherit_from(arr_ref.statistics()); + } Ok(bitpacked) } @@ -457,13 +463,12 @@ mod test { Validity::from_iter(valid_values), ); assert!(values.ptype().is_unsigned_int()); - let compressed = BitPackedArray::encode(&values.into_array(), 4).unwrap(); + let compressed = BitPackedData::encode(&values.into_array(), 4).unwrap(); assert!(compressed.patches().is_none()); assert_eq!( (0..(1 << 4)).collect::>(), compressed .validity_mask() - .unwrap() .to_bit_buffer() .set_indices() .collect::>() @@ -476,7 +481,7 @@ mod test { let array = PrimitiveArray::new(values, Validity::AllValid); assert!(array.ptype().is_signed_int()); - let err = BitPackedArray::encode(&array.into_array(), 1024u32.ilog2() as u8).unwrap_err(); + let err = BitPackedData::encode(&array.into_array(), 1024u32.ilog2() as u8).unwrap_err(); assert!(matches!(err, VortexError::InvalidArgument(_, _))); } diff --git a/encodings/fastlanes/src/bitpacking/array/bitpack_decompress.rs b/encodings/fastlanes/src/bitpacking/array/bitpack_decompress.rs index e4099cdcf24..85c18cd442f 100644 --- a/encodings/fastlanes/src/bitpacking/array/bitpack_decompress.rs +++ b/encodings/fastlanes/src/bitpacking/array/bitpack_decompress.rs @@ -170,14 +170,24 @@ mod tests { use vortex_session::VortexSession; use super::*; + use crate::BitPackedArray; + use crate::BitPackedData; use crate::bitpack_compress::bitpack_encode; + fn encode(array: &PrimitiveArray, bit_width: u8) -> BitPackedArray { + BitPackedArray::try_from_data(bitpack_encode(array, bit_width, None).unwrap()) + .vortex_expect("data is always valid") + } + static SESSION: LazyLock = LazyLock::new(|| VortexSession::empty().with::()); fn compression_roundtrip(n: usize) { let values = PrimitiveArray::from_iter((0..n).map(|i| (i % 2047) as u16)); - let compressed = BitPackedArray::encode(&values.clone().into_array(), 11).unwrap(); + let compressed = BitPackedArray::try_from_data( + BitPackedData::encode(&values.clone().into_array(), 11).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); assert_arrays_eq!(compressed, values); values @@ -206,7 +216,7 @@ mod tests { #[test] fn test_all_zeros() -> VortexResult<()> { let zeros = buffer![0u16, 0, 0, 0].into_array().to_primitive(); - let bitpacked = bitpack_encode(&zeros, 0, None)?; + let bitpacked = encode(&zeros, 0); let actual = unpack_array(&bitpacked, &mut SESSION.create_execution_ctx())?; assert_arrays_eq!(actual, PrimitiveArray::from_iter([0u16, 0, 0, 0])); Ok(()) @@ -215,7 +225,7 @@ mod tests { #[test] fn test_simple_patches() -> VortexResult<()> { let zeros = buffer![0u16, 1, 0, 1].into_array().to_primitive(); - let bitpacked = bitpack_encode(&zeros, 0, None).unwrap(); + let bitpacked = encode(&zeros, 0); let actual = unpack_array(&bitpacked, &mut SESSION.create_execution_ctx())?; assert_arrays_eq!(actual, PrimitiveArray::from_iter([0u16, 1, 0, 1])); Ok(()) @@ -224,7 +234,7 @@ mod tests { #[test] fn test_one_full_chunk() -> VortexResult<()> { let zeros = BufferMut::from_iter(0u16..1024).into_array().to_primitive(); - let bitpacked = bitpack_encode(&zeros, 10, None).unwrap(); + let bitpacked = encode(&zeros, 10); let actual = unpack_array(&bitpacked, &mut SESSION.create_execution_ctx())?; assert_arrays_eq!(actual, PrimitiveArray::from_iter(0u16..1024)); Ok(()) @@ -235,7 +245,7 @@ mod tests { let zeros = BufferMut::from_iter((5u16..1029).chain(5u16..1029).chain(5u16..1029)) .into_array() .to_primitive(); - let bitpacked = bitpack_encode(&zeros, 10, None).unwrap(); + let bitpacked = encode(&zeros, 10); assert!(bitpacked.patches().is_some()); let actual = unpack_array(&bitpacked, &mut SESSION.create_execution_ctx())?; assert_arrays_eq!( @@ -248,7 +258,7 @@ mod tests { #[test] fn test_one_full_chunk_and_one_short_chunk_no_patch() -> VortexResult<()> { let zeros = BufferMut::from_iter(0u16..1025).into_array().to_primitive(); - let bitpacked = bitpack_encode(&zeros, 11, None).unwrap(); + let bitpacked = encode(&zeros, 11); assert!(bitpacked.patches().is_none()); let actual = unpack_array(&bitpacked, &mut SESSION.create_execution_ctx())?; assert_arrays_eq!(actual, PrimitiveArray::from_iter(0u16..1025)); @@ -260,7 +270,7 @@ mod tests { let zeros = BufferMut::from_iter(512u16..1537) .into_array() .to_primitive(); - let bitpacked = bitpack_encode(&zeros, 10, None).unwrap(); + let bitpacked = encode(&zeros, 10); assert_eq!(bitpacked.len(), 1025); assert!(bitpacked.patches().is_some()); let actual = unpack_array(&bitpacked, &mut SESSION.create_execution_ctx())?; @@ -273,7 +283,7 @@ mod tests { let zeros = BufferMut::from_iter(512u16..1537) .into_array() .to_primitive(); - let bitpacked = bitpack_encode(&zeros, 10, None).unwrap(); + let bitpacked = encode(&zeros, 10); assert_eq!(bitpacked.len(), 1025); assert!(bitpacked.patches().is_some()); let slice_ref = bitpacked.into_array().slice(1023..1025).unwrap(); @@ -294,7 +304,7 @@ mod tests { let zeros = BufferMut::from_iter(512u16..2741) .into_array() .to_primitive(); - let bitpacked = bitpack_encode(&zeros, 10, None).unwrap(); + let bitpacked = encode(&zeros, 10); assert_eq!(bitpacked.len(), 2229); assert!(bitpacked.patches().is_some()); let slice_ref = bitpacked.into_array().slice(1023..2049).unwrap(); @@ -316,7 +326,7 @@ mod tests { #[test] fn test_unpack_into_empty_array() -> VortexResult<()> { let empty: PrimitiveArray = PrimitiveArray::from_iter(Vec::::new()); - let bitpacked = bitpack_encode(&empty, 0, None).unwrap(); + let bitpacked = encode(&empty, 0); let mut builder = PrimitiveBuilder::::new(Nullability::NonNullable); unpack_into_primitive_builder( @@ -343,7 +353,7 @@ mod tests { let array = PrimitiveArray::new(values, validity); // Bitpack the array. - let bitpacked = bitpack_encode(&array, 3, None).unwrap(); + let bitpacked = encode(&array, 3); // Unpack into a new builder. let mut builder = PrimitiveBuilder::::with_capacity(Nullability::Nullable, 5); @@ -375,7 +385,7 @@ mod tests { let array = PrimitiveArray::from_iter(values.clone()); // Bitpack with a bit width that will require patches. - let bitpacked = bitpack_encode(&array, 4, None).unwrap(); + let bitpacked = encode(&array, 4); assert!( bitpacked.patches().is_some(), "Should have patches for values > 15" @@ -408,7 +418,7 @@ mod tests { let array = PrimitiveArray::new(values, Validity::NonNullable); // Bitpack with a small bit width to force patches. - let bitpacked = bitpack_encode(&array, 6, None).unwrap(); + let bitpacked = encode(&array, 6); assert!(bitpacked.patches().is_some(), "Should have patches"); // Test with a larger array with multiple patches across chunks. @@ -422,7 +432,7 @@ mod tests { }) .collect(); let large_array = PrimitiveArray::from_iter(large_values); - let large_bitpacked = bitpack_encode(&large_array, 8, None).unwrap(); + let large_bitpacked = encode(&large_array, 8); assert!(large_bitpacked.patches().is_some()); let large_result = unpack_array(&large_bitpacked, &mut SESSION.create_execution_ctx())?; @@ -438,7 +448,7 @@ mod tests { let validity = Validity::from_iter([true, false, true, false, true, false, true]); let array = PrimitiveArray::new(values, validity); - let bitpacked = bitpack_encode(&array, 9, None).unwrap(); + let bitpacked = encode(&array, 9); let result = unpack_array(&bitpacked, &mut SESSION.create_execution_ctx()).vortex_expect("unpack"); @@ -454,7 +464,7 @@ mod tests { let patch_validity = Validity::from_iter([true, false, true, false, true, true, false]); let patch_array = PrimitiveArray::new(patch_values, patch_validity); - let patch_bitpacked = bitpack_encode(&patch_array, 5, None).unwrap(); + let patch_bitpacked = encode(&patch_array, 5); assert!(patch_bitpacked.patches().is_some()); let patch_result = unpack_array(&patch_bitpacked, &mut SESSION.create_execution_ctx()) @@ -466,7 +476,7 @@ mod tests { Buffer::from_iter([0u32, 0, 0, 0]), Validity::from_iter([false, false, false, false]), ); - let all_nulls_bp = bitpack_encode(&all_nulls, 0, None).unwrap(); + let all_nulls_bp = encode(&all_nulls, 0); let all_nulls_result = unpack_array(&all_nulls_bp, &mut SESSION.create_execution_ctx()) .vortex_expect("unpack"); assert_eq!(all_nulls_result.len(), 4); @@ -477,7 +487,7 @@ mod tests { fn test_execute_method_consistency() -> VortexResult<()> { // Test that execute(), unpack_to_primitive(), and unpack_array() all produce consistent results. let test_consistency = |array: &PrimitiveArray, bit_width: u8| -> VortexResult<()> { - let bitpacked = bitpack_encode(array, bit_width, None).unwrap(); + let bitpacked = encode(array, bit_width); let unpacked_array = unpack_array(&bitpacked, &mut SESSION.create_execution_ctx())?; @@ -538,7 +548,7 @@ mod tests { // Test with sliced array (offset > 0). let values = PrimitiveArray::from_iter(0u32..2048); - let bitpacked = bitpack_encode(&values, 11, None).unwrap(); + let bitpacked = encode(&values, 11); let slice_ref = bitpacked.into_array().slice(500..1500).unwrap(); let sliced = { let mut ctx = SESSION.create_execution_ctx(); @@ -582,13 +592,13 @@ mod tests { fn test_unpack_edge_cases() -> VortexResult<()> { // Empty array. let empty: PrimitiveArray = PrimitiveArray::from_iter(Vec::::new()); - let empty_bp = bitpack_encode(&empty, 0, None).unwrap(); + let empty_bp = encode(&empty, 0); let empty_result = unpack_array(&empty_bp, &mut SESSION.create_execution_ctx())?; assert_eq!(empty_result.len(), 0); // All zeros (bit_width = 0). let zeros = PrimitiveArray::from_iter([0u32; 100]); - let zeros_bp = bitpack_encode(&zeros, 0, None).unwrap(); + let zeros_bp = encode(&zeros, 0); let zeros_result = unpack_array(&zeros_bp, &mut SESSION.create_execution_ctx())?; assert_eq!(zeros_result.len(), 100); // Verify consistency with unpack_array. @@ -598,7 +608,7 @@ mod tests { // Maximum bit width for u16 (15 bits, since bitpacking requires bit_width < type bit width). let max_values = PrimitiveArray::from_iter([32767u16; 50]); // 2^15 - 1 - let max_bp = bitpack_encode(&max_values, 15, None).unwrap(); + let max_bp = encode(&max_values, 15); let max_result = unpack_array(&max_bp, &mut SESSION.create_execution_ctx())?; assert_eq!(max_result.len(), 50); @@ -613,7 +623,7 @@ mod tests { }) .collect(); let boundary_array = PrimitiveArray::from_iter(boundary_values); - let boundary_bp = bitpack_encode(&boundary_array, 7, None).unwrap(); + let boundary_bp = encode(&boundary_array, 7); assert!(boundary_bp.patches().is_some()); let boundary_result = unpack_array(&boundary_bp, &mut SESSION.create_execution_ctx())?; @@ -625,7 +635,7 @@ mod tests { // Single element. let single = PrimitiveArray::from_iter([42u8]); - let single_bp = bitpack_encode(&single, 6, None).unwrap(); + let single_bp = encode(&single, 6); let single_result = unpack_array(&single_bp, &mut SESSION.create_execution_ctx())?; assert_eq!(single_result.len(), 1); Ok(()) diff --git a/encodings/fastlanes/src/bitpacking/array/mod.rs b/encodings/fastlanes/src/bitpacking/array/mod.rs index dfe02730cb0..4e15da2bd44 100644 --- a/encodings/fastlanes/src/bitpacking/array/mod.rs +++ b/encodings/fastlanes/src/bitpacking/array/mod.rs @@ -33,7 +33,7 @@ pub struct BitPackedArrayParts { } #[derive(Clone, Debug)] -pub struct BitPackedArray { +pub struct BitPackedData { /// The offset within the first block (created with a slice). /// 0 <= offset < 1024 pub(super) offset: u16, @@ -46,7 +46,7 @@ pub struct BitPackedArray { pub(super) stats_set: ArrayStats, } -impl BitPackedArray { +impl BitPackedData { /// Create a new bitpacked array using a buffer of packed data. /// /// The packed data should be interpreted as a sequence of values with size `bit_width`. @@ -199,6 +199,35 @@ impl BitPackedArray { Ok(()) } + /// Returns the length of the array. + #[inline] + pub fn len(&self) -> usize { + self.len + } + + /// Returns `true` if the array is empty. + #[inline] + pub fn is_empty(&self) -> bool { + self.len == 0 + } + + /// Returns the dtype of the array. + #[inline] + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns the validity of the array. + #[allow(clippy::same_name_method)] + pub fn validity(&self) -> &Validity { + &self.validity + } + + /// Returns the validity as a [`Mask`](vortex_mask::Mask). + pub fn validity_mask(&self) -> vortex_mask::Mask { + self.validity.to_mask(self.len()) + } + pub fn ptype(&self) -> PType { self.dtype.as_ptype() } @@ -304,8 +333,10 @@ mod test { use vortex_array::arrays::PrimitiveArray; use vortex_array::assert_arrays_eq; use vortex_buffer::Buffer; + use vortex_error::VortexExpect; use crate::BitPackedArray; + use crate::BitPackedData; #[test] fn test_encode() { @@ -319,7 +350,10 @@ mod test { Some(u64::MAX), ]; let uncompressed = PrimitiveArray::from_option_iter(values); - let packed = BitPackedArray::encode(&uncompressed.into_array(), 1).unwrap(); + let packed = BitPackedArray::try_from_data( + BitPackedData::encode(&uncompressed.into_array(), 1).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); let expected = PrimitiveArray::from_option_iter(values); assert_arrays_eq!(packed.to_primitive(), expected); } @@ -328,9 +362,9 @@ mod test { fn test_encode_too_wide() { let values = [Some(1u8), None, Some(1), None, Some(1), None]; let uncompressed = PrimitiveArray::from_option_iter(values); - let _packed = BitPackedArray::encode(&uncompressed.clone().into_array(), 8) + let _packed = BitPackedData::encode(&uncompressed.clone().into_array(), 8) .expect_err("Cannot pack value into the same width"); - let _packed = BitPackedArray::encode(&uncompressed.into_array(), 9) + let _packed = BitPackedData::encode(&uncompressed.into_array(), 9) .expect_err("Cannot pack value into larger width"); } @@ -339,7 +373,9 @@ mod test { let values: Buffer = (0i32..=512).collect(); let parray = values.clone().into_array(); - let packed_with_patches = BitPackedArray::encode(&parray, 9).unwrap(); + let packed_with_patches = + BitPackedArray::try_from_data(BitPackedData::encode(&parray, 9).unwrap()) + .vortex_expect("BitPackedData is always valid"); assert!(packed_with_patches.patches().is_some()); assert_arrays_eq!( packed_with_patches.to_primitive(), diff --git a/encodings/fastlanes/src/bitpacking/array/unpack_iter.rs b/encodings/fastlanes/src/bitpacking/array/unpack_iter.rs index 412dab90d39..d14d218401c 100644 --- a/encodings/fastlanes/src/bitpacking/array/unpack_iter.rs +++ b/encodings/fastlanes/src/bitpacking/array/unpack_iter.rs @@ -12,7 +12,7 @@ use lending_iterator::prelude::LendingIterator; use vortex_array::dtype::PhysicalPType; use vortex_buffer::ByteBuffer; -use crate::BitPackedArray; +use crate::BitPackedData; const CHUNK_SIZE: usize = 1024; @@ -54,10 +54,10 @@ impl> UnpackStrategy for BitPackingStr /// use lending_iterator::prelude::LendingIterator; /// use vortex_array::IntoArray; /// use vortex_buffer::buffer; -/// use vortex_fastlanes::BitPackedArray; +/// use vortex_fastlanes::BitPackedData; /// use vortex_fastlanes::unpack_iter::BitUnpackedChunks; /// -/// let array = BitPackedArray::encode(&buffer![2, 3, 4, 5].into_array(), 2).unwrap(); +/// let array = BitPackedData::encode(&buffer![2, 3, 4, 5].into_array(), 2).unwrap(); /// let mut unpacked_chunks: BitUnpackedChunks = array.unpacked_chunks(); /// /// if let Some(header) = unpacked_chunks.initial() { @@ -89,7 +89,7 @@ pub struct UnpackedChunks> { pub type BitUnpackedChunks = UnpackedChunks; impl BitUnpackedChunks { - pub fn new(array: &BitPackedArray) -> Self { + pub fn new(array: &BitPackedData) -> Self { Self::new_with_strategy( BitPackingStrategy, array.packed().clone().unwrap_host(), diff --git a/encodings/fastlanes/src/bitpacking/compute/cast.rs b/encodings/fastlanes/src/bitpacking/compute/cast.rs index b6ba46626d3..b42dbfb0638 100644 --- a/encodings/fastlanes/src/bitpacking/compute/cast.rs +++ b/encodings/fastlanes/src/bitpacking/compute/cast.rs @@ -7,12 +7,11 @@ use vortex_array::builtins::ArrayBuiltins; use vortex_array::dtype::DType; use vortex_array::patches::Patches; use vortex_array::scalar_fn::fns::cast::CastReduce; -use vortex_array::vtable::ValidityHelper; use vortex_error::VortexResult; +use crate::BitPackedData; use crate::bitpacking::BitPacked; use crate::bitpacking::BitPackedArray; - impl CastReduce for BitPacked { fn cast(array: &BitPackedArray, dtype: &DType) -> VortexResult> { if array.dtype().eq_ignore_nullability(dtype) { @@ -21,7 +20,7 @@ impl CastReduce for BitPacked { .clone() .cast_nullability(dtype.nullability(), array.len())?; return Ok(Some( - BitPackedArray::try_new( + BitPackedData::try_new( array.packed().clone(), dtype.as_ptype(), new_validity, @@ -53,6 +52,7 @@ impl CastReduce for BitPacked { #[cfg(test)] mod tests { use rstest::rstest; + use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::arrays::PrimitiveArray; use vortex_array::assert_arrays_eq; @@ -62,13 +62,19 @@ mod tests { use vortex_array::dtype::Nullability; use vortex_array::dtype::PType; use vortex_buffer::buffer; + use vortex_error::VortexExpect; use crate::BitPackedArray; + use crate::BitPackedData; + + fn bp(array: &ArrayRef, bit_width: u8) -> BitPackedArray { + BitPackedArray::try_from_data(BitPackedData::encode(array, bit_width).unwrap()) + .vortex_expect("BitPackedData is always valid") + } #[test] fn test_cast_bitpacked_u8_to_u32() { - let packed = - BitPackedArray::encode(&buffer![10u8, 20, 30, 40, 50, 60].into_array(), 6).unwrap(); + let packed = bp(&buffer![10u8, 20, 30, 40, 50, 60].into_array(), 6); let casted = packed .into_array() @@ -80,7 +86,7 @@ mod tests { ); assert_arrays_eq!( - casted.as_ref(), + casted, PrimitiveArray::from_iter([10u32, 20, 30, 40, 50, 60]) ); } @@ -88,7 +94,7 @@ mod tests { #[test] fn test_cast_bitpacked_nullable() { let values = PrimitiveArray::from_option_iter([Some(5u16), None, Some(10), Some(15), None]); - let packed = BitPackedArray::encode(&values.into_array(), 4).unwrap(); + let packed = bp(&values.into_array(), 4); let casted = packed .into_array() @@ -101,10 +107,10 @@ mod tests { } #[rstest] - #[case(BitPackedArray::encode(&buffer![0u8, 10, 20, 30, 40, 50, 60, 63].into_array(), 6).unwrap())] - #[case(BitPackedArray::encode(&buffer![0u16, 100, 200, 300, 400, 500].into_array(), 9).unwrap())] - #[case(BitPackedArray::encode(&buffer![0u32, 1000, 2000, 3000, 4000].into_array(), 12).unwrap())] - #[case(BitPackedArray::encode(&PrimitiveArray::from_option_iter([Some(1u32), None, Some(7), Some(15), None]).into_array(), 4).unwrap())] + #[case(bp(&buffer![0u8, 10, 20, 30, 40, 50, 60, 63].into_array(), 6))] + #[case(bp(&buffer![0u16, 100, 200, 300, 400, 500].into_array(), 9))] + #[case(bp(&buffer![0u32, 1000, 2000, 3000, 4000].into_array(), 12))] + #[case(bp(&PrimitiveArray::from_option_iter([Some(1u32), None, Some(7), Some(15), None]).into_array(), 4))] fn test_cast_bitpacked_conformance(#[case] array: BitPackedArray) { test_cast_conformance(&array.into_array()); } diff --git a/encodings/fastlanes/src/bitpacking/compute/filter.rs b/encodings/fastlanes/src/bitpacking/compute/filter.rs index f394f76a26f..ea13750c7ee 100644 --- a/encodings/fastlanes/src/bitpacking/compute/filter.rs +++ b/encodings/fastlanes/src/bitpacking/compute/filter.rs @@ -98,7 +98,7 @@ fn filter_primitive_without_patches( selection: &Arc, ) -> VortexResult<(Buffer, Validity)> { let values = filter_with_indices(array, selection.indices()); - let validity = array.validity()?.filter(&Mask::Values(selection.clone()))?; + let validity = array.validity().filter(&Mask::Values(selection.clone()))?; Ok((values.freeze(), validity)) } @@ -170,15 +170,20 @@ mod test { use vortex_array::validity::Validity; use vortex_buffer::Buffer; use vortex_buffer::buffer; + use vortex_error::VortexExpect; use vortex_mask::Mask; use crate::BitPackedArray; + use crate::BitPackedData; #[test] fn take_indices() { // Create a u8 array modulo 63. let unpacked = PrimitiveArray::from_iter((0..4096).map(|i| (i % 63) as u8)); - let bitpacked = BitPackedArray::encode(&unpacked.into_array(), 6).unwrap(); + let bitpacked = BitPackedArray::try_from_data( + BitPackedData::encode(&unpacked.into_array(), 6).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); let mask = Mask::from_indices(bitpacked.len(), vec![0, 125, 2047, 2049, 2151, 2790]); @@ -193,7 +198,10 @@ mod test { fn take_sliced_indices() { // Create a u8 array modulo 63. let unpacked = PrimitiveArray::from_iter((0..4096).map(|i| (i % 63) as u8)); - let bitpacked = BitPackedArray::encode(&unpacked.into_array(), 6).unwrap(); + let bitpacked = BitPackedArray::try_from_data( + BitPackedData::encode(&unpacked.into_array(), 6).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); let sliced = bitpacked.slice(128..2050).unwrap(); let mask = Mask::from_indices(sliced.len(), vec![1919, 1921]); @@ -205,7 +213,10 @@ mod test { #[test] fn filter_bitpacked() { let unpacked = PrimitiveArray::from_iter((0..4096).map(|i| (i % 63) as u8)); - let bitpacked = BitPackedArray::encode(&unpacked.into_array(), 6).unwrap(); + let bitpacked = BitPackedArray::try_from_data( + BitPackedData::encode(&unpacked.into_array(), 6).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); let filtered = bitpacked .filter(Mask::from_indices(4096, (0..1024).collect())) .unwrap(); @@ -219,7 +230,10 @@ mod test { fn filter_bitpacked_signed() { let values: Buffer = (0..500).collect(); let unpacked = PrimitiveArray::new(values.clone(), Validity::NonNullable); - let bitpacked = BitPackedArray::encode(&unpacked.into_array(), 9).unwrap(); + let bitpacked = BitPackedArray::try_from_data( + BitPackedData::encode(&unpacked.into_array(), 9).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); let filtered = bitpacked .filter(Mask::from_indices(values.len(), (0..250).collect())) .unwrap() @@ -235,17 +249,22 @@ mod test { fn test_filter_bitpacked_conformance() { // Test with u8 values let unpacked = buffer![1u8, 2, 3, 4, 5].into_array(); - let bitpacked = BitPackedArray::encode(&unpacked, 3).unwrap(); + let bitpacked = BitPackedArray::try_from_data(BitPackedData::encode(&unpacked, 3).unwrap()) + .vortex_expect("BitPackedData is always valid"); test_filter_conformance(&bitpacked.into_array()); // Test with u32 values let unpacked = buffer![100u32, 200, 300, 400, 500].into_array(); - let bitpacked = BitPackedArray::encode(&unpacked, 9).unwrap(); + let bitpacked = BitPackedArray::try_from_data(BitPackedData::encode(&unpacked, 9).unwrap()) + .vortex_expect("BitPackedData is always valid"); test_filter_conformance(&bitpacked.into_array()); // Test with nullable values let unpacked = PrimitiveArray::from_option_iter([Some(1u16), None, Some(3), Some(4), None]); - let bitpacked = BitPackedArray::encode(&unpacked.into_array(), 3).unwrap(); + let bitpacked = BitPackedArray::try_from_data( + BitPackedData::encode(&unpacked.into_array(), 3).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); test_filter_conformance(&bitpacked.into_array()); } @@ -260,7 +279,10 @@ mod test { // Values 0-127 fit in 7 bits, but 1000 and 2000 do not. let values: Vec = vec![0, 10, 1000, 20, 30, 2000, 40, 50, 60, 70]; let unpacked = PrimitiveArray::from_iter(values.clone()); - let bitpacked = BitPackedArray::encode(&unpacked.into_array(), 7).unwrap(); + let bitpacked = BitPackedArray::try_from_data( + BitPackedData::encode(&unpacked.into_array(), 7).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); assert!( bitpacked.patches().is_some(), "Expected patches for values exceeding bit width" @@ -292,7 +314,10 @@ mod test { }) .collect(); let unpacked = PrimitiveArray::from_iter(values.clone()); - let bitpacked = BitPackedArray::encode(&unpacked.into_array(), 7).unwrap(); + let bitpacked = BitPackedArray::try_from_data( + BitPackedData::encode(&unpacked.into_array(), 7).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); assert!( bitpacked.patches().is_some(), "Expected patches for values exceeding bit width" diff --git a/encodings/fastlanes/src/bitpacking/compute/is_constant.rs b/encodings/fastlanes/src/bitpacking/compute/is_constant.rs index d3efa37adef..f223d3231e5 100644 --- a/encodings/fastlanes/src/bitpacking/compute/is_constant.rs +++ b/encodings/fastlanes/src/bitpacking/compute/is_constant.rs @@ -188,10 +188,14 @@ mod tests { use vortex_error::VortexResult; use crate::BitPackedArray; + use crate::BitPackedData; #[test] fn is_constant_with_patches() -> VortexResult<()> { - let array = BitPackedArray::encode(&buffer![4; 1025].into_array(), 2)?; + let array = BitPackedArray::try_from_data(BitPackedData::encode( + &buffer![4; 1025].into_array(), + 2, + )?)?; let mut ctx = LEGACY_SESSION.create_execution_ctx(); assert!(is_constant(&array.into_array(), &mut ctx)?); Ok(()) diff --git a/encodings/fastlanes/src/bitpacking/compute/mod.rs b/encodings/fastlanes/src/bitpacking/compute/mod.rs index f17054fc081..226d5ce37bb 100644 --- a/encodings/fastlanes/src/bitpacking/compute/mod.rs +++ b/encodings/fastlanes/src/bitpacking/compute/mod.rs @@ -45,11 +45,17 @@ mod tests { use vortex_array::arrays::PrimitiveArray; use vortex_array::compute::conformance::binary_numeric::test_binary_numeric_array; use vortex_array::compute::conformance::consistency::test_array_consistency; + use vortex_error::VortexExpect; use crate::BitPackedArray; use crate::bitpack_compress::bitpack_encode; use crate::bitpacking::compute::chunked_indices; + fn bp(array: &PrimitiveArray, bit_width: u8) -> BitPackedArray { + BitPackedArray::try_from_data(bitpack_encode(array, bit_width, None).unwrap()) + .vortex_expect("data is always valid") + } + #[test] fn chunk_indices_repeated() { let mut called = false; @@ -63,35 +69,35 @@ mod tests { #[rstest] // Basic integer arrays that can be bitpacked - #[case::u8_small(bitpack_encode(&PrimitiveArray::from_iter([1u8, 2, 3, 4, 5]), 3, None).unwrap())] - #[case::u16_array(bitpack_encode(&PrimitiveArray::from_iter([10u16, 20, 30, 40, 50]), 6, None).unwrap())] - #[case::u32_array(bitpack_encode(&PrimitiveArray::from_iter([100u32, 200, 300, 400, 500]), 9, None).unwrap())] + #[case::u8_small(bp(&PrimitiveArray::from_iter([1u8, 2, 3, 4, 5]), 3))] + #[case::u16_array(bp(&PrimitiveArray::from_iter([10u16, 20, 30, 40, 50]), 6))] + #[case::u32_array(bp(&PrimitiveArray::from_iter([100u32, 200, 300, 400, 500]), 9))] // Arrays with nulls - #[case::nullable_u8(bitpack_encode(&PrimitiveArray::from_option_iter([Some(1u8), None, Some(3), Some(4), None]), 3, None).unwrap())] - #[case::nullable_u32(bitpack_encode(&PrimitiveArray::from_option_iter([Some(100u32), None, Some(300), Some(400), None]), 9, None).unwrap())] + #[case::nullable_u8(bp(&PrimitiveArray::from_option_iter([Some(1u8), None, Some(3), Some(4), None]), 3))] + #[case::nullable_u32(bp(&PrimitiveArray::from_option_iter([Some(100u32), None, Some(300), Some(400), None]), 9))] // Edge cases - #[case::single_element(bitpack_encode(&PrimitiveArray::from_iter([42u32]), 6, None).unwrap())] - #[case::all_zeros(bitpack_encode(&PrimitiveArray::from_iter([0u16; 100]), 1, None).unwrap())] + #[case::single_element(bp(&PrimitiveArray::from_iter([42u32]), 6))] + #[case::all_zeros(bp(&PrimitiveArray::from_iter([0u16; 100]), 1))] // Large arrays (multiple chunks - fastlanes uses 1024-element chunks) - #[case::large_u16(bitpack_encode(&PrimitiveArray::from_iter((0..2048).map(|i| (i % 256) as u16)), 8, None).unwrap())] - #[case::large_u32(bitpack_encode(&PrimitiveArray::from_iter((0..3000).map(|i| (i % 1024) as u32)), 10, None).unwrap())] - #[case::large_u8_many_chunks(bitpack_encode(&PrimitiveArray::from_iter((0..5120).map(|i| (i % 128) as u8)), 7, None).unwrap())] // 5 chunks - #[case::large_nullable(bitpack_encode(&PrimitiveArray::from_option_iter((0..2500).map(|i| if i % 10 == 0 { None } else { Some((i % 512) as u16) })), 9, None).unwrap())] + #[case::large_u16(bp(&PrimitiveArray::from_iter((0..2048).map(|i| (i % 256) as u16)), 8))] + #[case::large_u32(bp(&PrimitiveArray::from_iter((0..3000).map(|i| (i % 1024) as u32)), 10))] + #[case::large_u8_many_chunks(bp(&PrimitiveArray::from_iter((0..5120).map(|i| (i % 128) as u8)), 7))] // 5 chunks + #[case::large_nullable(bp(&PrimitiveArray::from_option_iter((0..2500).map(|i| if i % 10 == 0 { None } else { Some((i % 512) as u16) })), 9))] // Arrays with specific bit patterns - #[case::max_value_for_bits(bitpack_encode(&PrimitiveArray::from_iter([7u8, 7, 7, 7, 7]), 3, None).unwrap())] // max value for 3 bits - #[case::alternating_bits(bitpack_encode(&PrimitiveArray::from_iter([0u16, 255, 0, 255, 0, 255]), 8, None).unwrap())] + #[case::max_value_for_bits(bp(&PrimitiveArray::from_iter([7u8, 7, 7, 7, 7]), 3))] // max value for 3 bits + #[case::alternating_bits(bp(&PrimitiveArray::from_iter([0u16, 255, 0, 255, 0, 255]), 8))] fn test_bitpacked_consistency(#[case] array: BitPackedArray) { test_array_consistency(&array.into_array()); } #[rstest] - #[case::u8_basic(bitpack_encode(&PrimitiveArray::from_iter([1u8, 2, 3, 4, 5]), 3, None).unwrap())] - #[case::u16_basic(bitpack_encode(&PrimitiveArray::from_iter([10u16, 20, 30, 40, 50]), 6, None).unwrap())] - #[case::u32_basic(bitpack_encode(&PrimitiveArray::from_iter([100u32, 200, 300, 400, 500]), 9, None).unwrap())] - #[case::u64_basic(bitpack_encode(&PrimitiveArray::from_iter([1000u64, 2000, 3000, 4000, 5000]), 13, None).unwrap())] - #[case::i32_basic(bitpack_encode(&PrimitiveArray::from_iter([10i32, 20, 30, 40, 50]), 7, None).unwrap())] - #[case::large_u32(bitpack_encode(&PrimitiveArray::from_iter((0..100).map(|i| i as u32)), 7, None).unwrap())] + #[case::u8_basic(bp(&PrimitiveArray::from_iter([1u8, 2, 3, 4, 5]), 3))] + #[case::u16_basic(bp(&PrimitiveArray::from_iter([10u16, 20, 30, 40, 50]), 6))] + #[case::u32_basic(bp(&PrimitiveArray::from_iter([100u32, 200, 300, 400, 500]), 9))] + #[case::u64_basic(bp(&PrimitiveArray::from_iter([1000u64, 2000, 3000, 4000, 5000]), 13))] + #[case::i32_basic(bp(&PrimitiveArray::from_iter([10i32, 20, 30, 40, 50]), 7))] + #[case::large_u32(bp(&PrimitiveArray::from_iter((0..100).map(|i| i as u32)), 7))] fn test_bitpacked_binary_numeric(#[case] array: BitPackedArray) { test_binary_numeric_array(array.into_array()); } diff --git a/encodings/fastlanes/src/bitpacking/compute/slice.rs b/encodings/fastlanes/src/bitpacking/compute/slice.rs index 3219637b8fc..09ec9569ef9 100644 --- a/encodings/fastlanes/src/bitpacking/compute/slice.rs +++ b/encodings/fastlanes/src/bitpacking/compute/slice.rs @@ -11,6 +11,7 @@ use vortex_error::VortexResult; use crate::BitPacked; use crate::BitPackedArray; +use crate::BitPackedData; impl SliceReduce for BitPacked { fn slice(array: &BitPackedArray, range: Range) -> VortexResult> { @@ -26,10 +27,10 @@ impl SliceReduce for BitPacked { // slice the buffer using the encoded start/stop values // SAFETY: slicing packed values without decoding preserves invariants Ok(Some(unsafe { - BitPackedArray::new_unchecked( + BitPackedData::new_unchecked( array.packed().slice(encoded_start..encoded_stop), array.dtype().clone(), - array.validity()?.slice(range.clone())?, + array.validity().slice(range.clone())?, array .patches() .map(|p| p.slice(range.clone())) diff --git a/encodings/fastlanes/src/bitpacking/compute/take.rs b/encodings/fastlanes/src/bitpacking/compute/take.rs index 4405645ace3..45bc0d877fe 100644 --- a/encodings/fastlanes/src/bitpacking/compute/take.rs +++ b/encodings/fastlanes/src/bitpacking/compute/take.rs @@ -17,7 +17,6 @@ use vortex_array::dtype::PType; use vortex_array::match_each_integer_ptype; use vortex_array::match_each_unsigned_integer_ptype; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::Buffer; use vortex_buffer::BufferMut; use vortex_error::VortexExpect as _; @@ -43,7 +42,7 @@ impl TakeExecute for BitPacked { // If the indices are large enough, it's faster to flatten and take the primitive array. if indices.len() * UNPACK_CHUNK_THRESHOLD > array.len() { let prim = array.clone().into_array().execute::(ctx)?; - return prim.take(indices.to_array()).map(Some); + return prim.into_array().take(indices.to_array()).map(Some); } // NOTE: we use the unsigned PType because all values in the BitPackedArray must @@ -161,8 +160,10 @@ mod test { use vortex_array::validity::Validity; use vortex_buffer::Buffer; use vortex_buffer::buffer; + use vortex_error::VortexExpect; use crate::BitPackedArray; + use crate::BitPackedData; use crate::bitpacking::compute::take::take_primitive; #[test] @@ -171,7 +172,10 @@ mod test { // Create a u8 array modulo 63. let unpacked = PrimitiveArray::from_iter((0..4096).map(|i| (i % 63) as u8)); - let bitpacked = BitPackedArray::encode(&unpacked.into_array(), 6).unwrap(); + let bitpacked = BitPackedArray::try_from_data( + BitPackedData::encode(&unpacked.into_array(), 6).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); let primitive_result = bitpacked.take(indices.to_array()).unwrap(); assert_arrays_eq!( @@ -183,7 +187,8 @@ mod test { #[test] fn take_with_patches() { let unpacked = Buffer::from_iter(0u32..1024).into_array(); - let bitpacked = BitPackedArray::encode(&unpacked, 2).unwrap(); + let bitpacked = BitPackedArray::try_from_data(BitPackedData::encode(&unpacked, 2).unwrap()) + .vortex_expect("BitPackedData is always valid"); let indices = buffer![0, 2, 4, 6].into_array(); @@ -197,7 +202,10 @@ mod test { // Create a u8 array modulo 63. let unpacked = PrimitiveArray::from_iter((0..4096).map(|i| (i % 63) as u8)); - let bitpacked = BitPackedArray::encode(&unpacked.into_array(), 6).unwrap(); + let bitpacked = BitPackedArray::try_from_data( + BitPackedData::encode(&unpacked.into_array(), 6).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); let sliced = bitpacked.slice(128..2050).unwrap(); let primitive_result = sliced.take(indices.to_array()).unwrap(); @@ -210,7 +218,10 @@ mod test { let num_patches: usize = 128; let values = (0..u16::MAX as u32 + num_patches as u32).collect::>(); let uncompressed = PrimitiveArray::new(values.clone(), Validity::NonNullable); - let packed = BitPackedArray::encode(&uncompressed.into_array(), 16).unwrap(); + let packed = BitPackedArray::try_from_data( + BitPackedData::encode(&uncompressed.into_array(), 16).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); assert!(packed.patches().is_some()); let rng = rng(); @@ -239,8 +250,10 @@ mod test { #[test] #[cfg_attr(miri, ignore)] fn take_signed_with_patches() { - let start = - BitPackedArray::encode(&buffer![1i32, 2i32, 3i32, 4i32].into_array(), 1).unwrap(); + let start = BitPackedArray::try_from_data( + BitPackedData::encode(&buffer![1i32, 2i32, 3i32, 4i32].into_array(), 1).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); let taken_primitive = take_primitive::( &start, @@ -254,8 +267,10 @@ mod test { #[test] fn take_nullable_with_nullables() { - let start = - BitPackedArray::encode(&buffer![1i32, 2i32, 3i32, 4i32].into_array(), 1).unwrap(); + let start = BitPackedArray::try_from_data( + BitPackedData::encode(&buffer![1i32, 2i32, 3i32, 4i32].into_array(), 1).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); let taken_primitive = start .take( @@ -270,15 +285,15 @@ mod test { } #[rstest] - #[case(BitPackedArray::encode(&PrimitiveArray::from_iter((0..100).map(|i| (i % 63) as u8)).into_array(), 6).unwrap())] - #[case(BitPackedArray::encode(&PrimitiveArray::from_iter((0..256).map(|i| i as u32)).into_array(), 8).unwrap())] - #[case(BitPackedArray::encode(&buffer![1i32, 2, 3, 4, 5, 6, 7, 8].into_array(), 3).unwrap())] - #[case(BitPackedArray::encode( + #[case(BitPackedArray::try_from_data(BitPackedData::encode(&PrimitiveArray::from_iter((0..100).map(|i| (i % 63) as u8)).into_array(), 6).unwrap()).unwrap())] + #[case(BitPackedArray::try_from_data(BitPackedData::encode(&PrimitiveArray::from_iter((0..256).map(|i| i as u32)).into_array(), 8).unwrap()).unwrap())] + #[case(BitPackedArray::try_from_data(BitPackedData::encode(&buffer![1i32, 2, 3, 4, 5, 6, 7, 8].into_array(), 3).unwrap()).unwrap())] + #[case(BitPackedArray::try_from_data(BitPackedData::encode( &PrimitiveArray::from_option_iter([Some(10u16), None, Some(20), Some(30), None]).into_array(), 5 - ).unwrap())] - #[case(BitPackedArray::encode(&buffer![42u32].into_array(), 6).unwrap())] - #[case(BitPackedArray::encode(&PrimitiveArray::from_iter((0..1024).map(|i| i as u32)).into_array(), 8).unwrap())] + ).unwrap()).unwrap())] + #[case(BitPackedArray::try_from_data(BitPackedData::encode(&buffer![42u32].into_array(), 6).unwrap()).unwrap())] + #[case(BitPackedArray::try_from_data(BitPackedData::encode(&PrimitiveArray::from_iter((0..1024).map(|i| i as u32)).into_array(), 8).unwrap()).unwrap())] fn test_take_bitpacked_conformance(#[case] bitpacked: BitPackedArray) { use vortex_array::compute::conformance::take::test_take_conformance; test_take_conformance(&bitpacked.into_array()); diff --git a/encodings/fastlanes/src/bitpacking/mod.rs b/encodings/fastlanes/src/bitpacking/mod.rs index 5130836e424..5a3a6ed0200 100644 --- a/encodings/fastlanes/src/bitpacking/mod.rs +++ b/encodings/fastlanes/src/bitpacking/mod.rs @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::BitPackedArray; pub use array::BitPackedArrayParts; +pub use array::BitPackedData; pub use array::bitpack_compress; pub use array::bitpack_decompress; pub use array::unpack_iter; @@ -12,3 +12,4 @@ pub(crate) mod compute; mod vtable; pub use vtable::BitPacked; +pub use vtable::BitPackedArray; diff --git a/encodings/fastlanes/src/bitpacking/vtable/mod.rs b/encodings/fastlanes/src/bitpacking/vtable/mod.rs index 58553d4d639..353cc4742cc 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/mod.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/mod.rs @@ -22,7 +22,7 @@ use vortex_array::match_each_integer_ptype; use vortex_array::patches::Patches; use vortex_array::patches::PatchesMetadata; use vortex_array::serde::ArrayChildren; -use vortex_array::stats::StatsSetRef; +use vortex_array::stats::ArrayStats; use vortex_array::validity::Validity; use vortex_array::vtable; use vortex_array::vtable::Array; @@ -42,7 +42,7 @@ use vortex_error::vortex_err; use vortex_error::vortex_panic; use vortex_session::VortexSession; -use crate::BitPackedArray; +use crate::BitPackedData; use crate::bitpack_decompress::unpack_array; use crate::bitpack_decompress::unpack_into_primitive_builder; use crate::bitpacking::vtable::kernels::PARENT_KERNELS; @@ -52,7 +52,7 @@ mod operations; mod rules; mod validity; -vtable!(BitPacked); +vtable!(BitPacked, BitPacked, BitPackedData); #[derive(Clone, prost::Message)] pub struct BitPackedMetadata { @@ -65,14 +65,14 @@ pub struct BitPackedMetadata { } impl VTable for BitPacked { - type Array = BitPackedArray; + type ArrayData = BitPackedData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValidityHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &BitPackedData) -> &Self { &BitPacked } @@ -80,23 +80,19 @@ impl VTable for BitPacked { Self::ID } - fn len(array: &BitPackedArray) -> usize { + fn len(array: &BitPackedData) -> usize { array.len } - fn dtype(array: &BitPackedArray) -> &DType { + fn dtype(array: &BitPackedData) -> &DType { &array.dtype } - fn stats(array: &BitPackedArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &BitPackedData) -> &ArrayStats { + &array.stats_set } - fn array_hash( - array: &BitPackedArray, - state: &mut H, - precision: Precision, - ) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.offset.hash(state); array.len.hash(state); array.dtype.hash(state); @@ -106,7 +102,7 @@ impl VTable for BitPacked { array.validity.array_hash(state, precision); } - fn array_eq(array: &BitPackedArray, other: &BitPackedArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.offset == other.offset && array.len == other.len && array.dtype == other.dtype @@ -116,29 +112,29 @@ impl VTable for BitPacked { && array.validity.array_eq(&other.validity, precision) } - fn nbuffers(_array: &BitPackedArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 1 } - fn buffer(array: &BitPackedArray, idx: usize) -> BufferHandle { + fn buffer(array: &Array, idx: usize) -> BufferHandle { match idx { 0 => array.packed().clone(), _ => vortex_panic!("BitPackedArray buffer index {idx} out of bounds"), } } - fn buffer_name(_array: &BitPackedArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { match idx { 0 => Some("packed".to_string()), _ => None, } } - fn nchildren(array: &BitPackedArray) -> usize { + fn nchildren(array: &Array) -> usize { array.patches().map_or(0, patches_nchildren) + validity_nchildren(&array.validity) } - fn child(array: &BitPackedArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { let pc = array.patches().map_or(0, patches_nchildren); if idx < pc { patches_child( @@ -155,7 +151,7 @@ impl VTable for BitPacked { } } - fn child_name(array: &BitPackedArray, idx: usize) -> String { + fn child_name(array: &Array, idx: usize) -> String { let pc = array.patches().map_or(0, patches_nchildren); if idx < pc { patches_child_name(idx).to_string() @@ -172,7 +168,7 @@ impl VTable for BitPacked { RULES.evaluate(array, parent, child_idx) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut BitPackedData, children: Vec) -> VortexResult<()> { // Children: patches (if present): indices, values, chunk_offsets; then validity (if present) let patches_info = array .patches() @@ -241,7 +237,7 @@ impl VTable for BitPacked { Ok(()) } - fn metadata(array: &BitPackedArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(BitPackedMetadata { bit_width: array.bit_width() as u32, offset: array.offset() as u32, @@ -278,7 +274,7 @@ impl VTable for BitPacked { metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { if buffers.len() != 1 { vortex_bail!("Expected 1 buffer, got {}", buffers.len()); } @@ -322,7 +318,7 @@ impl VTable for BitPacked { }) .transpose()?; - BitPackedArray::try_new( + BitPackedData::try_new( packed, PType::try_from(dtype)?, validity, @@ -344,7 +340,7 @@ impl VTable for BitPacked { } fn append_to_builder( - array: &BitPackedArray, + array: &Array, builder: &mut dyn ArrayBuilder, ctx: &mut ExecutionCtx, ) -> VortexResult<()> { @@ -381,4 +377,9 @@ pub struct BitPacked; impl BitPacked { pub const ID: ArrayId = ArrayId::new_ref("fastlanes.bitpacked"); + + /// Encode an array into a bitpacked representation with the given bit width. + pub fn encode(array: &ArrayRef, bit_width: u8) -> VortexResult { + Array::try_from_data(BitPackedData::encode(array, bit_width)?) + } } diff --git a/encodings/fastlanes/src/bitpacking/vtable/operations.rs b/encodings/fastlanes/src/bitpacking/vtable/operations.rs index fd91f98260c..b14b8dbfd24 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/operations.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/operations.rs @@ -3,16 +3,15 @@ use vortex_array::ExecutionCtx; use vortex_array::scalar::Scalar; +use vortex_array::vtable::Array; use vortex_array::vtable::OperationsVTable; use vortex_error::VortexResult; use crate::BitPacked; -use crate::BitPackedArray; use crate::bitpack_decompress; - impl OperationsVTable for BitPacked { fn scalar_at( - array: &BitPackedArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -32,6 +31,7 @@ impl OperationsVTable for BitPacked { mod test { use std::ops::Range; + use vortex_array::ArrayRef; use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::arrays::PrimitiveArray; @@ -49,9 +49,16 @@ mod test { use vortex_buffer::Buffer; use vortex_buffer::ByteBuffer; use vortex_buffer::buffer; + use vortex_error::VortexExpect; use crate::BitPacked; use crate::BitPackedArray; + use crate::BitPackedData; + + fn bp(array: &ArrayRef, bit_width: u8) -> BitPackedArray { + BitPackedArray::try_from_data(BitPackedData::encode(array, bit_width).unwrap()) + .vortex_expect("BitPackedData is always valid") + } fn slice_via_reduce(array: &BitPackedArray, range: Range) -> BitPackedArray { let array_ref = array.clone().into_array(); @@ -66,11 +73,10 @@ mod test { #[test] pub fn slice_block() { - let arr = BitPackedArray::encode( + let arr = bp( &PrimitiveArray::from_iter((0u32..2048).map(|v| v % 64)).into_array(), 6, - ) - .unwrap(); + ); let sliced = slice_via_reduce(&arr, 1024..2048); assert_nth_scalar!(sliced, 0, 1024u32 % 64); assert_nth_scalar!(sliced, 1023, 2047u32 % 64); @@ -80,11 +86,10 @@ mod test { #[test] pub fn slice_within_block() { - let arr = BitPackedArray::encode( + let arr = bp( &PrimitiveArray::from_iter((0u32..2048).map(|v| v % 64)).into_array(), 6, - ) - .unwrap(); + ); let sliced = slice_via_reduce(&arr, 512..1434); assert_nth_scalar!(sliced, 0, 512u32 % 64); assert_nth_scalar!(sliced, 921, 1433u32 % 64); @@ -94,11 +99,10 @@ mod test { #[test] fn slice_within_block_u8s() { - let packed = BitPackedArray::encode( + let packed = bp( &PrimitiveArray::from_iter((0..10_000).map(|i| (i % 63) as u8)).into_array(), 7, - ) - .unwrap(); + ); let compressed = packed.slice(768..9999).unwrap(); assert_nth_scalar!(compressed, 0, (768 % 63) as u8); @@ -107,11 +111,10 @@ mod test { #[test] fn slice_block_boundary_u8s() { - let packed = BitPackedArray::encode( + let packed = bp( &PrimitiveArray::from_iter((0..10_000).map(|i| (i % 63) as u8)).into_array(), 7, - ) - .unwrap(); + ); let compressed = packed.slice(7168..9216).unwrap(); assert_nth_scalar!(compressed, 0, (7168 % 63) as u8); @@ -120,11 +123,10 @@ mod test { #[test] fn double_slice_within_block() { - let arr = BitPackedArray::encode( + let arr = bp( &PrimitiveArray::from_iter((0u32..2048).map(|v| v % 64)).into_array(), 6, - ) - .unwrap(); + ); let sliced = slice_via_reduce(&arr, 512..1434); assert_nth_scalar!(sliced, 0, 512u32 % 64); assert_nth_scalar!(sliced, 921, 1433u32 % 64); @@ -140,7 +142,10 @@ mod test { #[test] fn slice_empty_patches() { // We create an array that has 1 element that does not fit in the 6-bit range. - let array = BitPackedArray::encode(&buffer![0u32..=64].into_array(), 6).unwrap(); + let array = BitPackedArray::try_from_data( + BitPackedData::encode(&buffer![0u32..=64].into_array(), 6).unwrap(), + ) + .vortex_expect("BitPackedData is always valid"); assert!(array.patches().is_some()); @@ -156,11 +161,10 @@ mod test { fn take_after_slice() { // Check that our take implementation respects the offsets applied after slicing. - let array = BitPackedArray::encode( + let array = bp( &PrimitiveArray::from_iter((63u32..).take(3072)).into_array(), 6, - ) - .unwrap(); + ); // Slice the array. // The resulting array will still have 3 1024-element chunks. @@ -180,7 +184,7 @@ mod test { #[test] fn scalar_at_invalid_patches() { let packed_array = unsafe { - BitPackedArray::new_unchecked( + BitPackedData::new_unchecked( BufferHandle::new_host(ByteBuffer::copy_from_aligned( [0u8; 128], Alignment::of::(), @@ -213,7 +217,9 @@ mod test { fn scalar_at() { let values = (0u32..257).collect::>(); let uncompressed = values.clone().into_array(); - let packed = BitPackedArray::encode(&uncompressed, 8).unwrap(); + let packed = + BitPackedArray::try_from_data(BitPackedData::encode(&uncompressed, 8).unwrap()) + .vortex_expect("BitPackedData is always valid"); assert!(packed.patches().is_some()); let patches = packed.patches().unwrap().indices().clone(); diff --git a/encodings/fastlanes/src/bitpacking/vtable/validity.rs b/encodings/fastlanes/src/bitpacking/vtable/validity.rs index feafa6fbc44..1bfaae668ca 100644 --- a/encodings/fastlanes/src/bitpacking/vtable/validity.rs +++ b/encodings/fastlanes/src/bitpacking/vtable/validity.rs @@ -4,9 +4,9 @@ use vortex_array::validity::Validity; use vortex_array::vtable::ValidityHelper; -use crate::BitPackedArray; +use crate::BitPackedData; -impl ValidityHelper for BitPackedArray { +impl ValidityHelper for BitPackedData { fn validity(&self) -> &Validity { &self.validity } diff --git a/encodings/fastlanes/src/delta/array/delta_compress.rs b/encodings/fastlanes/src/delta/array/delta_compress.rs index 94862ff26e6..030d3fda4ff 100644 --- a/encodings/fastlanes/src/delta/array/delta_compress.rs +++ b/encodings/fastlanes/src/delta/array/delta_compress.rs @@ -11,7 +11,6 @@ use vortex_array::ExecutionCtx; use vortex_array::arrays::PrimitiveArray; use vortex_array::dtype::NativePType; use vortex_array::match_each_unsigned_integer_ptype; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::Buffer; use vortex_buffer::BufferMut; use vortex_error::VortexResult; @@ -19,7 +18,6 @@ use vortex_error::VortexResult; use crate::FL_CHUNK_SIZE; use crate::bit_transpose::transpose_validity; use crate::fill_forward_nulls; - pub fn delta_compress( array: &PrimitiveArray, ctx: &mut ExecutionCtx, @@ -102,10 +100,12 @@ mod tests { use vortex_array::arrays::PrimitiveArray; use vortex_array::assert_arrays_eq; use vortex_array::session::ArraySession; + use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_session::VortexSession; use crate::DeltaArray; + use crate::DeltaData; use crate::bitpack_compress::bitpack_encode; use crate::delta::array::delta_decompress::delta_decompress; use crate::delta_compress; @@ -120,8 +120,10 @@ mod tests { (0u32..10_000).map(|i| (i % 2 == 0).then_some(i)), ))] fn test_compress(#[case] array: PrimitiveArray) -> VortexResult<()> { - let delta = - DeltaArray::try_from_primitive_array(&array, &mut SESSION.create_execution_ctx())?; + let delta = DeltaArray::try_from_data(DeltaData::try_from_primitive_array( + &array, + &mut SESSION.create_execution_ctx(), + )?)?; assert_eq!(delta.len(), array.len()); let decompressed = delta_decompress(&delta, &mut SESSION.create_execution_ctx())?; assert_arrays_eq!(decompressed, array); @@ -138,13 +140,16 @@ mod tests { ); let (bases, deltas) = delta_compress(&array, &mut SESSION.create_execution_ctx()).unwrap(); let bitpacked_deltas = bitpack_encode(&deltas, 1, None).unwrap(); - let packed_delta = DeltaArray::try_new( - bases.into_array(), - bitpacked_deltas.into_array(), - 0, - array.len(), + let packed_delta = DeltaArray::try_from_data( + DeltaData::try_new( + bases.into_array(), + bitpacked_deltas.into_array(), + 0, + array.len(), + ) + .unwrap(), ) - .unwrap(); + .vortex_expect("DeltaData is always valid"); assert_arrays_eq!(packed_delta.to_primitive(), array); } } diff --git a/encodings/fastlanes/src/delta/array/delta_decompress.rs b/encodings/fastlanes/src/delta/array/delta_decompress.rs index c678b7d9b87..338a39156ff 100644 --- a/encodings/fastlanes/src/delta/array/delta_decompress.rs +++ b/encodings/fastlanes/src/delta/array/delta_decompress.rs @@ -12,7 +12,6 @@ use vortex_array::ExecutionCtx; use vortex_array::arrays::PrimitiveArray; use vortex_array::dtype::NativePType; use vortex_array::match_each_unsigned_integer_ptype; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::Buffer; use vortex_buffer::BufferMut; use vortex_error::VortexResult; diff --git a/encodings/fastlanes/src/delta/array/mod.rs b/encodings/fastlanes/src/delta/array/mod.rs index 1b98d97522e..0b2e53d6c32 100644 --- a/encodings/fastlanes/src/delta/array/mod.rs +++ b/encodings/fastlanes/src/delta/array/mod.rs @@ -19,7 +19,7 @@ pub mod delta_decompress; /// A FastLanes-style delta-encoded array of primitive values. /// -/// A [`DeltaArray`] comprises a sequence of _chunks_ each representing exactly 1,024 +/// A DeltaArray comprises a sequence of _chunks_ each representing exactly 1,024 /// delta-encoded values. If the input array length is not a multiple of 1,024, the last chunk /// is padded with zeros to fill a complete 1,024-element chunk. /// @@ -30,11 +30,11 @@ pub mod delta_decompress; /// use vortex_array::VortexSessionExecute; /// use vortex_array::session::ArraySession; /// use vortex_session::VortexSession; -/// use vortex_fastlanes::DeltaArray; +/// use vortex_fastlanes::DeltaData; /// /// let session = VortexSession::empty().with::(); /// let primitive = PrimitiveArray::from_iter([1_u32, 2, 3, 5, 10, 11]); -/// let array = DeltaArray::try_from_primitive_array(&primitive, &mut session.create_execution_ctx()).unwrap(); +/// let array = DeltaData::try_from_primitive_array(&primitive, &mut session.create_execution_ctx()).unwrap(); /// ``` /// /// # Details @@ -57,7 +57,7 @@ pub mod delta_decompress; /// /// Note the validity is stored in the deltas array. #[derive(Clone, Debug)] -pub struct DeltaArray { +pub struct DeltaData { pub(super) offset: usize, pub(super) len: usize, pub(super) dtype: DType, @@ -66,7 +66,7 @@ pub struct DeltaArray { pub(super) stats_set: ArrayStats, } -impl DeltaArray { +impl DeltaData { pub fn try_from_primitive_array( array: &PrimitiveArray, ctx: &mut ExecutionCtx, @@ -77,7 +77,7 @@ impl DeltaArray { Self::try_new(bases.into_array(), deltas.into_array(), 0, logical_len) } - /// Create a [`DeltaArray`] from the given `bases` and `deltas` arrays + /// Create a DeltaArray from the given `bases` and `deltas` arrays /// with given `offset` into first chunk and `logical_len` length. pub fn try_new( bases: ArrayRef, diff --git a/encodings/fastlanes/src/delta/compute/cast.rs b/encodings/fastlanes/src/delta/compute/cast.rs index e93680e939a..b7bd0986018 100644 --- a/encodings/fastlanes/src/delta/compute/cast.rs +++ b/encodings/fastlanes/src/delta/compute/cast.rs @@ -10,9 +10,9 @@ use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_error::VortexResult; use vortex_error::vortex_panic; +use crate::DeltaData; use crate::delta::Delta; use crate::delta::DeltaArray; - impl CastReduce for Delta { fn cast(array: &DeltaArray, dtype: &DType) -> VortexResult> { // Delta encoding stores differences between consecutive values, which requires @@ -38,7 +38,7 @@ impl CastReduce for Delta { // Create a new DeltaArray with the casted components, preserving offset and logical length Ok(Some( - DeltaArray::try_new(casted_bases, casted_deltas, array.offset(), array.len())? + DeltaData::try_new(casted_bases, casted_deltas, array.offset(), array.len())? .into_array(), )) } @@ -62,7 +62,7 @@ mod tests { use vortex_buffer::buffer; use vortex_session::VortexSession; - use crate::delta::DeltaArray; + use crate::DeltaData; static SESSION: LazyLock = LazyLock::new(|| VortexSession::empty().with::()); @@ -70,7 +70,7 @@ mod tests { fn test_cast_delta_u8_to_u32() { let primitive = PrimitiveArray::from_iter([10u8, 20, 30, 40, 50]); let array = - DeltaArray::try_from_primitive_array(&primitive, &mut SESSION.create_execution_ctx()) + DeltaData::try_from_primitive_array(&primitive, &mut SESSION.create_execution_ctx()) .unwrap(); let casted = array @@ -95,7 +95,7 @@ mod tests { vortex_array::validity::Validity::NonNullable, ); let array = - DeltaArray::try_from_primitive_array(&values, &mut SESSION.create_execution_ctx()) + DeltaData::try_from_primitive_array(&values, &mut SESSION.create_execution_ctx()) .unwrap(); let casted = array @@ -135,7 +135,7 @@ mod tests { )] fn test_cast_delta_conformance(#[case] primitive: PrimitiveArray) { let delta_array = - DeltaArray::try_from_primitive_array(&primitive, &mut SESSION.create_execution_ctx()) + DeltaData::try_from_primitive_array(&primitive, &mut SESSION.create_execution_ctx()) .unwrap(); test_cast_conformance(&delta_array.into_array()); } diff --git a/encodings/fastlanes/src/delta/mod.rs b/encodings/fastlanes/src/delta/mod.rs index da4f390d37b..52ea9b33574 100644 --- a/encodings/fastlanes/src/delta/mod.rs +++ b/encodings/fastlanes/src/delta/mod.rs @@ -2,10 +2,11 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::DeltaArray; +pub use array::DeltaData; pub use array::delta_compress::delta_compress; mod compute; mod vtable; pub use vtable::Delta; +pub use vtable::DeltaArray; diff --git a/encodings/fastlanes/src/delta/vtable/mod.rs b/encodings/fastlanes/src/delta/vtable/mod.rs index 67b1325bd4e..0e81396055e 100644 --- a/encodings/fastlanes/src/delta/vtable/mod.rs +++ b/encodings/fastlanes/src/delta/vtable/mod.rs @@ -14,12 +14,13 @@ use vortex_array::ExecutionResult; use vortex_array::IntoArray; use vortex_array::Precision; use vortex_array::ProstMetadata; +use vortex_array::arrays::PrimitiveArray; use vortex_array::buffer::BufferHandle; use vortex_array::dtype::DType; use vortex_array::dtype::PType; use vortex_array::match_each_unsigned_integer_ptype; use vortex_array::serde::ArrayChildren; -use vortex_array::stats::StatsSetRef; +use vortex_array::stats::ArrayStats; use vortex_array::vtable; use vortex_array::vtable::Array; use vortex_array::vtable::ArrayId; @@ -30,7 +31,7 @@ use vortex_error::vortex_err; use vortex_error::vortex_panic; use vortex_session::VortexSession; -use crate::DeltaArray; +use crate::DeltaData; use crate::delta::array::delta_decompress::delta_decompress; mod operations; @@ -38,7 +39,7 @@ mod rules; mod slice; mod validity; -vtable!(Delta); +vtable!(Delta, Delta, DeltaData); #[derive(Clone, prost::Message)] #[repr(C)] @@ -50,14 +51,14 @@ pub struct DeltaMetadata { } impl VTable for Delta { - type Array = DeltaArray; + type ArrayData = DeltaData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = Self; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &DeltaData) -> &Self { &Delta } @@ -65,19 +66,19 @@ impl VTable for Delta { Self::ID } - fn len(array: &DeltaArray) -> usize { + fn len(array: &DeltaData) -> usize { array.len() } - fn dtype(array: &DeltaArray) -> &DType { + fn dtype(array: &DeltaData) -> &DType { array.dtype() } - fn stats(array: &DeltaArray) -> StatsSetRef<'_> { - array.stats_set().to_ref(array.as_ref()) + fn stats(array: &DeltaData) -> &ArrayStats { + array.stats_set() } - fn array_hash(array: &DeltaArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.offset().hash(state); array.len().hash(state); array.dtype().hash(state); @@ -85,7 +86,7 @@ impl VTable for Delta { array.deltas().array_hash(state, precision); } - fn array_eq(array: &DeltaArray, other: &DeltaArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.offset() == other.offset() && array.len() == other.len() && array.dtype() == other.dtype() @@ -93,23 +94,23 @@ impl VTable for Delta { && array.deltas().array_eq(other.deltas(), precision) } - fn nbuffers(_array: &DeltaArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &DeltaArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("DeltaArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &DeltaArray, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(_array: &DeltaArray) -> usize { + fn nchildren(_array: &Array) -> usize { 2 } - fn child(array: &DeltaArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.bases().clone(), 1 => array.deltas().clone(), @@ -117,7 +118,7 @@ impl VTable for Delta { } } - fn child_name(_array: &DeltaArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "bases".to_string(), 1 => "deltas".to_string(), @@ -133,7 +134,7 @@ impl VTable for Delta { rules::RULES.evaluate(array, parent, child_idx) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut DeltaData, children: Vec) -> VortexResult<()> { // DeltaArray children order (from visit_children): // 1. bases // 2. deltas @@ -150,7 +151,7 @@ impl VTable for Delta { Ok(()) } - fn metadata(array: &DeltaArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(DeltaMetadata { deltas_len: array.deltas().len() as u64, offset: array.offset() as u32, @@ -177,7 +178,7 @@ impl VTable for Delta { metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { assert_eq!(children.len(), 2); let ptype = PType::try_from(dtype)?; let lanes = match_each_unsigned_integer_ptype!(ptype, |T| { ::LANES }); @@ -192,7 +193,7 @@ impl VTable for Delta { let bases = children.get(0, dtype, bases_len)?; let deltas = children.get(1, dtype, deltas_len)?; - DeltaArray::try_new(bases, deltas, metadata.0.offset as usize, len) + DeltaData::try_new(bases, deltas, metadata.0.offset as usize, len) } fn execute(array: Arc>, ctx: &mut ExecutionCtx) -> VortexResult { @@ -207,6 +208,14 @@ pub struct Delta; impl Delta { pub const ID: ArrayId = ArrayId::new_ref("fastlanes.delta"); + + /// Compress a primitive array using Delta encoding. + pub fn try_from_primitive_array( + array: &PrimitiveArray, + ctx: &mut ExecutionCtx, + ) -> VortexResult { + Array::try_from_data(DeltaData::try_from_primitive_array(array, ctx)?) + } } #[cfg(test)] diff --git a/encodings/fastlanes/src/delta/vtable/operations.rs b/encodings/fastlanes/src/delta/vtable/operations.rs index 91e7501b308..8c60e9e9f24 100644 --- a/encodings/fastlanes/src/delta/vtable/operations.rs +++ b/encodings/fastlanes/src/delta/vtable/operations.rs @@ -1,23 +1,24 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use vortex_array::DynArray; use vortex_array::ExecutionCtx; +use vortex_array::IntoArray; use vortex_array::ToCanonical; use vortex_array::scalar::Scalar; +use vortex_array::vtable::Array; use vortex_array::vtable::OperationsVTable; use vortex_error::VortexResult; use super::Delta; -use crate::DeltaArray; - impl OperationsVTable for Delta { fn scalar_at( - array: &DeltaArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { - let decompressed = array.slice(index..index + 1)?.to_primitive(); - decompressed.scalar_at(0) + let decompressed = array.to_array_ref().slice(index..index + 1)?.to_primitive(); + decompressed.into_array().scalar_at(0) } } @@ -35,20 +36,26 @@ mod tests { use vortex_array::session::ArraySession; use vortex_array::validity::Validity; use vortex_buffer::buffer; + use vortex_error::VortexExpect; use vortex_session::VortexSession; use crate::DeltaArray; + use crate::DeltaData; static SESSION: LazyLock = LazyLock::new(|| VortexSession::empty().with::()); + fn da(array: &PrimitiveArray) -> DeltaArray { + DeltaArray::try_from_data( + DeltaData::try_from_primitive_array(array, &mut SESSION.create_execution_ctx()) + .unwrap(), + ) + .vortex_expect("DeltaData is always valid") + } + #[test] fn test_slice_non_jagged_array_first_chunk_of_two() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..2048).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap(); + let delta = da(&(0u32..2048).collect()); let actual = delta.slice(10..250).unwrap(); let expected = PrimitiveArray::from_iter(10u32..250).into_array(); @@ -57,11 +64,7 @@ mod tests { #[test] fn test_slice_non_jagged_array_second_chunk_of_two() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..2048).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap(); + let delta = da(&(0u32..2048).collect()); let actual = delta.slice(1024 + 10..1024 + 250).unwrap(); let expected = PrimitiveArray::from_iter((1024 + 10u32)..(1024 + 250)).into_array(); @@ -70,11 +73,7 @@ mod tests { #[test] fn test_slice_non_jagged_array_span_two_chunks_chunk_of_two() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..2048).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap(); + let delta = da(&(0u32..2048).collect()); let actual = delta.slice(1000..1048).unwrap(); let expected = PrimitiveArray::from_iter(1000u32..1048).into_array(); @@ -83,11 +82,7 @@ mod tests { #[test] fn test_slice_non_jagged_array_span_two_chunks_chunk_of_four() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..4096).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap(); + let delta = da(&(0u32..4096).collect()); let actual = delta.slice(2040..2050).unwrap(); let expected = PrimitiveArray::from_iter(2040u32..2050).into_array(); @@ -96,11 +91,7 @@ mod tests { #[test] fn test_slice_non_jagged_array_whole() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..4096).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap(); + let delta = da(&(0u32..4096).collect()); let actual = delta.slice(0..4096).unwrap(); let expected = PrimitiveArray::from_iter(0u32..4096).into_array(); @@ -109,11 +100,7 @@ mod tests { #[test] fn test_slice_non_jagged_array_empty() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..4096).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap(); + let delta = da(&(0u32..4096).collect()); let actual = delta.slice(0..0).unwrap(); let expected = PrimitiveArray::from_iter(Vec::::new()).into_array(); @@ -130,11 +117,7 @@ mod tests { #[test] fn test_slice_jagged_array_second_chunk_of_two() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..2000).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap(); + let delta = da(&(0u32..2000).collect()); let actual = delta.slice(1024 + 10..1024 + 250).unwrap(); let expected = PrimitiveArray::from_iter((1024 + 10u32)..(1024 + 250)).into_array(); @@ -143,11 +126,7 @@ mod tests { #[test] fn test_slice_jagged_array_empty() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..4000).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap(); + let delta = da(&(0u32..4000).collect()); let actual = delta.slice(0..0).unwrap(); let expected = PrimitiveArray::from_iter(Vec::::new()).into_array(); @@ -164,11 +143,7 @@ mod tests { #[test] fn test_slice_of_slice_of_non_jagged() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..2048).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap(); + let delta = da(&(0u32..2048).collect()); let sliced = delta.slice(10..1013).unwrap(); let sliced_again = sliced.slice(0..2).unwrap(); @@ -179,11 +154,7 @@ mod tests { #[test] fn test_slice_of_slice_of_jagged() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..2000).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap(); + let delta = da(&(0u32..2000).collect()); let sliced = delta.slice(10..1013).unwrap(); let sliced_again = sliced.slice(0..2).unwrap(); @@ -194,11 +165,7 @@ mod tests { #[test] fn test_slice_of_slice_second_chunk_of_non_jagged() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..2048).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap(); + let delta = da(&(0u32..2048).collect()); let sliced = delta.slice(1034..1050).unwrap(); let sliced_again = sliced.slice(0..2).unwrap(); @@ -209,11 +176,7 @@ mod tests { #[test] fn test_slice_of_slice_second_chunk_of_jagged() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..2000).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap(); + let delta = da(&(0u32..2000).collect()); let sliced = delta.slice(1034..1050).unwrap(); let sliced_again = sliced.slice(0..2).unwrap(); @@ -224,11 +187,7 @@ mod tests { #[test] fn test_slice_of_slice_spanning_two_chunks_of_non_jagged() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..2048).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap(); + let delta = da(&(0u32..2048).collect()); let sliced = delta.slice(1010..1050).unwrap(); let sliced_again = sliced.slice(5..20).unwrap(); @@ -239,11 +198,7 @@ mod tests { #[test] fn test_slice_of_slice_spanning_two_chunks_of_jagged() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..2000).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap(); + let delta = da(&(0u32..2000).collect()); let sliced = delta.slice(1010..1050).unwrap(); let sliced_again = sliced.slice(5..20).unwrap(); @@ -254,12 +209,7 @@ mod tests { #[test] fn test_scalar_at_non_jagged_array() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..2048).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap() - .into_array(); + let delta = da(&(0u32..2048).collect()).into_array(); let expected = PrimitiveArray::from_iter(0u32..2048).into_array(); assert_arrays_eq!(delta, expected); @@ -268,22 +218,12 @@ mod tests { #[test] #[should_panic] fn test_scalar_at_non_jagged_array_oob() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..2048).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap() - .into_array(); + let delta = da(&(0u32..2048).collect()).into_array(); delta.scalar_at(2048).unwrap(); } #[test] fn test_scalar_at_jagged_array() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..2000).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap() - .into_array(); + let delta = da(&(0u32..2000).collect()).into_array(); let expected = PrimitiveArray::from_iter(0u32..2000).into_array(); assert_arrays_eq!(delta, expected); @@ -292,12 +232,7 @@ mod tests { #[test] #[should_panic] fn test_scalar_at_jagged_array_oob() { - let delta = DeltaArray::try_from_primitive_array( - &(0u32..2000).collect(), - &mut SESSION.create_execution_ctx(), - ) - .unwrap() - .into_array(); + let delta = da(&(0u32..2000).collect()).into_array(); delta.scalar_at(2000).unwrap(); } @@ -311,11 +246,7 @@ mod tests { // Single element #[case::delta_single(PrimitiveArray::new(buffer![42u32], Validity::NonNullable))] fn test_delta_consistency(#[case] array: PrimitiveArray) { - test_array_consistency( - &DeltaArray::try_from_primitive_array(&array, &mut SESSION.create_execution_ctx()) - .unwrap() - .into_array(), - ); + test_array_consistency(&da(&array).into_array()); } #[rstest] @@ -325,10 +256,6 @@ mod tests { #[case::delta_u64_basic(PrimitiveArray::new(buffer![1u64, 1, 1, 1, 1], Validity::NonNullable))] #[case::delta_u32_large(PrimitiveArray::new(buffer![1u32; 100], Validity::NonNullable))] fn test_delta_binary_numeric(#[case] array: PrimitiveArray) { - test_binary_numeric_array( - DeltaArray::try_from_primitive_array(&array, &mut SESSION.create_execution_ctx()) - .unwrap() - .into_array(), - ); + test_binary_numeric_array(da(&array).into_array()); } } diff --git a/encodings/fastlanes/src/delta/vtable/slice.rs b/encodings/fastlanes/src/delta/vtable/slice.rs index 6c589b85db2..82f2171e312 100644 --- a/encodings/fastlanes/src/delta/vtable/slice.rs +++ b/encodings/fastlanes/src/delta/vtable/slice.rs @@ -7,13 +7,14 @@ use std::ops::Range; use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::arrays::slice::SliceReduce; +use vortex_array::vtable::Array; use vortex_error::VortexResult; -use crate::DeltaArray; +use crate::DeltaData; use crate::delta::vtable::Delta; impl SliceReduce for Delta { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { let physical_start = range.start + array.offset(); let physical_stop = range.end + array.offset(); @@ -34,7 +35,7 @@ impl SliceReduce for Delta { // SAFETY: slicing valid bases/deltas preserves correctness Ok(Some(unsafe { - DeltaArray::new_unchecked(new_bases, new_deltas, physical_start % 1024, range.len()) + DeltaData::new_unchecked(new_bases, new_deltas, physical_start % 1024, range.len()) .into_array() })) } diff --git a/encodings/fastlanes/src/delta/vtable/validity.rs b/encodings/fastlanes/src/delta/vtable/validity.rs index 17dc2063206..ed4e41f2edd 100644 --- a/encodings/fastlanes/src/delta/vtable/validity.rs +++ b/encodings/fastlanes/src/delta/vtable/validity.rs @@ -4,15 +4,15 @@ use vortex_array::LEGACY_SESSION; use vortex_array::VortexSessionExecute; use vortex_array::validity::Validity; +use vortex_array::vtable::Array; use vortex_array::vtable::ValidityVTable; use vortex_error::VortexResult; use crate::Delta; -use crate::DeltaArray; use crate::bit_transpose::untranspose_validity; impl ValidityVTable for Delta { - fn validity(array: &DeltaArray) -> VortexResult { + fn validity(array: &Array) -> VortexResult { let start = array.offset(); let end = start + array.len(); diff --git a/encodings/fastlanes/src/for/array/for_compress.rs b/encodings/fastlanes/src/for/array/for_compress.rs index 95277505360..14f87118826 100644 --- a/encodings/fastlanes/src/for/array/for_compress.rs +++ b/encodings/fastlanes/src/for/array/for_compress.rs @@ -5,6 +5,7 @@ use num_traits::PrimInt; use num_traits::WrappingSub; use vortex_array::IntoArray; use vortex_array::arrays::PrimitiveArray; +use vortex_array::arrays::PrimitiveData; use vortex_array::dtype::NativePType; use vortex_array::expr::stats::Stat; use vortex_array::match_each_integer_ptype; @@ -12,12 +13,12 @@ use vortex_array::stats::ArrayStats; use vortex_error::VortexResult; use vortex_error::vortex_err; -use crate::FoRArray; - -impl FoRArray { - pub fn encode(array: PrimitiveArray) -> VortexResult { - let stats = ArrayStats::from(array.statistics().to_owned()); - let min = array +use crate::FoRData; +impl FoRData { + pub fn encode(array: PrimitiveArray) -> VortexResult { + let array_ref = array.clone().into_array(); + let stats = ArrayStats::from(array_ref.statistics().to_owned()); + let min = array_ref .statistics() .compute_stat(Stat::Min)? .ok_or_else(|| vortex_err!("Min stat not found"))?; @@ -25,11 +26,12 @@ impl FoRArray { let encoded = match_each_integer_ptype!(array.ptype(), |T| { compress_primitive::(array, T::try_from(&min)?)?.into_array() }); - let for_array = FoRArray::try_new(encoded, min)?; + let for_array = FoRData::try_new(encoded, min)?; + let for_ref = for_array.clone().into_array(); for_array .stats_set() - .to_ref(for_array.as_ref()) - .inherit_from(stats.to_ref(for_array.as_ref())); + .to_ref(&*for_ref) + .inherit_from(stats.to_ref(&*for_ref)); Ok(for_array) } } @@ -37,16 +39,18 @@ impl FoRArray { fn compress_primitive( parray: PrimitiveArray, min: T, -) -> VortexResult { +) -> VortexResult { // Set null values to the min value, ensuring that decompress into a value in the primitive // range (and stop them wrapping around). - parray.map_each_with_validity::(|(v, bool)| { - if bool { - v.wrapping_sub(&min) - } else { - T::zero() - } - }) + parray + .into_data() + .map_each_with_validity::(|(v, bool)| { + if bool { + v.wrapping_sub(&min) + } else { + T::zero() + } + }) } #[cfg(test)] @@ -64,10 +68,13 @@ mod test { use vortex_array::session::ArraySession; use vortex_array::validity::Validity; use vortex_buffer::buffer; + use vortex_error::VortexExpect; use vortex_session::VortexSession; use super::*; use crate::BitPackedArray; + use crate::BitPackedData; + use crate::FoRArray; use crate::r#for::array::for_decompress::decompress; use crate::r#for::array::for_decompress::fused_decompress; @@ -80,7 +87,7 @@ mod test { (1i32..10).collect::>(), Validity::NonNullable, ); - let compressed = FoRArray::encode(array.clone()).unwrap(); + let compressed = FoRData::encode(array.clone()).unwrap(); assert_eq!(i32::try_from(compressed.reference_scalar()).unwrap(), 1); assert_arrays_eq!(compressed, array); @@ -95,7 +102,8 @@ mod test { .collect::>(), Validity::NonNullable, ); - let compressed = FoRArray::encode(array).unwrap(); + let compressed = FoRArray::try_from_data(FoRData::encode(array).unwrap()) + .vortex_expect("FoRData is always valid"); assert_eq!( u32::try_from(compressed.reference_scalar()).unwrap(), 1_000_000u32 @@ -108,7 +116,8 @@ mod test { assert_eq!(array.statistics().len(), 0); let dtype = array.dtype().clone(); - let compressed = FoRArray::encode(array).unwrap(); + let compressed = FoRArray::try_from_data(FoRData::encode(array).unwrap()) + .vortex_expect("FoRData is always valid"); assert_eq!(compressed.reference_scalar().dtype(), &dtype); assert!(compressed.reference_scalar().dtype().is_signed_int()); assert!(compressed.encoded().dtype().is_signed_int()); @@ -121,7 +130,7 @@ mod test { fn test_decompress() { // Create a range offset by a million. let array = PrimitiveArray::from_iter((0u32..100_000).step_by(1024).map(|v| v + 1_000_000)); - let compressed = FoRArray::encode(array.clone()).unwrap(); + let compressed = FoRData::encode(array.clone()).unwrap(); assert_arrays_eq!(compressed, array); } @@ -130,8 +139,10 @@ mod test { // Create a range offset by a million. let expect = PrimitiveArray::from_iter((0u32..1024).map(|x| x % 7 + 10)); let array = PrimitiveArray::from_iter((0u32..1024).map(|x| x % 7)); - let bp = BitPackedArray::encode(&array.into_array(), 3).unwrap(); - let compressed = FoRArray::try_new(bp.into_array(), 10u32.into()).unwrap(); + let bp = BitPackedData::encode(&array.into_array(), 3).unwrap(); + let compressed = + FoRArray::try_from_data(FoRData::try_new(bp.into_array(), 10u32.into()).unwrap()) + .vortex_expect("FoRData is always valid"); assert_arrays_eq!(compressed, expect); } @@ -140,8 +151,11 @@ mod test { // Create a range offset by a million. let expect = PrimitiveArray::from_iter((0u32..1024).map(|x| x % 7 + 10)); let array = PrimitiveArray::from_iter((0u32..1024).map(|x| x % 7)); - let bp = BitPackedArray::encode(&array.into_array(), 2).unwrap(); - let compressed = FoRArray::try_new(bp.clone().into_array(), 10u32.into()).unwrap(); + let bp = + BitPackedArray::try_from_data(BitPackedData::encode(&array.into_array(), 2).unwrap())?; + let compressed = FoRArray::try_from_data( + FoRData::try_new(bp.clone().into_array(), 10u32.into()).unwrap(), + )?; let decompressed = fused_decompress::(&compressed, &bp, &mut SESSION.create_execution_ctx())?; assert_arrays_eq!(decompressed, expect); @@ -151,7 +165,7 @@ mod test { #[test] fn test_overflow() -> VortexResult<()> { let array = PrimitiveArray::from_iter(i8::MIN..=i8::MAX); - let compressed = FoRArray::encode(array.clone()).unwrap(); + let compressed = FoRArray::try_from_data(FoRData::encode(array.clone()).unwrap())?; assert_eq!( i8::MIN, compressed diff --git a/encodings/fastlanes/src/for/array/for_decompress.rs b/encodings/fastlanes/src/for/array/for_decompress.rs index bffca15840b..3eb82678d25 100644 --- a/encodings/fastlanes/src/for/array/for_decompress.rs +++ b/encodings/fastlanes/src/for/array/for_decompress.rs @@ -12,7 +12,6 @@ use vortex_array::dtype::PhysicalPType; use vortex_array::dtype::UnsignedPType; use vortex_array::match_each_integer_ptype; use vortex_array::match_each_unsigned_integer_ptype; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::Buffer; use vortex_error::VortexExpect; use vortex_error::VortexResult; diff --git a/encodings/fastlanes/src/for/array/mod.rs b/encodings/fastlanes/src/for/array/mod.rs index 0f90e6fcd08..b9686117440 100644 --- a/encodings/fastlanes/src/for/array/mod.rs +++ b/encodings/fastlanes/src/for/array/mod.rs @@ -2,6 +2,7 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use vortex_array::ArrayRef; +use vortex_array::dtype::DType; use vortex_array::dtype::PType; use vortex_array::scalar::Scalar; use vortex_array::stats::ArrayStats; @@ -16,13 +17,13 @@ pub mod for_decompress; /// This encoding stores values as offsets from a reference value, which can significantly reduce /// storage requirements when values are clustered around a specific point. #[derive(Clone, Debug)] -pub struct FoRArray { +pub struct FoRData { pub(super) encoded: ArrayRef, pub(super) reference: Scalar, pub(super) stats_set: ArrayStats, } -impl FoRArray { +impl FoRData { pub fn try_new(encoded: ArrayRef, reference: Scalar) -> VortexResult { if reference.is_null() { vortex_bail!("Reference value cannot be null"); @@ -48,6 +49,24 @@ impl FoRArray { } } + /// Returns the length of the array. + #[inline] + pub fn len(&self) -> usize { + self.encoded.len() + } + + /// Returns `true` if the array is empty. + #[inline] + pub fn is_empty(&self) -> bool { + self.encoded.is_empty() + } + + /// Returns the dtype of the array. + #[inline] + pub fn dtype(&self) -> &DType { + self.reference.dtype() + } + #[inline] pub fn ptype(&self) -> PType { self.dtype().as_ptype() diff --git a/encodings/fastlanes/src/for/compute/cast.rs b/encodings/fastlanes/src/for/compute/cast.rs index 0524ba68bcf..90a734fa92d 100644 --- a/encodings/fastlanes/src/for/compute/cast.rs +++ b/encodings/fastlanes/src/for/compute/cast.rs @@ -8,9 +8,9 @@ use vortex_array::dtype::DType; use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_error::VortexResult; +use crate::FoRData; use crate::r#for::FoR; use crate::r#for::FoRArray; - impl CastReduce for FoR { fn cast(array: &FoRArray, dtype: &DType) -> VortexResult> { // FoR only supports integer types @@ -23,7 +23,7 @@ impl CastReduce for FoR { let casted_reference = array.reference_scalar().cast(dtype)?; Ok(Some( - FoRArray::try_new(casted_child, casted_reference)?.into_array(), + FoRData::try_new(casted_child, casted_reference)?.into_array(), )) } } @@ -31,6 +31,7 @@ impl CastReduce for FoR { #[cfg(test)] mod tests { use rstest::rstest; + use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::arrays::PrimitiveArray; use vortex_array::assert_arrays_eq; @@ -41,16 +42,22 @@ mod tests { use vortex_array::dtype::PType; use vortex_array::scalar::Scalar; use vortex_buffer::buffer; + use vortex_error::VortexExpect; use crate::FoRArray; + use crate::FoRData; + + fn for_arr(encoded: ArrayRef, reference: Scalar) -> FoRArray { + FoRArray::try_from_data(FoRData::try_new(encoded, reference).unwrap()) + .vortex_expect("FoRData is always valid") + } #[test] fn test_cast_for_i32_to_i64() { - let for_array = FoRArray::try_new( + let for_array = for_arr( buffer![0i32, 10, 20, 30, 40].into_array(), Scalar::from(100i32), - ) - .unwrap(); + ); let casted = for_array .into_array() @@ -71,7 +78,7 @@ mod tests { #[test] fn test_cast_for_nullable() { let values = PrimitiveArray::from_option_iter([Some(0i32), None, Some(20), Some(30), None]); - let for_array = FoRArray::try_new(values.into_array(), Scalar::from(50i32)).unwrap(); + let for_array = for_arr(values.into_array(), Scalar::from(50i32)); let casted = for_array .into_array() @@ -84,22 +91,22 @@ mod tests { } #[rstest] - #[case(FoRArray::try_new( + #[case(for_arr( buffer![0i32, 1, 2, 3, 4].into_array(), Scalar::from(100i32) - ).unwrap())] - #[case(FoRArray::try_new( + ))] + #[case(for_arr( buffer![0u64, 10, 20, 30].into_array(), Scalar::from(1000u64) - ).unwrap())] - #[case(FoRArray::try_new( + ))] + #[case(for_arr( PrimitiveArray::from_option_iter([Some(0i16), None, Some(5), Some(10), None]).into_array(), Scalar::from(50i16) - ).unwrap())] - #[case(FoRArray::try_new( + ))] + #[case(for_arr( buffer![-10i32, -5, 0, 5, 10].into_array(), Scalar::from(-100i32) - ).unwrap())] + ))] fn test_cast_for_conformance(#[case] array: FoRArray) { test_cast_conformance(&array.into_array()); } diff --git a/encodings/fastlanes/src/for/compute/compare.rs b/encodings/fastlanes/src/for/compute/compare.rs index 79629b6df92..69786572d0a 100644 --- a/encodings/fastlanes/src/for/compute/compare.rs +++ b/encodings/fastlanes/src/for/compute/compare.rs @@ -99,16 +99,22 @@ mod tests { use vortex_buffer::buffer; use super::*; + use crate::FoRArray; + use crate::FoRData; + + fn for_arr(encoded: ArrayRef, reference: Scalar) -> FoRArray { + FoRArray::try_from_data(FoRData::try_new(encoded, reference).unwrap()) + .vortex_expect("FoRData is always valid") + } #[test] fn test_compare_constant() { let reference = Scalar::from(10); // 10, 30, 12 - let lhs = FoRArray::try_new( + let lhs = for_arr( PrimitiveArray::new(buffer!(0i32, 20, 2), Validity::AllValid).into_array(), reference, - ) - .unwrap(); + ); let result = compare_constant(&lhs, 30i32, Nullability::NonNullable, CompareOperator::Eq) .unwrap() @@ -143,11 +149,10 @@ mod tests { fn test_compare_nullable_constant() { let reference = Scalar::from(0); // 10, 30, 12 - let lhs = FoRArray::try_new( + let lhs = for_arr( PrimitiveArray::new(buffer!(0i32, 20, 2), Validity::NonNullable).into_array(), reference, - ) - .unwrap(); + ); assert_eq!( compare_constant(&lhs, 30i32, Nullability::Nullable, CompareOperator::Eq) @@ -169,11 +174,10 @@ mod tests { fn compare_non_encodable_constant() { let reference = Scalar::from(10); // 10, 30, 12 - let lhs = FoRArray::try_new( + let lhs = for_arr( PrimitiveArray::new(buffer!(0i32, 10, 1), Validity::AllValid).into_array(), reference, - ) - .unwrap(); + ); let result = compare_constant(&lhs, -1i32, Nullability::NonNullable, CompareOperator::Eq) .unwrap() @@ -198,15 +202,14 @@ mod tests { fn compare_large_constant() { let reference = Scalar::from(-9219218377546224477i64); #[allow(clippy::cast_possible_truncation)] - let lhs = FoRArray::try_new( + let lhs = for_arr( PrimitiveArray::new( buffer![0i64, 9654309310445864926u64 as i64], Validity::AllValid, ) .into_array(), reference, - ) - .unwrap(); + ); let result = compare_constant( &lhs, diff --git a/encodings/fastlanes/src/for/compute/is_sorted.rs b/encodings/fastlanes/src/for/compute/is_sorted.rs index 110c2b575f6..05d5e31836e 100644 --- a/encodings/fastlanes/src/for/compute/is_sorted.rs +++ b/encodings/fastlanes/src/for/compute/is_sorted.rs @@ -15,64 +15,6 @@ use vortex_error::VortexResult; use crate::FoR; -/// FoR can express sortedness directly on its encoded form. -/// -/// If the minimum is greater than or equal to zero, subtracting it from the other values does not -/// wrap (the value always decreases and the smallest value is zero because min - min = 0). -/// -/// Subtraction without wrapping is order-preserving, so we only need to consider what happens to -/// wrapped numbers. -/// -/// Non-negative minimum values can't wrap. For a negative minimum value, wrapping means that -/// -/// ```text -/// a + abs(min) > 127 -/// ``` -/// -/// There's some residue r, -/// -/// ```text -/// r < 128 -/// ``` -/// -/// such that -/// -/// ```text -/// a + abs(min) mod 128 = r -/// ``` -/// -/// For example, -/// -/// ```text -/// min = -128 -/// a = 1 -/// -/// 1 - -128 = 129 -/// ``` -/// -/// And 129's residue is 1. 129 is represented as -/// -/// ```text -/// -128 + 1 = -127 -/// ``` -/// -/// The unsigned representation is -/// -/// ```text -/// 2^8 - 127 -/// ``` -/// -/// More directly, for some residue r: -/// -/// ```text -/// 2^8 + (-128 + r) -/// = 2^8 - 128 + r -/// = 128 + r -/// ``` -/// -/// Addition is order-preserving, so all the wrapped values preserve their order and they're all -/// represented as unsigned values larger than 127 so they also preserve their order with the -/// unwrapped values. #[derive(Debug)] pub(crate) struct FoRIsSortedKernel; @@ -116,14 +58,14 @@ mod test { use vortex_array::validity::Validity; use vortex_buffer::buffer; - use crate::FoRArray; + use crate::FoRData; #[test] fn test_sorted() { let mut ctx = LEGACY_SESSION.create_execution_ctx(); let a = PrimitiveArray::new(buffer![-1, 0, i8::MAX], Validity::NonNullable); - let b = FoRArray::encode(a).unwrap(); + let b = FoRData::encode(a).unwrap(); assert!( is_sorted(&b.clone().into_array(), &mut ctx).unwrap(), "{}", @@ -131,7 +73,7 @@ mod test { ); let a = PrimitiveArray::new(buffer![i8::MIN, 0, i8::MAX], Validity::NonNullable); - let b = FoRArray::encode(a).unwrap(); + let b = FoRData::encode(a).unwrap(); assert!( is_sorted(&b.clone().into_array(), &mut ctx).unwrap(), "{}", @@ -139,7 +81,7 @@ mod test { ); let a = PrimitiveArray::new(buffer![i8::MIN, 0, 30, 127], Validity::NonNullable); - let b = FoRArray::encode(a).unwrap(); + let b = FoRData::encode(a).unwrap(); assert!( is_sorted(&b.clone().into_array(), &mut ctx).unwrap(), "{}", @@ -147,7 +89,7 @@ mod test { ); let a = PrimitiveArray::new(buffer![i8::MIN, -3, -1], Validity::NonNullable); - let b = FoRArray::encode(a).unwrap(); + let b = FoRData::encode(a).unwrap(); assert!( is_sorted(&b.clone().into_array(), &mut ctx).unwrap(), "{}", @@ -155,7 +97,7 @@ mod test { ); let a = PrimitiveArray::new(buffer![-10, -3, -1], Validity::NonNullable); - let b = FoRArray::encode(a).unwrap(); + let b = FoRData::encode(a).unwrap(); assert!( is_sorted(&b.clone().into_array(), &mut ctx).unwrap(), "{}", @@ -163,7 +105,7 @@ mod test { ); let a = PrimitiveArray::new(buffer![-10, -11, -1], Validity::NonNullable); - let b = FoRArray::encode(a).unwrap(); + let b = FoRData::encode(a).unwrap(); assert!( !is_sorted(&b.clone().into_array(), &mut ctx).unwrap(), "{}", @@ -171,7 +113,7 @@ mod test { ); let a = PrimitiveArray::new(buffer![-10, i8::MIN, -1], Validity::NonNullable); - let b = FoRArray::encode(a).unwrap(); + let b = FoRData::encode(a).unwrap(); assert!( !is_sorted(&b.clone().into_array(), &mut ctx).unwrap(), "{}", diff --git a/encodings/fastlanes/src/for/compute/mod.rs b/encodings/fastlanes/src/for/compute/mod.rs index 921cc7affe7..8bd599a625f 100644 --- a/encodings/fastlanes/src/for/compute/mod.rs +++ b/encodings/fastlanes/src/for/compute/mod.rs @@ -17,6 +17,7 @@ use vortex_mask::Mask; use crate::FoR; use crate::FoRArray; +use crate::FoRData; impl TakeExecute for FoR { fn take( @@ -25,7 +26,7 @@ impl TakeExecute for FoR { _ctx: &mut ExecutionCtx, ) -> VortexResult> { Ok(Some( - FoRArray::try_new( + FoRData::try_new( array.encoded().take(indices.to_array())?, array.reference_scalar().clone(), )? @@ -36,7 +37,7 @@ impl TakeExecute for FoR { impl FilterReduce for FoR { fn filter(array: &FoRArray, mask: &Mask) -> VortexResult> { - FoRArray::try_new( + FoRData::try_new( array.encoded().filter(mask.clone())?, array.reference_scalar().clone(), ) @@ -47,45 +48,51 @@ impl FilterReduce for FoR { #[cfg(test)] mod test { use rstest::rstest; + use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::arrays::PrimitiveArray; use vortex_array::compute::conformance::filter::test_filter_conformance; use vortex_array::scalar::Scalar; use vortex_buffer::buffer; + use vortex_error::VortexExpect; use crate::FoRArray; + use crate::FoRData; + + fn fa(encoded: ArrayRef, reference: Scalar) -> FoRArray { + FoRArray::try_from_data(FoRData::try_new(encoded, reference).unwrap()) + .vortex_expect("FoRData is always valid") + } #[test] fn test_filter_for_array() { - // Test with i32 values - let values = buffer![100i32, 101, 102, 103, 104].into_array(); - let reference = Scalar::from(100i32); - let for_array = FoRArray::try_new(values, reference).unwrap(); + let for_array = fa( + buffer![100i32, 101, 102, 103, 104].into_array(), + Scalar::from(100i32), + ); test_filter_conformance(&for_array.into_array()); - // Test with u64 values - let values = buffer![1000u64, 1001, 1002, 1003, 1004].into_array(); - let reference = Scalar::from(1000u64); - let for_array = FoRArray::try_new(values, reference).unwrap(); + let for_array = fa( + buffer![1000u64, 1001, 1002, 1003, 1004].into_array(), + Scalar::from(1000u64), + ); test_filter_conformance(&for_array.into_array()); - // Test with nullable values let values = PrimitiveArray::from_option_iter([Some(50i16), None, Some(52), Some(53), None]); - let reference = Scalar::from(50i16); - let for_array = FoRArray::try_new(values.into_array(), reference).unwrap(); + let for_array = fa(values.into_array(), Scalar::from(50i16)); test_filter_conformance(&for_array.into_array()); } #[rstest] - #[case(FoRArray::try_new(buffer![100i32, 101, 102, 103, 104].into_array(), Scalar::from(100i32)).unwrap())] - #[case(FoRArray::try_new(buffer![1000u64, 1001, 1002, 1003, 1004].into_array(), Scalar::from(1000u64)).unwrap())] - #[case(FoRArray::try_new( + #[case(fa(buffer![100i32, 101, 102, 103, 104].into_array(), Scalar::from(100i32)))] + #[case(fa(buffer![1000u64, 1001, 1002, 1003, 1004].into_array(), Scalar::from(1000u64)))] + #[case(fa( PrimitiveArray::from_option_iter([Some(50i16), None, Some(52), Some(53), None]).into_array(), Scalar::from(50i16) - ).unwrap())] - #[case(FoRArray::try_new(buffer![-100i32, -99, -98, -97, -96].into_array(), Scalar::from(-100i32)).unwrap())] - #[case(FoRArray::try_new(buffer![42i64].into_array(), Scalar::from(40i64)).unwrap())] + ))] + #[case(fa(buffer![-100i32, -99, -98, -97, -96].into_array(), Scalar::from(-100i32)))] + #[case(fa(buffer![42i64].into_array(), Scalar::from(40i64)))] fn test_take_for_conformance(#[case] for_array: FoRArray) { use vortex_array::compute::conformance::take::test_take_conformance; test_take_conformance(&for_array.into_array()); @@ -95,92 +102,64 @@ mod test { #[cfg(test)] mod tests { use rstest::rstest; + use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::arrays::PrimitiveArray; use vortex_array::compute::conformance::binary_numeric::test_binary_numeric_array; use vortex_array::compute::conformance::consistency::test_array_consistency; use vortex_array::scalar::Scalar; use vortex_buffer::buffer; + use vortex_error::VortexExpect; use crate::FoRArray; + use crate::FoRData; + + fn fa(encoded: ArrayRef, reference: Scalar) -> FoRArray { + FoRArray::try_from_data(FoRData::try_new(encoded, reference).unwrap()) + .vortex_expect("FoRData is always valid") + } #[rstest] - // Basic FoR arrays - #[case::for_i32(FoRArray::try_new( - buffer![100i32, 101, 102, 103, 104].into_array(), - Scalar::from(100i32) - ).unwrap())] - #[case::for_u64(FoRArray::try_new( - buffer![1000u64, 1001, 1002, 1003, 1004].into_array(), - Scalar::from(1000u64) - ).unwrap())] - // Nullable arrays - #[case::for_nullable_i16(FoRArray::try_new( + #[case::for_i32(fa(buffer![100i32, 101, 102, 103, 104].into_array(), Scalar::from(100i32)))] + #[case::for_u64(fa(buffer![1000u64, 1001, 1002, 1003, 1004].into_array(), Scalar::from(1000u64)))] + #[case::for_nullable_i16(fa( PrimitiveArray::from_option_iter([Some(50i16), None, Some(52), Some(53), None]).into_array(), Scalar::from(50i16) - ).unwrap())] - #[case::for_nullable_i32(FoRArray::try_new( + ))] + #[case::for_nullable_i32(fa( PrimitiveArray::from_option_iter([Some(200i32), None, Some(202), Some(203), None]).into_array(), Scalar::from(200i32) - ).unwrap())] - // Negative values - #[case::for_negative(FoRArray::try_new( - buffer![-100i32, -99, -98, -97, -96].into_array(), - Scalar::from(-100i32) - ).unwrap())] - // Edge cases - #[case::for_single(FoRArray::try_new( - buffer![42i64].into_array(), - Scalar::from(40i64) - ).unwrap())] - #[case::for_zero_ref(FoRArray::try_new( - buffer![0u32, 1, 2, 3, 4].into_array(), - Scalar::from(0u32) - ).unwrap())] - // Large arrays (> 1024 elements for fastlanes chunking) - #[case::for_large(FoRArray::try_new( + ))] + #[case::for_negative(fa(buffer![-100i32, -99, -98, -97, -96].into_array(), Scalar::from(-100i32)))] + #[case::for_single(fa(buffer![42i64].into_array(), Scalar::from(40i64)))] + #[case::for_zero_ref(fa(buffer![0u32, 1, 2, 3, 4].into_array(), Scalar::from(0u32)))] + #[case::for_large(fa( PrimitiveArray::from_iter((0..1500).map(|i| 5000 + i)).into_array(), Scalar::from(5000i32) - ).unwrap())] - #[case::for_very_large(FoRArray::try_new( + ))] + #[case::for_very_large(fa( PrimitiveArray::from_iter((0..3072).map(|i| 10000 + i as i64)).into_array(), Scalar::from(10000i64) - ).unwrap())] - #[case::for_large_nullable(FoRArray::try_new( + ))] + #[case::for_large_nullable(fa( PrimitiveArray::from_option_iter((0..2048).map(|i| (i % 15 == 0).then_some(1000 + i))).into_array(), Scalar::from(1000i32) - ).unwrap())] - // Arrays with large deltas from reference - #[case::for_large_deltas(FoRArray::try_new( - buffer![100i64, 200, 300, 400, 500].into_array(), - Scalar::from(100i64) - ).unwrap())] + ))] + #[case::for_large_deltas(fa(buffer![100i64, 200, 300, 400, 500].into_array(), Scalar::from(100i64)))] fn test_for_consistency(#[case] array: FoRArray) { test_array_consistency(&array.into_array()); } #[rstest] - #[case::for_i32_basic(FoRArray::try_new( - buffer![100i32, 101, 102, 103, 104].into_array(), - Scalar::from(100i32) - ).unwrap())] - #[case::for_u32_basic(FoRArray::try_new( - buffer![1000u32, 1001, 1002, 1003, 1004].into_array(), - Scalar::from(1000u32) - ).unwrap())] - #[case::for_i64_basic(FoRArray::try_new( - buffer![5000i64, 5001, 5002, 5003, 5004].into_array(), - Scalar::from(5000i64) - ).unwrap())] - #[case::for_u64_basic(FoRArray::try_new( - buffer![10000u64, 10001, 10002, 10003, 10004].into_array(), - Scalar::from(10000u64) - ).unwrap())] - #[case::for_i32_large(FoRArray::try_new( + #[case::for_i32_basic(fa(buffer![100i32, 101, 102, 103, 104].into_array(), Scalar::from(100i32)))] + #[case::for_u32_basic(fa(buffer![1000u32, 1001, 1002, 1003, 1004].into_array(), Scalar::from(1000u32)))] + #[case::for_i64_basic(fa(buffer![5000i64, 5001, 5002, 5003, 5004].into_array(), Scalar::from(5000i64)))] + #[case::for_u64_basic(fa(buffer![10000u64, 10001, 10002, 10003, 10004].into_array(), Scalar::from(10000u64)))] + #[case::for_i32_large(fa( PrimitiveArray::from_iter((0..100).map(|i| 2000 + i)).into_array(), Scalar::from(2000i32) - ).unwrap())] + ))] fn test_for_binary_numeric(#[case] array: FoRArray) { test_binary_numeric_array(array.into_array()); } diff --git a/encodings/fastlanes/src/for/mod.rs b/encodings/fastlanes/src/for/mod.rs index 1dfaf61114f..99f19486e91 100644 --- a/encodings/fastlanes/src/for/mod.rs +++ b/encodings/fastlanes/src/for/mod.rs @@ -2,9 +2,10 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::FoRArray; +pub use array::FoRData; pub(crate) mod compute; mod vtable; pub use vtable::FoR; +pub use vtable::FoRArray; diff --git a/encodings/fastlanes/src/for/vtable/mod.rs b/encodings/fastlanes/src/for/vtable/mod.rs index 54ab93d93e4..0ae8823c36b 100644 --- a/encodings/fastlanes/src/for/vtable/mod.rs +++ b/encodings/fastlanes/src/for/vtable/mod.rs @@ -12,12 +12,13 @@ use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; use vortex_array::IntoArray; use vortex_array::Precision; +use vortex_array::arrays::PrimitiveArray; use vortex_array::buffer::BufferHandle; use vortex_array::dtype::DType; use vortex_array::scalar::Scalar; use vortex_array::scalar::ScalarValue; use vortex_array::serde::ArrayChildren; -use vortex_array::stats::StatsSetRef; +use vortex_array::stats::ArrayStats; use vortex_array::vtable; use vortex_array::vtable::Array; use vortex_array::vtable::ArrayId; @@ -29,7 +30,7 @@ use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; -use crate::FoRArray; +use crate::FoRData; use crate::r#for::array::for_decompress::decompress; use crate::r#for::vtable::kernels::PARENT_KERNELS; use crate::r#for::vtable::rules::PARENT_RULES; @@ -40,17 +41,17 @@ mod rules; mod slice; mod validity; -vtable!(FoR); +vtable!(FoR, FoR, FoRData); impl VTable for FoR { - type Array = FoRArray; + type ArrayData = FoRData; type Metadata = Scalar; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromChild; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &FoRData) -> &Self { &FoR } @@ -58,59 +59,59 @@ impl VTable for FoR { Self::ID } - fn len(array: &FoRArray) -> usize { + fn len(array: &FoRData) -> usize { array.encoded().len() } - fn dtype(array: &FoRArray) -> &DType { + fn dtype(array: &FoRData) -> &DType { array.reference_scalar().dtype() } - fn stats(array: &FoRArray) -> StatsSetRef<'_> { - array.stats_set().to_ref(array.as_ref()) + fn stats(array: &FoRData) -> &ArrayStats { + array.stats_set() } - fn array_hash(array: &FoRArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.encoded().array_hash(state, precision); array.reference_scalar().hash(state); } - fn array_eq(array: &FoRArray, other: &FoRArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.encoded().array_eq(other.encoded(), precision) && array.reference_scalar() == other.reference_scalar() } - fn nbuffers(_array: &FoRArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &FoRArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("FoRArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &FoRArray, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(_array: &FoRArray) -> usize { + fn nchildren(_array: &Array) -> usize { 1 } - fn child(array: &FoRArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.encoded().clone(), _ => vortex_panic!("FoRArray child index {idx} out of bounds"), } } - fn child_name(_array: &FoRArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "encoded".to_string(), _ => vortex_panic!("FoRArray child name index {idx} out of bounds"), } } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut FoRData, children: Vec) -> VortexResult<()> { // FoRArray children order (from visit_children): // 1. encoded @@ -125,7 +126,7 @@ impl VTable for FoR { Ok(()) } - fn metadata(array: &FoRArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(array.reference_scalar().clone()) } @@ -151,7 +152,7 @@ impl VTable for FoR { metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { if children.len() != 1 { vortex_bail!( "Expected 1 child for FoR encoding, found {}", @@ -161,7 +162,7 @@ impl VTable for FoR { let encoded = children.get(0, dtype, len)?; - FoRArray::try_new(encoded, metadata.clone()) + FoRData::try_new(encoded, metadata.clone()) } fn reduce_parent( @@ -191,4 +192,14 @@ pub struct FoR; impl FoR { pub const ID: ArrayId = ArrayId::new_ref("fastlanes.for"); + + /// Construct a new FoR array from an encoded array and a reference scalar. + pub fn try_new(encoded: ArrayRef, reference: Scalar) -> VortexResult { + Array::try_from_data(FoRData::try_new(encoded, reference)?) + } + + /// Encode a primitive array using Frame of Reference encoding. + pub fn encode(array: PrimitiveArray) -> VortexResult { + Array::try_from_data(FoRData::encode(array)?) + } } diff --git a/encodings/fastlanes/src/for/vtable/operations.rs b/encodings/fastlanes/src/for/vtable/operations.rs index 21f0fed5da9..a251180ea27 100644 --- a/encodings/fastlanes/src/for/vtable/operations.rs +++ b/encodings/fastlanes/src/for/vtable/operations.rs @@ -4,15 +4,18 @@ use vortex_array::ExecutionCtx; use vortex_array::match_each_integer_ptype; use vortex_array::scalar::Scalar; +use vortex_array::vtable::Array; use vortex_array::vtable::OperationsVTable; use vortex_error::VortexExpect; use vortex_error::VortexResult; use super::FoR; -use crate::FoRArray; - impl OperationsVTable for FoR { - fn scalar_at(array: &FoRArray, index: usize, _ctx: &mut ExecutionCtx) -> VortexResult { + fn scalar_at( + array: &Array, + index: usize, + _ctx: &mut ExecutionCtx, + ) -> VortexResult { let encoded_pvalue = array.encoded().scalar_at(index)?; let encoded_pvalue = encoded_pvalue.as_primitive(); let reference = array.reference_scalar(); @@ -38,13 +41,17 @@ impl OperationsVTable for FoR { mod test { use vortex_array::arrays::PrimitiveArray; use vortex_array::assert_arrays_eq; + use vortex_error::VortexExpect; use crate::FoRArray; + use crate::FoRData; #[test] fn for_scalar_at() { - let for_arr = - FoRArray::encode(PrimitiveArray::from_iter([-100, 1100, 1500, 1900])).unwrap(); + let for_arr = FoRArray::try_from_data( + FoRData::encode(PrimitiveArray::from_iter([-100, 1100, 1500, 1900])).unwrap(), + ) + .vortex_expect("FoRData is always valid"); let expected = PrimitiveArray::from_iter([-100, 1100, 1500, 1900]); assert_arrays_eq!(for_arr, expected); } diff --git a/encodings/fastlanes/src/for/vtable/rules.rs b/encodings/fastlanes/src/for/vtable/rules.rs index edeffda8bd7..d33d67d1278 100644 --- a/encodings/fastlanes/src/for/vtable/rules.rs +++ b/encodings/fastlanes/src/for/vtable/rules.rs @@ -15,6 +15,7 @@ use vortex_error::VortexResult; use crate::FoR; use crate::FoRArray; +use crate::FoRData; pub(super) const PARENT_RULES: ParentRuleSet = ParentRuleSet::new(&[ // TODO: add BetweenReduceAdaptor(FoR) @@ -37,7 +38,7 @@ impl ArrayParentReduceRule for FoRFilterPushDownRule { _child_idx: usize, ) -> VortexResult> { let new_array = unsafe { - FoRArray::new_unchecked( + FoRData::new_unchecked( child.encoded.filter(parent.filter_mask().clone())?, child.reference.clone(), ) diff --git a/encodings/fastlanes/src/for/vtable/slice.rs b/encodings/fastlanes/src/for/vtable/slice.rs index 2bf9a7ff7da..9a3abb85653 100644 --- a/encodings/fastlanes/src/for/vtable/slice.rs +++ b/encodings/fastlanes/src/for/vtable/slice.rs @@ -6,16 +6,17 @@ use std::ops::Range; use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::arrays::slice::SliceReduce; +use vortex_array::vtable::Array; use vortex_error::VortexResult; use crate::FoR; -use crate::FoRArray; +use crate::FoRData; impl SliceReduce for FoR { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { // SAFETY: Just slicing encoded data does not affect FOR. Ok(Some(unsafe { - FoRArray::new_unchecked( + FoRData::new_unchecked( array.encoded().slice(range)?, array.reference_scalar().clone(), ) diff --git a/encodings/fastlanes/src/for/vtable/validity.rs b/encodings/fastlanes/src/for/vtable/validity.rs index 3b86795d458..2131f0ba2f4 100644 --- a/encodings/fastlanes/src/for/vtable/validity.rs +++ b/encodings/fastlanes/src/for/vtable/validity.rs @@ -5,10 +5,10 @@ use vortex_array::ArrayRef; use vortex_array::vtable::ValidityChild; use super::FoR; -use crate::FoRArray; +use crate::FoRData; impl ValidityChild for FoR { - fn validity_child(array: &FoRArray) -> &ArrayRef { + fn validity_child(array: &FoRData) -> &ArrayRef { array.encoded() } } diff --git a/encodings/fastlanes/src/rle/array/mod.rs b/encodings/fastlanes/src/rle/array/mod.rs index 6faa1951999..070ec13ab5e 100644 --- a/encodings/fastlanes/src/rle/array/mod.rs +++ b/encodings/fastlanes/src/rle/array/mod.rs @@ -15,7 +15,7 @@ pub mod rle_compress; pub mod rle_decompress; #[derive(Clone, Debug)] -pub struct RLEArray { +pub struct RLEData { pub(super) dtype: DType, /// Run value in the dictionary. pub(super) values: ArrayRef, @@ -38,7 +38,7 @@ pub struct RLEArray { pub(super) length: usize, } -impl RLEArray { +impl RLEData { fn validate( values: &ArrayRef, indices: &ArrayRef, @@ -230,11 +230,13 @@ mod tests { use vortex_array::validity::Validity; use vortex_buffer::Buffer; use vortex_buffer::ByteBufferMut; + use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_session::registry::ReadContext; use crate::FL_CHUNK_SIZE; use crate::RLEArray; + use crate::RLEData; use crate::test::SESSION; #[test] @@ -246,7 +248,10 @@ mod tests { PrimitiveArray::from_iter([0u16, 0, 1, 1, 2].iter().cycle().take(1024).copied()) .into_array(); let values_idx_offsets = PrimitiveArray::from_iter([0u64]).into_array(); - let rle_array = RLEArray::try_new(values, indices, values_idx_offsets, 0, 5).unwrap(); + let rle_array = RLEArray::try_from_data( + RLEData::try_new(values, indices, values_idx_offsets, 0, 5).unwrap(), + ) + .vortex_expect("RLEData is always valid"); assert_eq!(rle_array.len(), 5); assert_eq!(rle_array.values().len(), 3); @@ -273,14 +278,17 @@ mod tests { ) .into_array(); - let rle_array = RLEArray::try_new( - values.clone(), - indices_with_validity, - values_idx_offsets, - 0, - 3, + let rle_array = RLEArray::try_from_data( + RLEData::try_new( + values.clone(), + indices_with_validity, + values_idx_offsets, + 0, + 3, + ) + .unwrap(), ) - .unwrap(); + .vortex_expect("RLEData is always valid"); assert_eq!(rle_array.len(), 3); assert_eq!(rle_array.values().len(), 2); @@ -309,14 +317,17 @@ mod tests { ) .into_array(); - let rle_array = RLEArray::try_new( - values.clone(), - indices_with_validity, - values_idx_offsets, - 0, - 5, + let rle_array = RLEArray::try_from_data( + RLEData::try_new( + values.clone(), + indices_with_validity, + values_idx_offsets, + 0, + 5, + ) + .unwrap(), ) - .unwrap(); + .vortex_expect("RLEData is always valid"); let valid_slice = rle_array.slice(0..3).unwrap().to_primitive(); // TODO(joe): replace with compute null count @@ -346,14 +357,17 @@ mod tests { ) .into_array(); - let rle_array = RLEArray::try_new( - values.clone(), - indices_with_validity, - values_idx_offsets, - 0, - 5, + let rle_array = RLEArray::try_from_data( + RLEData::try_new( + values.clone(), + indices_with_validity, + values_idx_offsets, + 0, + 5, + ) + .unwrap(), ) - .unwrap(); + .vortex_expect("RLEData is always valid"); // TODO(joe): replace with compute null count let invalid_slice = rle_array @@ -388,14 +402,17 @@ mod tests { ) .into_array(); - let rle_array = RLEArray::try_new( - values.clone(), - indices_with_validity, - values_idx_offsets, - 0, - 4, + let rle_array = RLEArray::try_from_data( + RLEData::try_new( + values.clone(), + indices_with_validity, + values_idx_offsets, + 0, + 4, + ) + .unwrap(), ) - .unwrap(); + .vortex_expect("RLEData is always valid"); let sliced_array = rle_array.slice(1..4).unwrap(); let validity_mask = sliced_array.validity_mask().unwrap(); @@ -415,14 +432,17 @@ mod tests { let values = PrimitiveArray::from_iter(Vec::::new()).into_array(); let indices = PrimitiveArray::from_iter(Vec::::new()).into_array(); let values_idx_offsets = PrimitiveArray::from_iter(Vec::::new()).into_array(); - let rle_array = RLEArray::try_new( - values, - indices.clone(), - values_idx_offsets, - 0, - indices.len(), + let rle_array = RLEArray::try_from_data( + RLEData::try_new( + values, + indices.clone(), + values_idx_offsets, + 0, + indices.len(), + ) + .unwrap(), ) - .unwrap(); + .vortex_expect("RLEData is always valid"); assert_eq!(rle_array.len(), 0); assert_eq!(rle_array.values().len(), 0); @@ -433,7 +453,10 @@ mod tests { let values = PrimitiveArray::from_iter([10u32, 20, 30, 40]).into_array(); let indices = PrimitiveArray::from_iter([0u16, 1].repeat(1024)).into_array(); let values_idx_offsets = PrimitiveArray::from_iter([0u64, 2]).into_array(); - let rle_array = RLEArray::try_new(values, indices, values_idx_offsets, 0, 2048).unwrap(); + let rle_array = RLEArray::try_from_data( + RLEData::try_new(values, indices, values_idx_offsets, 0, 2048).unwrap(), + ) + .vortex_expect("RLEData is always valid"); assert_eq!(rle_array.len(), 2048); assert_eq!(rle_array.values().len(), 4); @@ -445,7 +468,8 @@ mod tests { #[test] fn test_rle_serialization() { let primitive = PrimitiveArray::from_iter((0..2048).map(|i| (i / 100) as u32)); - let rle_array = RLEArray::encode(&primitive).unwrap(); + let rle_array = RLEArray::try_from_data(RLEData::encode(&primitive).unwrap()) + .vortex_expect("RLEData is always valid"); assert_eq!(rle_array.len(), 2048); let original_data = rle_array.to_primitive(); @@ -480,16 +504,20 @@ mod tests { #[test] fn test_rle_serialization_slice() { let primitive = PrimitiveArray::from_iter((0..2048).map(|i| (i / 100) as u32)); - let rle_array = RLEArray::encode(&primitive).unwrap(); - - let sliced = RLEArray::try_new( - rle_array.values().clone(), - rle_array.indices().clone(), - rle_array.values_idx_offsets().clone(), - 100, - 100, + let rle_array = RLEArray::try_from_data(RLEData::encode(&primitive).unwrap()) + .vortex_expect("RLEData is always valid"); + + let sliced = RLEArray::try_from_data( + RLEData::try_new( + rle_array.values().clone(), + rle_array.indices().clone(), + rle_array.values_idx_offsets().clone(), + 100, + 100, + ) + .unwrap(), ) - .unwrap(); + .vortex_expect("RLEData is always valid"); assert_eq!(sliced.len(), 100); let ctx = ArrayContext::empty(); @@ -539,17 +567,17 @@ mod tests { // Chunk 1 (positions 1024..) is all-null. let original = PrimitiveArray::from_option_iter(values); - let rle = RLEArray::encode(&original)?; + let rle = RLEArray::try_from_data(RLEData::encode(&original)?)?; // Simulate cascading compression: narrow u16→u8 then re-encode with RLE, // matching the path taken by the BtrBlocks compressor. let indices_prim = rle.indices().to_primitive().narrow()?; - let re_encoded = RLEArray::encode(&indices_prim)?; + let re_encoded = RLEArray::try_from_data(RLEData::encode(&indices_prim)?)?; // Reconstruct the outer RLE with re-encoded indices. // SAFETY: we only replace the indices child; all other invariants hold. - let reconstructed = unsafe { - RLEArray::new_unchecked( + let reconstructed = RLEArray::try_from_data(unsafe { + RLEData::new_unchecked( rle.values().clone(), re_encoded.into_array(), rle.values_idx_offsets().clone(), @@ -557,7 +585,7 @@ mod tests { rle.offset(), rle.len(), ) - }; + })?; // Decompress — panicked before the fill_forward_nulls chunk-boundary fix. let decoded = reconstructed.to_primitive(); diff --git a/encodings/fastlanes/src/rle/array/rle_compress.rs b/encodings/fastlanes/src/rle/array/rle_compress.rs index 51cf30c447e..42a089d3f4f 100644 --- a/encodings/fastlanes/src/rle/array/rle_compress.rs +++ b/encodings/fastlanes/src/rle/array/rle_compress.rs @@ -10,16 +10,15 @@ use vortex_array::arrays::primitive::NativeValue; use vortex_array::dtype::NativePType; use vortex_array::match_each_native_ptype; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::BitBufferMut; use vortex_buffer::BufferMut; use vortex_error::VortexResult; use crate::FL_CHUNK_SIZE; -use crate::RLEArray; +use crate::RLEData; use crate::fill_forward_nulls; -impl RLEArray { +impl RLEData { /// Encodes a primitive array of unsigned integers using FastLanes RLE. pub fn encode(array: &PrimitiveArray) -> VortexResult { match_each_native_ptype!(array.ptype(), |T| { rle_encode_typed::(array) }) @@ -29,7 +28,7 @@ impl RLEArray { /// Encodes a primitive array of unsigned integers using FastLanes RLE. /// /// In case the input array length is % 1024 != 0, the last chunk is padded. -fn rle_encode_typed(array: &PrimitiveArray) -> VortexResult +fn rle_encode_typed(array: &PrimitiveArray) -> VortexResult where T: NativePType + RLE, NativeValue: RLE, @@ -98,7 +97,7 @@ where // SAFETY: NativeValue is repr(transparent) to T. let values_buf = unsafe { values_buf.transmute::().freeze() }; - RLEArray::try_new( + RLEData::try_new( values_buf.into_array(), PrimitiveArray::new(indices_buf.freeze(), padded_validity(array)).into_array(), values_idx_offsets.into_array(), @@ -141,31 +140,39 @@ mod tests { use vortex_array::dtype::half::f16; use vortex_buffer::Buffer; use vortex_buffer::buffer; + use vortex_error::VortexExpect; use super::*; + use crate::RLEArray; #[test] fn test_encode_decode() { // u8 let array_u8: Buffer = buffer![1, 1, 2, 2, 3, 3]; - let encoded_u8 = - RLEArray::encode(&PrimitiveArray::new(array_u8, Validity::NonNullable)).unwrap(); + let encoded_u8 = RLEArray::try_from_data( + RLEData::encode(&PrimitiveArray::new(array_u8, Validity::NonNullable)).unwrap(), + ) + .vortex_expect("RLEData is always valid"); let decoded_u8 = encoded_u8.to_primitive(); let expected_u8 = PrimitiveArray::from_iter(vec![1u8, 1, 2, 2, 3, 3]); assert_arrays_eq!(decoded_u8, expected_u8); // u16 let array_u16: Buffer = buffer![100, 100, 200, 200]; - let encoded_u16 = - RLEArray::encode(&PrimitiveArray::new(array_u16, Validity::NonNullable)).unwrap(); + let encoded_u16 = RLEArray::try_from_data( + RLEData::encode(&PrimitiveArray::new(array_u16, Validity::NonNullable)).unwrap(), + ) + .vortex_expect("RLEData is always valid"); let decoded_u16 = encoded_u16.to_primitive(); let expected_u16 = PrimitiveArray::from_iter(vec![100u16, 100, 200, 200]); assert_arrays_eq!(decoded_u16, expected_u16); // u64 let array_u64: Buffer = buffer![1000, 1000, 2000]; - let encoded_u64 = - RLEArray::encode(&PrimitiveArray::new(array_u64, Validity::NonNullable)).unwrap(); + let encoded_u64 = RLEArray::try_from_data( + RLEData::encode(&PrimitiveArray::new(array_u64, Validity::NonNullable)).unwrap(), + ) + .vortex_expect("RLEData is always valid"); let decoded_u64 = encoded_u64.to_primitive(); let expected_u64 = PrimitiveArray::from_iter(vec![1000u64, 1000, 2000]); assert_arrays_eq!(decoded_u64, expected_u64); @@ -174,16 +181,20 @@ mod tests { #[test] fn test_length() { let values: Buffer = buffer![1, 1, 2, 2, 2, 3]; - let encoded = - RLEArray::encode(&PrimitiveArray::new(values, Validity::NonNullable)).unwrap(); + let encoded = RLEArray::try_from_data( + RLEData::encode(&PrimitiveArray::new(values, Validity::NonNullable)).unwrap(), + ) + .vortex_expect("RLEData is always valid"); assert_eq!(encoded.len(), 6); } #[test] fn test_empty_length() { let values: Buffer = Buffer::empty(); - let encoded = - RLEArray::encode(&PrimitiveArray::new(values, Validity::NonNullable)).unwrap(); + let encoded = RLEArray::try_from_data( + RLEData::encode(&PrimitiveArray::new(values, Validity::NonNullable)).unwrap(), + ) + .vortex_expect("RLEData is always valid"); assert_eq!(encoded.len(), 0); assert_eq!(encoded.values().len(), 0); @@ -193,8 +204,10 @@ mod tests { fn test_single_value() { let values: Buffer = vec![42; 2000].into_iter().collect(); - let encoded = - RLEArray::encode(&PrimitiveArray::new(values, Validity::NonNullable)).unwrap(); + let encoded = RLEArray::try_from_data( + RLEData::encode(&PrimitiveArray::new(values, Validity::NonNullable)).unwrap(), + ) + .vortex_expect("RLEData is always valid"); assert_eq!(encoded.values().len(), 2); // 2 chunks, each storing value 42 let decoded = encoded.to_primitive(); // Verify round-trip @@ -206,8 +219,10 @@ mod tests { fn test_all_different() { let values: Buffer = (0u8..=255).collect(); - let encoded = - RLEArray::encode(&PrimitiveArray::new(values, Validity::NonNullable)).unwrap(); + let encoded = RLEArray::try_from_data( + RLEData::encode(&PrimitiveArray::new(values, Validity::NonNullable)).unwrap(), + ) + .vortex_expect("RLEData is always valid"); assert_eq!(encoded.values().len(), 256); let decoded = encoded.to_primitive(); // Verify round-trip @@ -221,7 +236,8 @@ mod tests { let values: Buffer = (0..1500).map(|i| (i / 100) as u32).collect(); let array = PrimitiveArray::new(values, Validity::NonNullable); - let encoded = RLEArray::encode(&array).unwrap(); + let encoded = RLEArray::try_from_data(RLEData::encode(&array).unwrap()) + .vortex_expect("RLEData is always valid"); assert_eq!(encoded.len(), 1500); assert_arrays_eq!(encoded, array); @@ -235,7 +251,8 @@ mod tests { let values: Buffer = (0..2048).map(|i| (i / 100) as u32).collect(); let array = PrimitiveArray::new(values, Validity::NonNullable); - let encoded = RLEArray::encode(&array).unwrap(); + let encoded = RLEArray::try_from_data(RLEData::encode(&array).unwrap()) + .vortex_expect("RLEData is always valid"); assert_eq!(encoded.len(), 2048); assert_arrays_eq!(encoded, array); @@ -256,7 +273,8 @@ mod tests { #[case::f64((-2000..2000).map(|i| i as f64).collect::>())] fn test_roundtrip_primitive_types(#[case] values: Buffer) { let primitive = values.clone().into_array().to_primitive(); - let result = RLEArray::encode(&primitive).unwrap(); + let result = RLEArray::try_from_data(RLEData::encode(&primitive).unwrap()) + .vortex_expect("RLEData is always valid"); let decoded = result.to_primitive(); let expected = PrimitiveArray::new(values, primitive.validity().clone()); assert_arrays_eq!(decoded, expected); @@ -270,7 +288,8 @@ mod tests { #[case(vec![0f64, -0f64])] fn test_float_zeros(#[case] values: Vec) { let primitive = PrimitiveArray::from_iter(values); - let rle = RLEArray::encode(&primitive).unwrap(); + let rle = RLEArray::try_from_data(RLEData::encode(&primitive).unwrap()) + .vortex_expect("RLEData is always valid"); let decoded = rle.to_primitive(); assert_arrays_eq!(primitive, decoded); } diff --git a/encodings/fastlanes/src/rle/compute/cast.rs b/encodings/fastlanes/src/rle/compute/cast.rs index fca72d5afce..bd18100c961 100644 --- a/encodings/fastlanes/src/rle/compute/cast.rs +++ b/encodings/fastlanes/src/rle/compute/cast.rs @@ -8,9 +8,9 @@ use vortex_array::dtype::DType; use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_error::VortexResult; +use crate::RLEData; use crate::rle::RLE; use crate::rle::RLEArray; - impl CastReduce for RLE { fn cast(array: &RLEArray, dtype: &DType) -> VortexResult> { // Cast RLE values. @@ -27,7 +27,7 @@ impl CastReduce for RLE { }; Ok(Some(unsafe { - RLEArray::new_unchecked( + RLEData::new_unchecked( casted_values, casted_indices, array.values_idx_offsets().clone(), @@ -54,18 +54,25 @@ mod tests { use vortex_array::dtype::PType; use vortex_array::validity::Validity; use vortex_buffer::Buffer; + use vortex_error::VortexExpect; + use crate::RLEData; use crate::rle::RLEArray; + fn rle(primitive: &PrimitiveArray) -> RLEArray { + RLEArray::try_from_data(RLEData::encode(primitive).unwrap()) + .vortex_expect("RLEData is always valid") + } + #[test] fn try_cast_rle_success() { let primitive = PrimitiveArray::new( Buffer::from_iter([10u8, 20, 30, 40, 50]), Validity::from_iter([true, true, true, true, true]), ); - let rle = RLEArray::encode(&primitive).unwrap(); + let encoded = rle(&primitive); - let casted = rle + let casted = encoded .into_array() .cast(DType::Primitive(PType::U16, Nullability::NonNullable)) .unwrap(); @@ -79,8 +86,9 @@ mod tests { Buffer::from_iter([10u8, 20, 30, 40, 50]), Validity::from_iter([true, false, true, true, false]), ); - let rle = RLEArray::encode(&primitive).unwrap(); - rle.into_array() + let encoded = rle(&primitive); + encoded + .into_array() .cast(DType::Primitive(PType::U8, Nullability::NonNullable)) .and_then(|a| a.to_canonical().map(|c| c.into_array())) .unwrap(); @@ -136,7 +144,7 @@ mod tests { ) )] fn test_cast_rle_conformance(#[case] primitive: PrimitiveArray) { - let rle_array = RLEArray::encode(&primitive).unwrap(); + let rle_array = rle(&primitive); test_cast_conformance(&rle_array.into_array()); } } diff --git a/encodings/fastlanes/src/rle/kernel.rs b/encodings/fastlanes/src/rle/kernel.rs index 6d0064b0191..b60cb314344 100644 --- a/encodings/fastlanes/src/rle/kernel.rs +++ b/encodings/fastlanes/src/rle/kernel.rs @@ -14,6 +14,7 @@ use vortex_error::VortexResult; use crate::FL_CHUNK_SIZE; use crate::RLE; use crate::RLEArray; +use crate::RLEData; pub(crate) static PARENT_KERNELS: ParentKernelSet = ParentKernelSet::new(&[ParentKernelSet::lift(&SliceExecuteAdaptor(RLE))]); @@ -47,7 +48,7 @@ impl SliceKernel for RLE { // SAFETY: Slicing preserves all invariants. Ok(Some(unsafe { - RLEArray::new_unchecked( + RLEData::new_unchecked( sliced_values, sliced_indices, sliced_values_idx_offsets, diff --git a/encodings/fastlanes/src/rle/mod.rs b/encodings/fastlanes/src/rle/mod.rs index 2fa51dd5929..1dd0b644156 100644 --- a/encodings/fastlanes/src/rle/mod.rs +++ b/encodings/fastlanes/src/rle/mod.rs @@ -2,10 +2,11 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::RLEArray; +pub use array::RLEData; mod compute; mod kernel; mod vtable; pub use vtable::RLE; +pub use vtable::RLEArray; diff --git a/encodings/fastlanes/src/rle/vtable/mod.rs b/encodings/fastlanes/src/rle/vtable/mod.rs index c82c94d9c0a..8968394f7f8 100644 --- a/encodings/fastlanes/src/rle/vtable/mod.rs +++ b/encodings/fastlanes/src/rle/vtable/mod.rs @@ -13,23 +13,25 @@ use vortex_array::ExecutionResult; use vortex_array::IntoArray; use vortex_array::Precision; use vortex_array::ProstMetadata; +use vortex_array::arrays::PrimitiveArray; use vortex_array::buffer::BufferHandle; use vortex_array::dtype::DType; use vortex_array::dtype::Nullability; use vortex_array::dtype::PType; use vortex_array::serde::ArrayChildren; -use vortex_array::stats::StatsSetRef; +use vortex_array::stats::ArrayStats; use vortex_array::vtable; use vortex_array::vtable::Array; use vortex_array::vtable::ArrayId; use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityVTableFromChildSliceHelper; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_panic; use vortex_session::VortexSession; -use crate::RLEArray; +use crate::RLEData; use crate::rle::array::rle_decompress::rle_decompress; use crate::rle::kernel::PARENT_KERNELS; use crate::rle::vtable::rules::RULES; @@ -38,7 +40,7 @@ mod operations; mod rules; mod validity; -vtable!(RLE); +vtable!(RLE, RLE, RLEData); #[derive(Clone, prost::Message)] pub struct RLEMetadata { @@ -57,14 +59,14 @@ pub struct RLEMetadata { } impl VTable for RLE { - type Array = RLEArray; + type ArrayData = RLEData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromChildSliceHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &RLEData) -> &Self { &RLE } @@ -72,19 +74,19 @@ impl VTable for RLE { Self::ID } - fn len(array: &RLEArray) -> usize { + fn len(array: &RLEData) -> usize { array.len() } - fn dtype(array: &RLEArray) -> &DType { + fn dtype(array: &RLEData) -> &DType { array.dtype() } - fn stats(array: &RLEArray) -> StatsSetRef<'_> { - array.stats_set().to_ref(array.as_ref()) + fn stats(array: &RLEData) -> &ArrayStats { + array.stats_set() } - fn array_hash(array: &RLEArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype().hash(state); array.values().array_hash(state, precision); array.indices().array_hash(state, precision); @@ -93,7 +95,7 @@ impl VTable for RLE { array.len().hash(state); } - fn array_eq(array: &RLEArray, other: &RLEArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype() == other.dtype() && array.values().array_eq(other.values(), precision) && array.indices().array_eq(other.indices(), precision) @@ -104,23 +106,23 @@ impl VTable for RLE { && array.len() == other.len() } - fn nbuffers(_array: &RLEArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &RLEArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("RLEArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &RLEArray, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(_array: &RLEArray) -> usize { + fn nchildren(_array: &Array) -> usize { 3 } - fn child(array: &RLEArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.values().clone(), 1 => array.indices().clone(), @@ -129,7 +131,7 @@ impl VTable for RLE { } } - fn child_name(_array: &RLEArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "values".to_string(), 1 => "indices".to_string(), @@ -146,7 +148,7 @@ impl VTable for RLE { RULES.evaluate(array, parent, child_idx) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut RLEData, children: Vec) -> VortexResult<()> { // RLEArray children order (from visit_children): // 1. values // 2. indices @@ -165,7 +167,7 @@ impl VTable for RLE { Ok(()) } - fn metadata(array: &RLEArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(RLEMetadata { values_len: array.values().len() as u64, indices_len: array.indices().len() as u64, @@ -196,7 +198,7 @@ impl VTable for RLE { metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let metadata = &metadata.0; let values = children.get( 0, @@ -219,7 +221,7 @@ impl VTable for RLE { usize::try_from(metadata.values_idx_offsets_len)?, )?; - RLEArray::try_new( + RLEData::try_new( values, indices, values_idx_offsets, @@ -249,6 +251,29 @@ pub struct RLE; impl RLE { pub const ID: ArrayId = ArrayId::new_ref("fastlanes.rle"); + + /// Create a new RLE array without validation. + /// + /// # Safety + /// See [`RLEData::new_unchecked`] for preconditions. + pub unsafe fn new_unchecked( + values: ArrayRef, + indices: ArrayRef, + values_idx_offsets: ArrayRef, + dtype: DType, + offset: usize, + length: usize, + ) -> RLEArray { + Array::try_from_data(unsafe { + RLEData::new_unchecked(values, indices, values_idx_offsets, dtype, offset, length) + }) + .vortex_expect("RLEData is always valid") + } + + /// Encode a primitive array using FastLanes RLE. + pub fn encode(array: &PrimitiveArray) -> VortexResult { + Array::try_from_data(RLEData::encode(array)?) + } } #[cfg(test)] diff --git a/encodings/fastlanes/src/rle/vtable/operations.rs b/encodings/fastlanes/src/rle/vtable/operations.rs index 9f00432c727..3c5e57305a1 100644 --- a/encodings/fastlanes/src/rle/vtable/operations.rs +++ b/encodings/fastlanes/src/rle/vtable/operations.rs @@ -3,16 +3,20 @@ use vortex_array::ExecutionCtx; use vortex_array::scalar::Scalar; +use vortex_array::vtable::Array; use vortex_array::vtable::OperationsVTable; use vortex_error::VortexExpect; use vortex_error::VortexResult; use super::RLE; use crate::FL_CHUNK_SIZE; -use crate::RLEArray; impl OperationsVTable for RLE { - fn scalar_at(array: &RLEArray, index: usize, _ctx: &mut ExecutionCtx) -> VortexResult { + fn scalar_at( + array: &Array, + index: usize, + _ctx: &mut ExecutionCtx, + ) -> VortexResult { let offset_in_chunk = array.offset(); let chunk_relative_idx = array.indices().scalar_at(offset_in_chunk + index)?; @@ -44,6 +48,8 @@ mod tests { use vortex_buffer::buffer; use super::*; + use crate::RLEArray; + use crate::RLEData; mod fixture { use super::*; @@ -60,14 +66,17 @@ mod tests { .into_array(); let values_idx_offsets = PrimitiveArray::from_iter([0u64]).into_array(); - RLEArray::try_new( - values, - indices.clone(), - values_idx_offsets, - 0, - indices.len(), + RLEArray::try_from_data( + RLEData::try_new( + values, + indices.clone(), + values_idx_offsets, + 0, + indices.len(), + ) + .unwrap(), ) - .unwrap() + .vortex_expect("RLEData is always valid") } pub(super) fn rle_array_with_nulls() -> RLEArray { @@ -95,14 +104,17 @@ mod tests { ) .into_array(); - RLEArray::try_new( - values, - indices.clone(), - values_idx_offsets, - 0, - indices.len(), + RLEArray::try_from_data( + RLEData::try_new( + values, + indices.clone(), + values_idx_offsets, + 0, + indices.len(), + ) + .unwrap(), ) - .unwrap() + .vortex_expect("RLEData is always valid") } } @@ -163,7 +175,8 @@ mod tests { let expected: Vec = (0..3000).map(|i| (i / 50) as u16).collect(); let array = values.into_array(); - let encoded = RLEArray::encode(&array.to_primitive()).unwrap(); + let encoded = RLEArray::try_from_data(RLEData::encode(&array.to_primitive()).unwrap()) + .vortex_expect("RLEData is always valid"); // Access scalars from multiple chunks. for &idx in &[1023, 1024, 1025, 2047, 2048, 2049] { @@ -269,7 +282,8 @@ mod tests { let expected: Vec = (0..2100).map(|i| (i / 100) as u32).collect(); let array = values.into_array(); - let encoded = RLEArray::encode(&array.to_primitive()).unwrap(); + let encoded = RLEArray::try_from_data(RLEData::encode(&array.to_primitive()).unwrap()) + .vortex_expect("RLEData is always valid"); // Slice across first and second chunk. let slice = encoded.slice(500..1500).unwrap(); diff --git a/encodings/fastlanes/src/rle/vtable/validity.rs b/encodings/fastlanes/src/rle/vtable/validity.rs index a8c2756b41e..f46998774cd 100644 --- a/encodings/fastlanes/src/rle/vtable/validity.rs +++ b/encodings/fastlanes/src/rle/vtable/validity.rs @@ -6,15 +6,15 @@ use vortex_array::vtable::ValidityChild; use vortex_array::vtable::ValidityChildSliceHelper; use super::RLE; -use crate::RLEArray; +use crate::RLEData; impl ValidityChild for RLE { - fn validity_child(array: &RLEArray) -> &ArrayRef { + fn validity_child(array: &RLEData) -> &ArrayRef { array.indices() } } -impl ValidityChildSliceHelper for RLEArray { +impl ValidityChildSliceHelper for RLEData { fn unsliced_child_and_slice(&self) -> (&ArrayRef, usize, usize) { let (start, len) = (self.offset(), self.len()); (self.indices(), start, start + len) diff --git a/encodings/fsst/benches/fsst_compress.rs b/encodings/fsst/benches/fsst_compress.rs index 96854f824a6..3bd94850f72 100644 --- a/encodings/fsst/benches/fsst_compress.rs +++ b/encodings/fsst/benches/fsst_compress.rs @@ -9,6 +9,7 @@ use divan::Bencher; use rand::RngExt; use rand::SeedableRng; use rand::rngs::StdRng; +use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::LEGACY_SESSION; use vortex_array::RecursiveCanonical; @@ -24,6 +25,7 @@ use vortex_array::dtype::Nullability; use vortex_array::scalar::Scalar; use vortex_array::scalar_fn::fns::operators::Operator; use vortex_array::session::ArraySession; +use vortex_error::VortexExpect; use vortex_fsst::fsst_compress; use vortex_fsst::fsst_train_compressor; use vortex_session::VortexSession; @@ -57,14 +59,20 @@ fn compress_fsst(bencher: Bencher, (string_count, avg_len, unique_chars): (usize let compressor = fsst_train_compressor(&array); bencher .with_inputs(|| (&array, &compressor)) - .bench_refs(|(array, compressor)| fsst_compress(*array, compressor)) + .bench_refs(|(array, compressor)| { + fsst_compress(*array, array.len(), array.dtype(), compressor) + }) } #[divan::bench(args = BENCH_ARGS)] fn decompress_fsst(bencher: Bencher, (string_count, avg_len, unique_chars): (usize, usize, u8)) { let array = generate_test_data(string_count, avg_len, unique_chars); let compressor = fsst_train_compressor(&array); - let encoded = fsst_compress(array, &compressor); + let len = array.len(); + let dtype = array.dtype().clone(); + let encoded = + vortex_fsst::FSSTArray::try_from_data(fsst_compress(array, len, &dtype, &compressor)) + .vortex_expect("data is always valid"); bencher .with_inputs(|| &encoded) @@ -83,7 +91,7 @@ fn train_compressor(bencher: Bencher, (string_count, avg_len, unique_chars): (us fn pushdown_compare(bencher: Bencher, (string_count, avg_len, unique_chars): (usize, usize, u8)) { let array = generate_test_data(string_count, avg_len, unique_chars); let compressor = fsst_train_compressor(&array); - let fsst_array = fsst_compress(&array, &compressor); + let fsst_array = fsst_compress(&array, array.len(), array.dtype(), &compressor); let constant = ConstantArray::new(Scalar::from(&b"const"[..]), array.len()); bencher @@ -112,7 +120,13 @@ fn canonicalize_compare( ) { let array = generate_test_data(string_count, avg_len, unique_chars); let compressor = fsst_train_compressor(&array); - let fsst_array = fsst_compress(&array, &compressor); + let fsst_array = vortex_fsst::FSSTArray::try_from_data(fsst_compress( + &array, + array.len(), + array.dtype(), + &compressor, + )) + .vortex_expect("data is always valid"); let constant = ConstantArray::new(Scalar::from(&b"const"[..]), array.len()); bencher @@ -127,8 +141,7 @@ fn canonicalize_compare( fsst_array .to_canonical() .unwrap() - .as_ref() - .to_array() + .into_array() .binary(constant.clone().into_array(), Operator::Eq) .unwrap() .execute::(ctx) @@ -215,7 +228,9 @@ fn generate_chunked_test_data( .map(|_| { let array = generate_test_data(string_count, avg_len, unique_chars); let compressor = fsst_train_compressor(&array); - fsst_compress(array, &compressor).into_array() + let len = array.len(); + let dtype = array.dtype().clone(); + fsst_compress(array, len, &dtype, &compressor).into_array() }) .collect::() } diff --git a/encodings/fsst/benches/fsst_url_compare.rs b/encodings/fsst/benches/fsst_url_compare.rs index 1b11e49a5ce..466e35cde50 100644 --- a/encodings/fsst/benches/fsst_url_compare.rs +++ b/encodings/fsst/benches/fsst_url_compare.rs @@ -18,6 +18,7 @@ use vortex_array::expr::root; use vortex_array::scalar::Scalar; use vortex_array::scalar_fn::fns::operators::Operator; use vortex_array::session::ArraySession; +use vortex_error::VortexExpect; use vortex_fsst::fsst_compress; use vortex_fsst::fsst_train_compressor; use vortex_fsst::test_utils::HIGH_MATCH_DOMAIN; @@ -56,7 +57,7 @@ fn pick_url_with_domain(data: &VarBinArray, domain: &str) -> String { fn eq_pushdown_high_match(bencher: Bencher) { let data = &*URL_DATA; let compressor = fsst_train_compressor(data); - let fsst_array = fsst_compress(data, &compressor); + let fsst_array = fsst_compress(data, data.len(), data.dtype(), &compressor); let match_url = pick_url_with_domain(data, HIGH_MATCH_DOMAIN); let constant = ConstantArray::new(Scalar::from(match_url.as_str()), NUM_URLS); @@ -77,7 +78,7 @@ fn eq_pushdown_high_match(bencher: Bencher) { fn eq_pushdown_low_match(bencher: Bencher) { let data = &*URL_DATA; let compressor = fsst_train_compressor(data); - let fsst_array = fsst_compress(data, &compressor); + let fsst_array = fsst_compress(data, data.len(), data.dtype(), &compressor); let match_url = pick_url_with_domain(data, LOW_MATCH_DOMAIN); let constant = ConstantArray::new(Scalar::from(match_url.as_str()), NUM_URLS); @@ -98,7 +99,13 @@ fn eq_pushdown_low_match(bencher: Bencher) { fn eq_canonicalize_high_match(bencher: Bencher) { let data = &*URL_DATA; let compressor = fsst_train_compressor(data); - let fsst_array = fsst_compress(data, &compressor); + let fsst_array = vortex_fsst::FSSTArray::try_from_data(fsst_compress( + data, + data.len(), + data.dtype(), + &compressor, + )) + .vortex_expect("data is always valid"); let match_url = pick_url_with_domain(data, HIGH_MATCH_DOMAIN); let constant = ConstantArray::new(Scalar::from(match_url.as_str()), NUM_URLS); @@ -108,8 +115,7 @@ fn eq_canonicalize_high_match(bencher: Bencher) { fsst_array .to_canonical() .unwrap() - .as_ref() - .to_array() + .into_array() .binary(constant.clone().into_array(), Operator::Eq) .unwrap() .execute::(ctx) @@ -121,7 +127,13 @@ fn eq_canonicalize_high_match(bencher: Bencher) { fn eq_canonicalize_low_match(bencher: Bencher) { let data = &*URL_DATA; let compressor = fsst_train_compressor(data); - let fsst_array = fsst_compress(data, &compressor); + let fsst_array = vortex_fsst::FSSTArray::try_from_data(fsst_compress( + data, + data.len(), + data.dtype(), + &compressor, + )) + .vortex_expect("data is always valid"); let match_url = pick_url_with_domain(data, LOW_MATCH_DOMAIN); let constant = ConstantArray::new(Scalar::from(match_url.as_str()), NUM_URLS); @@ -131,8 +143,7 @@ fn eq_canonicalize_low_match(bencher: Bencher) { fsst_array .to_canonical() .unwrap() - .as_ref() - .to_array() + .into_array() .binary(constant.clone().into_array(), Operator::Eq) .unwrap() .execute::(ctx) @@ -148,7 +159,7 @@ fn eq_canonicalize_low_match(bencher: Bencher) { fn like_substr_high_match(bencher: Bencher) { let data = &*URL_DATA; let compressor = fsst_train_compressor(data); - let fsst_array = fsst_compress(data, &compressor); + let fsst_array = fsst_compress(data, data.len(), data.dtype(), &compressor); let pattern = format!("%{HIGH_MATCH_DOMAIN}%"); let expr = like(root(), lit(pattern.as_str())); @@ -169,7 +180,7 @@ fn like_substr_high_match(bencher: Bencher) { fn like_substr_low_match(bencher: Bencher) { let data = &*URL_DATA; let compressor = fsst_train_compressor(data); - let fsst_array = fsst_compress(data, &compressor); + let fsst_array = fsst_compress(data, data.len(), data.dtype(), &compressor); let pattern = format!("%{LOW_MATCH_DOMAIN}%"); let expr = like(root(), lit(pattern.as_str())); diff --git a/encodings/fsst/public-api.lock b/encodings/fsst/public-api.lock index f5d3c61381b..c750e33b888 100644 --- a/encodings/fsst/public-api.lock +++ b/encodings/fsst/public-api.lock @@ -6,6 +6,8 @@ impl vortex_fsst::FSST pub const vortex_fsst::FSST::ID: vortex_array::vtable::dyn_::ArrayId +pub fn vortex_fsst::FSST::try_new(dtype: vortex_array::dtype::DType, symbols: vortex_buffer::buffer::Buffer, symbol_lengths: vortex_buffer::buffer::Buffer, codes: vortex_array::arrays::varbin::vtable::VarBinArray, uncompressed_lengths: vortex_array::array::ArrayRef) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_fsst::FSST pub fn vortex_fsst::FSST::clone(&self) -> vortex_fsst::FSST @@ -24,7 +26,7 @@ pub fn vortex_fsst::FSST::filter(array: &vortex_fsst::FSSTArray, mask: &vortex_m impl vortex_array::arrays::slice::SliceReduce for vortex_fsst::FSST -pub fn vortex_fsst::FSST::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_fsst::FSST::slice(array: &vortex_array::vtable::typed::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::binary::compare::CompareKernel for vortex_fsst::FSST @@ -40,7 +42,7 @@ pub fn vortex_fsst::FSST::like(array: &vortex_fsst::FSSTArray, pattern: &vortex_ impl vortex_array::vtable::VTable for vortex_fsst::FSST -pub type vortex_fsst::FSST::Array = vortex_fsst::FSSTArray +pub type vortex_fsst::FSST::ArrayData = vortex_fsst::FSSTData pub type vortex_fsst::FSST::Metadata = vortex_array::metadata::ProstMetadata @@ -48,25 +50,25 @@ pub type vortex_fsst::FSST::OperationsVTable = vortex_fsst::FSST pub type vortex_fsst::FSST::ValidityVTable = vortex_array::vtable::validity::ValidityVTableFromChild -pub fn vortex_fsst::FSST::append_to_builder(array: &vortex_fsst::FSSTArray, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_fsst::FSST::append_to_builder(array: &vortex_array::vtable::typed::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_fsst::FSST::array_eq(array: &vortex_fsst::FSSTArray, other: &vortex_fsst::FSSTArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_fsst::FSST::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_fsst::FSST::array_hash(array: &vortex_fsst::FSSTArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_fsst::FSST::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_fsst::FSST::buffer(array: &vortex_fsst::FSSTArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_fsst::FSST::buffer(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_fsst::FSST::buffer_name(_array: &vortex_fsst::FSSTArray, idx: usize) -> core::option::Option +pub fn vortex_fsst::FSST::buffer_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> core::option::Option -pub fn vortex_fsst::FSST::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_fsst::FSST::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_fsst::FSST::child(array: &vortex_fsst::FSSTArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_fsst::FSST::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_fsst::FSST::child_name(_array: &vortex_fsst::FSSTArray, idx: usize) -> alloc::string::String +pub fn vortex_fsst::FSST::child_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_fsst::FSST::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_fsst::FSST::dtype(array: &vortex_fsst::FSSTArray) -> &vortex_array::dtype::DType +pub fn vortex_fsst::FSST::dtype(array: &vortex_fsst::FSSTData) -> &vortex_array::dtype::DType pub fn vortex_fsst::FSST::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -74,83 +76,75 @@ pub fn vortex_fsst::FSST::execute_parent(array: &vortex_array::vtable::typed::Ar pub fn vortex_fsst::FSST::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_fsst::FSST::len(array: &vortex_fsst::FSSTArray) -> usize +pub fn vortex_fsst::FSST::len(array: &vortex_fsst::FSSTData) -> usize -pub fn vortex_fsst::FSST::metadata(array: &vortex_fsst::FSSTArray) -> vortex_error::VortexResult +pub fn vortex_fsst::FSST::metadata(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_fsst::FSST::nbuffers(_array: &vortex_fsst::FSSTArray) -> usize +pub fn vortex_fsst::FSST::nbuffers(_array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_fsst::FSST::nchildren(array: &vortex_fsst::FSSTArray) -> usize +pub fn vortex_fsst::FSST::nchildren(array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_fsst::FSST::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_fsst::FSST::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_fsst::FSST::stats(array: &vortex_fsst::FSSTArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_fsst::FSST::stats(array: &vortex_fsst::FSSTData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_fsst::FSST::vtable(_array: &Self::Array) -> &Self +pub fn vortex_fsst::FSST::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_fsst::FSST::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_fsst::FSST::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_fsst::FSST -pub fn vortex_fsst::FSST::scalar_at(array: &vortex_fsst::FSSTArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_fsst::FSST::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::validity::ValidityChild for vortex_fsst::FSST -pub fn vortex_fsst::FSST::validity_child(array: &vortex_fsst::FSSTArray) -> &vortex_array::array::ArrayRef - -pub struct vortex_fsst::FSSTArray - -impl vortex_fsst::FSSTArray +pub fn vortex_fsst::FSST::validity_child(array: &vortex_fsst::FSSTData) -> &vortex_array::array::ArrayRef -pub fn vortex_fsst::FSSTArray::codes(&self) -> &vortex_array::arrays::varbin::array::VarBinArray +pub struct vortex_fsst::FSSTData -pub fn vortex_fsst::FSSTArray::codes_dtype(&self) -> &vortex_array::dtype::DType +impl vortex_fsst::FSSTData -pub fn vortex_fsst::FSSTArray::compressor(&self) -> &fsst::Compressor +pub fn vortex_fsst::FSSTData::codes(&self) -> &vortex_array::arrays::varbin::vtable::VarBinArray -pub fn vortex_fsst::FSSTArray::decompressor(&self) -> fsst::Decompressor<'_> +pub fn vortex_fsst::FSSTData::codes_dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_fsst::FSSTArray::symbol_lengths(&self) -> &vortex_buffer::buffer::Buffer +pub fn vortex_fsst::FSSTData::compressor(&self) -> &fsst::Compressor -pub fn vortex_fsst::FSSTArray::symbols(&self) -> &vortex_buffer::buffer::Buffer +pub fn vortex_fsst::FSSTData::decompressor(&self) -> fsst::Decompressor<'_> -pub fn vortex_fsst::FSSTArray::try_new(dtype: vortex_array::dtype::DType, symbols: vortex_buffer::buffer::Buffer, symbol_lengths: vortex_buffer::buffer::Buffer, codes: vortex_array::arrays::varbin::array::VarBinArray, uncompressed_lengths: vortex_array::array::ArrayRef) -> vortex_error::VortexResult +pub fn vortex_fsst::FSSTData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_fsst::FSSTArray::uncompressed_lengths(&self) -> &vortex_array::array::ArrayRef +pub fn vortex_fsst::FSSTData::is_empty(&self) -> bool -pub fn vortex_fsst::FSSTArray::uncompressed_lengths_dtype(&self) -> &vortex_array::dtype::DType +pub fn vortex_fsst::FSSTData::len(&self) -> usize -impl vortex_fsst::FSSTArray +pub fn vortex_fsst::FSSTData::symbol_lengths(&self) -> &vortex_buffer::buffer::Buffer -pub fn vortex_fsst::FSSTArray::to_array(&self) -> vortex_array::array::ArrayRef +pub fn vortex_fsst::FSSTData::symbols(&self) -> &vortex_buffer::buffer::Buffer -impl core::clone::Clone for vortex_fsst::FSSTArray +pub fn vortex_fsst::FSSTData::try_new(dtype: vortex_array::dtype::DType, symbols: vortex_buffer::buffer::Buffer, symbol_lengths: vortex_buffer::buffer::Buffer, codes: vortex_array::arrays::varbin::vtable::VarBinArray, uncompressed_lengths: vortex_array::array::ArrayRef) -> vortex_error::VortexResult -pub fn vortex_fsst::FSSTArray::clone(&self) -> vortex_fsst::FSSTArray +pub fn vortex_fsst::FSSTData::uncompressed_lengths(&self) -> &vortex_array::array::ArrayRef -impl core::convert::AsRef for vortex_fsst::FSSTArray +pub fn vortex_fsst::FSSTData::uncompressed_lengths_dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_fsst::FSSTArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +impl core::clone::Clone for vortex_fsst::FSSTData -impl core::convert::From for vortex_array::array::ArrayRef +pub fn vortex_fsst::FSSTData::clone(&self) -> vortex_fsst::FSSTData -pub fn vortex_array::array::ArrayRef::from(value: vortex_fsst::FSSTArray) -> vortex_array::array::ArrayRef +impl core::convert::From for vortex_array::array::ArrayRef -impl core::fmt::Debug for vortex_fsst::FSSTArray +pub fn vortex_array::array::ArrayRef::from(value: vortex_fsst::FSSTData) -> vortex_array::array::ArrayRef -pub fn vortex_fsst::FSSTArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::fmt::Debug for vortex_fsst::FSSTData -impl core::ops::deref::Deref for vortex_fsst::FSSTArray +pub fn vortex_fsst::FSSTData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub type vortex_fsst::FSSTArray::Target = dyn vortex_array::array::DynArray +impl vortex_array::array::IntoArray for vortex_fsst::FSSTData -pub fn vortex_fsst::FSSTArray::deref(&self) -> &Self::Target - -impl vortex_array::array::IntoArray for vortex_fsst::FSSTArray - -pub fn vortex_fsst::FSSTArray::into_array(self) -> vortex_array::array::ArrayRef +pub fn vortex_fsst::FSSTData::into_array(self) -> vortex_array::array::ArrayRef pub struct vortex_fsst::FSSTMetadata @@ -186,8 +180,10 @@ pub fn vortex_fsst::FSSTMetadata::clear(&mut self) pub fn vortex_fsst::FSSTMetadata::encoded_len(&self) -> usize -pub fn vortex_fsst::fsst_compress + core::convert::AsRef>(strings: A, compressor: &fsst::Compressor) -> vortex_fsst::FSSTArray +pub fn vortex_fsst::fsst_compress>(strings: A, len: usize, dtype: &vortex_array::dtype::DType, compressor: &fsst::Compressor) -> vortex_fsst::FSSTData -pub fn vortex_fsst::fsst_compress_iter<'a, I>(iter: I, len: usize, dtype: vortex_array::dtype::DType, compressor: &fsst::Compressor) -> vortex_fsst::FSSTArray where I: core::iter::traits::iterator::Iterator> +pub fn vortex_fsst::fsst_compress_iter<'a, I>(iter: I, len: usize, dtype: vortex_array::dtype::DType, compressor: &fsst::Compressor) -> vortex_fsst::FSSTData where I: core::iter::traits::iterator::Iterator> pub fn vortex_fsst::fsst_train_compressor>(array: &A) -> fsst::Compressor + +pub type vortex_fsst::FSSTArray = vortex_array::vtable::typed::Array diff --git a/encodings/fsst/src/array.rs b/encodings/fsst/src/array.rs index d537201450b..28a5e363fa2 100644 --- a/encodings/fsst/src/array.rs +++ b/encodings/fsst/src/array.rs @@ -32,14 +32,12 @@ use vortex_array::dtype::Nullability; use vortex_array::dtype::PType; use vortex_array::serde::ArrayChildren; use vortex_array::stats::ArrayStats; -use vortex_array::stats::StatsSetRef; use vortex_array::validity::Validity; use vortex_array::vtable; use vortex_array::vtable::Array; use vortex_array::vtable::ArrayId; use vortex_array::vtable::VTable; use vortex_array::vtable::ValidityChild; -use vortex_array::vtable::ValidityHelper; use vortex_array::vtable::ValidityVTableFromChild; use vortex_array::vtable::validity_nchildren; use vortex_array::vtable::validity_to_child; @@ -57,7 +55,7 @@ use crate::canonical::fsst_decode_views; use crate::kernel::PARENT_KERNELS; use crate::rules::RULES; -vtable!(FSST); +vtable!(FSST, FSST, FSSTData); #[derive(Clone, prost::Message)] pub struct FSSTMetadata { @@ -76,13 +74,13 @@ impl FSSTMetadata { } impl VTable for FSST { - type Array = FSSTArray; + type ArrayData = FSSTData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromChild; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &FSST } @@ -90,27 +88,31 @@ impl VTable for FSST { Self::ID } - fn len(array: &FSSTArray) -> usize { + fn len(array: &FSSTData) -> usize { array.codes().len() } - fn dtype(array: &FSSTArray) -> &DType { + fn dtype(array: &FSSTData) -> &DType { &array.dtype } - fn stats(array: &FSSTArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &FSSTData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &FSSTArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.symbols.array_hash(state, precision); array.symbol_lengths.array_hash(state, precision); - array.codes.as_ref().array_hash(state, precision); + array + .codes + .clone() + .into_array() + .array_hash(state, precision); array.uncompressed_lengths.array_hash(state, precision); } - fn array_eq(array: &FSSTArray, other: &FSSTArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.symbols.array_eq(&other.symbols, precision) && array @@ -118,18 +120,19 @@ impl VTable for FSST { .array_eq(&other.symbol_lengths, precision) && array .codes - .as_ref() - .array_eq(other.codes.as_ref(), precision) + .clone() + .into_array() + .array_eq(&other.codes.clone().into_array(), precision) && array .uncompressed_lengths .array_eq(&other.uncompressed_lengths, precision) } - fn nbuffers(_array: &FSSTArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 3 } - fn buffer(array: &FSSTArray, idx: usize) -> BufferHandle { + fn buffer(array: &Array, idx: usize) -> BufferHandle { match idx { 0 => BufferHandle::new_host(array.symbols().clone().into_byte_buffer()), 1 => BufferHandle::new_host(array.symbol_lengths().clone().into_byte_buffer()), @@ -138,7 +141,7 @@ impl VTable for FSST { } } - fn buffer_name(_array: &FSSTArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { match idx { 0 => Some("symbols".to_string()), 1 => Some("symbol_lengths".to_string()), @@ -147,11 +150,11 @@ impl VTable for FSST { } } - fn nchildren(array: &FSSTArray) -> usize { + fn nchildren(array: &Array) -> usize { 2 + validity_nchildren(array.codes.validity()) } - fn child(array: &FSSTArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.uncompressed_lengths().clone(), 1 => array.codes.offsets().clone(), @@ -161,7 +164,7 @@ impl VTable for FSST { } } - fn child_name(_array: &FSSTArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "uncompressed_lengths".to_string(), 1 => "codes_offsets".to_string(), @@ -170,7 +173,7 @@ impl VTable for FSST { } } - fn metadata(array: &FSSTArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(FSSTMetadata { uncompressed_lengths_ptype: array.uncompressed_lengths().dtype().as_ptype().into(), codes_offsets_ptype: array.codes.offsets().dtype().as_ptype().into(), @@ -194,7 +197,7 @@ impl VTable for FSST { } fn append_to_builder( - array: &FSSTArray, + array: &Array, builder: &mut dyn ArrayBuilder, ctx: &mut ExecutionCtx, ) -> VortexResult<()> { @@ -223,7 +226,7 @@ impl VTable for FSST { metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let symbols = Buffer::::from_byte_buffer(buffers[0].clone().try_to_host_sync()?); let symbol_lengths = Buffer::::from_byte_buffer(buffers[1].clone().try_to_host_sync()?); @@ -251,7 +254,7 @@ impl VTable for FSST { len, )?; - return FSSTArray::try_new( + return FSSTData::try_new( dtype.clone(), symbols, symbol_lengths, @@ -298,7 +301,7 @@ impl VTable for FSST { codes_validity, )?; - return FSSTArray::try_new( + return FSSTData::try_new( dtype.clone(), symbols, symbol_lengths, @@ -313,7 +316,7 @@ impl VTable for FSST { ); } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 2, "FSSTArray expects 2 children, got {}", @@ -367,7 +370,7 @@ impl VTable for FSST { } #[derive(Clone)] -pub struct FSSTArray { +pub struct FSSTData { dtype: DType, symbols: Buffer, symbol_lengths: Buffer, @@ -382,7 +385,7 @@ pub struct FSSTArray { compressor: Arc Compressor + Send>>>, } -impl Debug for FSSTArray { +impl Debug for FSSTData { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { f.debug_struct("FSSTArray") .field("dtype", &self.dtype) @@ -399,9 +402,26 @@ pub struct FSST; impl FSST { pub const ID: ArrayId = ArrayId::new_ref("vortex.fsst"); + + /// Build an FSST array from a set of `symbols` and `codes`. + pub fn try_new( + dtype: DType, + symbols: Buffer, + symbol_lengths: Buffer, + codes: VarBinArray, + uncompressed_lengths: ArrayRef, + ) -> VortexResult { + Array::try_from_data(FSSTData::try_new( + dtype, + symbols, + symbol_lengths, + codes, + uncompressed_lengths, + )?) + } } -impl FSSTArray { +impl FSSTData { /// Build an FSST array from a set of `symbols` and `codes`. /// /// Symbols are 8-bytes and can represent short strings, each of which is assigned @@ -477,6 +497,21 @@ impl FSSTArray { } } + /// Returns the number of elements in the array. + pub fn len(&self) -> usize { + self.codes.len() + } + + /// Returns `true` if the array contains no elements. + pub fn is_empty(&self) -> bool { + self.codes.len() == 0 + } + + /// Returns the logical data type of the array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + /// Access the symbol table array pub fn symbols(&self) -> &Buffer { &self.symbols @@ -522,7 +557,7 @@ impl FSSTArray { } impl ValidityChild for FSST { - fn validity_child(array: &FSSTArray) -> &ArrayRef { + fn validity_child(array: &FSSTData) -> &ArrayRef { &array.codes_array } } diff --git a/encodings/fsst/src/canonical.rs b/encodings/fsst/src/canonical.rs index aabd0e14027..494e2dcb400 100644 --- a/encodings/fsst/src/canonical.rs +++ b/encodings/fsst/src/canonical.rs @@ -12,7 +12,6 @@ use vortex_array::arrays::varbinview::build_views::BinaryView; use vortex_array::arrays::varbinview::build_views::MAX_BUFFER_LEN; use vortex_array::arrays::varbinview::build_views::build_views; use vortex_array::match_each_integer_ptype; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::Buffer; use vortex_buffer::ByteBuffer; use vortex_buffer::ByteBufferMut; @@ -151,7 +150,10 @@ mod tests { .map(|_| { let (array, data) = make_data(); let compressor = fsst_train_compressor(&array); - (fsst_compress(&array, &compressor).into_array(), data) + ( + fsst_compress(&array, array.len(), array.dtype(), &compressor).into_array(), + data, + ) }) .unzip(); @@ -167,7 +169,10 @@ mod tests { let mut builder = VarBinViewBuilder::with_capacity(chunked_arr.dtype().clone(), chunked_arr.len()); - chunked_arr.append_to_builder(&mut builder, &mut SESSION.create_execution_ctx())?; + chunked_arr + .clone() + .into_array() + .append_to_builder(&mut builder, &mut SESSION.create_execution_ctx())?; { let arr = builder.finish_into_canonical().into_varbinview(); diff --git a/encodings/fsst/src/compress.rs b/encodings/fsst/src/compress.rs index 669e488a16c..28c2fb41e09 100644 --- a/encodings/fsst/src/compress.rs +++ b/encodings/fsst/src/compress.rs @@ -5,7 +5,6 @@ use fsst::Compressor; use fsst::Symbol; -use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::accessor::ArrayAccessor; use vortex_array::arrays::varbin::builder::VarBinBuilder; @@ -14,16 +13,15 @@ use vortex_buffer::Buffer; use vortex_buffer::BufferMut; use vortex_error::VortexExpect; -use crate::FSSTArray; - /// Compress a string array using FSST. -pub fn fsst_compress + AsRef>( +use crate::FSSTData; +pub fn fsst_compress>( strings: A, + len: usize, + dtype: &DType, compressor: &Compressor, -) -> FSSTArray { - let len = strings.as_ref().len(); - let dtype = strings.as_ref().dtype().clone(); - strings.with_iterator(|iter| fsst_compress_iter(iter, len, dtype, compressor)) +) -> FSSTData { + strings.with_iterator(|iter| fsst_compress_iter(iter, len, dtype.clone(), compressor)) } /// Train a compressor from an array. @@ -62,7 +60,7 @@ pub fn fsst_compress_iter<'a, I>( len: usize, dtype: DType, compressor: &Compressor, -) -> FSSTArray +) -> FSSTData where I: Iterator>, { @@ -103,7 +101,7 @@ where let uncompressed_lengths = uncompressed_lengths.into_array(); - FSSTArray::try_new(dtype, symbols, symbol_lengths, codes, uncompressed_lengths) + FSSTData::try_new(dtype, symbols, symbol_lengths, codes, uncompressed_lengths) .vortex_expect("building FSSTArray from parts") } @@ -113,7 +111,9 @@ mod tests { use vortex_array::dtype::DType; use vortex_array::dtype::Nullability; use vortex_array::scalar::Scalar; + use vortex_error::VortexExpect; + use crate::FSSTArray; use crate::compress::DEFAULT_BUFFER_LEN; use crate::fsst_compress_iter; @@ -134,7 +134,10 @@ mod tests { &compressor, ); - let decoded = compressed.scalar_at(0).unwrap(); + let decoded = FSSTArray::try_from_data(compressed) + .vortex_expect("data is always valid") + .scalar_at(0) + .unwrap(); let expected = Scalar::utf8(big_string, Nullability::NonNullable); diff --git a/encodings/fsst/src/compute/cast.rs b/encodings/fsst/src/compute/cast.rs index e21934665c6..7a080a108e9 100644 --- a/encodings/fsst/src/compute/cast.rs +++ b/encodings/fsst/src/compute/cast.rs @@ -11,7 +11,7 @@ use vortex_error::VortexResult; use crate::FSST; use crate::FSSTArray; - +use crate::FSSTData; impl CastReduce for FSST { fn cast(array: &FSSTArray, dtype: &DType) -> VortexResult> { // FSST is a string compression encoding. @@ -25,7 +25,7 @@ impl CastReduce for FSST { .cast(array.codes().dtype().with_nullability(dtype.nullability()))?; Ok(Some( - FSSTArray::try_new( + FSSTData::try_new( dtype.clone(), array.symbols().clone(), array.symbol_lengths().clone(), @@ -61,7 +61,9 @@ mod tests { ); let compressor = fsst_train_compressor(&strings); - let fsst = fsst_compress(strings, &compressor); + let len = strings.len(); + let dtype = strings.dtype().clone(); + let fsst = fsst_compress(strings, len, &dtype, &compressor); // Cast to nullable let casted = fsst @@ -86,7 +88,7 @@ mod tests { ))] fn test_cast_fsst_conformance(#[case] array: VarBinArray) { let compressor = fsst_train_compressor(&array); - let fsst = fsst_compress(&array, &compressor); + let fsst = fsst_compress(&array, array.len(), array.dtype(), &compressor); test_cast_conformance(&fsst.into_array()); } } diff --git a/encodings/fsst/src/compute/compare.rs b/encodings/fsst/src/compute/compare.rs index e6efbd075ed..f88fdb3e550 100644 --- a/encodings/fsst/src/compute/compare.rs +++ b/encodings/fsst/src/compute/compare.rs @@ -124,7 +124,6 @@ fn compare_fsst_constant( #[cfg(test)] mod tests { - use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::ToCanonical; use vortex_array::arrays::BoolArray; @@ -154,7 +153,9 @@ mod tests { DType::Utf8(Nullability::Nullable), ); let compressor = fsst_train_compressor(&lhs); - let lhs = fsst_compress(lhs, &compressor); + let len = lhs.len(); + let dtype = lhs.dtype().clone(); + let lhs = fsst_compress(lhs, len, &dtype, &compressor); let rhs = ConstantArray::new("world", lhs.len()); diff --git a/encodings/fsst/src/compute/filter.rs b/encodings/fsst/src/compute/filter.rs index b06f442addb..bb2df9ed45b 100644 --- a/encodings/fsst/src/compute/filter.rs +++ b/encodings/fsst/src/compute/filter.rs @@ -12,7 +12,7 @@ use vortex_mask::Mask; use crate::FSST; use crate::FSSTArray; - +use crate::FSSTData; impl FilterKernel for FSST { fn filter( array: &FSSTArray, @@ -27,7 +27,7 @@ impl FilterKernel for FSST { .vortex_expect("must be VarBin"); Ok(Some( - FSSTArray::try_new( + FSSTData::try_new( array.dtype().clone(), array.symbols().clone(), array.symbol_lengths().clone(), @@ -62,7 +62,7 @@ mod test { let varbin = builder.finish(DType::Utf8(Nullability::NonNullable)); let compressor = fsst_train_compressor(&varbin); - let array = fsst_compress(&varbin, &compressor); + let array = fsst_compress(&varbin, varbin.len(), varbin.dtype(), &compressor); test_filter_conformance(&array.into_array()); // Test with longer strings that benefit from compression @@ -75,7 +75,7 @@ mod test { let varbin = builder.finish(DType::Utf8(Nullability::NonNullable)); let compressor = fsst_train_compressor(&varbin); - let array = fsst_compress(&varbin, &compressor); + let array = fsst_compress(&varbin, varbin.len(), varbin.dtype(), &compressor); test_filter_conformance(&array.into_array()); // Test with nullable strings @@ -88,7 +88,7 @@ mod test { let varbin = builder.finish(DType::Utf8(Nullability::Nullable)); let compressor = fsst_train_compressor(&varbin); - let array = fsst_compress(&varbin, &compressor); + let array = fsst_compress(&varbin, varbin.len(), varbin.dtype(), &compressor); test_filter_conformance(&array.into_array()); } } diff --git a/encodings/fsst/src/compute/like.rs b/encodings/fsst/src/compute/like.rs index c438a9ab01e..8db501e996c 100644 --- a/encodings/fsst/src/compute/like.rs +++ b/encodings/fsst/src/compute/like.rs @@ -72,7 +72,8 @@ impl LikeKernel for FSST { // directly without cloning the entire FSSTArray into an ArrayRef. let validity = array .codes() - .validity()? + .validity() + .clone() .union_nullability(pattern_scalar.dtype().nullability()); Ok(Some(BoolArray::new(result, validity).into_array())) @@ -97,6 +98,7 @@ mod tests { use vortex_array::scalar_fn::fns::like::LikeKernel; use vortex_array::scalar_fn::fns::like::LikeOptions; use vortex_array::session::ArraySession; + use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_session::VortexSession; @@ -111,7 +113,10 @@ mod tests { fn make_fsst(strings: &[Option<&str>], nullability: Nullability) -> FSSTArray { let varbin = VarBinArray::from_iter(strings.iter().copied(), DType::Utf8(nullability)); let compressor = fsst_train_compressor(&varbin); - fsst_compress(varbin, &compressor) + let len = varbin.len(); + let dtype = varbin.dtype().clone(); + FSSTArray::try_from_data(fsst_compress(varbin, len, &dtype, &compressor)) + .vortex_expect("data is always valid") } fn run_like(array: FSSTArray, pattern: &str, opts: LikeOptions) -> VortexResult { diff --git a/encodings/fsst/src/compute/mod.rs b/encodings/fsst/src/compute/mod.rs index f49c2954a04..29da66d8773 100644 --- a/encodings/fsst/src/compute/mod.rs +++ b/encodings/fsst/src/compute/mod.rs @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use crate::FSSTData; mod cast; mod compare; mod filter; @@ -28,7 +29,7 @@ impl TakeExecute for FSST { _ctx: &mut ExecutionCtx, ) -> VortexResult> { Ok(Some( - FSSTArray::try_new( + FSSTData::try_new( array .dtype() .clone() @@ -62,6 +63,7 @@ mod tests { use vortex_array::compute::conformance::take::test_take_conformance; use vortex_array::dtype::DType; use vortex_array::dtype::Nullability; + use vortex_error::VortexExpect; use crate::FSSTArray; use crate::fsst_compress; @@ -71,7 +73,8 @@ mod tests { fn test_take_null() { let arr = VarBinArray::from_iter([Some("h")], DType::Utf8(Nullability::NonNullable)); let compr = fsst_train_compressor(&arr); - let fsst = fsst_compress(&arr, &compr); + let fsst = FSSTArray::try_from_data(fsst_compress(&arr, arr.len(), arr.dtype(), &compr)) + .vortex_expect("data is always valid"); let idx1: PrimitiveArray = (0..1).collect(); @@ -103,7 +106,13 @@ mod tests { ))] fn test_take_fsst_conformance(#[case] varbin: VarBinArray) { let compressor = fsst_train_compressor(&varbin); - let array = fsst_compress(&varbin, &compressor); + let array = FSSTArray::try_from_data(fsst_compress( + &varbin, + varbin.len(), + varbin.dtype(), + &compressor, + )) + .vortex_expect("data is always valid"); test_take_conformance(&array.into_array()); } @@ -115,7 +124,7 @@ mod tests { DType::Utf8(Nullability::NonNullable), ); let compressor = fsst_train_compressor(&varbin); - fsst_compress(&varbin, &compressor) + FSSTArray::try_from_data(fsst_compress(&varbin, varbin.len(), varbin.dtype(), &compressor)).vortex_expect("data is always valid") })] // Nullable strings #[case::fsst_nullable({ @@ -124,7 +133,9 @@ mod tests { DType::Utf8(Nullability::Nullable), ); let compressor = fsst_train_compressor(&varbin); - fsst_compress(varbin, &compressor) + let len = varbin.len(); + let dtype = varbin.dtype().clone(); + FSSTArray::try_from_data(fsst_compress(varbin, len, &dtype, &compressor)).vortex_expect("data is always valid") })] // Repetitive patterns (good for FSST compression) #[case::fsst_repetitive({ @@ -133,7 +144,7 @@ mod tests { DType::Utf8(Nullability::NonNullable), ); let compressor = fsst_train_compressor(&varbin); - fsst_compress(&varbin, &compressor) + FSSTArray::try_from_data(fsst_compress(&varbin, varbin.len(), varbin.dtype(), &compressor)).vortex_expect("data is always valid") })] // Edge cases #[case::fsst_single({ @@ -142,7 +153,7 @@ mod tests { DType::Utf8(Nullability::NonNullable), ); let compressor = fsst_train_compressor(&varbin); - fsst_compress(&varbin, &compressor) + FSSTArray::try_from_data(fsst_compress(&varbin, varbin.len(), varbin.dtype(), &compressor)).vortex_expect("data is always valid") })] #[case::fsst_empty_strings({ let varbin = VarBinArray::from_iter( @@ -150,7 +161,9 @@ mod tests { DType::Utf8(Nullability::NonNullable), ); let compressor = fsst_train_compressor(&varbin); - fsst_compress(varbin, &compressor) + let len = varbin.len(); + let dtype = varbin.dtype().clone(); + FSSTArray::try_from_data(fsst_compress(varbin, len, &dtype, &compressor)).vortex_expect("data is always valid") })] // Large arrays #[case::fsst_large({ @@ -170,7 +183,9 @@ mod tests { .collect(); let varbin = VarBinArray::from_iter(data, DType::Utf8(Nullability::NonNullable)); let compressor = fsst_train_compressor(&varbin); - fsst_compress(varbin, &compressor) + let len = varbin.len(); + let dtype = varbin.dtype().clone(); + FSSTArray::try_from_data(fsst_compress(varbin, len, &dtype, &compressor)).vortex_expect("data is always valid") })] fn test_fsst_consistency(#[case] array: FSSTArray) { diff --git a/encodings/fsst/src/dfa/tests.rs b/encodings/fsst/src/dfa/tests.rs index d135014c42e..fd23c69f978 100644 --- a/encodings/fsst/src/dfa/tests.rs +++ b/encodings/fsst/src/dfa/tests.rs @@ -20,6 +20,7 @@ use vortex_array::dtype::Nullability; use vortex_array::scalar_fn::fns::like::Like; use vortex_array::scalar_fn::fns::like::LikeOptions; use vortex_array::session::ArraySession; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_session::VortexSession; @@ -227,7 +228,10 @@ fn make_fsst_str(strings: &[Option<&str>]) -> FSSTArray { DType::Utf8(Nullability::NonNullable), ); let compressor = fsst_train_compressor(&varbin); - fsst_compress(varbin, &compressor) + let len = varbin.len(); + let dtype = varbin.dtype().clone(); + FSSTArray::try_from_data(fsst_compress(varbin, len, &dtype, &compressor)) + .vortex_expect("data is always valid") } fn run_like(array: FSSTArray, pattern_arr: ArrayRef) -> VortexResult { diff --git a/encodings/fsst/src/kernel.rs b/encodings/fsst/src/kernel.rs index 3ec36dd1b32..192e0f22759 100644 --- a/encodings/fsst/src/kernel.rs +++ b/encodings/fsst/src/kernel.rs @@ -57,7 +57,9 @@ mod tests { let input = builder.finish(DType::Utf8(Nullability::NonNullable)); let compressor = fsst_train_compressor(&input); - fsst_compress(input, &compressor).into_array() + let len = input.len(); + let dtype = input.dtype().clone(); + fsst_compress(input, len, &dtype, &compressor).into_array() } #[test] @@ -130,7 +132,8 @@ mod tests { let input = builder.finish(DType::Utf8(Nullability::Nullable)); let compressor = fsst_train_compressor(&input); - let fsst_array: ArrayRef = fsst_compress(input.clone(), &compressor).into_array(); + let fsst_array: ArrayRef = + fsst_compress(input.clone(), input.len(), input.dtype(), &compressor).into_array(); // Filter: only select the last element (index 22) let mut mask = vec![false; 22]; @@ -158,7 +161,8 @@ mod tests { let input = builder.finish(DType::Utf8(Nullability::Nullable)); let compressor = fsst_train_compressor(&input); - let fsst_array: ArrayRef = fsst_compress(input.clone(), &compressor).into_array(); + let fsst_array: ArrayRef = + fsst_compress(input.clone(), input.len(), input.dtype(), &compressor).into_array(); let mask = Mask::from_iter([true, false, true]); diff --git a/encodings/fsst/src/ops.rs b/encodings/fsst/src/ops.rs index ba6c709d65e..39186c0d44d 100644 --- a/encodings/fsst/src/ops.rs +++ b/encodings/fsst/src/ops.rs @@ -4,16 +4,20 @@ use vortex_array::ExecutionCtx; use vortex_array::arrays::varbin::varbin_scalar; use vortex_array::scalar::Scalar; +use vortex_array::vtable::Array; use vortex_array::vtable::OperationsVTable; use vortex_buffer::ByteBuffer; use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::FSST; -use crate::FSSTArray; impl OperationsVTable for FSST { - fn scalar_at(array: &FSSTArray, index: usize, _ctx: &mut ExecutionCtx) -> VortexResult { + fn scalar_at( + array: &Array, + index: usize, + _ctx: &mut ExecutionCtx, + ) -> VortexResult { let compressed = array.codes().scalar_at(index)?; let binary_datum = compressed.as_binary().value().vortex_expect("non-null"); diff --git a/encodings/fsst/src/slice.rs b/encodings/fsst/src/slice.rs index a010a703250..ecf7c7ff63f 100644 --- a/encodings/fsst/src/slice.rs +++ b/encodings/fsst/src/slice.rs @@ -7,22 +7,23 @@ use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::arrays::VarBin; use vortex_array::arrays::slice::SliceReduce; +use vortex_array::vtable::Array; use vortex_error::VortexResult; use vortex_error::vortex_err; use crate::FSST; -use crate::FSSTArray; +use crate::FSSTData; impl SliceReduce for FSST { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { // SAFETY: slicing the `codes` leaves the symbol table intact Ok(Some( unsafe { - FSSTArray::new_unchecked( + FSSTData::new_unchecked( array.dtype().clone(), array.symbols().clone(), array.symbol_lengths().clone(), - VarBin::_slice(array.codes().as_::(), range.clone())? + VarBin::_slice(array.codes(), range.clone())? .try_into::() .map_err(|_| vortex_err!("cannot fail conversion"))?, array.uncompressed_lengths().slice(range)?, diff --git a/encodings/fsst/src/test_utils.rs b/encodings/fsst/src/test_utils.rs index 701a41828c5..645957088fd 100644 --- a/encodings/fsst/src/test_utils.rs +++ b/encodings/fsst/src/test_utils.rs @@ -14,6 +14,7 @@ use vortex_array::arrays::VarBinArray; use vortex_array::dtype::DType; use vortex_array::dtype::NativePType; use vortex_array::dtype::Nullability; +use vortex_array::vtable::Array; use vortex_error::VortexExpect; use crate::FSSTArray; @@ -43,7 +44,11 @@ pub fn gen_fsst_test_data(len: usize, avg_str_len: usize, unique_chars: u8) -> A ); let compressor = fsst_train_compressor(&varbin); - fsst_compress(varbin, &compressor).into_array() + let len = varbin.len(); + let dtype = varbin.dtype().clone(); + FSSTArray::try_from_data(fsst_compress(varbin, len, &dtype, &compressor)) + .vortex_expect("data is always valid") + .into_array() } pub fn gen_dict_fsst_test_data( @@ -137,7 +142,10 @@ pub fn generate_url_data_n(n: usize) -> VarBinArray { pub fn make_fsst_urls(n: usize) -> FSSTArray { let varbin = generate_url_data_n(n); let compressor = fsst_train_compressor(&varbin); - fsst_compress(varbin, &compressor) + let len = varbin.len(); + let dtype = varbin.dtype().clone(); + Array::try_from_data(fsst_compress(varbin, len, &dtype, &compressor)) + .vortex_expect("data is always valid") } // --------------------------------------------------------------------------- @@ -231,7 +239,10 @@ pub fn make_fsst_clickbench_urls(n: usize) -> FSSTArray { DType::Utf8(Nullability::NonNullable), ); let compressor = fsst_train_compressor(&varbin); - fsst_compress(varbin, &compressor) + let len = varbin.len(); + let dtype = varbin.dtype().clone(); + Array::try_from_data(fsst_compress(varbin, len, &dtype, &compressor)) + .vortex_expect("data is always valid") } // --------------------------------------------------------------------------- @@ -297,7 +308,10 @@ pub fn make_fsst_short_urls(n: usize) -> FSSTArray { DType::Utf8(Nullability::NonNullable), ); let compressor = fsst_train_compressor(&varbin); - fsst_compress(varbin, &compressor) + let len = varbin.len(); + let dtype = varbin.dtype().clone(); + Array::try_from_data(fsst_compress(varbin, len, &dtype, &compressor)) + .vortex_expect("data is always valid") } // --------------------------------------------------------------------------- @@ -367,7 +381,10 @@ pub fn make_fsst_log_lines(n: usize) -> FSSTArray { DType::Utf8(Nullability::NonNullable), ); let compressor = fsst_train_compressor(&varbin); - fsst_compress(varbin, &compressor) + let len = varbin.len(); + let dtype = varbin.dtype().clone(); + Array::try_from_data(fsst_compress(varbin, len, &dtype, &compressor)) + .vortex_expect("data is always valid") } // --------------------------------------------------------------------------- @@ -424,7 +441,10 @@ pub fn make_fsst_json_strings(n: usize) -> FSSTArray { DType::Utf8(Nullability::NonNullable), ); let compressor = fsst_train_compressor(&varbin); - fsst_compress(varbin, &compressor) + let len = varbin.len(); + let dtype = varbin.dtype().clone(); + Array::try_from_data(fsst_compress(varbin, len, &dtype, &compressor)) + .vortex_expect("data is always valid") } // --------------------------------------------------------------------------- @@ -494,7 +514,10 @@ pub fn make_fsst_file_paths(n: usize) -> FSSTArray { DType::Utf8(Nullability::NonNullable), ); let compressor = fsst_train_compressor(&varbin); - fsst_compress(varbin, &compressor) + let len = varbin.len(); + let dtype = varbin.dtype().clone(); + Array::try_from_data(fsst_compress(varbin, len, &dtype, &compressor)) + .vortex_expect("data is always valid") } // --------------------------------------------------------------------------- @@ -545,7 +568,10 @@ pub fn make_fsst_emails(n: usize) -> FSSTArray { DType::Utf8(Nullability::NonNullable), ); let compressor = fsst_train_compressor(&varbin); - fsst_compress(varbin, &compressor) + let len = varbin.len(); + let dtype = varbin.dtype().clone(); + Array::try_from_data(fsst_compress(varbin, len, &dtype, &compressor)) + .vortex_expect("data is always valid") } // --------------------------------------------------------------------------- @@ -582,5 +608,8 @@ pub fn make_fsst_rare_match(n: usize) -> FSSTArray { DType::Utf8(Nullability::NonNullable), ); let compressor = fsst_train_compressor(&varbin); - fsst_compress(varbin, &compressor) + let len = varbin.len(); + let dtype = varbin.dtype().clone(); + Array::try_from_data(fsst_compress(varbin, len, &dtype, &compressor)) + .vortex_expect("data is always valid") } diff --git a/encodings/fsst/src/tests.rs b/encodings/fsst/src/tests.rs index e5a7b2f327c..27a734730be 100644 --- a/encodings/fsst/src/tests.rs +++ b/encodings/fsst/src/tests.rs @@ -28,7 +28,9 @@ pub(crate) fn build_fsst_array() -> ArrayRef { let input_array = input_array.finish(DType::Utf8(Nullability::NonNullable)); let compressor = fsst_train_compressor(&input_array); - fsst_compress(input_array, &compressor).into_array() + let len = input_array.len(); + let dtype = input_array.dtype().clone(); + fsst_compress(input_array, len, &dtype, &compressor).into_array() } #[test] diff --git a/encodings/parquet-variant/src/array.rs b/encodings/parquet-variant/src/array.rs index 70f0c43bf2d..52d85f13484 100644 --- a/encodings/parquet-variant/src/array.rs +++ b/encodings/parquet-variant/src/array.rs @@ -49,7 +49,7 @@ use vortex_error::vortex_ensure_eq; /// 3. **Typed-value child nullability**: the `typed_value` child carries its own `DType` /// (which includes nullability). #[derive(Clone, Debug)] -pub struct ParquetVariantArray { +pub struct ParquetVariantData { pub(crate) dtype: DType, pub(crate) validity: Validity, pub(crate) metadata: ArrayRef, @@ -58,14 +58,14 @@ pub struct ParquetVariantArray { pub(crate) stats_set: ArrayStats, } -impl ParquetVariantArray { +impl ParquetVariantData { /// Creates a Parquet Variant array with explicit outer validity. pub fn try_new( validity: Validity, metadata: ArrayRef, value: Option, typed_value: Option, - ) -> VortexResult { + ) -> VortexResult { vortex_ensure!( value.is_some() || typed_value.is_some(), "at least one of value or typed_value must be present" @@ -154,7 +154,7 @@ impl ParquetVariantArray { .map(|tv| ArrayRef::from_arrow(tv.as_ref(), typed_value_nullable)) .transpose()?; - let pv = ParquetVariantArray::try_new(validity, metadata, value, typed_value)?; + let pv = ParquetVariantData::try_new(validity, metadata, value, typed_value)?; Ok(VariantArray::new(pv.into_array()).into_array()) } @@ -227,11 +227,11 @@ mod tests { use vortex_error::VortexResult; use crate::ParquetVariant; - use crate::ParquetVariantArray; + use crate::ParquetVariantData; fn assert_arrow_variant_storage_roundtrip(struct_array: StructArray) -> VortexResult<()> { let arrow_variant = ArrowVariantArray::try_new(&struct_array).unwrap(); - let vortex_arr = ParquetVariantArray::from_arrow_variant(&arrow_variant)?; + let vortex_arr = ParquetVariantData::from_arrow_variant(&arrow_variant)?; let inner = vortex_arr .as_opt::() .unwrap() @@ -285,7 +285,7 @@ mod tests { builder.append_variant(PqVariant::from(true)); let arrow_variant = builder.build(); - let vortex_arr = ParquetVariantArray::from_arrow_variant(&arrow_variant)?; + let vortex_arr = ParquetVariantData::from_arrow_variant(&arrow_variant)?; assert_eq!(vortex_arr.len(), 3); assert_eq!( @@ -318,7 +318,7 @@ mod tests { let arrow_variant = ArrowVariantArray::try_new(&struct_array).unwrap(); - let vortex_arr = ParquetVariantArray::from_arrow_variant(&arrow_variant)?; + let vortex_arr = ParquetVariantData::from_arrow_variant(&arrow_variant)?; assert_eq!(vortex_arr.len(), 3); assert_eq!( vortex_arr.dtype(), @@ -337,7 +337,7 @@ mod tests { let metadata = VarBinViewArray::from_iter_bin([b"\x01\x00", b"\x01\x00"]).into_array(); let value = VarBinViewArray::from_iter_bin([b"\x10", b"\x11"]).into_array(); let pv_array = - ParquetVariantArray::try_new(Validity::NonNullable, metadata, Some(value), None)?; + ParquetVariantData::try_new(Validity::NonNullable, metadata, Some(value), None)?; let mut ctx = LEGACY_SESSION.create_execution_ctx(); let variant_arr = pv_array.to_arrow(&mut ctx)?; @@ -354,7 +354,7 @@ mod tests { let metadata = VarBinViewArray::from_iter_bin([b"\x01\x00", b"\x01\x00"]).into_array(); let value = VarBinViewArray::from_iter_bin([b"\x10", b"\x11"]).into_array(); let typed_value = buffer![1i32, 2].into_array(); - let pv_array = ParquetVariantArray::try_new( + let pv_array = ParquetVariantData::try_new( Validity::NonNullable, metadata, Some(value), diff --git a/encodings/parquet-variant/src/kernel.rs b/encodings/parquet-variant/src/kernel.rs index 841537095a8..1f9ad394d60 100644 --- a/encodings/parquet-variant/src/kernel.rs +++ b/encodings/parquet-variant/src/kernel.rs @@ -18,7 +18,8 @@ use vortex_error::VortexResult; use vortex_mask::Mask; use crate::ParquetVariant; -use crate::array::ParquetVariantArray; +use crate::ParquetVariantArray; +use crate::array::ParquetVariantData; pub(crate) static PARENT_KERNELS: ParentKernelSet = ParentKernelSet::new(&[ ParentKernelSet::lift(&FilterExecuteAdaptor(ParquetVariant)), @@ -45,7 +46,7 @@ impl SliceKernel for ParquetVariant { .map(|tv| tv.slice(range)) .transpose()?; Ok(Some( - ParquetVariantArray::try_new(validity, metadata, value, typed_value)?.into_array(), + ParquetVariantData::try_new(validity, metadata, value, typed_value)?.into_array(), )) } } @@ -69,7 +70,7 @@ impl FilterKernel for ParquetVariant { .map(|tv| tv.filter(mask.clone())) .transpose()?; Ok(Some( - ParquetVariantArray::try_new(validity, metadata, value, typed_value)?.into_array(), + ParquetVariantData::try_new(validity, metadata, value, typed_value)?.into_array(), )) } } @@ -93,7 +94,7 @@ impl TakeExecute for ParquetVariant { .map(|tv| tv.take(indices.to_array())) .transpose()?; Ok(Some( - ParquetVariantArray::try_new(validity, metadata, value, typed_value)?.into_array(), + ParquetVariantData::try_new(validity, metadata, value, typed_value)?.into_array(), )) } } @@ -117,7 +118,7 @@ mod tests { use vortex_error::VortexResult; use vortex_mask::Mask; - use crate::ParquetVariantArray; + use crate::ParquetVariantData; fn make_unshredded_array() -> VortexResult { let mut builder = VariantArrayBuilder::new(4); @@ -125,7 +126,7 @@ mod tests { builder.append_variant(PqVariant::from("hello")); builder.append_variant(PqVariant::from(true)); builder.append_variant(PqVariant::from(99i64)); - ParquetVariantArray::from_arrow_variant(&builder.build()) + ParquetVariantData::from_arrow_variant(&builder.build()) } fn make_nullable_array() -> VortexResult { @@ -143,7 +144,7 @@ mod tests { ) .unwrap(); let arrow_variant = ArrowVariantArray::try_new(&null_struct).unwrap(); - ParquetVariantArray::from_arrow_variant(&arrow_variant) + ParquetVariantData::from_arrow_variant(&arrow_variant) } #[test] @@ -253,7 +254,7 @@ mod tests { ) .unwrap(); let arrow_variant = ArrowVariantArray::try_new(&struct_array).unwrap(); - let arr = ParquetVariantArray::from_arrow_variant(&arrow_variant)?; + let arr = ParquetVariantData::from_arrow_variant(&arrow_variant)?; let sliced = arr.slice(1..3)?; assert_eq!(sliced.len(), 2); diff --git a/encodings/parquet-variant/src/lib.rs b/encodings/parquet-variant/src/lib.rs index 6188f8fe727..3f1f7cb68a6 100644 --- a/encodings/parquet-variant/src/lib.rs +++ b/encodings/parquet-variant/src/lib.rs @@ -30,6 +30,7 @@ mod operations; mod validity; mod vtable; -pub use array::ParquetVariantArray; +pub use array::ParquetVariantData; pub use vtable::ParquetVariant; +pub use vtable::ParquetVariantArray; pub use vtable::ParquetVariantMetadata; diff --git a/encodings/parquet-variant/src/operations.rs b/encodings/parquet-variant/src/operations.rs index c11d1b370ab..ac3fb3ae636 100644 --- a/encodings/parquet-variant/src/operations.rs +++ b/encodings/parquet-variant/src/operations.rs @@ -25,8 +25,8 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_err; -use crate::array::ParquetVariantArray; use crate::vtable::ParquetVariant; +use crate::vtable::ParquetVariantArray; impl OperationsVTable for ParquetVariant { /// Resolves a single variant value according to the Parquet Variant shredding spec: @@ -355,7 +355,7 @@ mod tests { use vortex_error::VortexResult; use crate::ParquetVariant; - use crate::ParquetVariantArray; + use crate::ParquetVariantData; use crate::operations::parquet_variant_to_scalar; fn binary_view_array(values: &[&[u8]]) -> ArrowArrayRef { @@ -370,7 +370,7 @@ mod tests { arrow_variant: &ArrowVariantArray, rows: impl IntoIterator, ) -> VortexResult<()> { - let vortex_arr = ParquetVariantArray::from_arrow_variant(arrow_variant)?; + let vortex_arr = ParquetVariantData::from_arrow_variant(arrow_variant)?; for index in rows { let expected_inner = @@ -402,7 +402,7 @@ mod tests { .unwrap(); let arrow_variant = ArrowVariantArray::try_new(&null_struct).unwrap(); - let vortex_arr = ParquetVariantArray::from_arrow_variant(&arrow_variant)?; + let vortex_arr = ParquetVariantData::from_arrow_variant(&arrow_variant)?; assert_eq!(vortex_arr.dtype(), &DType::Variant(Nullability::Nullable)); @@ -431,7 +431,7 @@ mod tests { .unwrap(); let arrow_variant = ArrowVariantArray::try_new(&null_struct).unwrap(); - let vortex_arr = ParquetVariantArray::from_arrow_variant(&arrow_variant)?; + let vortex_arr = ParquetVariantData::from_arrow_variant(&arrow_variant)?; assert_eq!(vortex_arr.dtype(), &DType::Variant(Nullability::Nullable)); assert!(vortex_arr.scalar_at(0)?.is_null()); @@ -457,7 +457,7 @@ mod tests { builder.append_variant(PqVariant::from(2i32)); let arrow_variant = builder.build(); - let vortex_arr = ParquetVariantArray::from_arrow_variant(&arrow_variant)?; + let vortex_arr = ParquetVariantData::from_arrow_variant(&arrow_variant)?; assert_eq!( vortex_arr.dtype(), @@ -577,7 +577,7 @@ mod tests { .unwrap(); let arrow_variant = ArrowVariantArray::try_new(&struct_array).unwrap(); - let vortex_arr = ParquetVariantArray::from_arrow_variant(&arrow_variant)?; + let vortex_arr = ParquetVariantData::from_arrow_variant(&arrow_variant)?; let row0 = vortex_arr.scalar_at(0)?; let row0 = row0.as_variant().value().unwrap().as_list(); @@ -674,7 +674,7 @@ mod tests { .unwrap(); let arrow_variant = ArrowVariantArray::try_new(&struct_array).unwrap(); - let vortex_arr = ParquetVariantArray::from_arrow_variant(&arrow_variant)?; + let vortex_arr = ParquetVariantData::from_arrow_variant(&arrow_variant)?; let object = vortex_arr.scalar_at(0)?; let object = object.as_variant().value().unwrap().as_struct(); diff --git a/encodings/parquet-variant/src/validity.rs b/encodings/parquet-variant/src/validity.rs index 5257c7a9c78..3f7b33c6eba 100644 --- a/encodings/parquet-variant/src/validity.rs +++ b/encodings/parquet-variant/src/validity.rs @@ -4,9 +4,9 @@ use vortex_array::validity::Validity; use vortex_array::vtable::ValidityHelper; -use crate::array::ParquetVariantArray; +use crate::array::ParquetVariantData; -impl ValidityHelper for ParquetVariantArray { +impl ValidityHelper for ParquetVariantData { fn validity(&self) -> &Validity { &self.validity } diff --git a/encodings/parquet-variant/src/vtable.rs b/encodings/parquet-variant/src/vtable.rs index 1232709f559..ba6ffc0d905 100644 --- a/encodings/parquet-variant/src/vtable.rs +++ b/encodings/parquet-variant/src/vtable.rs @@ -18,7 +18,7 @@ use vortex_array::buffer::BufferHandle; use vortex_array::dtype::DType; use vortex_array::dtype::Nullability; use vortex_array::serde::ArrayChildren; -use vortex_array::stats::StatsSetRef; +use vortex_array::stats::ArrayStats; use vortex_array::validity::Validity; use vortex_array::vtable; use vortex_array::vtable::Array; @@ -35,7 +35,7 @@ use vortex_error::vortex_panic; use vortex_proto::dtype as pb; use vortex_session::VortexSession; -use crate::array::ParquetVariantArray; +use crate::array::ParquetVariantData; use crate::kernel::PARENT_KERNELS; /// VTable for [`ParquetVariantArray`]. @@ -76,15 +76,15 @@ struct ParquetVariantMetadataProto { pub value_nullable: bool, } -vtable!(ParquetVariant); +vtable!(ParquetVariant, ParquetVariant, ParquetVariantData); impl VTable for ParquetVariant { - type Array = ParquetVariantArray; + type ArrayData = ParquetVariantData; type Metadata = ParquetVariantMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValidityHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &ParquetVariant } @@ -92,19 +92,19 @@ impl VTable for ParquetVariant { Self::ID } - fn len(array: &ParquetVariantArray) -> usize { + fn len(array: &ParquetVariantData) -> usize { array.metadata.len() } - fn dtype(array: &ParquetVariantArray) -> &DType { + fn dtype(array: &ParquetVariantData) -> &DType { &array.dtype } - fn stats(array: &ParquetVariantArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &ParquetVariantData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &ParquetVariantArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.validity.array_hash(state, precision); array.metadata.array_hash(state, precision); // Hash discriminators so that (value=Some, typed_value=None) and @@ -119,11 +119,7 @@ impl VTable for ParquetVariant { } } - fn array_eq( - array: &ParquetVariantArray, - other: &ParquetVariantArray, - precision: Precision, - ) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { if !array.validity.array_eq(&other.validity, precision) || !array.metadata.array_eq(&other.metadata, precision) { @@ -145,25 +141,25 @@ impl VTable for ParquetVariant { } } - fn nbuffers(_array: &ParquetVariantArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &ParquetVariantArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("ParquetVariantArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &ParquetVariantArray, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(array: &ParquetVariantArray) -> usize { + fn nchildren(array: &Array) -> usize { 1 + validity_nchildren(&array.validity) + array.value.is_some() as usize + array.typed_value.is_some() as usize } - fn child(array: &ParquetVariantArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { let vc = validity_nchildren(&array.validity); if idx < vc { validity_to_child(&array.validity, array.metadata.len()) @@ -188,7 +184,7 @@ impl VTable for ParquetVariant { } } - fn child_name(array: &ParquetVariantArray, idx: usize) -> String { + fn child_name(array: &Array, idx: usize) -> String { let vc = validity_nchildren(&array.validity); match idx { idx if idx < vc => "validity".to_string(), @@ -202,7 +198,7 @@ impl VTable for ParquetVariant { } } - fn metadata(array: &ParquetVariantArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ParquetVariantMetadata { has_value: array.value.is_some(), value_nullable: array @@ -254,7 +250,7 @@ impl VTable for ParquetVariant { metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { vortex_ensure!(matches!(dtype, DType::Variant(_)), "Expected Variant DType"); let has_typed_value = metadata.typed_value_dtype.is_some(); vortex_ensure!( @@ -304,14 +300,18 @@ impl VTable for ParquetVariant { None }; - ParquetVariantArray::try_new(validity, variant_metadata, value, typed_value) + ParquetVariantData::try_new(validity, variant_metadata, value, typed_value) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { + let expected_nchildren = 1 + + validity_nchildren(&array.validity) + + array.value.is_some() as usize + + array.typed_value.is_some() as usize; vortex_ensure!( - children.len() == array.nchildren(), + children.len() == expected_nchildren, "ParquetVariantArray expects {} children, got {}", - array.nchildren(), + expected_nchildren, children.len() ); let mut iter = children.into_iter(); @@ -379,7 +379,7 @@ mod tests { use vortex_session::registry::ReadContext; use crate::ParquetVariant; - use crate::ParquetVariantArray; + use crate::ParquetVariantData; fn roundtrip(array: ArrayRef) -> ArrayRef { let dtype = array.dtype().clone(); @@ -412,7 +412,7 @@ mod tests { let inner_metadata = VarBinViewArray::from_iter_bin([b"\x01\x00", b"\x01\x00", b"\x01\x00"]).into_array(); let inner_value = VarBinViewArray::from_iter_bin([b"\x02", b"\x03", b"\x04"]).into_array(); - let inner_pv = ParquetVariantArray::try_new( + let inner_pv = ParquetVariantData::try_new( Validity::NonNullable, inner_metadata, Some(inner_value), @@ -421,7 +421,7 @@ mod tests { .unwrap(); let typed_value = VariantArray::new(inner_pv.into_array()).into_array(); - let outer_pv = ParquetVariantArray::try_new( + let outer_pv = ParquetVariantData::try_new( Validity::NonNullable, outer_metadata, None, @@ -444,7 +444,7 @@ mod tests { let value = VarBinViewArray::from_iter_bin([b"\x10", b"\x11", b"\x12"]).into_array(); let validity = Validity::from(BitBuffer::from_iter([true, false, true])); - let pv = ParquetVariantArray::try_new(validity, metadata, Some(value), None).unwrap(); + let pv = ParquetVariantData::try_new(validity, metadata, Some(value), None).unwrap(); let array = pv.into_array(); let decoded = roundtrip(array.clone()); @@ -461,7 +461,7 @@ mod tests { VarBinViewArray::from_iter_bin([b"\x01\x00", b"\x01\x00", b"\x01\x00"]).into_array(); let typed_value = buffer![10i32, 20, 30].into_array(); - let outer_pv = ParquetVariantArray::try_new( + let outer_pv = ParquetVariantData::try_new( Validity::NonNullable, outer_metadata, None, diff --git a/encodings/pco/public-api.lock b/encodings/pco/public-api.lock index e2a15ed3df5..57140df9304 100644 --- a/encodings/pco/public-api.lock +++ b/encodings/pco/public-api.lock @@ -6,6 +6,8 @@ impl vortex_pco::Pco pub const vortex_pco::Pco::ID: vortex_array::vtable::dyn_::ArrayId +pub fn vortex_pco::Pco::from_primitive(parray: &vortex_array::arrays::primitive::vtable::PrimitiveArray, level: usize, values_per_page: usize) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_pco::Pco pub fn vortex_pco::Pco::clone(&self) -> vortex_pco::Pco @@ -16,7 +18,7 @@ pub fn vortex_pco::Pco::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fm impl vortex_array::arrays::slice::SliceReduce for vortex_pco::Pco -pub fn vortex_pco::Pco::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_pco::Pco::slice(array: &vortex_array::vtable::typed::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::kernel::CastReduce for vortex_pco::Pco @@ -24,7 +26,7 @@ pub fn vortex_pco::Pco::cast(array: &vortex_pco::PcoArray, dtype: &vortex_array: impl vortex_array::vtable::VTable for vortex_pco::Pco -pub type vortex_pco::Pco::Array = vortex_pco::PcoArray +pub type vortex_pco::Pco::ArrayData = vortex_pco::PcoData pub type vortex_pco::Pco::Metadata = vortex_array::metadata::ProstMetadata @@ -32,117 +34,109 @@ pub type vortex_pco::Pco::OperationsVTable = vortex_pco::Pco pub type vortex_pco::Pco::ValidityVTable = vortex_array::vtable::validity::ValidityVTableFromValiditySliceHelper -pub fn vortex_pco::Pco::array_eq(array: &vortex_pco::PcoArray, other: &vortex_pco::PcoArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_pco::Pco::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_pco::Pco::array_hash(array: &vortex_pco::PcoArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_pco::Pco::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_pco::Pco::buffer(array: &vortex_pco::PcoArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_pco::Pco::buffer(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_pco::Pco::buffer_name(array: &vortex_pco::PcoArray, idx: usize) -> core::option::Option +pub fn vortex_pco::Pco::buffer_name(array: &vortex_array::vtable::typed::Array, idx: usize) -> core::option::Option -pub fn vortex_pco::Pco::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_pco::Pco::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_pco::Pco::child(array: &vortex_pco::PcoArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_pco::Pco::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_pco::Pco::child_name(_array: &vortex_pco::PcoArray, idx: usize) -> alloc::string::String +pub fn vortex_pco::Pco::child_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_pco::Pco::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_pco::Pco::dtype(array: &vortex_pco::PcoArray) -> &vortex_array::dtype::DType +pub fn vortex_pco::Pco::dtype(array: &vortex_pco::PcoData) -> &vortex_array::dtype::DType pub fn vortex_pco::Pco::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult pub fn vortex_pco::Pco::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_pco::Pco::len(array: &vortex_pco::PcoArray) -> usize +pub fn vortex_pco::Pco::len(array: &vortex_pco::PcoData) -> usize -pub fn vortex_pco::Pco::metadata(array: &vortex_pco::PcoArray) -> vortex_error::VortexResult +pub fn vortex_pco::Pco::metadata(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_pco::Pco::nbuffers(array: &vortex_pco::PcoArray) -> usize +pub fn vortex_pco::Pco::nbuffers(array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_pco::Pco::nchildren(array: &vortex_pco::PcoArray) -> usize +pub fn vortex_pco::Pco::nchildren(array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_pco::Pco::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_pco::Pco::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_pco::Pco::stats(array: &vortex_pco::PcoArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_pco::Pco::stats(array: &vortex_pco::PcoData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_pco::Pco::vtable(_array: &Self::Array) -> &Self +pub fn vortex_pco::Pco::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_pco::Pco::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_pco::Pco::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_pco::Pco -pub fn vortex_pco::Pco::scalar_at(array: &vortex_pco::PcoArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult - -pub struct vortex_pco::PcoArray - -impl vortex_pco::PcoArray - -pub fn vortex_pco::PcoArray::decompress(&self, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_pco::Pco::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_pco::PcoArray::from_array(array: vortex_array::array::ArrayRef, level: usize, nums_per_page: usize) -> vortex_error::VortexResult - -pub fn vortex_pco::PcoArray::from_primitive(parray: &vortex_array::arrays::primitive::array::PrimitiveArray, level: usize, values_per_page: usize) -> vortex_error::VortexResult +pub struct vortex_pco::PcoChunkInfo -pub fn vortex_pco::PcoArray::new(chunk_metas: alloc::vec::Vec, pages: alloc::vec::Vec, dtype: vortex_array::dtype::DType, metadata: vortex_pco::PcoMetadata, len: usize, validity: vortex_array::validity::Validity) -> Self +pub vortex_pco::PcoChunkInfo::pages: alloc::vec::Vec -impl vortex_pco::PcoArray +impl core::clone::Clone for vortex_pco::PcoChunkInfo -pub fn vortex_pco::PcoArray::to_array(&self) -> vortex_array::array::ArrayRef +pub fn vortex_pco::PcoChunkInfo::clone(&self) -> vortex_pco::PcoChunkInfo -impl core::clone::Clone for vortex_pco::PcoArray +impl core::default::Default for vortex_pco::PcoChunkInfo -pub fn vortex_pco::PcoArray::clone(&self) -> vortex_pco::PcoArray +pub fn vortex_pco::PcoChunkInfo::default() -> Self -impl core::convert::AsRef for vortex_pco::PcoArray +impl core::fmt::Debug for vortex_pco::PcoChunkInfo -pub fn vortex_pco::PcoArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +pub fn vortex_pco::PcoChunkInfo::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::convert::From for vortex_array::array::ArrayRef +impl prost::message::Message for vortex_pco::PcoChunkInfo -pub fn vortex_array::array::ArrayRef::from(value: vortex_pco::PcoArray) -> vortex_array::array::ArrayRef +pub fn vortex_pco::PcoChunkInfo::clear(&mut self) -impl core::fmt::Debug for vortex_pco::PcoArray +pub fn vortex_pco::PcoChunkInfo::encoded_len(&self) -> usize -pub fn vortex_pco::PcoArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub struct vortex_pco::PcoData -impl core::ops::deref::Deref for vortex_pco::PcoArray +impl vortex_pco::PcoData -pub type vortex_pco::PcoArray::Target = dyn vortex_array::array::DynArray +pub fn vortex_pco::PcoData::decompress(&self, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_pco::PcoArray::deref(&self) -> &Self::Target +pub fn vortex_pco::PcoData::dtype(&self) -> &vortex_array::dtype::DType -impl vortex_array::array::IntoArray for vortex_pco::PcoArray +pub fn vortex_pco::PcoData::from_array(array: vortex_array::array::ArrayRef, level: usize, nums_per_page: usize) -> vortex_error::VortexResult -pub fn vortex_pco::PcoArray::into_array(self) -> vortex_array::array::ArrayRef +pub fn vortex_pco::PcoData::from_primitive(parray: &vortex_array::arrays::primitive::vtable::PrimitiveArray, level: usize, values_per_page: usize) -> vortex_error::VortexResult -impl vortex_array::vtable::validity::ValiditySliceHelper for vortex_pco::PcoArray +pub fn vortex_pco::PcoData::is_empty(&self) -> bool -pub fn vortex_pco::PcoArray::unsliced_validity_and_slice(&self) -> (&vortex_array::validity::Validity, usize, usize) +pub fn vortex_pco::PcoData::len(&self) -> usize -pub struct vortex_pco::PcoChunkInfo +pub fn vortex_pco::PcoData::new(chunk_metas: alloc::vec::Vec, pages: alloc::vec::Vec, dtype: vortex_array::dtype::DType, metadata: vortex_pco::PcoMetadata, len: usize, validity: vortex_array::validity::Validity) -> Self -pub vortex_pco::PcoChunkInfo::pages: alloc::vec::Vec +impl core::clone::Clone for vortex_pco::PcoData -impl core::clone::Clone for vortex_pco::PcoChunkInfo +pub fn vortex_pco::PcoData::clone(&self) -> vortex_pco::PcoData -pub fn vortex_pco::PcoChunkInfo::clone(&self) -> vortex_pco::PcoChunkInfo +impl core::convert::From for vortex_array::array::ArrayRef -impl core::default::Default for vortex_pco::PcoChunkInfo +pub fn vortex_array::array::ArrayRef::from(value: vortex_pco::PcoData) -> vortex_array::array::ArrayRef -pub fn vortex_pco::PcoChunkInfo::default() -> Self +impl core::fmt::Debug for vortex_pco::PcoData -impl core::fmt::Debug for vortex_pco::PcoChunkInfo +pub fn vortex_pco::PcoData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_pco::PcoChunkInfo::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::array::IntoArray for vortex_pco::PcoData -impl prost::message::Message for vortex_pco::PcoChunkInfo +pub fn vortex_pco::PcoData::into_array(self) -> vortex_array::array::ArrayRef -pub fn vortex_pco::PcoChunkInfo::clear(&mut self) +impl vortex_array::vtable::validity::ValiditySliceHelper for vortex_pco::PcoData -pub fn vortex_pco::PcoChunkInfo::encoded_len(&self) -> usize +pub fn vortex_pco::PcoData::unsliced_validity_and_slice(&self) -> (&vortex_array::validity::Validity, usize, usize) pub struct vortex_pco::PcoMetadata @@ -189,3 +183,5 @@ impl prost::message::Message for vortex_pco::PcoPageInfo pub fn vortex_pco::PcoPageInfo::clear(&mut self) pub fn vortex_pco::PcoPageInfo::encoded_len(&self) -> usize + +pub type vortex_pco::PcoArray = vortex_array::vtable::typed::Array diff --git a/encodings/pco/src/array.rs b/encodings/pco/src/array.rs index a2e7be7b955..3de987b5b10 100644 --- a/encodings/pco/src/array.rs +++ b/encodings/pco/src/array.rs @@ -37,14 +37,12 @@ use vortex_array::dtype::half; use vortex_array::scalar::Scalar; use vortex_array::serde::ArrayChildren; use vortex_array::stats::ArrayStats; -use vortex_array::stats::StatsSetRef; use vortex_array::validity::Validity; use vortex_array::vtable; use vortex_array::vtable::Array; use vortex_array::vtable::ArrayId; use vortex_array::vtable::OperationsVTable; use vortex_array::vtable::VTable; -use vortex_array::vtable::ValidityHelper; use vortex_array::vtable::ValiditySliceHelper; use vortex_array::vtable::ValidityVTableFromValiditySliceHelper; use vortex_array::vtable::validity_nchildren; @@ -85,16 +83,16 @@ use crate::PcoPageInfo; const VALUES_PER_CHUNK: usize = pco::DEFAULT_MAX_PAGE_N; -vtable!(Pco); +vtable!(Pco, Pco, PcoData); impl VTable for Pco { - type Array = PcoArray; + type ArrayData = PcoData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValiditySliceHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Pco } @@ -102,19 +100,19 @@ impl VTable for Pco { Self::ID } - fn len(array: &PcoArray) -> usize { + fn len(array: &PcoData) -> usize { array.slice_stop - array.slice_start } - fn dtype(array: &PcoArray) -> &DType { + fn dtype(array: &PcoData) -> &DType { &array.dtype } - fn stats(array: &PcoArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &PcoData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &PcoArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.unsliced_validity.array_hash(state, precision); array.unsliced_n_rows.hash(state); @@ -129,7 +127,7 @@ impl VTable for Pco { } } - fn array_eq(array: &PcoArray, other: &PcoArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { if array.dtype != other.dtype || !array .unsliced_validity @@ -155,11 +153,11 @@ impl VTable for Pco { true } - fn nbuffers(array: &PcoArray) -> usize { + fn nbuffers(array: &Array) -> usize { array.chunk_metas.len() + array.pages.len() } - fn buffer(array: &PcoArray, idx: usize) -> BufferHandle { + fn buffer(array: &Array, idx: usize) -> BufferHandle { if idx < array.chunk_metas.len() { BufferHandle::new_host(array.chunk_metas[idx].clone()) } else { @@ -168,7 +166,7 @@ impl VTable for Pco { } } - fn buffer_name(array: &PcoArray, idx: usize) -> Option { + fn buffer_name(array: &Array, idx: usize) -> Option { if idx < array.chunk_metas.len() { Some(format!("chunk_meta_{idx}")) } else { @@ -176,23 +174,23 @@ impl VTable for Pco { } } - fn nchildren(array: &PcoArray) -> usize { + fn nchildren(array: &Array) -> usize { validity_nchildren(&array.unsliced_validity) } - fn child(array: &PcoArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { validity_to_child(&array.unsliced_validity, array.unsliced_n_rows) .unwrap_or_else(|| vortex_panic!("PcoArray child index {idx} out of bounds")) } - fn child_name(_array: &PcoArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "validity".to_string(), _ => vortex_panic!("PcoArray child_name index {idx} out of bounds"), } } - fn metadata(array: &PcoArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(array.metadata.clone())) } @@ -216,7 +214,7 @@ impl VTable for Pco { metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let validity = if children.is_empty() { Validity::from(dtype.nullability()) } else if children.len() == 1 { @@ -244,7 +242,7 @@ impl VTable for Pco { .sum::(); vortex_ensure!(pages.len() == expected_n_pages); - Ok(PcoArray::new( + Ok(PcoData::new( chunk_metas, pages, dtype.clone(), @@ -254,7 +252,7 @@ impl VTable for Pco { )) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() <= 1, "PcoArray expects 0 or 1 children, got {}", @@ -302,7 +300,7 @@ pub(crate) fn number_type_from_dtype(dtype: &DType) -> NumberType { fn collect_valid(parray: &PrimitiveArray) -> VortexResult { let mask = parray.validity_mask()?; - Ok(parray.clone().into_array().filter(mask)?.to_primitive()) + Ok(parray.filter(mask)?.to_primitive()) } pub(crate) fn vortex_err_from_pco(err: PcoError) -> VortexError { @@ -319,10 +317,19 @@ pub struct Pco; impl Pco { pub const ID: ArrayId = ArrayId::new_ref("vortex.pco"); + + /// Compress a primitive array using pcodec. + pub fn from_primitive( + parray: &PrimitiveArray, + level: usize, + values_per_page: usize, + ) -> VortexResult { + Array::try_from_data(PcoData::from_primitive(parray, level, values_per_page)?) + } } #[derive(Clone, Debug)] -pub struct PcoArray { +pub struct PcoData { pub(crate) chunk_metas: Vec, pub(crate) pages: Vec, pub(crate) metadata: PcoMetadata, @@ -334,7 +341,7 @@ pub struct PcoArray { slice_stop: usize, } -impl PcoArray { +impl PcoData { pub fn new( chunk_metas: Vec, pages: Vec, @@ -427,7 +434,7 @@ impl PcoArray { header, chunks: chunk_infos, }; - Ok(PcoArray::new( + Ok(PcoData::new( chunk_meta_buffers, page_buffers, parray.dtype().clone(), @@ -542,7 +549,7 @@ impl PcoArray { } pub(crate) fn _slice(&self, start: usize, stop: usize) -> Self { - PcoArray { + PcoData { slice_start: self.slice_start + start, slice_stop: self.slice_start + stop, stats_set: Default::default(), @@ -550,7 +557,18 @@ impl PcoArray { } } - pub(crate) fn dtype(&self) -> &DType { + /// Returns the number of elements in the array. + pub fn len(&self) -> usize { + self.slice_stop - self.slice_start + } + + /// Returns `true` if the array contains no elements. + pub fn is_empty(&self) -> bool { + self.slice_stop == self.slice_start + } + + /// Returns the logical data type of the array. + pub fn dtype(&self) -> &DType { &self.dtype } @@ -567,18 +585,23 @@ impl PcoArray { } } -impl ValiditySliceHelper for PcoArray { +impl ValiditySliceHelper for PcoData { fn unsliced_validity_and_slice(&self) -> (&Validity, usize, usize) { (&self.unsliced_validity, self.slice_start, self.slice_stop) } } impl OperationsVTable for Pco { - fn scalar_at(array: &PcoArray, index: usize, _ctx: &mut ExecutionCtx) -> VortexResult { + fn scalar_at( + array: &Array, + index: usize, + _ctx: &mut ExecutionCtx, + ) -> VortexResult { let mut ctx = LEGACY_SESSION.create_execution_ctx(); array ._slice(index, index + 1) .decompress(&mut ctx)? + .into_array() .scalar_at(0) } } @@ -591,7 +614,7 @@ mod tests { use vortex_array::validity::Validity; use vortex_buffer::buffer; - use crate::PcoArray; + use crate::Pco; #[test] fn test_slice_nullable() { @@ -600,7 +623,7 @@ mod tests { buffer![10u32, 20, 30, 40, 50, 60], Validity::from_iter([false, true, true, true, true, false]), ); - let pco = PcoArray::from_primitive(&values, 0, 128).unwrap(); + let pco = Pco::from_primitive(&values, 0, 128).unwrap(); assert_arrays_eq!( pco, PrimitiveArray::from_option_iter([ diff --git a/encodings/pco/src/compute/cast.rs b/encodings/pco/src/compute/cast.rs index 86dc4758977..211b7f8c65f 100644 --- a/encodings/pco/src/compute/cast.rs +++ b/encodings/pco/src/compute/cast.rs @@ -9,7 +9,7 @@ use vortex_error::VortexResult; use crate::Pco; use crate::PcoArray; - +use crate::PcoData; impl CastReduce for Pco { fn cast(array: &PcoArray, dtype: &DType) -> VortexResult> { if !dtype.is_nullable() || !array.all_valid()? { @@ -30,7 +30,7 @@ impl CastReduce for Pco { .cast_nullability(dtype.nullability(), array.len())?; return Ok(Some( - PcoArray::new( + PcoData::new( array.chunk_metas.clone(), array.pages.clone(), dtype.clone(), @@ -62,12 +62,12 @@ mod tests { use vortex_array::validity::Validity; use vortex_buffer::buffer; - use crate::PcoArray; + use crate::Pco; #[test] fn test_cast_pco_f32_to_f64() { let values = PrimitiveArray::from_iter([1.0f32, 2.0, 3.0, 4.0, 5.0]); - let pco = PcoArray::from_primitive(&values, 0, 128).unwrap(); + let pco = Pco::from_primitive(&values, 0, 128).unwrap(); let casted = pco .into_array() @@ -88,7 +88,7 @@ mod tests { fn test_cast_pco_nullability_change() { // Test casting from NonNullable to Nullable let values = PrimitiveArray::from_iter([10u32, 20, 30, 40]); - let pco = PcoArray::from_primitive(&values, 0, 128).unwrap(); + let pco = Pco::from_primitive(&values, 0, 128).unwrap(); let casted = pco .into_array() @@ -106,7 +106,7 @@ mod tests { buffer![10u32, 20, 30, 40, 50, 60], Validity::from_iter([true, true, true, true, true, true]), ); - let pco = PcoArray::from_primitive(&values, 0, 128).unwrap(); + let pco = Pco::from_primitive(&values, 0, 128).unwrap(); let sliced = pco.slice(1..5).unwrap(); let casted = sliced .cast(DType::Primitive(PType::U32, Nullability::NonNullable)) @@ -129,7 +129,7 @@ mod tests { Some(50), Some(60), ]); - let pco = PcoArray::from_primitive(&values, 0, 128).unwrap(); + let pco = Pco::from_primitive(&values, 0, 128).unwrap(); let sliced = pco.slice(1..5).unwrap(); let casted = sliced .cast(DType::Primitive(PType::U32, Nullability::NonNullable)) @@ -163,7 +163,7 @@ mod tests { Validity::NonNullable, ))] fn test_cast_pco_conformance(#[case] values: PrimitiveArray) { - let pco = PcoArray::from_primitive(&values, 0, 128).unwrap(); + let pco = Pco::from_primitive(&values, 0, 128).unwrap(); test_cast_conformance(&pco.into_array()); } } diff --git a/encodings/pco/src/compute/mod.rs b/encodings/pco/src/compute/mod.rs index a5db93b4833..990a54179ae 100644 --- a/encodings/pco/src/compute/mod.rs +++ b/encodings/pco/src/compute/mod.rs @@ -10,46 +10,47 @@ mod tests { use vortex_array::arrays::PrimitiveArray; use vortex_array::compute::conformance::consistency::test_array_consistency; + use crate::Pco; use crate::PcoArray; fn pco_f32() -> PcoArray { let values = PrimitiveArray::from_iter([1.23f32, 4.56, 7.89, 10.11, 12.13]); - PcoArray::from_primitive(&values, 0, 128).unwrap() + Pco::from_primitive(&values, 0, 128).unwrap() } fn pco_f64() -> PcoArray { let values = PrimitiveArray::from_iter([100.1f64, 200.2, 300.3, 400.4, 500.5]); - PcoArray::from_primitive(&values, 0, 128).unwrap() + Pco::from_primitive(&values, 0, 128).unwrap() } fn pco_i32() -> PcoArray { let values = PrimitiveArray::from_iter([100i32, 200, 300, 400, 500]); - PcoArray::from_primitive(&values, 0, 128).unwrap() + Pco::from_primitive(&values, 0, 128).unwrap() } fn pco_u64() -> PcoArray { let values = PrimitiveArray::from_iter([1000u64, 2000, 3000, 4000]); - PcoArray::from_primitive(&values, 0, 128).unwrap() + Pco::from_primitive(&values, 0, 128).unwrap() } fn pco_i16() -> PcoArray { let values = PrimitiveArray::from_iter([10i16, 20, 30, 40, 50]); - PcoArray::from_primitive(&values, 0, 128).unwrap() + Pco::from_primitive(&values, 0, 128).unwrap() } fn pco_i32_alt() -> PcoArray { let values = PrimitiveArray::from_iter([1i32, 2, 3, 4, 5]); - PcoArray::from_primitive(&values, 0, 128).unwrap() + Pco::from_primitive(&values, 0, 128).unwrap() } fn pco_single() -> PcoArray { let values = PrimitiveArray::from_iter([42.42f64]); - PcoArray::from_primitive(&values, 0, 128).unwrap() + Pco::from_primitive(&values, 0, 128).unwrap() } fn pco_large() -> PcoArray { let values = PrimitiveArray::from_iter(0u32..1000); - PcoArray::from_primitive(&values, 3, 128).unwrap() + Pco::from_primitive(&values, 3, 128).unwrap() } #[rstest] diff --git a/encodings/pco/src/slice.rs b/encodings/pco/src/slice.rs index 66bcaa5cf87..0c7da3ecc62 100644 --- a/encodings/pco/src/slice.rs +++ b/encodings/pco/src/slice.rs @@ -6,12 +6,13 @@ use std::ops::Range; use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::arrays::slice::SliceReduce; +use vortex_array::vtable::Array; use vortex_error::VortexResult; use crate::Pco; impl SliceReduce for Pco { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { Ok(Some(array._slice(range.start, range.end).into_array())) } } diff --git a/encodings/pco/src/test.rs b/encodings/pco/src/test.rs index a73bbc7948f..5e4dbdfc3dd 100644 --- a/encodings/pco/src/test.rs +++ b/encodings/pco/src/test.rs @@ -5,6 +5,7 @@ use std::sync::LazyLock; use vortex_array::ArrayContext; +use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::LEGACY_SESSION; use vortex_array::ToCanonical; @@ -22,14 +23,16 @@ use vortex_array::serde::SerializeOptions; use vortex_array::session::ArraySession; use vortex_array::session::ArraySessionExt; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::Buffer; use vortex_buffer::BufferMut; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_mask::Mask; use vortex_session::VortexSession; use vortex_session::registry::ReadContext; +use crate::PcoData; + static SESSION: LazyLock = LazyLock::new(|| { let session = VortexSession::empty().with::(); session.arrays().register(Pco); @@ -43,9 +46,9 @@ use crate::PcoArray; fn test_compress_decompress() { let data: Vec = (0..200).collect(); let array = PrimitiveArray::from_iter(data.clone()); - let compressed = PcoArray::from_primitive(&array, 3, 0).unwrap(); + let compressed = Pco::from_primitive(&array, 3, 0).unwrap(); // this data should be compressible - assert!(compressed.pages.len() < array.nbytes() as usize); + assert!(compressed.pages.len() < array.into_array().nbytes() as usize); // check full decompression works let mut ctx = LEGACY_SESSION.create_execution_ctx(); @@ -66,7 +69,7 @@ fn test_compress_decompress() { #[test] fn test_compress_decompress_small() { let array = PrimitiveArray::from_option_iter([None, Some(1)]); - let compressed = PcoArray::from_primitive(&array, 3, 0).unwrap(); + let compressed = Pco::from_primitive(&array, 3, 0).unwrap(); let expected = array.into_array(); assert_arrays_eq!(compressed, expected); @@ -80,7 +83,7 @@ fn test_compress_decompress_small() { fn test_empty() { let data: Vec = vec![]; let array = PrimitiveArray::from_iter(data.clone()); - let compressed = PcoArray::from_primitive(&array, 3, 100).unwrap(); + let compressed = Pco::from_primitive(&array, 3, 100).unwrap(); let mut ctx = LEGACY_SESSION.create_execution_ctx(); let primitive = compressed.decompress(&mut ctx).unwrap(); assert_arrays_eq!(primitive, PrimitiveArray::from_iter(data)); @@ -99,13 +102,16 @@ fn test_validity_and_multiple_chunks_and_pages() { let compression_level = 3; let values_per_chunk = 33; let values_per_page = 10; - let compressed = PcoArray::from_primitive_with_values_per_chunk( - &array, - compression_level, - values_per_chunk, - values_per_page, + let compressed = PcoArray::try_from_data( + PcoData::from_primitive_with_values_per_chunk( + &array, + compression_level, + values_per_chunk, + values_per_page, + ) + .unwrap(), ) - .unwrap(); + .vortex_expect("PcoData is always valid"); assert_eq!(compressed.metadata.chunks.len(), 6); // 191 values / 33 rounds up to 6 assert_eq!(compressed.metadata.chunks[0].pages.len(), 4); // 33 / 10 rounds up to 4 @@ -143,9 +149,9 @@ fn test_validity_vtable() { Buffer::from(data), Validity::Array(BoolArray::from_iter(mask_bools.clone()).into_array()), ); - let compressed = PcoArray::from_primitive(&array, 3, 0).unwrap(); + let compressed = Pco::from_primitive(&array, 3, 0).unwrap(); assert_eq!( - compressed.validity_mask().unwrap(), + DynArray::validity_mask(&compressed).unwrap(), Mask::from_iter(mask_bools) ); assert_eq!( @@ -157,7 +163,7 @@ fn test_validity_vtable() { #[test] fn test_serde() -> VortexResult<()> { let data: PrimitiveArray = (0i32..1_000_000).collect(); - let pco = PcoArray::from_primitive(&data, 3, 100)?.into_array(); + let pco = Pco::from_primitive(&data, 3, 100)?.into_array(); let context = ArrayContext::empty(); diff --git a/encodings/runend/benches/run_end_compress.rs b/encodings/runend/benches/run_end_compress.rs index bac8175b37a..5fa07b813b6 100644 --- a/encodings/runend/benches/run_end_compress.rs +++ b/encodings/runend/benches/run_end_compress.rs @@ -14,7 +14,7 @@ use vortex_array::arrays::VarBinViewArray; use vortex_array::dtype::IntegerPType; use vortex_array::validity::Validity; use vortex_buffer::Buffer; -use vortex_runend::RunEndArray; +use vortex_runend::RunEnd; use vortex_runend::compress::runend_encode; fn main() { @@ -64,7 +64,7 @@ fn decompress(bencher: Bencher, (length, run_step): (usize, usi .collect::>() .into_array(); - let run_end_array = RunEndArray::new(ends, values); + let run_end_array = RunEnd::new(ends, values); let array = run_end_array.into_array(); bencher @@ -89,7 +89,7 @@ fn take_indices(bencher: Bencher, (length, run_step): (usize, usize)) { let source_array = PrimitiveArray::from_iter(0..(length as i32)).into_array(); let (ends, values) = runend_encode(&values); - let runend_array = RunEndArray::try_new(ends.into_array(), values) + let runend_array = RunEnd::try_new(ends.into_array(), values) .unwrap() .into_array(); @@ -121,7 +121,7 @@ fn decompress_utf8(bencher: Bencher, (length, run_step): (usize, usize)) { let values = VarBinViewArray::from_iter_str((0..num_runs).map(|i| format!("run_value_{i}"))) .into_array(); - let run_end_array = RunEndArray::new(ends, values); + let run_end_array = RunEnd::new(ends, values); let array = run_end_array.into_array(); bencher diff --git a/encodings/runend/benches/run_end_null_count.rs b/encodings/runend/benches/run_end_null_count.rs index d85683a4c92..8a90f56a638 100644 --- a/encodings/runend/benches/run_end_null_count.rs +++ b/encodings/runend/benches/run_end_null_count.rs @@ -11,6 +11,7 @@ use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::arrays::PrimitiveArray; use vortex_buffer::Buffer; +use vortex_runend::RunEnd; use vortex_runend::RunEndArray; fn main() { @@ -68,5 +69,5 @@ fn fixture(n: usize, run_step: usize, valid_density: f64) -> RunEndArray { ) .into_array(); - RunEndArray::new(ends, values) + RunEnd::new(ends, values) } diff --git a/encodings/runend/public-api.lock b/encodings/runend/public-api.lock index 3e7eca7f426..b7831f28858 100644 --- a/encodings/runend/public-api.lock +++ b/encodings/runend/public-api.lock @@ -2,17 +2,17 @@ pub mod vortex_runend pub mod vortex_runend::compress -pub fn vortex_runend::compress::runend_decode_primitive(ends: vortex_array::arrays::primitive::array::PrimitiveArray, values: vortex_array::arrays::primitive::array::PrimitiveArray, offset: usize, length: usize) -> vortex_error::VortexResult +pub fn vortex_runend::compress::runend_decode_primitive(ends: vortex_array::arrays::primitive::vtable::PrimitiveArray, values: vortex_array::arrays::primitive::vtable::PrimitiveArray, offset: usize, length: usize) -> vortex_error::VortexResult -pub fn vortex_runend::compress::runend_decode_typed_primitive(run_ends: impl core::iter::traits::iterator::Iterator, values: &[T], values_validity: vortex_mask::Mask, values_nullability: vortex_array::dtype::nullability::Nullability, length: usize) -> vortex_array::arrays::primitive::array::PrimitiveArray +pub fn vortex_runend::compress::runend_decode_typed_primitive(run_ends: impl core::iter::traits::iterator::Iterator, values: &[T], values_validity: vortex_mask::Mask, values_nullability: vortex_array::dtype::nullability::Nullability, length: usize) -> vortex_array::arrays::primitive::vtable::PrimitiveArray -pub fn vortex_runend::compress::runend_decode_varbinview(ends: vortex_array::arrays::primitive::array::PrimitiveArray, values: vortex_array::arrays::varbinview::array::VarBinViewArray, offset: usize, length: usize) -> vortex_error::VortexResult +pub fn vortex_runend::compress::runend_decode_varbinview(ends: vortex_array::arrays::primitive::vtable::PrimitiveArray, values: vortex_array::arrays::varbinview::vtable::VarBinViewArray, offset: usize, length: usize) -> vortex_error::VortexResult -pub fn vortex_runend::compress::runend_encode(array: &vortex_array::arrays::primitive::array::PrimitiveArray) -> (vortex_array::arrays::primitive::array::PrimitiveArray, vortex_array::array::ArrayRef) +pub fn vortex_runend::compress::runend_encode(array: &vortex_array::arrays::primitive::vtable::PrimitiveArray) -> (vortex_array::arrays::primitive::vtable::PrimitiveArray, vortex_array::array::ArrayRef) pub mod vortex_runend::decompress_bool -pub fn vortex_runend::decompress_bool::runend_decode_bools(ends: vortex_array::arrays::primitive::array::PrimitiveArray, values: vortex_array::arrays::bool::array::BoolArray, offset: usize, length: usize) -> vortex_error::VortexResult +pub fn vortex_runend::decompress_bool::runend_decode_bools(ends: vortex_array::arrays::primitive::vtable::PrimitiveArray, values: vortex_array::arrays::bool::vtable::BoolArray, offset: usize, length: usize) -> vortex_error::VortexResult pub fn vortex_runend::decompress_bool::runend_decode_typed_bool(run_ends: impl core::iter::traits::iterator::Iterator, values: &vortex_buffer::bit::buf::BitBuffer, values_validity: vortex_mask::Mask, values_nullability: vortex_array::dtype::nullability::Nullability, length: usize) -> vortex_array::array::ArrayRef @@ -22,6 +22,16 @@ impl vortex_runend::RunEnd pub const vortex_runend::RunEnd::ID: vortex_array::vtable::dyn_::ArrayId +pub fn vortex_runend::RunEnd::encode(array: vortex_array::array::ArrayRef) -> vortex_error::VortexResult + +pub fn vortex_runend::RunEnd::new(ends: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef) -> vortex_runend::RunEndArray + +pub unsafe fn vortex_runend::RunEnd::new_unchecked(ends: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef, offset: usize, length: usize) -> vortex_runend::RunEndArray + +pub fn vortex_runend::RunEnd::try_new(ends: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef) -> vortex_error::VortexResult + +pub fn vortex_runend::RunEnd::try_new_offset_length(ends: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef, offset: usize, length: usize) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_runend::RunEnd pub fn vortex_runend::RunEnd::clone(&self) -> vortex_runend::RunEnd @@ -52,7 +62,7 @@ pub fn vortex_runend::RunEnd::fill_null(array: &vortex_runend::RunEndArray, fill impl vortex_array::vtable::VTable for vortex_runend::RunEnd -pub type vortex_runend::RunEnd::Array = vortex_runend::RunEndArray +pub type vortex_runend::RunEnd::ArrayData = vortex_runend::RunEndData pub type vortex_runend::RunEnd::Metadata = vortex_array::metadata::ProstMetadata @@ -60,23 +70,23 @@ pub type vortex_runend::RunEnd::OperationsVTable = vortex_runend::RunEnd pub type vortex_runend::RunEnd::ValidityVTable = vortex_runend::RunEnd -pub fn vortex_runend::RunEnd::array_eq(array: &vortex_runend::RunEndArray, other: &vortex_runend::RunEndArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_runend::RunEnd::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_runend::RunEnd::array_hash(array: &vortex_runend::RunEndArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_runend::RunEnd::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_runend::RunEnd::buffer(_array: &vortex_runend::RunEndArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_runend::RunEnd::buffer(_array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_runend::RunEnd::buffer_name(_array: &vortex_runend::RunEndArray, idx: usize) -> core::option::Option +pub fn vortex_runend::RunEnd::buffer_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> core::option::Option -pub fn vortex_runend::RunEnd::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_runend::RunEnd::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_runend::RunEnd::child(array: &vortex_runend::RunEndArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_runend::RunEnd::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_runend::RunEnd::child_name(_array: &vortex_runend::RunEndArray, idx: usize) -> alloc::string::String +pub fn vortex_runend::RunEnd::child_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_runend::RunEnd::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_runend::RunEnd::dtype(array: &vortex_runend::RunEndArray) -> &vortex_array::dtype::DType +pub fn vortex_runend::RunEnd::dtype(array: &vortex_runend::RunEndData) -> &vortex_array::dtype::DType pub fn vortex_runend::RunEnd::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -84,95 +94,87 @@ pub fn vortex_runend::RunEnd::execute_parent(array: &vortex_array::vtable::typed pub fn vortex_runend::RunEnd::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_runend::RunEnd::len(array: &vortex_runend::RunEndArray) -> usize +pub fn vortex_runend::RunEnd::len(array: &vortex_runend::RunEndData) -> usize -pub fn vortex_runend::RunEnd::metadata(array: &vortex_runend::RunEndArray) -> vortex_error::VortexResult +pub fn vortex_runend::RunEnd::metadata(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_runend::RunEnd::nbuffers(_array: &vortex_runend::RunEndArray) -> usize +pub fn vortex_runend::RunEnd::nbuffers(_array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_runend::RunEnd::nchildren(_array: &vortex_runend::RunEndArray) -> usize +pub fn vortex_runend::RunEnd::nchildren(_array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_runend::RunEnd::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_runend::RunEnd::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_runend::RunEnd::stats(array: &vortex_runend::RunEndArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_runend::RunEnd::stats(array: &vortex_runend::RunEndData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_runend::RunEnd::vtable(_array: &Self::Array) -> &Self +pub fn vortex_runend::RunEnd::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_runend::RunEnd::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_runend::RunEnd::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_runend::RunEnd -pub fn vortex_runend::RunEnd::scalar_at(array: &vortex_runend::RunEndArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_runend::RunEnd::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::validity::ValidityVTable for vortex_runend::RunEnd -pub fn vortex_runend::RunEnd::validity(array: &vortex_runend::RunEndArray) -> vortex_error::VortexResult - -pub struct vortex_runend::RunEndArray - -impl vortex_runend::RunEndArray - -pub fn vortex_runend::RunEndArray::encode(array: vortex_array::array::ArrayRef) -> vortex_error::VortexResult +pub fn vortex_runend::RunEnd::validity(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_runend::RunEndArray::ends(&self) -> &vortex_array::array::ArrayRef - -pub fn vortex_runend::RunEndArray::find_physical_index(&self, index: usize) -> vortex_error::VortexResult +pub struct vortex_runend::RunEndArrayParts -pub fn vortex_runend::RunEndArray::into_parts(self) -> vortex_runend::RunEndArrayParts +pub vortex_runend::RunEndArrayParts::ends: vortex_array::array::ArrayRef -pub fn vortex_runend::RunEndArray::new(ends: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef) -> Self +pub vortex_runend::RunEndArrayParts::values: vortex_array::array::ArrayRef -pub unsafe fn vortex_runend::RunEndArray::new_unchecked(ends: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef, offset: usize, length: usize) -> Self +pub struct vortex_runend::RunEndData -pub fn vortex_runend::RunEndArray::offset(&self) -> usize +impl vortex_runend::RunEndData -pub fn vortex_runend::RunEndArray::try_new(ends: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef) -> vortex_error::VortexResult +pub fn vortex_runend::RunEndData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_runend::RunEndArray::try_new_offset_length(ends: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef, offset: usize, length: usize) -> vortex_error::VortexResult +pub fn vortex_runend::RunEndData::encode(array: vortex_array::array::ArrayRef) -> vortex_error::VortexResult -pub fn vortex_runend::RunEndArray::values(&self) -> &vortex_array::array::ArrayRef +pub fn vortex_runend::RunEndData::ends(&self) -> &vortex_array::array::ArrayRef -impl vortex_runend::RunEndArray +pub fn vortex_runend::RunEndData::find_physical_index(&self, index: usize) -> vortex_error::VortexResult -pub fn vortex_runend::RunEndArray::to_array(&self) -> vortex_array::array::ArrayRef +pub fn vortex_runend::RunEndData::into_parts(self) -> vortex_runend::RunEndArrayParts -impl core::clone::Clone for vortex_runend::RunEndArray +pub fn vortex_runend::RunEndData::is_empty(&self) -> bool -pub fn vortex_runend::RunEndArray::clone(&self) -> vortex_runend::RunEndArray +pub fn vortex_runend::RunEndData::len(&self) -> usize -impl core::convert::AsRef for vortex_runend::RunEndArray +pub fn vortex_runend::RunEndData::new(ends: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef) -> Self -pub fn vortex_runend::RunEndArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +pub unsafe fn vortex_runend::RunEndData::new_unchecked(ends: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef, offset: usize, length: usize) -> Self -impl core::convert::From for vortex_array::array::ArrayRef +pub fn vortex_runend::RunEndData::offset(&self) -> usize -pub fn vortex_array::array::ArrayRef::from(value: vortex_runend::RunEndArray) -> vortex_array::array::ArrayRef +pub fn vortex_runend::RunEndData::try_new(ends: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef) -> vortex_error::VortexResult -impl core::fmt::Debug for vortex_runend::RunEndArray +pub fn vortex_runend::RunEndData::try_new_offset_length(ends: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef, offset: usize, length: usize) -> vortex_error::VortexResult -pub fn vortex_runend::RunEndArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_runend::RunEndData::values(&self) -> &vortex_array::array::ArrayRef -impl core::ops::deref::Deref for vortex_runend::RunEndArray +impl core::clone::Clone for vortex_runend::RunEndData -pub type vortex_runend::RunEndArray::Target = dyn vortex_array::array::DynArray +pub fn vortex_runend::RunEndData::clone(&self) -> vortex_runend::RunEndData -pub fn vortex_runend::RunEndArray::deref(&self) -> &Self::Target +impl core::convert::From for vortex_array::array::ArrayRef -impl vortex_array::array::IntoArray for vortex_runend::RunEndArray +pub fn vortex_array::array::ArrayRef::from(value: vortex_runend::RunEndData) -> vortex_array::array::ArrayRef -pub fn vortex_runend::RunEndArray::into_array(self) -> vortex_array::array::ArrayRef +impl core::fmt::Debug for vortex_runend::RunEndData -impl vortex_array::arrow::FromArrowArray<&arrow_array::array::run_array::RunArray> for vortex_runend::RunEndArray where ::Native: vortex_array::dtype::ptype::NativePType +pub fn vortex_runend::RunEndData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_runend::RunEndArray::from_arrow(array: &arrow_array::array::run_array::RunArray, nullable: bool) -> vortex_error::VortexResult +impl vortex_array::array::IntoArray for vortex_runend::RunEndData -pub struct vortex_runend::RunEndArrayParts +pub fn vortex_runend::RunEndData::into_array(self) -> vortex_array::array::ArrayRef -pub vortex_runend::RunEndArrayParts::ends: vortex_array::array::ArrayRef +impl vortex_array::arrow::FromArrowArray<&arrow_array::array::run_array::RunArray> for vortex_runend::RunEndData where ::Native: vortex_array::dtype::ptype::NativePType -pub vortex_runend::RunEndArrayParts::values: vortex_array::array::ArrayRef +pub fn vortex_runend::RunEndData::from_arrow(array: &arrow_array::array::run_array::RunArray, nullable: bool) -> vortex_error::VortexResult pub struct vortex_runend::RunEndMetadata @@ -209,3 +211,5 @@ pub fn vortex_runend::RunEndMetadata::encoded_len(&self) -> usize pub fn vortex_runend::initialize(session: &mut vortex_session::VortexSession) pub fn vortex_runend::trimmed_ends_iter(run_ends: &[E], offset: usize, length: usize) -> impl core::iter::traits::iterator::Iterator + use<'_, E> + +pub type vortex_runend::RunEndArray = vortex_array::vtable::typed::Array diff --git a/encodings/runend/src/arbitrary.rs b/encodings/runend/src/arbitrary.rs index f4a3a83f150..a63fa9bb2ed 100644 --- a/encodings/runend/src/arbitrary.rs +++ b/encodings/runend/src/arbitrary.rs @@ -14,11 +14,11 @@ use vortex_array::validity::Validity; use vortex_buffer::Buffer; use vortex_error::VortexExpect; -use crate::RunEndArray; +use crate::RunEndData; /// A wrapper type to implement `Arbitrary` for `RunEndArray`. #[derive(Clone, Debug)] -pub struct ArbitraryRunEndArray(pub RunEndArray); +pub struct ArbitraryRunEndArray(pub RunEndData); impl<'a> Arbitrary<'a> for ArbitraryRunEndArray { fn arbitrary(u: &mut Unstructured<'a>) -> Result { @@ -42,7 +42,7 @@ impl ArbitraryRunEndArray { // Empty RunEndArray let ends = PrimitiveArray::from_iter(Vec::::new()).into_array(); let values = ArbitraryArray::arbitrary_with(u, Some(0), dtype)?.0; - let runend_array = RunEndArray::try_new(ends, values) + let runend_array = RunEndData::try_new(ends, values) .vortex_expect("Empty RunEndArray creation should succeed"); return Ok(ArbitraryRunEndArray(runend_array)); } @@ -54,7 +54,7 @@ impl ArbitraryRunEndArray { // Each end must be > previous end, and first end must be >= 1 let ends = random_strictly_sorted_ends(u, num_runs, len)?; - let runend_array = RunEndArray::try_new(ends, values) + let runend_array = RunEndData::try_new(ends, values) .vortex_expect("RunEndArray creation should succeed in arbitrary impl"); Ok(ArbitraryRunEndArray(runend_array)) diff --git a/encodings/runend/src/array.rs b/encodings/runend/src/array.rs index 6402e3b511c..9a5e4418c56 100644 --- a/encodings/runend/src/array.rs +++ b/encodings/runend/src/array.rs @@ -27,7 +27,6 @@ use vortex_array::search_sorted::SearchSorted; use vortex_array::search_sorted::SearchSortedSide; use vortex_array::serde::ArrayChildren; use vortex_array::stats::ArrayStats; -use vortex_array::stats::StatsSetRef; use vortex_array::validity::Validity; use vortex_array::vtable; use vortex_array::vtable::Array; @@ -48,7 +47,7 @@ use crate::decompress_bool::runend_decode_bools; use crate::kernel::PARENT_KERNELS; use crate::rules::RULES; -vtable!(RunEnd); +vtable!(RunEnd, RunEnd, RunEndData); #[derive(Clone, prost::Message)] pub struct RunEndMetadata { @@ -61,13 +60,13 @@ pub struct RunEndMetadata { } impl VTable for RunEnd { - type Array = RunEndArray; + type ArrayData = RunEndData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = Self; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &RunEnd } @@ -75,49 +74,49 @@ impl VTable for RunEnd { Self::ID } - fn len(array: &RunEndArray) -> usize { + fn len(array: &RunEndData) -> usize { array.length } - fn dtype(array: &RunEndArray) -> &DType { + fn dtype(array: &RunEndData) -> &DType { array.values.dtype() } - fn stats(array: &RunEndArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &RunEndData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &RunEndArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.ends.array_hash(state, precision); array.values.array_hash(state, precision); array.offset.hash(state); array.length.hash(state); } - fn array_eq(array: &RunEndArray, other: &RunEndArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.ends.array_eq(&other.ends, precision) && array.values.array_eq(&other.values, precision) && array.offset == other.offset && array.length == other.length } - fn nbuffers(_array: &RunEndArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &RunEndArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("RunEndArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &RunEndArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { vortex_panic!("RunEndArray buffer_name index {idx} out of bounds") } - fn nchildren(_array: &RunEndArray) -> usize { + fn nchildren(_array: &Array) -> usize { 2 } - fn child(array: &RunEndArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.ends().clone(), 1 => array.values().clone(), @@ -125,7 +124,7 @@ impl VTable for RunEnd { } } - fn child_name(_array: &RunEndArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "ends".to_string(), 1 => "values".to_string(), @@ -133,7 +132,7 @@ impl VTable for RunEnd { } } - fn metadata(array: &RunEndArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(RunEndMetadata { ends_ptype: PType::try_from(array.ends().dtype()).vortex_expect("Must be a valid PType") as i32, @@ -163,14 +162,14 @@ impl VTable for RunEnd { metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let ends_dtype = DType::Primitive(metadata.ends_ptype(), Nullability::NonNullable); let runs = usize::try_from(metadata.num_runs).vortex_expect("Must be a valid usize"); let ends = children.get(0, &ends_dtype, runs)?; let values = children.get(1, dtype, runs)?; - RunEndArray::try_new_offset_length( + RunEndData::try_new_offset_length( ends, values, usize::try_from(metadata.offset).vortex_expect("Offset must be a valid usize"), @@ -178,7 +177,7 @@ impl VTable for RunEnd { ) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 2, "RunEndArray expects 2 children, got {}", @@ -215,7 +214,7 @@ impl VTable for RunEnd { } #[derive(Clone, Debug)] -pub struct RunEndArray { +pub struct RunEndData { ends: ArrayRef, values: ArrayRef, offset: usize, @@ -233,9 +232,51 @@ pub struct RunEnd; impl RunEnd { pub const ID: ArrayId = ArrayId::new_ref("vortex.runend"); + + /// Build a new [`RunEndArray`] without validation. + /// + /// # Safety + /// See [`RunEndData::new_unchecked`] for preconditions. + pub unsafe fn new_unchecked( + ends: ArrayRef, + values: ArrayRef, + offset: usize, + length: usize, + ) -> RunEndArray { + Array::try_from_data(unsafe { RunEndData::new_unchecked(ends, values, offset, length) }) + .vortex_expect("RunEndData is always valid") + } + + /// Build a new [`RunEndArray`] from ends and values. + pub fn try_new(ends: ArrayRef, values: ArrayRef) -> VortexResult { + Array::try_from_data(RunEndData::try_new(ends, values)?) + } + + /// Build a new [`RunEndArray`] from ends, values, offset, and length. + pub fn try_new_offset_length( + ends: ArrayRef, + values: ArrayRef, + offset: usize, + length: usize, + ) -> VortexResult { + Array::try_from_data(RunEndData::try_new_offset_length( + ends, values, offset, length, + )?) + } + + /// Build a new [`RunEndArray`] from ends and values (panics on invalid input). + pub fn new(ends: ArrayRef, values: ArrayRef) -> RunEndArray { + Array::try_from_data(RunEndData::new(ends, values)) + .vortex_expect("RunEndData is always valid") + } + + /// Run the array through run-end encoding. + pub fn encode(array: ArrayRef) -> VortexResult { + Array::try_from_data(RunEndData::encode(array)?) + } } -impl RunEndArray { +impl RunEndData { fn validate( ends: &ArrayRef, values: &ArrayRef, @@ -311,10 +352,10 @@ impl RunEndArray { } } -impl RunEndArray { +impl RunEndData { /// Build a new `RunEndArray` from an array of run `ends` and an array of `values`. /// - /// Panics if any of the validation conditions described in [`RunEndArray::try_new`] is + /// Panics if any of the validation conditions described in [`RunEndData::try_new`] is /// not satisfied. /// /// # Examples @@ -324,11 +365,11 @@ impl RunEndArray { /// # use vortex_array::IntoArray; /// # use vortex_buffer::buffer; /// # use vortex_error::VortexResult; - /// # use vortex_runend::RunEndArray; + /// # use vortex_runend::RunEnd; /// # fn main() -> VortexResult<()> { /// let ends = buffer![2u8, 3u8].into_array(); /// let values = BoolArray::from_iter([false, true]).into_array(); - /// let run_end = RunEndArray::new(ends, values); + /// let run_end = RunEnd::new(ends, values); /// /// // Array encodes /// assert_eq!(run_end.scalar_at(0)?, false.into()); @@ -358,7 +399,7 @@ impl RunEndArray { /// Construct a new sliced `RunEndArray` with the provided offset and length. /// - /// This performs all the same validation as [`RunEndArray::try_new`]. + /// This performs all the same validation as [`RunEndData::try_new`]. pub fn try_new_offset_length( ends: ArrayRef, values: ArrayRef, @@ -380,10 +421,10 @@ impl RunEndArray { /// /// # Safety /// - /// The caller must ensure that all the validation performed in [`RunEndArray::try_new`] is + /// The caller must ensure that all the validation performed in [`RunEndData::try_new`] is /// satisfied before calling this function. /// - /// See [`RunEndArray::try_new`] for the preconditions needed to build a new array. + /// See [`RunEndData::try_new`] for the preconditions needed to build a new array. pub unsafe fn new_unchecked( ends: ArrayRef, values: ArrayRef, @@ -429,6 +470,24 @@ impl RunEndArray { } } + /// Returns the length of the array. + #[inline] + pub fn len(&self) -> usize { + self.length + } + + /// Returns whether the array is empty. + #[inline] + pub fn is_empty(&self) -> bool { + self.length == 0 + } + + /// Returns the logical data type of the array. + #[inline] + pub fn dtype(&self) -> &DType { + self.values.dtype() + } + /// The offset that the `ends` is relative to. /// /// This is generally zero for a "new" array, and non-zero after a slicing operation. @@ -466,12 +525,12 @@ impl RunEndArray { } impl ValidityVTable for RunEnd { - fn validity(array: &RunEndArray) -> VortexResult { + fn validity(array: &Array) -> VortexResult { Ok(match array.values().validity()? { Validity::NonNullable | Validity::AllValid => Validity::AllValid, Validity::AllInvalid => Validity::AllInvalid, Validity::Array(values_validity) => Validity::Array(unsafe { - RunEndArray::new_unchecked( + RunEndData::new_unchecked( array.ends().clone(), values_validity, array.offset(), @@ -520,11 +579,11 @@ mod tests { use vortex_array::dtype::PType; use vortex_buffer::buffer; - use crate::RunEndArray; + use crate::RunEnd; #[test] fn test_runend_constructor() { - let arr = RunEndArray::new( + let arr = RunEnd::new( buffer![2u32, 5, 10].into_array(), buffer![1i32, 2, 3].into_array(), ); @@ -544,7 +603,7 @@ mod tests { #[test] fn test_runend_utf8() { let values = VarBinViewArray::from_iter_str(["a", "b", "c"]).into_array(); - let arr = RunEndArray::new(buffer![2u32, 5, 10].into_array(), values); + let arr = RunEnd::new(buffer![2u32, 5, 10].into_array(), values); assert_eq!(arr.len(), 10); assert_eq!(arr.dtype(), &DType::Utf8(Nullability::NonNullable)); @@ -560,8 +619,7 @@ mod tests { let dict_codes = buffer![0u32, 1, 2].into_array(); let dict = DictArray::try_new(dict_codes, dict_values).unwrap(); - let arr = - RunEndArray::try_new(buffer![2u32, 5, 10].into_array(), dict.into_array()).unwrap(); + let arr = RunEnd::try_new(buffer![2u32, 5, 10].into_array(), dict.into_array()).unwrap(); assert_eq!(arr.len(), 10); let expected = diff --git a/encodings/runend/src/arrow.rs b/encodings/runend/src/arrow.rs index 4b2ddc9a448..82eb837f48f 100644 --- a/encodings/runend/src/arrow.rs +++ b/encodings/runend/src/arrow.rs @@ -15,10 +15,9 @@ use vortex_array::validity::Validity; use vortex_buffer::Buffer; use vortex_error::VortexResult; -use crate::RunEndArray; +use crate::RunEndData; use crate::ops::find_slice_end_index; - -impl FromArrowArray<&RunArray> for RunEndArray +impl FromArrowArray<&RunArray> for RunEndData where R::Native: NativePType, { @@ -31,23 +30,24 @@ where .reinterpret_cast(R::Native::PTYPE.to_unsigned()); let values = ArrayRef::from_arrow(array.values().as_ref(), nullable)?; + let ends_array = ends.into_array(); let (ends_slice, values_slice) = if offset == 0 && len == array.run_ends().max_value() { - (ends.into_array(), values) + (ends_array, values) } else { - let slice_begin = ends + let slice_begin = ends_array .as_primitive_typed() .search_sorted(&PValue::from(offset), SearchSortedSide::Right)? - .to_ends_index(ends.len()); - let slice_end = find_slice_end_index(&ends.clone().into_array(), offset + len)?; + .to_ends_index(ends_array.len()); + let slice_end = find_slice_end_index(&ends_array, offset + len)?; ( - ends.slice(slice_begin..slice_end)?, + ends_array.slice(slice_begin..slice_end)?, values.slice(slice_begin..slice_end)?, ) }; // SAFETY: arrow-rs enforces the RunEndArray invariants, we inherit their guarantees - Ok(unsafe { RunEndArray::new_unchecked(ends_slice, values_slice, offset, len) }) + Ok(unsafe { RunEndData::new_unchecked(ends_slice, values_slice, offset, len) }) } } @@ -79,7 +79,7 @@ mod tests { use vortex_error::VortexResult; use vortex_session::VortexSession; - use crate::RunEndArray; + use crate::RunEndData; static SESSION: LazyLock = LazyLock::new(|| VortexSession::empty().with::()); @@ -94,10 +94,10 @@ mod tests { let arrow_run_array = RunArray::::try_new(&run_ends, &values).unwrap(); // Convert to Vortex - let vortex_array = RunEndArray::from_arrow(&arrow_run_array, false)?; + let vortex_array = RunEndData::from_arrow(&arrow_run_array, false)?; assert_arrays_eq!( - vortex_array.as_ref(), + vortex_array.into_array(), buffer![10i32, 10, 10, 20, 20, 30, 30, 30].into_array() ); Ok(()) @@ -111,10 +111,10 @@ mod tests { let arrow_run_array = RunArray::::try_new(&run_ends, &values).unwrap(); // Convert to Vortex with nullable=true - let vortex_array = RunEndArray::from_arrow(&arrow_run_array, true)?; + let vortex_array = RunEndData::from_arrow(&arrow_run_array, true)?; assert_arrays_eq!( - vortex_array.as_ref(), + vortex_array.into_array(), PrimitiveArray::from_option_iter([ Some(100i32), Some(100i32), @@ -135,7 +135,7 @@ mod tests { let arrow_run_array = RunArray::::try_new(&run_ends, &values).unwrap(); // Convert to Vortex - let vortex_array = RunEndArray::from_arrow(&arrow_run_array, false)?; + let vortex_array = RunEndData::from_arrow(&arrow_run_array, false)?; assert_arrays_eq!(vortex_array, buffer![1.5f64, 2.5, 2.5, 3.5].into_array()); Ok(()) @@ -155,7 +155,7 @@ mod tests { let sliced_array = arrow_run_array.slice(1, 6); // Convert the sliced array to Vortex - let vortex_array = RunEndArray::from_arrow(&sliced_array, false)?; + let vortex_array = RunEndData::from_arrow(&sliced_array, false)?; assert_arrays_eq!( vortex_array, buffer![100, 200, 200, 200, 300, 300].into_array() @@ -178,7 +178,7 @@ mod tests { let sliced_array = arrow_run_array.slice(4, 6); // Convert to Vortex with nullable=true - let vortex_array = RunEndArray::from_arrow(&sliced_array, true)?; + let vortex_array = RunEndData::from_arrow(&sliced_array, true)?; assert_arrays_eq!( vortex_array, @@ -209,7 +209,7 @@ mod tests { let sliced_array = arrow_run_array.slice(4, 0); // Convert to Vortex with nullable=true - let vortex_array = RunEndArray::from_arrow(&sliced_array, true)?; + let vortex_array = RunEndData::from_arrow(&sliced_array, true)?; // Verify properties assert_eq!(vortex_array.len(), 0); @@ -240,7 +240,7 @@ mod tests { &Int32Array::from(vec![3i32, 5, 8]), &Int32Array::from(vec![10, 20, 30]), )?; - let vortex_array = RunEndArray::from_arrow(&original, false)?; + let vortex_array = RunEndData::from_arrow(&original, false)?; let target = ree_type(DataType::Int32, DataType::Int32); let result = execute(vortex_array.into_array(), &target)?; @@ -274,7 +274,7 @@ mod tests { #[case] expected_values: &[i32], ) -> VortexResult<()> { let array = - RunEndArray::encode(PrimitiveArray::from_iter(input.iter().copied()).into_array())?; + RunEndData::encode(PrimitiveArray::from_iter(input.iter().copied()).into_array())?; let sliced = array.into_array().slice(slice_range.clone())?; let target = ree_type(DataType::Int32, DataType::Int32); let result = execute(sliced, &target)?; diff --git a/encodings/runend/src/compress.rs b/encodings/runend/src/compress.rs index 0a841c28194..c36413059da 100644 --- a/encodings/runend/src/compress.rs +++ b/encodings/runend/src/compress.rs @@ -18,7 +18,6 @@ use vortex_array::match_each_native_ptype; use vortex_array::match_each_unsigned_integer_ptype; use vortex_array::scalar::Scalar; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::BitBuffer; use vortex_buffer::BitBufferMut; use vortex_buffer::Buffer; @@ -70,10 +69,7 @@ pub fn runend_encode(array: &PrimitiveArray) -> (PrimitiveArray, ArrayRef) { } }; - let ends = ends - .narrow() - .vortex_expect("Ends must succeed downcasting") - .to_primitive(); + let ends = ends.narrow().vortex_expect("Ends must succeed downcasting"); ends.statistics() .set(Stat::IsStrictSorted, Precision::Exact(true.into())); @@ -287,7 +283,7 @@ pub fn runend_decode_varbinview( ) }); - let parts = values.into_parts(); + let parts = values.into_data().into_parts(); let view_handle = BufferHandle::new_host(decoded_views.into_byte_buffer()); // SAFETY: we are expanding views from a valid VarBinViewArray with the same diff --git a/encodings/runend/src/compute/cast.rs b/encodings/runend/src/compute/cast.rs index d106c2e86aa..46376e7700b 100644 --- a/encodings/runend/src/compute/cast.rs +++ b/encodings/runend/src/compute/cast.rs @@ -10,7 +10,7 @@ use vortex_error::VortexResult; use crate::RunEnd; use crate::RunEndArray; - +use crate::RunEndData; impl CastReduce for RunEnd { fn cast(array: &RunEndArray, dtype: &DType) -> VortexResult> { // Cast the values array to the target type @@ -19,7 +19,7 @@ impl CastReduce for RunEnd { // SAFETY: casting does not affect the ends being valid unsafe { Ok(Some( - RunEndArray::new_unchecked( + RunEndData::new_unchecked( array.ends().clone(), casted_values, array.offset(), @@ -47,11 +47,12 @@ mod tests { use vortex_array::dtype::PType; use vortex_buffer::buffer; + use crate::RunEnd; use crate::RunEndArray; #[test] fn test_cast_runend_i32_to_i64() { - let runend = RunEndArray::try_new( + let runend = RunEnd::try_new( buffer![3u64, 5, 8, 10].into_array(), buffer![100i32, 200, 100, 300].into_array(), ) @@ -90,7 +91,7 @@ mod tests { #[test] fn test_cast_runend_nullable() { - let runend = RunEndArray::try_new( + let runend = RunEnd::try_new( buffer![2u64, 4, 7].into_array(), PrimitiveArray::from_option_iter([Some(10i32), None, Some(20)]).into_array(), ) @@ -109,7 +110,7 @@ mod tests { #[test] fn test_cast_runend_with_offset() { // Create a RunEndArray: [100, 100, 100, 200, 200, 300, 300, 300, 300, 300] - let runend = RunEndArray::try_new( + let runend = RunEnd::try_new( buffer![3u64, 5, 10].into_array(), buffer![100i32, 200, 300].into_array(), ) @@ -134,23 +135,23 @@ mod tests { } #[rstest] - #[case(RunEndArray::try_new( + #[case(RunEnd::try_new( buffer![3u64, 5, 8].into_array(), buffer![100i32, 200, 300].into_array() ).unwrap())] - #[case(RunEndArray::try_new( + #[case(RunEnd::try_new( buffer![1u64, 4, 10].into_array(), buffer![1.5f32, 2.5, 3.5].into_array() ).unwrap())] - #[case(RunEndArray::try_new( + #[case(RunEnd::try_new( buffer![2u64, 3, 5].into_array(), PrimitiveArray::from_option_iter([Some(42i32), None, Some(84)]).into_array() ).unwrap())] - #[case(RunEndArray::try_new( + #[case(RunEnd::try_new( buffer![10u64].into_array(), buffer![255u8].into_array() ).unwrap())] - #[case(RunEndArray::try_new( + #[case(RunEnd::try_new( buffer![2u64, 4, 6, 8, 10].into_array(), BoolArray::from_iter(vec![true, false, true, false, true]).into_array() ).unwrap())] diff --git a/encodings/runend/src/compute/compare.rs b/encodings/runend/src/compute/compare.rs index 9601d0502d8..10cd2501350 100644 --- a/encodings/runend/src/compute/compare.rs +++ b/encodings/runend/src/compute/compare.rs @@ -55,13 +55,12 @@ mod test { use vortex_array::builtins::ArrayBuiltins; use vortex_array::scalar_fn::fns::operators::Operator; + use crate::RunEnd; use crate::RunEndArray; fn ree_array() -> RunEndArray { - RunEndArray::encode( - PrimitiveArray::from_iter([1, 1, 1, 4, 4, 4, 2, 2, 5, 5, 5, 5]).into_array(), - ) - .unwrap() + RunEnd::encode(PrimitiveArray::from_iter([1, 1, 1, 4, 4, 4, 2, 2, 5, 5, 5, 5]).into_array()) + .unwrap() } #[test] diff --git a/encodings/runend/src/compute/fill_null.rs b/encodings/runend/src/compute/fill_null.rs index 0f0445ba58e..cc4d7b459ea 100644 --- a/encodings/runend/src/compute/fill_null.rs +++ b/encodings/runend/src/compute/fill_null.rs @@ -11,14 +11,15 @@ use vortex_error::VortexResult; use crate::RunEnd; use crate::RunEndArray; use crate::RunEndArrayParts; +use crate::RunEndData; impl FillNullReduce for RunEnd { fn fill_null(array: &RunEndArray, fill_value: &Scalar) -> VortexResult> { - let RunEndArrayParts { values, ends } = array.clone().into_parts(); + let RunEndArrayParts { values, ends } = array.clone().into_data().into_parts(); let new_values = values.fill_null(fill_value.clone())?; // SAFETY: modifying values only, does not affect ends Ok(Some( - unsafe { RunEndArray::new_unchecked(ends, new_values, array.offset(), array.len()) } + unsafe { RunEndData::new_unchecked(ends, new_values, array.offset(), array.len()) } .into_array(), )) } diff --git a/encodings/runend/src/compute/filter.rs b/encodings/runend/src/compute/filter.rs index cf6f6043de9..3ddd81e15da 100644 --- a/encodings/runend/src/compute/filter.rs +++ b/encodings/runend/src/compute/filter.rs @@ -21,8 +21,8 @@ use vortex_mask::Mask; use crate::RunEnd; use crate::RunEndArray; +use crate::RunEndData; use crate::compute::take::take_indices_unchecked; - const FILTER_TAKE_THRESHOLD: f64 = 0.1; impl FilterKernel for RunEnd { @@ -59,7 +59,7 @@ impl FilterKernel for RunEnd { // SAFETY: guaranteed by implementation of filter_run_end_primitive unsafe { Ok(Some( - RunEndArray::new_unchecked( + RunEndData::new_unchecked( run_ends.into_array(), values, 0, @@ -121,13 +121,12 @@ mod tests { use vortex_error::VortexResult; use vortex_mask::Mask; + use crate::RunEnd; use crate::RunEndArray; fn ree_array() -> RunEndArray { - RunEndArray::encode( - PrimitiveArray::from_iter([1, 1, 1, 4, 4, 4, 2, 2, 5, 5, 5, 5]).into_array(), - ) - .unwrap() + RunEnd::encode(PrimitiveArray::from_iter([1, 1, 1, 4, 4, 4, 2, 2, 5, 5, 5, 5]).into_array()) + .unwrap() } #[test] @@ -137,7 +136,7 @@ mod tests { assert_arrays_eq!( filtered, - RunEndArray::new( + RunEnd::new( PrimitiveArray::from_iter([1u8, 2, 3]).into_array(), PrimitiveArray::from_iter([1i32, 4, 2]).into_array() ) diff --git a/encodings/runend/src/compute/mod.rs b/encodings/runend/src/compute/mod.rs index 0e4f4ce8d1a..f1f6dd97593 100644 --- a/encodings/runend/src/compute/mod.rs +++ b/encodings/runend/src/compute/mod.rs @@ -19,28 +19,29 @@ mod tests { use vortex_array::compute::conformance::consistency::test_array_consistency; use vortex_buffer::buffer; + use crate::RunEnd; use crate::RunEndArray; #[rstest] // Simple run-end arrays - #[case::runend_i32(RunEndArray::encode( + #[case::runend_i32(RunEnd::encode( buffer![1i32, 1, 1, 2, 2, 3, 3, 3, 3].into_array() ).unwrap())] - #[case::runend_single_run(RunEndArray::encode( + #[case::runend_single_run(RunEnd::encode( buffer![5i32, 5, 5, 5, 5].into_array() ).unwrap())] - #[case::runend_alternating(RunEndArray::encode( + #[case::runend_alternating(RunEnd::encode( buffer![1i32, 2, 1, 2, 1, 2].into_array() ).unwrap())] // Different types - #[case::runend_u64(RunEndArray::encode( + #[case::runend_u64(RunEnd::encode( buffer![100u64, 100, 200, 200, 200].into_array() ).unwrap())] // Edge cases - #[case::runend_single(RunEndArray::encode( + #[case::runend_single(RunEnd::encode( buffer![42i32].into_array() ).unwrap())] - #[case::runend_large(RunEndArray::encode( + #[case::runend_large(RunEnd::encode( PrimitiveArray::from_iter((0..1000).map(|i| i / 10)).into_array() ).unwrap())] diff --git a/encodings/runend/src/compute/take.rs b/encodings/runend/src/compute/take.rs index e8ad6dfdf3c..d3d4bc77ff2 100644 --- a/encodings/runend/src/compute/take.rs +++ b/encodings/runend/src/compute/take.rs @@ -15,7 +15,6 @@ use vortex_array::search_sorted::SearchResult; use vortex_array::search_sorted::SearchSorted; use vortex_array::search_sorted::SearchSortedSide; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::Buffer; use vortex_error::VortexResult; use vortex_error::vortex_bail; @@ -102,10 +101,11 @@ mod test { use vortex_array::compute::conformance::take::test_take_conformance; use vortex_buffer::buffer; + use crate::RunEnd; use crate::RunEndArray; fn ree_array() -> RunEndArray { - RunEndArray::encode(buffer![1, 1, 1, 4, 4, 4, 2, 2, 5, 5, 5, 5].into_array()).unwrap() + RunEnd::encode(buffer![1, 1, 1, 4, 4, 4, 2, 2, 5, 5, 5, 5].into_array()).unwrap() } #[test] @@ -153,10 +153,10 @@ mod test { #[rstest] #[case(ree_array())] - #[case(RunEndArray::encode( + #[case(RunEnd::encode( buffer![1u8, 1, 2, 2, 2, 3, 3, 3, 3, 4].into_array(), ).unwrap())] - #[case(RunEndArray::encode( + #[case(RunEnd::encode( PrimitiveArray::from_option_iter([ Some(10), Some(10), @@ -168,9 +168,9 @@ mod test { ]) .into_array(), ).unwrap())] - #[case(RunEndArray::encode(buffer![42i32, 42, 42, 42, 42].into_array()) + #[case(RunEnd::encode(buffer![42i32, 42, 42, 42, 42].into_array()) .unwrap())] - #[case(RunEndArray::encode( + #[case(RunEnd::encode( buffer![1i32, 2, 3, 4, 5, 6, 7, 8, 9, 10].into_array(), ).unwrap())] #[case({ @@ -180,7 +180,7 @@ mod test { values.push(i); } } - RunEndArray::encode(PrimitiveArray::from_iter(values).into_array()).unwrap() + RunEnd::encode(PrimitiveArray::from_iter(values).into_array()).unwrap() })] fn test_take_runend_conformance(#[case] array: RunEndArray) { test_take_conformance(&array.into_array()); @@ -189,7 +189,7 @@ mod test { #[rstest] #[case(ree_array().slice(3..6).unwrap())] #[case({ - let array = RunEndArray::encode( + let array = RunEnd::encode( buffer![1i32, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3].into_array(), ) .unwrap(); diff --git a/encodings/runend/src/compute/take_from.rs b/encodings/runend/src/compute/take_from.rs index 12cb415bd12..d003dfc6463 100644 --- a/encodings/runend/src/compute/take_from.rs +++ b/encodings/runend/src/compute/take_from.rs @@ -38,7 +38,7 @@ impl ExecuteParentKernel for RunEndTakeFrom { // Create a new run-end array containing values as values, instead of indices as values. // SAFETY: we are copying ends from an existing valid RunEndArray let ree_array = unsafe { - RunEndArray::new_unchecked( + RunEnd::new_unchecked( array.ends().clone(), dict.values().take(array.values().clone())?, array.offset(), @@ -63,6 +63,7 @@ mod tests { use vortex_error::VortexResult; use vortex_session::VortexSession; + use crate::RunEnd; use crate::RunEndArray; use crate::compute::take_from::RunEndTakeFrom; @@ -73,7 +74,7 @@ mod tests { /// Codes: `[0, 0, 0, 1, 1, 0, 0]` /// RunEnd encoded codes: ends=`[3, 5, 7]`, values=`[0, 1, 0]` fn make_dict_with_runend_codes() -> (RunEndArray, DictArray) { - let codes = RunEndArray::encode(buffer![0u32, 0, 0, 1, 1, 0, 0].into_array()).unwrap(); + let codes = RunEnd::encode(buffer![0u32, 0, 0, 1, 1, 0, 0].into_array()).unwrap(); let values = buffer![2i32, 3].into_array(); let dict = DictArray::try_new(codes.clone().into_array(), values).unwrap(); (codes, dict) @@ -98,7 +99,7 @@ mod tests { let (codes, dict) = make_dict_with_runend_codes(); // Slice codes to positions 2..5 → logical codes [0, 1, 1] → values [2, 3, 3] let sliced_codes = unsafe { - RunEndArray::new_unchecked( + RunEnd::new_unchecked( codes.ends().clone(), codes.values().clone(), 2, // offset @@ -121,7 +122,7 @@ mod tests { let (codes, dict) = make_dict_with_runend_codes(); // Slice codes to positions 3..7 → logical codes [1, 1, 0, 0] → values [3, 3, 2, 2] let sliced_codes = unsafe { - RunEndArray::new_unchecked( + RunEnd::new_unchecked( codes.ends().clone(), codes.values().clone(), 3, // offset at exact run boundary @@ -144,7 +145,7 @@ mod tests { let (codes, dict) = make_dict_with_runend_codes(); // Slice to single element at position 4 → code=1 → value=3 let sliced_codes = unsafe { - RunEndArray::new_unchecked( + RunEnd::new_unchecked( codes.ends().slice(1..3)?, codes.values().slice(1..3)?, 4, // offset diff --git a/encodings/runend/src/kernel.rs b/encodings/runend/src/kernel.rs index 42a51da7070..d8f6fdd214b 100644 --- a/encodings/runend/src/kernel.rs +++ b/encodings/runend/src/kernel.rs @@ -18,6 +18,7 @@ use vortex_error::VortexResult; use crate::RunEnd; use crate::RunEndArray; +use crate::RunEndData; use crate::compute::take_from::RunEndTakeFrom; pub(super) const PARENT_KERNELS: ParentKernelSet = ParentKernelSet::new(&[ @@ -63,7 +64,7 @@ fn slice(array: &RunEndArray, range: Range) -> VortexResult { // SAFETY: we maintain the ends invariant in our slice implementation Ok(unsafe { - RunEndArray::new_unchecked( + RunEndData::new_unchecked( array.ends().slice(slice_begin..slice_end)?, array.values().slice(slice_begin..slice_end)?, range.start + array.offset(), diff --git a/encodings/runend/src/ops.rs b/encodings/runend/src/ops.rs index 098f4b35051..e2a14ce9962 100644 --- a/encodings/runend/src/ops.rs +++ b/encodings/runend/src/ops.rs @@ -8,15 +8,15 @@ use vortex_array::scalar::Scalar; use vortex_array::search_sorted::SearchResult; use vortex_array::search_sorted::SearchSorted; use vortex_array::search_sorted::SearchSortedSide; +use vortex_array::vtable::Array; use vortex_array::vtable::OperationsVTable; use vortex_error::VortexResult; use crate::RunEnd; -use crate::RunEndArray; impl OperationsVTable for RunEnd { fn scalar_at( - array: &RunEndArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -59,11 +59,11 @@ mod tests { use vortex_array::dtype::PType; use vortex_buffer::buffer; - use crate::RunEndArray; + use crate::RunEnd; #[test] fn slice_array() { - let arr = RunEndArray::try_new( + let arr = RunEnd::try_new( buffer![2u32, 5, 10].into_array(), buffer![1i32, 2, 3].into_array(), ) @@ -82,7 +82,7 @@ mod tests { #[test] fn double_slice() { - let arr = RunEndArray::try_new( + let arr = RunEnd::try_new( buffer![2u32, 5, 10].into_array(), buffer![1i32, 2, 3].into_array(), ) @@ -99,7 +99,7 @@ mod tests { #[test] fn slice_end_inclusive() { - let arr = RunEndArray::try_new( + let arr = RunEnd::try_new( buffer![2u32, 5, 10].into_array(), buffer![1i32, 2, 3].into_array(), ) @@ -118,7 +118,7 @@ mod tests { #[test] fn slice_at_end() { - let re_array = RunEndArray::try_new( + let re_array = RunEnd::try_new( buffer![7_u64, 10].into_array(), buffer![2_u64, 3].into_array(), ) @@ -132,7 +132,7 @@ mod tests { #[test] fn slice_single_end() { - let re_array = RunEndArray::try_new( + let re_array = RunEnd::try_new( buffer![7_u64, 10].into_array(), buffer![2_u64, 3].into_array(), ) @@ -148,7 +148,7 @@ mod tests { #[test] fn ree_scalar_at_end() { - let scalar = RunEndArray::encode(buffer![1, 1, 1, 4, 4, 4, 2, 2, 5, 5, 5, 5].into_array()) + let scalar = RunEnd::encode(buffer![1, 1, 1, 4, 4, 4, 2, 2, 5, 5, 5, 5].into_array()) .unwrap() .scalar_at(11) .unwrap(); @@ -160,7 +160,7 @@ mod tests { fn slice_along_run_boundaries() { // Create a runend array with runs: [1, 1, 1] [4, 4, 4] [2, 2] [5, 5, 5, 5] // Run ends at indices: 3, 6, 8, 12 - let arr = RunEndArray::try_new( + let arr = RunEnd::try_new( buffer![3u32, 6, 8, 12].into_array(), buffer![1i32, 4, 2, 5].into_array(), ) diff --git a/encodings/runend/src/rules.rs b/encodings/runend/src/rules.rs index ead3cc5018e..7ef30e573dc 100644 --- a/encodings/runend/src/rules.rs +++ b/encodings/runend/src/rules.rs @@ -16,6 +16,7 @@ use vortex_error::VortexResult; use crate::RunEnd; use crate::RunEndArray; +use crate::RunEndData; pub(super) const RULES: ParentRuleSet = ParentRuleSet::new(&[ // CastReduceAdaptor must come before RunEndScalarFnRule so that cast operations are executed @@ -79,7 +80,7 @@ impl ArrayParentReduceRule for RunEndScalarFnRule { Ok(Some( unsafe { - RunEndArray::new_unchecked( + RunEndData::new_unchecked( run_end.ends().clone(), new_values, run_end.offset(), diff --git a/encodings/sequence/public-api.lock b/encodings/sequence/public-api.lock index 2568daccc35..88802653758 100644 --- a/encodings/sequence/public-api.lock +++ b/encodings/sequence/public-api.lock @@ -6,6 +6,10 @@ impl vortex_sequence::Sequence pub const vortex_sequence::Sequence::ID: vortex_array::vtable::dyn_::ArrayId +pub fn vortex_sequence::Sequence::try_new(base: vortex_array::scalar::typed_view::primitive::pvalue::PValue, multiplier: vortex_array::scalar::typed_view::primitive::pvalue::PValue, ptype: vortex_array::dtype::ptype::PType, nullability: vortex_array::dtype::nullability::Nullability, length: usize) -> vortex_error::VortexResult + +pub fn vortex_sequence::Sequence::try_new_typed>(base: T, multiplier: T, nullability: vortex_array::dtype::nullability::Nullability, length: usize) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_sequence::Sequence pub fn vortex_sequence::Sequence::clone(&self) -> vortex_sequence::Sequence @@ -24,7 +28,7 @@ pub fn vortex_sequence::Sequence::filter(array: &vortex_sequence::SequenceArray, impl vortex_array::arrays::slice::SliceReduce for vortex_sequence::Sequence -pub fn vortex_sequence::Sequence::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_sequence::Sequence::slice(array: &vortex_array::vtable::typed::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::binary::compare::CompareKernel for vortex_sequence::Sequence @@ -36,11 +40,11 @@ pub fn vortex_sequence::Sequence::cast(array: &vortex_sequence::SequenceArray, d impl vortex_array::scalar_fn::fns::list_contains::kernel::ListContainsElementReduce for vortex_sequence::Sequence -pub fn vortex_sequence::Sequence::list_contains(list: &vortex_array::array::ArrayRef, element: &Self::Array) -> vortex_error::VortexResult> +pub fn vortex_sequence::Sequence::list_contains(list: &vortex_array::array::ArrayRef, element: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult> impl vortex_array::vtable::VTable for vortex_sequence::Sequence -pub type vortex_sequence::Sequence::Array = vortex_sequence::SequenceArray +pub type vortex_sequence::Sequence::ArrayData = vortex_sequence::SequenceData pub type vortex_sequence::Sequence::Metadata = vortex_sequence::array::SequenceMetadata @@ -48,23 +52,23 @@ pub type vortex_sequence::Sequence::OperationsVTable = vortex_sequence::Sequence pub type vortex_sequence::Sequence::ValidityVTable = vortex_sequence::Sequence -pub fn vortex_sequence::Sequence::array_eq(array: &vortex_sequence::SequenceArray, other: &vortex_sequence::SequenceArray, _precision: vortex_array::hash::Precision) -> bool +pub fn vortex_sequence::Sequence::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, _precision: vortex_array::hash::Precision) -> bool -pub fn vortex_sequence::Sequence::array_hash(array: &vortex_sequence::SequenceArray, state: &mut H, _precision: vortex_array::hash::Precision) +pub fn vortex_sequence::Sequence::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, _precision: vortex_array::hash::Precision) -pub fn vortex_sequence::Sequence::buffer(_array: &vortex_sequence::SequenceArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_sequence::Sequence::buffer(_array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_sequence::Sequence::buffer_name(_array: &vortex_sequence::SequenceArray, idx: usize) -> core::option::Option +pub fn vortex_sequence::Sequence::buffer_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> core::option::Option -pub fn vortex_sequence::Sequence::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_sequence::Sequence::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_sequence::Sequence::child(_array: &vortex_sequence::SequenceArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_sequence::Sequence::child(_array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_sequence::Sequence::child_name(_array: &vortex_sequence::SequenceArray, idx: usize) -> alloc::string::String +pub fn vortex_sequence::Sequence::child_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_sequence::Sequence::deserialize(bytes: &[u8], dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_sequence::Sequence::dtype(array: &vortex_sequence::SequenceArray) -> &vortex_array::dtype::DType +pub fn vortex_sequence::Sequence::dtype(array: &vortex_sequence::SequenceData) -> &vortex_array::dtype::DType pub fn vortex_sequence::Sequence::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -72,92 +76,86 @@ pub fn vortex_sequence::Sequence::execute_parent(array: &vortex_array::vtable::t pub fn vortex_sequence::Sequence::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_sequence::Sequence::len(array: &vortex_sequence::SequenceArray) -> usize +pub fn vortex_sequence::Sequence::len(array: &vortex_sequence::SequenceData) -> usize -pub fn vortex_sequence::Sequence::metadata(array: &vortex_sequence::SequenceArray) -> vortex_error::VortexResult +pub fn vortex_sequence::Sequence::metadata(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_sequence::Sequence::nbuffers(_array: &vortex_sequence::SequenceArray) -> usize +pub fn vortex_sequence::Sequence::nbuffers(_array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_sequence::Sequence::nchildren(_array: &vortex_sequence::SequenceArray) -> usize +pub fn vortex_sequence::Sequence::nchildren(_array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_sequence::Sequence::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_sequence::Sequence::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_sequence::Sequence::stats(array: &vortex_sequence::SequenceArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_sequence::Sequence::stats(array: &vortex_sequence::SequenceData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_sequence::Sequence::vtable(_array: &Self::Array) -> &Self +pub fn vortex_sequence::Sequence::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_sequence::Sequence::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_sequence::Sequence::with_children(_array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_sequence::Sequence -pub fn vortex_sequence::Sequence::scalar_at(array: &vortex_sequence::SequenceArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_sequence::Sequence::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::validity::ValidityVTable for vortex_sequence::Sequence -pub fn vortex_sequence::Sequence::validity(_array: &vortex_sequence::SequenceArray) -> vortex_error::VortexResult - -pub struct vortex_sequence::SequenceArray - -impl vortex_sequence::SequenceArray - -pub fn vortex_sequence::SequenceArray::base(&self) -> vortex_array::scalar::typed_view::primitive::pvalue::PValue +pub fn vortex_sequence::Sequence::validity(_array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_sequence::SequenceArray::into_parts(self) -> vortex_sequence::SequenceArrayParts - -pub fn vortex_sequence::SequenceArray::last(&self) -> vortex_array::scalar::typed_view::primitive::pvalue::PValue +pub struct vortex_sequence::SequenceArrayParts -pub fn vortex_sequence::SequenceArray::multiplier(&self) -> vortex_array::scalar::typed_view::primitive::pvalue::PValue +pub vortex_sequence::SequenceArrayParts::base: vortex_array::scalar::typed_view::primitive::pvalue::PValue -pub fn vortex_sequence::SequenceArray::ptype(&self) -> vortex_array::dtype::ptype::PType +pub vortex_sequence::SequenceArrayParts::len: usize -pub fn vortex_sequence::SequenceArray::try_new(base: vortex_array::scalar::typed_view::primitive::pvalue::PValue, multiplier: vortex_array::scalar::typed_view::primitive::pvalue::PValue, ptype: vortex_array::dtype::ptype::PType, nullability: vortex_array::dtype::nullability::Nullability, length: usize) -> vortex_error::VortexResult +pub vortex_sequence::SequenceArrayParts::multiplier: vortex_array::scalar::typed_view::primitive::pvalue::PValue -pub fn vortex_sequence::SequenceArray::try_new_typed>(base: T, multiplier: T, nullability: vortex_array::dtype::nullability::Nullability, length: usize) -> vortex_error::VortexResult +pub vortex_sequence::SequenceArrayParts::nullability: vortex_array::dtype::nullability::Nullability -impl vortex_sequence::SequenceArray +pub vortex_sequence::SequenceArrayParts::ptype: vortex_array::dtype::ptype::PType -pub fn vortex_sequence::SequenceArray::to_array(&self) -> vortex_array::array::ArrayRef +pub struct vortex_sequence::SequenceData -impl core::clone::Clone for vortex_sequence::SequenceArray +impl vortex_sequence::SequenceData -pub fn vortex_sequence::SequenceArray::clone(&self) -> vortex_sequence::SequenceArray +pub fn vortex_sequence::SequenceData::base(&self) -> vortex_array::scalar::typed_view::primitive::pvalue::PValue -impl core::convert::AsRef for vortex_sequence::SequenceArray +pub fn vortex_sequence::SequenceData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_sequence::SequenceArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +pub fn vortex_sequence::SequenceData::into_parts(self) -> vortex_sequence::SequenceArrayParts -impl core::convert::From for vortex_array::array::ArrayRef +pub fn vortex_sequence::SequenceData::is_empty(&self) -> bool -pub fn vortex_array::array::ArrayRef::from(value: vortex_sequence::SequenceArray) -> vortex_array::array::ArrayRef +pub fn vortex_sequence::SequenceData::last(&self) -> vortex_array::scalar::typed_view::primitive::pvalue::PValue -impl core::fmt::Debug for vortex_sequence::SequenceArray +pub fn vortex_sequence::SequenceData::len(&self) -> usize -pub fn vortex_sequence::SequenceArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_sequence::SequenceData::multiplier(&self) -> vortex_array::scalar::typed_view::primitive::pvalue::PValue -impl core::ops::deref::Deref for vortex_sequence::SequenceArray +pub fn vortex_sequence::SequenceData::ptype(&self) -> vortex_array::dtype::ptype::PType -pub type vortex_sequence::SequenceArray::Target = dyn vortex_array::array::DynArray +pub fn vortex_sequence::SequenceData::try_new(base: vortex_array::scalar::typed_view::primitive::pvalue::PValue, multiplier: vortex_array::scalar::typed_view::primitive::pvalue::PValue, ptype: vortex_array::dtype::ptype::PType, nullability: vortex_array::dtype::nullability::Nullability, length: usize) -> vortex_error::VortexResult -pub fn vortex_sequence::SequenceArray::deref(&self) -> &Self::Target +pub fn vortex_sequence::SequenceData::try_new_typed>(base: T, multiplier: T, nullability: vortex_array::dtype::nullability::Nullability, length: usize) -> vortex_error::VortexResult -impl vortex_array::array::IntoArray for vortex_sequence::SequenceArray +impl core::clone::Clone for vortex_sequence::SequenceData -pub fn vortex_sequence::SequenceArray::into_array(self) -> vortex_array::array::ArrayRef +pub fn vortex_sequence::SequenceData::clone(&self) -> vortex_sequence::SequenceData -pub struct vortex_sequence::SequenceArrayParts +impl core::convert::From for vortex_array::array::ArrayRef -pub vortex_sequence::SequenceArrayParts::base: vortex_array::scalar::typed_view::primitive::pvalue::PValue +pub fn vortex_array::array::ArrayRef::from(value: vortex_sequence::SequenceData) -> vortex_array::array::ArrayRef -pub vortex_sequence::SequenceArrayParts::len: usize +impl core::fmt::Debug for vortex_sequence::SequenceData -pub vortex_sequence::SequenceArrayParts::multiplier: vortex_array::scalar::typed_view::primitive::pvalue::PValue +pub fn vortex_sequence::SequenceData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub vortex_sequence::SequenceArrayParts::nullability: vortex_array::dtype::nullability::Nullability +impl vortex_array::array::IntoArray for vortex_sequence::SequenceData -pub vortex_sequence::SequenceArrayParts::ptype: vortex_array::dtype::ptype::PType +pub fn vortex_sequence::SequenceData::into_array(self) -> vortex_array::array::ArrayRef pub fn vortex_sequence::initialize(session: &mut vortex_session::VortexSession) -pub fn vortex_sequence::sequence_encode(primitive_array: &vortex_array::arrays::primitive::array::PrimitiveArray) -> vortex_error::VortexResult> +pub fn vortex_sequence::sequence_encode(primitive_array: &vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_error::VortexResult> + +pub type vortex_sequence::SequenceArray = vortex_array::vtable::typed::Array diff --git a/encodings/sequence/src/array.rs b/encodings/sequence/src/array.rs index 1f638eae90b..7f7cd953a15 100644 --- a/encodings/sequence/src/array.rs +++ b/encodings/sequence/src/array.rs @@ -29,7 +29,6 @@ use vortex_array::scalar::ScalarValue; use vortex_array::serde::ArrayChildren; use vortex_array::stats::ArrayStats; use vortex_array::stats::StatsSet; -use vortex_array::stats::StatsSetRef; use vortex_array::validity::Validity; use vortex_array::vtable; use vortex_array::vtable::Array; @@ -49,7 +48,7 @@ use crate::compress::sequence_decompress; use crate::kernel::PARENT_KERNELS; use crate::rules::RULES; -vtable!(Sequence); +vtable!(Sequence, Sequence, SequenceData); #[derive(Debug, Clone, Copy)] pub struct SequenceMetadata { @@ -76,7 +75,7 @@ pub struct SequenceArrayParts { #[derive(Clone, Debug)] /// An array representing the equation `A[i] = base + i * multiplier`. -pub struct SequenceArray { +pub struct SequenceData { base: PValue, multiplier: PValue, dtype: DType, @@ -84,7 +83,7 @@ pub struct SequenceArray { stats_set: ArrayStats, } -impl SequenceArray { +impl SequenceData { pub fn try_new_typed>( base: T, multiplier: T, @@ -173,6 +172,24 @@ impl SequenceArray { } } + /// Returns the length of the array. + #[inline] + pub fn len(&self) -> usize { + self.len + } + + /// Returns whether the array is empty. + #[inline] + pub fn is_empty(&self) -> bool { + self.len == 0 + } + + /// Returns the logical data type of the array. + #[inline] + pub fn dtype(&self) -> &DType { + &self.dtype + } + pub fn ptype(&self) -> PType { self.dtype.as_ptype() } @@ -238,13 +255,13 @@ impl SequenceArray { } impl VTable for Sequence { - type Array = SequenceArray; + type ArrayData = SequenceData; type Metadata = SequenceMetadata; type OperationsVTable = Self; type ValidityVTable = Self; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Sequence } @@ -252,61 +269,57 @@ impl VTable for Sequence { Self::ID } - fn len(array: &SequenceArray) -> usize { + fn len(array: &SequenceData) -> usize { array.len } - fn dtype(array: &SequenceArray) -> &DType { + fn dtype(array: &SequenceData) -> &DType { &array.dtype } - fn stats(array: &SequenceArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &SequenceData) -> &ArrayStats { + &array.stats_set } - fn array_hash( - array: &SequenceArray, - state: &mut H, - _precision: Precision, - ) { + fn array_hash(array: &Array, state: &mut H, _precision: Precision) { array.base.hash(state); array.multiplier.hash(state); array.dtype.hash(state); array.len.hash(state); } - fn array_eq(array: &SequenceArray, other: &SequenceArray, _precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, _precision: Precision) -> bool { array.base == other.base && array.multiplier == other.multiplier && array.dtype == other.dtype && array.len == other.len } - fn nbuffers(_array: &SequenceArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &SequenceArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("SequenceArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &SequenceArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { vortex_panic!("SequenceArray buffer_name index {idx} out of bounds") } - fn nchildren(_array: &SequenceArray) -> usize { + fn nchildren(_array: &Array) -> usize { 0 } - fn child(_array: &SequenceArray, idx: usize) -> ArrayRef { + fn child(_array: &Array, idx: usize) -> ArrayRef { vortex_panic!("SequenceArray child index {idx} out of bounds") } - fn child_name(_array: &SequenceArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { vortex_panic!("SequenceArray child_name index {idx} out of bounds") } - fn metadata(array: &SequenceArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(SequenceMetadata { base: array.base(), multiplier: array.multiplier(), @@ -368,8 +381,8 @@ impl VTable for Sequence { metadata: &Self::Metadata, _buffers: &[BufferHandle], _children: &dyn ArrayChildren, - ) -> VortexResult { - SequenceArray::try_new( + ) -> VortexResult { + SequenceData::try_new( metadata.base, metadata.multiplier, dtype.as_ptype(), @@ -378,7 +391,7 @@ impl VTable for Sequence { ) } - fn with_children(_array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(_array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.is_empty(), "SequenceArray expects 0 children, got {}", @@ -411,7 +424,7 @@ impl VTable for Sequence { impl OperationsVTable for Sequence { fn scalar_at( - array: &SequenceArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -423,7 +436,7 @@ impl OperationsVTable for Sequence { } impl ValidityVTable for Sequence { - fn validity(_array: &SequenceArray) -> VortexResult { + fn validity(_array: &Array) -> VortexResult { Ok(Validity::AllValid) } } @@ -433,6 +446,38 @@ pub struct Sequence; impl Sequence { pub const ID: ArrayId = ArrayId::new_ref("vortex.sequence"); + + /// Construct a new [`SequenceArray`] from its components. + pub fn try_new( + base: PValue, + multiplier: PValue, + ptype: PType, + nullability: Nullability, + length: usize, + ) -> VortexResult { + Array::try_from_data(SequenceData::try_new( + base, + multiplier, + ptype, + nullability, + length, + )?) + } + + /// Construct a new typed [`SequenceArray`] from base/multiplier values. + pub fn try_new_typed>( + base: T, + multiplier: T, + nullability: Nullability, + length: usize, + ) -> VortexResult { + Array::try_from_data(SequenceData::try_new_typed( + base, + multiplier, + nullability, + length, + )?) + } } #[cfg(test)] @@ -447,11 +492,11 @@ mod tests { use vortex_array::scalar::ScalarValue; use vortex_error::VortexResult; - use crate::array::SequenceArray; + use crate::Sequence; #[test] fn test_sequence_canonical() { - let arr = SequenceArray::try_new_typed(2i64, 3, Nullability::NonNullable, 4).unwrap(); + let arr = Sequence::try_new_typed(2i64, 3, Nullability::NonNullable, 4).unwrap(); let canon = PrimitiveArray::from_iter((0..4).map(|i| 2i64 + i * 3)); @@ -460,7 +505,7 @@ mod tests { #[test] fn test_sequence_slice_canonical() { - let arr = SequenceArray::try_new_typed(2i64, 3, Nullability::NonNullable, 4) + let arr = Sequence::try_new_typed(2i64, 3, Nullability::NonNullable, 4) .unwrap() .slice(2..3) .unwrap(); @@ -472,7 +517,7 @@ mod tests { #[test] fn test_sequence_scalar_at() { - let scalar = SequenceArray::try_new_typed(2i64, 3, Nullability::NonNullable, 4) + let scalar = Sequence::try_new_typed(2i64, 3, Nullability::NonNullable, 4) .unwrap() .scalar_at(2) .unwrap(); @@ -485,19 +530,19 @@ mod tests { #[test] fn test_sequence_min_max() { - assert!(SequenceArray::try_new_typed(-127i8, -1i8, Nullability::NonNullable, 2).is_ok()); - assert!(SequenceArray::try_new_typed(126i8, -1i8, Nullability::NonNullable, 2).is_ok()); + assert!(Sequence::try_new_typed(-127i8, -1i8, Nullability::NonNullable, 2).is_ok()); + assert!(Sequence::try_new_typed(126i8, -1i8, Nullability::NonNullable, 2).is_ok()); } #[test] fn test_sequence_too_big() { - assert!(SequenceArray::try_new_typed(127i8, 1i8, Nullability::NonNullable, 2).is_err()); - assert!(SequenceArray::try_new_typed(-128i8, -1i8, Nullability::NonNullable, 2).is_err()); + assert!(Sequence::try_new_typed(127i8, 1i8, Nullability::NonNullable, 2).is_err()); + assert!(Sequence::try_new_typed(-128i8, -1i8, Nullability::NonNullable, 2).is_err()); } #[test] fn positive_multiplier_is_strict_sorted() -> VortexResult<()> { - let arr = SequenceArray::try_new_typed(0i64, 3, Nullability::NonNullable, 4)?; + let arr = Sequence::try_new_typed(0i64, 3, Nullability::NonNullable, 4)?; let is_sorted = arr .statistics() @@ -513,7 +558,7 @@ mod tests { #[test] fn zero_multiplier_is_sorted_not_strict() -> VortexResult<()> { - let arr = SequenceArray::try_new_typed(5i64, 0, Nullability::NonNullable, 4)?; + let arr = Sequence::try_new_typed(5i64, 0, Nullability::NonNullable, 4)?; let is_sorted = arr .statistics() @@ -529,7 +574,7 @@ mod tests { #[test] fn negative_multiplier_not_sorted() -> VortexResult<()> { - let arr = SequenceArray::try_new_typed(10i64, -1, Nullability::NonNullable, 4)?; + let arr = Sequence::try_new_typed(10i64, -1, Nullability::NonNullable, 4)?; let is_sorted = arr .statistics() @@ -548,7 +593,7 @@ mod tests { #[test] fn test_large_multiplier_sorted() -> VortexResult<()> { let large_multiplier = (i64::MAX as u64) + 1; - let arr = SequenceArray::try_new_typed(0, large_multiplier, Nullability::NonNullable, 2)?; + let arr = Sequence::try_new_typed(0, large_multiplier, Nullability::NonNullable, 2)?; let is_sorted = arr .statistics() diff --git a/encodings/sequence/src/compress.rs b/encodings/sequence/src/compress.rs index 09ffa47bc55..b073ace8dc2 100644 --- a/encodings/sequence/src/compress.rs +++ b/encodings/sequence/src/compress.rs @@ -19,8 +19,8 @@ use vortex_buffer::trusted_len::TrustedLen; use vortex_error::VortexResult; use crate::SequenceArray; - /// An iterator that yields `base, base + step, base + 2*step, ...` via repeated addition. +use crate::SequenceData; struct SequenceIter { acc: T, step: T, @@ -112,7 +112,7 @@ fn encode_primitive_array + CheckedAdd + CheckedSu ) -> VortexResult> { if slice.len() == 1 { // The multiplier here can be any value, zero is chosen - return SequenceArray::try_new_typed(slice[0], P::zero(), nullability, 1) + return SequenceData::try_new_typed(slice[0], P::zero(), nullability, 1) .map(|a| Some(a.into_array())); } let base = slice[0]; @@ -124,7 +124,7 @@ fn encode_primitive_array + CheckedAdd + CheckedSu return Ok(None); } - if SequenceArray::try_last(base.into(), multiplier.into(), P::PTYPE, slice.len()).is_err() { + if SequenceData::try_last(base.into(), multiplier.into(), P::PTYPE, slice.len()).is_err() { // If the last value is out of range, we cannot encode return Ok(None); } @@ -133,7 +133,7 @@ fn encode_primitive_array + CheckedAdd + CheckedSu .windows(2) .all(|w| Some(w[1]) == w[0].checked_add(&multiplier)) .then_some( - SequenceArray::try_new_typed(base, multiplier, nullability, slice.len()) + SequenceData::try_new_typed(base, multiplier, nullability, slice.len()) .map(|a| a.into_array()), ) .transpose() diff --git a/encodings/sequence/src/compute/cast.rs b/encodings/sequence/src/compute/cast.rs index 85a42b74c81..574f8b85315 100644 --- a/encodings/sequence/src/compute/cast.rs +++ b/encodings/sequence/src/compute/cast.rs @@ -13,7 +13,7 @@ use vortex_error::vortex_err; use crate::Sequence; use crate::SequenceArray; - +use crate::SequenceData; impl CastReduce for Sequence { fn cast(array: &SequenceArray, dtype: &DType) -> VortexResult> { // SequenceArray represents arithmetic sequences (base + i * multiplier) which @@ -32,7 +32,7 @@ impl CastReduce for Sequence { // For SequenceArray, we can just create a new one with the same parameters // but different nullability return Ok(Some( - SequenceArray::try_new( + SequenceData::try_new( array.base(), array.multiplier(), *target_ptype, @@ -71,7 +71,7 @@ impl CastReduce for Sequence { .ok_or_else(|| vortex_err!("Cast resulted in null multiplier value"))?; return Ok(Some( - SequenceArray::try_new( + SequenceData::try_new( new_base, new_multiplier, *target_ptype, @@ -99,12 +99,12 @@ mod tests { use vortex_array::dtype::Nullability; use vortex_array::dtype::PType; + use crate::Sequence; use crate::SequenceArray; #[test] fn test_cast_sequence_nullability() { - let sequence = - SequenceArray::try_new_typed(0u32, 1u32, Nullability::NonNullable, 4).unwrap(); + let sequence = Sequence::try_new_typed(0u32, 1u32, Nullability::NonNullable, 4).unwrap(); // Cast to nullable let casted = sequence @@ -119,8 +119,7 @@ mod tests { #[test] fn test_cast_sequence_u32_to_i64() { - let sequence = - SequenceArray::try_new_typed(100u32, 10u32, Nullability::NonNullable, 4).unwrap(); + let sequence = Sequence::try_new_typed(100u32, 10u32, Nullability::NonNullable, 4).unwrap(); let casted = sequence .into_array() @@ -139,8 +138,7 @@ mod tests { #[test] fn test_cast_sequence_i16_to_i32_nullable() { // Test ptype change AND nullability change in one cast - let sequence = - SequenceArray::try_new_typed(5i16, 3i16, Nullability::NonNullable, 3).unwrap(); + let sequence = Sequence::try_new_typed(5i16, 3i16, Nullability::NonNullable, 3).unwrap(); let casted = sequence .into_array() @@ -161,8 +159,7 @@ mod tests { #[test] fn test_cast_sequence_to_float_delegates_to_canonical() { - let sequence = - SequenceArray::try_new_typed(0i32, 1i32, Nullability::NonNullable, 5).unwrap(); + let sequence = Sequence::try_new_typed(0i32, 1i32, Nullability::NonNullable, 5).unwrap(); // Cast to float should delegate to canonical (SequenceArray doesn't support float) let casted = sequence @@ -184,15 +181,15 @@ mod tests { } #[rstest] - #[case::i32(SequenceArray::try_new_typed(0i32, 1i32, Nullability::NonNullable, 5).unwrap())] - #[case::u64(SequenceArray::try_new_typed(1000u64, 100u64, Nullability::NonNullable, 4).unwrap())] + #[case::i32(Sequence::try_new_typed(0i32, 1i32, Nullability::NonNullable, 5).unwrap())] + #[case::u64(Sequence::try_new_typed(1000u64, 100u64, Nullability::NonNullable, 4).unwrap())] // TODO(DK): SequenceArray does not actually conform. You cannot cast this array to u8 even // though all its values are representable therein. // - // #[case::negative_step(SequenceArray::try_new_typed(100i32, -10i32, Nullability::NonNullable, + // #[case::negative_step(Sequence::try_new_typed(100i32, -10i32, Nullability::NonNullable, // 5).unwrap())] - #[case::single(SequenceArray::try_new_typed(42i64, 0i64, Nullability::NonNullable, 1).unwrap())] - #[case::constant(SequenceArray::try_new_typed( + #[case::single(Sequence::try_new_typed(42i64, 0i64, Nullability::NonNullable, 1).unwrap())] + #[case::constant(Sequence::try_new_typed( 100i32, 0i32, // multiplier of 0 means constant array Nullability::NonNullable, diff --git a/encodings/sequence/src/compute/compare.rs b/encodings/sequence/src/compute/compare.rs index 18ed08daa8a..7e0e58fca9b 100644 --- a/encodings/sequence/src/compute/compare.rs +++ b/encodings/sequence/src/compute/compare.rs @@ -145,11 +145,11 @@ mod tests { use vortex_array::dtype::Nullability::Nullable; use vortex_array::scalar_fn::fns::operators::Operator; - use crate::SequenceArray; + use crate::Sequence; #[test] fn test_compare_match() { - let lhs = SequenceArray::try_new_typed(2i64, 1, NonNullable, 4).unwrap(); + let lhs = Sequence::try_new_typed(2i64, 1, NonNullable, 4).unwrap(); let rhs = ConstantArray::new(4i64, lhs.len()); let result = lhs .into_array() @@ -161,7 +161,7 @@ mod tests { #[test] fn test_compare_match_scale() { - let lhs = SequenceArray::try_new_typed(2i64, 3, Nullable, 4).unwrap(); + let lhs = Sequence::try_new_typed(2i64, 3, Nullable, 4).unwrap(); let rhs = ConstantArray::new(8i64, lhs.len()); let result = lhs .into_array() @@ -173,7 +173,7 @@ mod tests { #[test] fn test_compare_no_match() { - let lhs = SequenceArray::try_new_typed(2i64, 1, NonNullable, 4).unwrap(); + let lhs = Sequence::try_new_typed(2i64, 1, NonNullable, 4).unwrap(); let rhs = ConstantArray::new(1i64, lhs.len()); let result = lhs .into_array() diff --git a/encodings/sequence/src/compute/filter.rs b/encodings/sequence/src/compute/filter.rs index 9b49ce2bdd9..febbdf1d0c5 100644 --- a/encodings/sequence/src/compute/filter.rs +++ b/encodings/sequence/src/compute/filter.rs @@ -53,21 +53,22 @@ mod tests { use vortex_array::compute::conformance::filter::test_filter_conformance; use vortex_array::dtype::Nullability; + use crate::Sequence; use crate::SequenceArray; #[rstest] - #[case(SequenceArray::try_new_typed(0i32, 1, Nullability::NonNullable, 5).unwrap())] - #[case(SequenceArray::try_new_typed(10i32, 2, Nullability::NonNullable, 5).unwrap())] - #[case(SequenceArray::try_new_typed(100i32, -3, Nullability::NonNullable, 5).unwrap())] - #[case(SequenceArray::try_new_typed(0i32, 1, Nullability::NonNullable, 1).unwrap())] - #[case(SequenceArray::try_new_typed(0i32, 1, Nullability::NonNullable, MEDIUM_SIZE).unwrap())] - #[case(SequenceArray::try_new_typed(0i32, 1, Nullability::NonNullable, LARGE_SIZE).unwrap())] - #[case(SequenceArray::try_new_typed(0i64, 1, Nullability::NonNullable, 5).unwrap())] - #[case(SequenceArray::try_new_typed(1000i64, 50, Nullability::NonNullable, 5).unwrap())] - #[case(SequenceArray::try_new_typed(-100i64, 10, Nullability::NonNullable, MEDIUM_SIZE).unwrap())] - #[case(SequenceArray::try_new_typed(0u32, 1, Nullability::NonNullable, 5).unwrap())] - #[case(SequenceArray::try_new_typed(0u32, 5, Nullability::NonNullable, MEDIUM_SIZE).unwrap())] - #[case(SequenceArray::try_new_typed(0u64, 1, Nullability::NonNullable, LARGE_SIZE).unwrap())] + #[case(Sequence::try_new_typed(0i32, 1, Nullability::NonNullable, 5).unwrap())] + #[case(Sequence::try_new_typed(10i32, 2, Nullability::NonNullable, 5).unwrap())] + #[case(Sequence::try_new_typed(100i32, -3, Nullability::NonNullable, 5).unwrap())] + #[case(Sequence::try_new_typed(0i32, 1, Nullability::NonNullable, 1).unwrap())] + #[case(Sequence::try_new_typed(0i32, 1, Nullability::NonNullable, MEDIUM_SIZE).unwrap())] + #[case(Sequence::try_new_typed(0i32, 1, Nullability::NonNullable, LARGE_SIZE).unwrap())] + #[case(Sequence::try_new_typed(0i64, 1, Nullability::NonNullable, 5).unwrap())] + #[case(Sequence::try_new_typed(1000i64, 50, Nullability::NonNullable, 5).unwrap())] + #[case(Sequence::try_new_typed(-100i64, 10, Nullability::NonNullable, MEDIUM_SIZE).unwrap())] + #[case(Sequence::try_new_typed(0u32, 1, Nullability::NonNullable, 5).unwrap())] + #[case(Sequence::try_new_typed(0u32, 5, Nullability::NonNullable, MEDIUM_SIZE).unwrap())] + #[case(Sequence::try_new_typed(0u64, 1, Nullability::NonNullable, LARGE_SIZE).unwrap())] fn test_filter_sequence_conformance(#[case] array: SequenceArray) { test_filter_conformance(&array.into_array()); } diff --git a/encodings/sequence/src/compute/list_contains.rs b/encodings/sequence/src/compute/list_contains.rs index 6b06d55768e..21f0fd4aacc 100644 --- a/encodings/sequence/src/compute/list_contains.rs +++ b/encodings/sequence/src/compute/list_contains.rs @@ -6,6 +6,7 @@ use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::arrays::BoolArray; use vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduce; +use vortex_array::vtable::Array; use vortex_error::VortexExpect; use vortex_error::VortexResult; @@ -13,7 +14,7 @@ use crate::array::Sequence; use crate::compute::compare::find_intersection_scalar; impl ListContainsElementReduce for Sequence { - fn list_contains(list: &ArrayRef, element: &Self::Array) -> VortexResult> { + fn list_contains(list: &ArrayRef, element: &Array) -> VortexResult> { let Some(list_scalar) = list.as_constant() else { return Ok(None); }; @@ -50,7 +51,7 @@ impl ListContainsElementReduce for Sequence { mod tests { use std::sync::Arc; - use vortex_array::DynArray; + use vortex_array::IntoArray; use vortex_array::arrays::BoolArray; use vortex_array::assert_arrays_eq; use vortex_array::dtype::Nullability; @@ -60,7 +61,7 @@ mod tests { use vortex_array::expr::root; use vortex_array::scalar::Scalar; - use crate::SequenceArray; + use crate::Sequence; #[test] fn test_list_contains_seq() { @@ -74,7 +75,9 @@ mod tests { // [1, 3] in 1 // 2 // 3 - let array = SequenceArray::try_new_typed(1, 1, Nullability::NonNullable, 3).unwrap(); + let array = Sequence::try_new_typed(1, 1, Nullability::NonNullable, 3) + .unwrap() + .into_array(); let expr = list_contains(lit(list_scalar.clone()), root()); let result = array.apply(&expr).unwrap(); @@ -86,7 +89,9 @@ mod tests { // [1, 3] in 1 // 3 // 5 - let array = SequenceArray::try_new_typed(1, 2, Nullability::NonNullable, 3).unwrap(); + let array = Sequence::try_new_typed(1, 2, Nullability::NonNullable, 3) + .unwrap() + .into_array(); let expr = list_contains(lit(list_scalar), root()); let result = array.apply(&expr).unwrap(); diff --git a/encodings/sequence/src/compute/mod.rs b/encodings/sequence/src/compute/mod.rs index 2cf0ec5cc2e..9a99ff235c4 100644 --- a/encodings/sequence/src/compute/mod.rs +++ b/encodings/sequence/src/compute/mod.rs @@ -17,17 +17,18 @@ mod tests { use vortex_array::compute::conformance::consistency::test_array_consistency; use vortex_array::dtype::Nullability; + use crate::Sequence; use crate::SequenceArray; #[rstest] // Basic sequence arrays - A[i] = base + i * multiplier - #[case::sequence_i32(SequenceArray::try_new_typed( + #[case::sequence_i32(Sequence::try_new_typed( 0i32, // base 1i32, // multiplier Nullability::NonNullable, 5 // length ).unwrap())] // Results in [0, 1, 2, 3, 4] - #[case::sequence_i64_step2(SequenceArray::try_new_typed( + #[case::sequence_i64_step2(Sequence::try_new_typed( 10i64, // base 2i64, // multiplier Nullability::NonNullable, @@ -35,13 +36,13 @@ mod tests { ).unwrap())] // Results in [10, 12, 14, 16, 18] // Different types - #[case::sequence_u32(SequenceArray::try_new_typed( + #[case::sequence_u32(Sequence::try_new_typed( 100u32, // base 10u32, // multiplier Nullability::NonNullable, 5 // length ).unwrap())] // Results in [100, 110, 120, 130, 140] - #[case::sequence_i16(SequenceArray::try_new_typed( + #[case::sequence_i16(Sequence::try_new_typed( -10i16, // base 3i16, // multiplier Nullability::NonNullable, @@ -49,19 +50,19 @@ mod tests { ).unwrap())] // Results in [-10, -7, -4, -1, 2] // Edge cases - #[case::sequence_single(SequenceArray::try_new_typed( + #[case::sequence_single(Sequence::try_new_typed( 42i32, 0i32, // multiplier of 0 means constant array Nullability::NonNullable, 1 ).unwrap())] - #[case::sequence_zero_multiplier(SequenceArray::try_new_typed( + #[case::sequence_zero_multiplier(Sequence::try_new_typed( 100i32, 0i32, // All values will be 100 Nullability::NonNullable, 5 ).unwrap())] - #[case::sequence_negative_step(SequenceArray::try_new_typed( + #[case::sequence_negative_step(Sequence::try_new_typed( 100i32, -10i32, // Decreasing sequence Nullability::NonNullable, @@ -69,13 +70,13 @@ mod tests { ).unwrap())] // Results in [100, 90, 80, 70, 60] // Large arrays - #[case::sequence_large(SequenceArray::try_new_typed( + #[case::sequence_large(Sequence::try_new_typed( 0i64, 1i64, Nullability::NonNullable, 2000 ).unwrap())] // Results in [0, 1, 2, ..., 1999] - #[case::sequence_large_step(SequenceArray::try_new_typed( + #[case::sequence_large_step(Sequence::try_new_typed( 1000i32, 100i32, Nullability::NonNullable, diff --git a/encodings/sequence/src/compute/slice.rs b/encodings/sequence/src/compute/slice.rs index fe717791ea1..848f6b1a3d4 100644 --- a/encodings/sequence/src/compute/slice.rs +++ b/encodings/sequence/src/compute/slice.rs @@ -6,17 +6,18 @@ use std::ops::Range; use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::arrays::slice::SliceReduce; +use vortex_array::vtable::Array; use vortex_error::VortexResult; use crate::Sequence; -use crate::SequenceArray; +use crate::SequenceData; impl SliceReduce for Sequence { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { // SAFETY: this is a slice of an already-validated `SequenceArray`, so this is still valid. Ok(Some( unsafe { - SequenceArray::new_unchecked( + SequenceData::new_unchecked( array.index_value(range.start), array.multiplier(), array.ptype(), diff --git a/encodings/sequence/src/compute/take.rs b/encodings/sequence/src/compute/take.rs index 23b91cabc36..b79366f22c3 100644 --- a/encodings/sequence/src/compute/take.rs +++ b/encodings/sequence/src/compute/take.rs @@ -110,52 +110,53 @@ mod test { use vortex_array::arrays::PrimitiveArray; use vortex_array::dtype::Nullability; + use crate::Sequence; use crate::SequenceArray; #[rstest] - #[case::basic_sequence(SequenceArray::try_new_typed( + #[case::basic_sequence(Sequence::try_new_typed( 0i32, 1i32, Nullability::NonNullable, 10 ).unwrap())] - #[case::sequence_with_multiplier(SequenceArray::try_new_typed( + #[case::sequence_with_multiplier(Sequence::try_new_typed( 10i32, 5i32, Nullability::Nullable, 20 ).unwrap())] - #[case::sequence_i64(SequenceArray::try_new_typed( + #[case::sequence_i64(Sequence::try_new_typed( 100i64, 10i64, Nullability::NonNullable, 50 ).unwrap())] - #[case::sequence_u32(SequenceArray::try_new_typed( + #[case::sequence_u32(Sequence::try_new_typed( 0u32, 2u32, Nullability::NonNullable, 100 ).unwrap())] - #[case::sequence_negative_step(SequenceArray::try_new_typed( + #[case::sequence_negative_step(Sequence::try_new_typed( 1000i32, -10i32, Nullability::Nullable, 30 ).unwrap())] - #[case::sequence_constant(SequenceArray::try_new_typed( + #[case::sequence_constant(Sequence::try_new_typed( 42i32, 0i32, // multiplier of 0 means all values are the same Nullability::Nullable, 15 ).unwrap())] - #[case::sequence_i16(SequenceArray::try_new_typed( + #[case::sequence_i16(Sequence::try_new_typed( -100i16, 3i16, Nullability::NonNullable, 25 ).unwrap())] - #[case::sequence_large(SequenceArray::try_new_typed( + #[case::sequence_large(Sequence::try_new_typed( 0i64, 1i64, Nullability::Nullable, @@ -169,7 +170,7 @@ mod test { #[test] #[should_panic(expected = "out of bounds")] fn test_bounds_check() { - let array = SequenceArray::try_new_typed(0i32, 1i32, Nullability::NonNullable, 10).unwrap(); + let array = Sequence::try_new_typed(0i32, 1i32, Nullability::NonNullable, 10).unwrap(); let indices = PrimitiveArray::from_iter([0i32, 20]); let _array = array .take(indices.into_array()) diff --git a/encodings/sequence/src/lib.rs b/encodings/sequence/src/lib.rs index a6ff277b23d..958bbf6352f 100644 --- a/encodings/sequence/src/lib.rs +++ b/encodings/sequence/src/lib.rs @@ -14,6 +14,7 @@ pub use array::Sequence; /// This can be used for compression, fast comparisons and also for row ids. pub use array::SequenceArray; pub use array::SequenceArrayParts; +pub use array::SequenceData; pub use compress::sequence_encode; use vortex_array::aggregate_fn::AggregateFnVTable; use vortex_array::aggregate_fn::fns::is_sorted::IsSorted; diff --git a/encodings/sparse/public-api.lock b/encodings/sparse/public-api.lock index 084ae72c63e..1409d0e099b 100644 --- a/encodings/sparse/public-api.lock +++ b/encodings/sparse/public-api.lock @@ -26,6 +26,10 @@ impl vortex_sparse::Sparse pub const vortex_sparse::Sparse::ID: vortex_array::vtable::dyn_::ArrayId +pub fn vortex_sparse::Sparse::encode(array: &vortex_array::array::ArrayRef, fill_value: core::option::Option) -> vortex_error::VortexResult + +pub fn vortex_sparse::Sparse::try_new(indices: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef, len: usize, fill_value: vortex_array::scalar::Scalar) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_sparse::Sparse pub fn vortex_sparse::Sparse::clone(&self) -> vortex_sparse::Sparse @@ -56,7 +60,7 @@ pub fn vortex_sparse::Sparse::invert(array: &vortex_sparse::SparseArray) -> vort impl vortex_array::vtable::VTable for vortex_sparse::Sparse -pub type vortex_sparse::Sparse::Array = vortex_sparse::SparseArray +pub type vortex_sparse::Sparse::ArrayData = vortex_sparse::SparseData pub type vortex_sparse::Sparse::Metadata = vortex_sparse::SparseMetadata @@ -64,23 +68,23 @@ pub type vortex_sparse::Sparse::OperationsVTable = vortex_sparse::Sparse pub type vortex_sparse::Sparse::ValidityVTable = vortex_sparse::Sparse -pub fn vortex_sparse::Sparse::array_eq(array: &vortex_sparse::SparseArray, other: &vortex_sparse::SparseArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_sparse::Sparse::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_sparse::Sparse::array_hash(array: &vortex_sparse::SparseArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_sparse::Sparse::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_sparse::Sparse::buffer(array: &vortex_sparse::SparseArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_sparse::Sparse::buffer(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_sparse::Sparse::buffer_name(_array: &vortex_sparse::SparseArray, idx: usize) -> core::option::Option +pub fn vortex_sparse::Sparse::buffer_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> core::option::Option -pub fn vortex_sparse::Sparse::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_sparse::Sparse::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_sparse::Sparse::child(array: &vortex_sparse::SparseArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_sparse::Sparse::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_sparse::Sparse::child_name(_array: &vortex_sparse::SparseArray, idx: usize) -> alloc::string::String +pub fn vortex_sparse::Sparse::child_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_sparse::Sparse::deserialize(bytes: &[u8], dtype: &vortex_array::dtype::DType, _len: usize, buffers: &[vortex_array::buffer::BufferHandle], session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_sparse::Sparse::dtype(array: &vortex_sparse::SparseArray) -> &vortex_array::dtype::DType +pub fn vortex_sparse::Sparse::dtype(array: &vortex_sparse::SparseData) -> &vortex_array::dtype::DType pub fn vortex_sparse::Sparse::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -88,80 +92,74 @@ pub fn vortex_sparse::Sparse::execute_parent(array: &vortex_array::vtable::typed pub fn vortex_sparse::Sparse::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_sparse::Sparse::len(array: &vortex_sparse::SparseArray) -> usize +pub fn vortex_sparse::Sparse::len(array: &vortex_sparse::SparseData) -> usize -pub fn vortex_sparse::Sparse::metadata(array: &vortex_sparse::SparseArray) -> vortex_error::VortexResult +pub fn vortex_sparse::Sparse::metadata(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_sparse::Sparse::nbuffers(_array: &vortex_sparse::SparseArray) -> usize +pub fn vortex_sparse::Sparse::nbuffers(_array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_sparse::Sparse::nchildren(array: &vortex_sparse::SparseArray) -> usize +pub fn vortex_sparse::Sparse::nchildren(array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_sparse::Sparse::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_sparse::Sparse::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_sparse::Sparse::stats(array: &vortex_sparse::SparseArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_sparse::Sparse::stats(array: &vortex_sparse::SparseData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_sparse::Sparse::vtable(_array: &Self::Array) -> &Self +pub fn vortex_sparse::Sparse::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_sparse::Sparse::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_sparse::Sparse::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_sparse::Sparse -pub fn vortex_sparse::Sparse::scalar_at(array: &vortex_sparse::SparseArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_sparse::Sparse::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::validity::ValidityVTable for vortex_sparse::Sparse -pub fn vortex_sparse::Sparse::validity(array: &vortex_sparse::SparseArray) -> vortex_error::VortexResult - -pub struct vortex_sparse::SparseArray - -impl vortex_sparse::SparseArray +pub fn vortex_sparse::Sparse::validity(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_sparse::SparseArray::encode(array: &vortex_array::array::ArrayRef, fill_value: core::option::Option) -> vortex_error::VortexResult +pub struct vortex_sparse::SparseData -pub fn vortex_sparse::SparseArray::fill_scalar(&self) -> &vortex_array::scalar::Scalar +impl vortex_sparse::SparseData -pub fn vortex_sparse::SparseArray::patches(&self) -> &vortex_array::patches::Patches +pub fn vortex_sparse::SparseData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_sparse::SparseArray::resolved_patches(&self) -> vortex_error::VortexResult +pub fn vortex_sparse::SparseData::encode(array: &vortex_array::array::ArrayRef, fill_value: core::option::Option) -> vortex_error::VortexResult -pub fn vortex_sparse::SparseArray::try_new(indices: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef, len: usize, fill_value: vortex_array::scalar::Scalar) -> vortex_error::VortexResult +pub fn vortex_sparse::SparseData::fill_scalar(&self) -> &vortex_array::scalar::Scalar -pub fn vortex_sparse::SparseArray::try_new_from_patches(patches: vortex_array::patches::Patches, fill_value: vortex_array::scalar::Scalar) -> vortex_error::VortexResult +pub fn vortex_sparse::SparseData::is_empty(&self) -> bool -impl vortex_sparse::SparseArray +pub fn vortex_sparse::SparseData::len(&self) -> usize -pub fn vortex_sparse::SparseArray::to_array(&self) -> vortex_array::array::ArrayRef +pub fn vortex_sparse::SparseData::patches(&self) -> &vortex_array::patches::Patches -impl core::clone::Clone for vortex_sparse::SparseArray +pub fn vortex_sparse::SparseData::resolved_patches(&self) -> vortex_error::VortexResult -pub fn vortex_sparse::SparseArray::clone(&self) -> vortex_sparse::SparseArray +pub fn vortex_sparse::SparseData::try_new(indices: vortex_array::array::ArrayRef, values: vortex_array::array::ArrayRef, len: usize, fill_value: vortex_array::scalar::Scalar) -> vortex_error::VortexResult -impl core::convert::AsRef for vortex_sparse::SparseArray +pub fn vortex_sparse::SparseData::try_new_from_patches(patches: vortex_array::patches::Patches, fill_value: vortex_array::scalar::Scalar) -> vortex_error::VortexResult -pub fn vortex_sparse::SparseArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +impl core::clone::Clone for vortex_sparse::SparseData -impl core::convert::From for vortex_array::array::ArrayRef +pub fn vortex_sparse::SparseData::clone(&self) -> vortex_sparse::SparseData -pub fn vortex_array::array::ArrayRef::from(value: vortex_sparse::SparseArray) -> vortex_array::array::ArrayRef +impl core::convert::From for vortex_array::array::ArrayRef -impl core::fmt::Debug for vortex_sparse::SparseArray +pub fn vortex_array::array::ArrayRef::from(value: vortex_sparse::SparseData) -> vortex_array::array::ArrayRef -pub fn vortex_sparse::SparseArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::fmt::Debug for vortex_sparse::SparseData -impl core::ops::deref::Deref for vortex_sparse::SparseArray +pub fn vortex_sparse::SparseData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub type vortex_sparse::SparseArray::Target = dyn vortex_array::array::DynArray +impl vortex_array::array::IntoArray for vortex_sparse::SparseData -pub fn vortex_sparse::SparseArray::deref(&self) -> &Self::Target - -impl vortex_array::array::IntoArray for vortex_sparse::SparseArray - -pub fn vortex_sparse::SparseArray::into_array(self) -> vortex_array::array::ArrayRef +pub fn vortex_sparse::SparseData::into_array(self) -> vortex_array::array::ArrayRef pub struct vortex_sparse::SparseMetadata impl core::fmt::Debug for vortex_sparse::SparseMetadata pub fn vortex_sparse::SparseMetadata::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +pub type vortex_sparse::SparseArray = vortex_array::vtable::typed::Array diff --git a/encodings/sparse/src/canonical.rs b/encodings/sparse/src/canonical.rs index 2e0f51843cd..8c7e1969c9f 100644 --- a/encodings/sparse/src/canonical.rs +++ b/encodings/sparse/src/canonical.rs @@ -40,7 +40,6 @@ use vortex_array::scalar::ListScalar; use vortex_array::scalar::Scalar; use vortex_array::scalar::StructScalar; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::BitBuffer; use vortex_buffer::Buffer; use vortex_buffer::BufferString; @@ -55,7 +54,7 @@ use vortex_error::vortex_panic; use crate::ConstantArray; use crate::SparseArray; - +use crate::SparseData; pub(super) fn execute_sparse( array: &SparseArray, ctx: &mut ExecutionCtx, @@ -439,7 +438,7 @@ fn execute_sparse_struct( .cloned() .zip_eq(fill_values) .map(|(patch_values, fill_value)| unsafe { - SparseArray::new_unchecked( + SparseData::new_unchecked( unresolved_patches .clone() .map_values(|_| Ok(patch_values)) @@ -476,7 +475,7 @@ fn execute_sparse_decimal( } } let filled_array = builder.finish_into_decimal(); - let array = filled_array.patch(patches, ctx)?; + let array = filled_array.into_data().patch(patches, ctx)?; Ok(array.into_array()) } @@ -508,8 +507,8 @@ fn execute_varbin_inner( ) -> VarBinViewArray { assert_eq!(dtype.nullability(), validity.nullability()); - let n_patch_buffers = values.buffers().len(); - let mut buffers = values.buffers().to_vec(); + let n_patch_buffers = values.data_buffers().len(); + let mut buffers = values.data_buffers().to_vec(); let fill = if let Some(buffer) = &fill_value { buffers.push(BufferHandle::new_host(buffer.clone())); @@ -571,7 +570,7 @@ mod test { use vortex_error::VortexResult; use vortex_mask::Mask; - use crate::SparseArray; + use crate::Sparse; #[rstest] #[case(Some(true))] @@ -580,8 +579,7 @@ mod test { fn test_sparse_bool(#[case] fill_value: Option) { let indices = buffer![0u64, 1, 7].into_array(); let values = BoolArray::from_iter([Some(true), None, Some(false)]).into_array(); - let sparse_bools = - SparseArray::try_new(indices, values, 10, Scalar::from(fill_value)).unwrap(); + let sparse_bools = Sparse::try_new(indices, values, 10, Scalar::from(fill_value)).unwrap(); let actual = sparse_bools.to_bool(); let expected = BoolArray::from_iter([ @@ -607,8 +605,7 @@ mod test { fn test_sparse_primitive(#[case] fill_value: Option) { let indices = buffer![0u64, 1, 7].into_array(); let values = PrimitiveArray::from_option_iter([Some(0i32), None, Some(1)]).into_array(); - let sparse_ints = - SparseArray::try_new(indices, values, 10, Scalar::from(fill_value)).unwrap(); + let sparse_ints = Sparse::try_new(indices, values, 10, Scalar::from(fill_value)).unwrap(); assert_eq!(*sparse_ints.dtype(), DType::Primitive(PType::I32, Nullable)); let flat_ints = sparse_ints.to_primitive(); @@ -659,7 +656,7 @@ mod test { vec![Scalar::from(Some(-10i32)), Scalar::from(Some(-1i32))], ); let len = 10; - let sparse_struct = SparseArray::try_new(indices, patch_values, len, fill_scalar).unwrap(); + let sparse_struct = Sparse::try_new(indices, patch_values, len, fill_scalar).unwrap(); let expected_a = PrimitiveArray::from_option_iter((0..len).map(|i| { if i == 0 { @@ -726,7 +723,7 @@ mod test { let fill_scalar = Scalar::null(struct_dtype); let len = 10; - let sparse_struct = SparseArray::try_new(indices, patch_values, len, fill_scalar).unwrap(); + let sparse_struct = Sparse::try_new(indices, patch_values, len, fill_scalar).unwrap(); let expected_a = PrimitiveArray::from_option_iter((0..len).map(|i| { if i == 0 { @@ -777,7 +774,7 @@ mod test { .into_array(); let len = 10; let fill_scalar = Scalar::decimal(DecimalValue::I32(123), decimal_dtype, Nullable); - let sparse_struct = SparseArray::try_new(indices, patch_values, len, fill_scalar).unwrap(); + let sparse_struct = Sparse::try_new(indices, patch_values, len, fill_scalar).unwrap(); let expected = DecimalArray::new( buffer![100i128, 200, 123, 123, 123, 123, 123, 300, 4000, 123], @@ -812,7 +809,7 @@ mod test { ]) .into_array(); - let array = SparseArray::try_new( + let array = Sparse::try_new( buffer![0u16, 3, 4, 5, 7, 9, 10].into_array(), strings, 12, @@ -853,7 +850,7 @@ mod test { ]) .into_array(); - let array = SparseArray::try_new( + let array = Sparse::try_new( buffer![0u16, 3, 4, 5, 7, 9, 10].into_array(), strings, 12, @@ -887,7 +884,7 @@ mod test { VarBinViewArray::from_iter_str(["hello", "goodbye", "hello", "bonjour", "你好"]) .into_array(); - let array = SparseArray::try_new( + let array = Sparse::try_new( buffer![0u16, 3, 4, 5, 8].into_array(), strings, 9, @@ -917,7 +914,7 @@ mod test { ]) .into_array(); - let array = SparseArray::try_new( + let array = Sparse::try_new( buffer![0u16, 3, 4, 5, 7, 9, 10].into_array(), strings, 12, @@ -958,7 +955,7 @@ mod test { ]) .into_array(); - let array = SparseArray::try_new( + let array = Sparse::try_new( buffer![0u16, 3, 4, 5, 7, 9, 10].into_array(), binaries, 12, @@ -1005,7 +1002,7 @@ mod test { let indices = buffer![0u8, 3u8, 4u8, 5u8].into_array(); let fill_value = Scalar::null(lists.dtype().clone()); - let sparse = SparseArray::try_new(indices, lists, 6, fill_value) + let sparse = Sparse::try_new(indices, lists, 6, fill_value) .unwrap() .into_array(); @@ -1059,7 +1056,7 @@ mod test { let indices = buffer![0u8, 3u8, 4u8, 5u8].into_array(); let fill_value = Scalar::null(lists.dtype().clone()); - let sparse = SparseArray::try_new(indices, lists, 6, fill_value) + let sparse = Sparse::try_new(indices, lists, 6, fill_value) .unwrap() .into_array(); @@ -1102,7 +1099,7 @@ mod test { let indices = buffer![0u8, 3u8, 4u8, 5u8].into_array(); let fill_value = Scalar::from(Some(vec![5i32, 6, 7, 8])); - let sparse = SparseArray::try_new(indices, lists, 6, fill_value) + let sparse = Sparse::try_new(indices, lists, 6, fill_value) .unwrap() .into_array(); @@ -1171,7 +1168,7 @@ mod test { ]) .into_array(); - let array = SparseArray::try_new( + let array = Sparse::try_new( buffer![0u16, 3, 4, 5, 7, 9, 10].into_array(), strings, 12, @@ -1213,7 +1210,7 @@ mod test { 3, Nullable, )); - let sparse = SparseArray::try_new(indices, fsl, 5, fill_value) + let sparse = Sparse::try_new(indices, fsl, 5, fill_value) .unwrap() .into_array(); @@ -1251,7 +1248,7 @@ mod test { ], NonNullable, ); - let sparse = SparseArray::try_new(indices, fsl, 6, fill_value) + let sparse = Sparse::try_new(indices, fsl, 6, fill_value) .unwrap() .into_array(); @@ -1289,7 +1286,7 @@ mod test { ], Nullable, ); - let sparse = SparseArray::try_new(indices, fsl, 6, fill_value) + let sparse = Sparse::try_new(indices, fsl, 6, fill_value) .unwrap() .into_array(); @@ -1337,7 +1334,7 @@ mod test { NonNullable, ); - let sparse = SparseArray::try_new(indices, fsl, 100, fill_value) + let sparse = Sparse::try_new(indices, fsl, 100, fill_value) .unwrap() .into_array(); @@ -1394,7 +1391,7 @@ mod test { ], NonNullable, ); - let sparse = SparseArray::try_new(indices, fsl, 1, fill_value) + let sparse = Sparse::try_new(indices, fsl, 1, fill_value) .unwrap() .into_array(); @@ -1420,7 +1417,7 @@ mod test { let indices = buffer![0u8, 1u8, 2u8, 3u8].into_array(); let fill_value = Scalar::from(Some(vec![42i32; 252])); // 252 + 4 elements = 256 > u8::MAX - let sparse = SparseArray::try_new(indices, lists, 5, fill_value) + let sparse = Sparse::try_new(indices, lists, 5, fill_value) .unwrap() .into_array(); @@ -1482,7 +1479,7 @@ mod test { // - Index 7: List 2 [30, 31, 32, 33] // - Index 8-9: null let indices = buffer![1u8, 4, 7].into_array(); - let sparse = SparseArray::try_new( + let sparse = Sparse::try_new( indices, list_view.into_array(), 10, @@ -1568,7 +1565,7 @@ mod test { // Extract only the values we need from the sliced array let values = sliced.slice(0..2).unwrap(); let sparse = - SparseArray::try_new(indices, values, 5, Scalar::null(sliced.dtype().clone())).unwrap(); + Sparse::try_new(indices, values, 5, Scalar::null(sliced.dtype().clone())).unwrap(); let canonical = sparse.to_canonical()?.into_array(); let result_listview = canonical.to_listview(); diff --git a/encodings/sparse/src/compute/cast.rs b/encodings/sparse/src/compute/cast.rs index 1b9b1a1bb61..dd4be0511c8 100644 --- a/encodings/sparse/src/compute/cast.rs +++ b/encodings/sparse/src/compute/cast.rs @@ -11,7 +11,7 @@ use vortex_error::VortexResult; use crate::Sparse; use crate::SparseArray; - +use crate::SparseData; impl CastReduce for Sparse { fn cast(array: &SparseArray, dtype: &DType) -> VortexResult> { let casted_patches = array @@ -28,7 +28,7 @@ impl CastReduce for Sparse { }; Ok(Some( - SparseArray::try_new_from_patches(casted_patches, casted_fill)?.into_array(), + SparseData::try_new_from_patches(casted_patches, casted_fill)?.into_array(), )) } } @@ -48,11 +48,12 @@ mod tests { use vortex_array::scalar::Scalar; use vortex_buffer::buffer; + use crate::Sparse; use crate::SparseArray; #[test] fn test_cast_sparse_i32_to_i64() { - let sparse = SparseArray::try_new( + let sparse = Sparse::try_new( buffer![2u64, 5, 8].into_array(), buffer![100i32, 200, 300].into_array(), 10, @@ -75,7 +76,7 @@ mod tests { #[test] fn test_cast_sparse_with_null_fill() { - let sparse = SparseArray::try_new( + let sparse = Sparse::try_new( buffer![1u64, 3, 5].into_array(), PrimitiveArray::from_option_iter([Some(42i32), Some(84), Some(126)]).into_array(), 8, @@ -94,25 +95,25 @@ mod tests { } #[rstest] - #[case(SparseArray::try_new( + #[case(Sparse::try_new( buffer![2u64, 5, 8].into_array(), buffer![100i32, 200, 300].into_array(), 10, Scalar::from(0i32) ).unwrap())] - #[case(SparseArray::try_new( + #[case(Sparse::try_new( buffer![0u64, 4, 9].into_array(), buffer![1.5f32, 2.5, 3.5].into_array(), 10, Scalar::from(0.0f32) ).unwrap())] - #[case(SparseArray::try_new( + #[case(Sparse::try_new( buffer![1u64, 3, 7].into_array(), PrimitiveArray::from_option_iter([Some(100i32), None, Some(300)]).into_array(), 10, Scalar::null_native::() ).unwrap())] - #[case(SparseArray::try_new( + #[case(Sparse::try_new( buffer![5u64].into_array(), buffer![42u8].into_array(), 10, @@ -129,7 +130,7 @@ mod tests { // When all positions are patched the null fill is unused, so a cast to // non-nullable is valid. Sparse::cast detects this case, substitutes a // zero fill, and keeps the result in the Sparse encoding. - let sparse = SparseArray::try_new( + let sparse = Sparse::try_new( buffer![0u64, 1, 2, 3, 4].into_array(), buffer![10u64, 20, 30, 40, 50].into_array(), 5, @@ -155,7 +156,7 @@ mod tests { // Regression test for https://github.com/vortex-data/vortex/issues/6932 // fill_null on a sparse array with null fill triggers an internal cast to // non-nullable, which must not panic. - let sparse = SparseArray::try_new( + let sparse = Sparse::try_new( buffer![1u64, 3].into_array(), buffer![10u64, 20].into_array(), 5, diff --git a/encodings/sparse/src/compute/filter.rs b/encodings/sparse/src/compute/filter.rs index 56556d285ed..0e032d65461 100644 --- a/encodings/sparse/src/compute/filter.rs +++ b/encodings/sparse/src/compute/filter.rs @@ -11,7 +11,7 @@ use vortex_mask::Mask; use crate::ConstantArray; use crate::Sparse; use crate::SparseArray; - +use crate::SparseData; impl FilterKernel for Sparse { fn filter( array: &SparseArray, @@ -27,7 +27,7 @@ impl FilterKernel for Sparse { }; Ok(Some( - SparseArray::try_new_from_patches(new_patches, array.fill_scalar().clone())? + SparseData::try_new_from_patches(new_patches, array.fill_scalar().clone())? .into_array(), )) } @@ -52,11 +52,11 @@ mod tests { use vortex_buffer::buffer; use vortex_mask::Mask; - use crate::SparseArray; + use crate::Sparse; #[fixture] fn array() -> ArrayRef { - SparseArray::try_new( + Sparse::try_new( buffer![2u64, 9, 15].into_array(), PrimitiveArray::new(buffer![33_i32, 44, 55], Validity::AllValid).into_array(), 20, @@ -76,7 +76,7 @@ mod tests { // Construct expected SparseArray: index 2 was kept, which had value 33. // The new index is 0 (since it's the only element). - let expected = SparseArray::try_new( + let expected = Sparse::try_new( buffer![0u64].into_array(), PrimitiveArray::new(buffer![33_i32], Validity::AllValid).into_array(), 1, @@ -90,7 +90,7 @@ mod tests { #[test] fn true_fill_value() { let mask = Mask::from_iter([false, true, false, true, false, true, true]); - let array = SparseArray::try_new( + let array = Sparse::try_new( buffer![0_u64, 3, 6].into_array(), PrimitiveArray::new(buffer![33_i32, 44, 55], Validity::AllValid).into_array(), 7, @@ -105,7 +105,7 @@ mod tests { // Mask keeps indices 1, 3, 5, 6 -> new indices 0, 1, 2, 3. // Index 3 (value 44) maps to new index 1. // Index 6 (value 55) maps to new index 3. - let expected = SparseArray::try_new( + let expected = Sparse::try_new( buffer![1u64, 3].into_array(), PrimitiveArray::new(buffer![44_i32, 55], Validity::AllValid).into_array(), 4, @@ -120,7 +120,7 @@ mod tests { fn test_filter_sparse_array() { let null_fill_value = Scalar::null(DType::Primitive(PType::I32, Nullability::Nullable)); test_filter_conformance( - &SparseArray::try_new( + &Sparse::try_new( buffer![1u64, 2, 4].into_array(), buffer![100i32, 200, 300] .into_array() @@ -135,7 +135,7 @@ mod tests { let ten_fill_value = Scalar::from(10i32); test_filter_conformance( - &SparseArray::try_new( + &Sparse::try_new( buffer![1u64, 2, 4].into_array(), buffer![100i32, 200, 300].into_array(), 5, diff --git a/encodings/sparse/src/compute/mod.rs b/encodings/sparse/src/compute/mod.rs index 0f0ad4b98c4..a303a06b58a 100644 --- a/encodings/sparse/src/compute/mod.rs +++ b/encodings/sparse/src/compute/mod.rs @@ -24,11 +24,11 @@ mod test { use vortex_buffer::buffer; use vortex_mask::Mask; - use crate::SparseArray; + use crate::Sparse; #[fixture] fn array() -> ArrayRef { - SparseArray::try_new( + Sparse::try_new( buffer![2u64, 9, 15].into_array(), PrimitiveArray::new(buffer![33_i32, 44, 55], Validity::AllValid).into_array(), 20, @@ -48,7 +48,7 @@ mod test { // Construct expected SparseArray: index 2 was kept, which had value 33. // The new index is 0 (since it's the only element). - let expected = SparseArray::try_new( + let expected = Sparse::try_new( buffer![0u64].into_array(), PrimitiveArray::new(buffer![33_i32], Validity::AllValid).into_array(), 1, @@ -62,7 +62,7 @@ mod test { #[test] fn true_fill_value() { let mask = Mask::from_iter([false, true, false, true, false, true, true]); - let array = SparseArray::try_new( + let array = Sparse::try_new( buffer![0_u64, 3, 6].into_array(), PrimitiveArray::new(buffer![33_i32, 44, 55], Validity::AllValid).into_array(), 7, @@ -77,7 +77,7 @@ mod test { // Mask keeps indices 1, 3, 5, 6 -> new indices 0, 1, 2, 3. // Index 3 (value 44) maps to new index 1. // Index 6 (value 55) maps to new index 3. - let expected = SparseArray::try_new( + let expected = Sparse::try_new( buffer![1u64, 3].into_array(), PrimitiveArray::new(buffer![44_i32, 55], Validity::AllValid).into_array(), 4, @@ -97,7 +97,7 @@ mod test { fn test_mask_sparse_array() { let null_fill_value = Scalar::null(DType::Primitive(PType::I32, Nullability::Nullable)); test_mask_conformance( - &SparseArray::try_new( + &Sparse::try_new( buffer![1u64, 2, 4].into_array(), buffer![100i32, 200, 300] .into_array() @@ -112,7 +112,7 @@ mod test { let ten_fill_value = Scalar::from(10i32); test_mask_conformance( - &SparseArray::try_new( + &Sparse::try_new( buffer![1u64, 2, 4].into_array(), buffer![100i32, 200, 300].into_array(), 5, @@ -138,50 +138,51 @@ mod tests { use vortex_array::scalar::Scalar; use vortex_buffer::buffer; + use crate::Sparse; use crate::SparseArray; #[rstest] // Basic sparse arrays - #[case::sparse_i32_null_fill(SparseArray::try_new( + #[case::sparse_i32_null_fill(Sparse::try_new( buffer![2u64, 5, 8].into_array(), PrimitiveArray::from_option_iter([Some(100i32), Some(200), Some(300)]).into_array(), 10, Scalar::null_native::() ).unwrap())] - #[case::sparse_i32_value_fill(SparseArray::try_new( + #[case::sparse_i32_value_fill(Sparse::try_new( buffer![1u64, 3, 7].into_array(), buffer![42i32, 84, 126].into_array(), 10, Scalar::from(0i32) ).unwrap())] // Different types - #[case::sparse_u64(SparseArray::try_new( + #[case::sparse_u64(Sparse::try_new( buffer![0u64, 4, 9].into_array(), buffer![1000u64, 2000, 3000].into_array(), 10, Scalar::from(999u64) ).unwrap())] - #[case::sparse_f32(SparseArray::try_new( + #[case::sparse_f32(Sparse::try_new( buffer![2u64, 6].into_array(), buffer![std::f32::consts::PI, std::f32::consts::E].into_array(), 8, Scalar::from(0.0f32) ).unwrap())] // Edge cases - #[case::sparse_single_patch(SparseArray::try_new( + #[case::sparse_single_patch(Sparse::try_new( buffer![5u64].into_array(), buffer![42i32].into_array(), 10, Scalar::from(-1i32) ).unwrap())] - #[case::sparse_dense_patches(SparseArray::try_new( + #[case::sparse_dense_patches(Sparse::try_new( buffer![0u64, 1, 2, 3, 4].into_array(), PrimitiveArray::from_option_iter([Some(10i32), Some(20), Some(30), Some(40), Some(50)]).into_array(), 5, Scalar::null_native::() ).unwrap())] // Large sparse arrays - #[case::sparse_large(SparseArray::try_new( + #[case::sparse_large(Sparse::try_new( buffer![100u64, 500, 900, 1500, 1999].into_array(), buffer![111i32, 222, 333, 444, 555].into_array(), 2000, @@ -190,7 +191,7 @@ mod tests { // Nullable patches #[case::sparse_nullable_patches({ let null_fill_value = Scalar::null(DType::Primitive(PType::I32, Nullability::Nullable)); - SparseArray::try_new( + Sparse::try_new( buffer![1u64, 4, 7].into_array(), PrimitiveArray::from_option_iter([Some(100i32), None, Some(300)]) .into_array() @@ -206,37 +207,37 @@ mod tests { } #[rstest] - #[case::sparse_i32_basic(SparseArray::try_new( + #[case::sparse_i32_basic(Sparse::try_new( buffer![2u64, 5, 8].into_array(), buffer![100i32, 200, 300].into_array(), 10, Scalar::from(0i32) ).unwrap())] - #[case::sparse_u32_basic(SparseArray::try_new( + #[case::sparse_u32_basic(Sparse::try_new( buffer![1u64, 3, 7].into_array(), buffer![1000u32, 2000, 3000].into_array(), 10, Scalar::from(100u32) ).unwrap())] - #[case::sparse_i64_basic(SparseArray::try_new( + #[case::sparse_i64_basic(Sparse::try_new( buffer![0u64, 4, 9].into_array(), buffer![5000i64, 6000, 7000].into_array(), 10, Scalar::from(1000i64) ).unwrap())] - #[case::sparse_f32_basic(SparseArray::try_new( + #[case::sparse_f32_basic(Sparse::try_new( buffer![2u64, 6].into_array(), buffer![1.5f32, 2.5].into_array(), 8, Scalar::from(0.5f32) ).unwrap())] - #[case::sparse_f64_basic(SparseArray::try_new( + #[case::sparse_f64_basic(Sparse::try_new( buffer![1u64, 5, 9].into_array(), buffer![10.1f64, 20.2, 30.3].into_array(), 10, Scalar::from(5.0f64) ).unwrap())] - #[case::sparse_i32_large(SparseArray::try_new( + #[case::sparse_i32_large(Sparse::try_new( buffer![10u64, 50, 90, 150, 199].into_array(), buffer![111i32, 222, 333, 444, 555].into_array(), 200, diff --git a/encodings/sparse/src/compute/take.rs b/encodings/sparse/src/compute/take.rs index 610cd52d064..8dd7a969880 100644 --- a/encodings/sparse/src/compute/take.rs +++ b/encodings/sparse/src/compute/take.rs @@ -11,7 +11,7 @@ use vortex_error::VortexResult; use crate::ConstantArray; use crate::Sparse; use crate::SparseArray; - +use crate::SparseData; impl TakeExecute for Sparse { fn take( array: &SparseArray, @@ -41,7 +41,7 @@ impl TakeExecute for Sparse { } Ok(Some( - SparseArray::try_new_from_patches( + SparseData::try_new_from_patches( new_patches, array.fill_scalar().cast( &array @@ -68,6 +68,7 @@ mod test { use vortex_array::validity::Validity; use vortex_buffer::buffer; + use crate::Sparse; use crate::SparseArray; fn test_array_fill_value() -> Scalar { @@ -76,7 +77,7 @@ mod test { } fn sparse_array() -> ArrayRef { - SparseArray::try_new( + Sparse::try_new( buffer![0u64, 37, 47, 99].into_array(), PrimitiveArray::new(buffer![1.23f64, 0.47, 9.99, 3.5], Validity::AllValid).into_array(), 100, @@ -129,7 +130,7 @@ mod test { #[test] fn nullable_take() { - let arr = SparseArray::try_new( + let arr = Sparse::try_new( buffer![1u32].into_array(), buffer![10].into_array(), 10, @@ -150,7 +151,7 @@ mod test { #[test] fn nullable_take_with_many_patches() { - let arr = SparseArray::try_new( + let arr = Sparse::try_new( buffer![1u32, 3, 7, 8, 9].into_array(), buffer![10, 8, 3, 2, 1].into_array(), 10, @@ -170,13 +171,13 @@ mod test { } #[rstest] - #[case(SparseArray::try_new( + #[case(Sparse::try_new( buffer![0u64, 37, 47, 99].into_array(), PrimitiveArray::new(buffer![1.23f64, 0.47, 9.99, 3.5], Validity::AllValid).into_array(), 100, Scalar::null_native::(), ).unwrap())] - #[case(SparseArray::try_new( + #[case(Sparse::try_new( buffer![1u32, 3, 7, 8, 9].into_array(), buffer![10, 8, 3, 2, 1].into_array(), 10, @@ -184,14 +185,14 @@ mod test { ).unwrap())] #[case({ let nullable_values = PrimitiveArray::from_option_iter([Some(100i64), None, Some(300)]); - SparseArray::try_new( + Sparse::try_new( buffer![2u64, 4, 6].into_array(), nullable_values.into_array(), 10, Scalar::null_native::(), ).unwrap() })] - #[case(SparseArray::try_new( + #[case(Sparse::try_new( buffer![5u64].into_array(), buffer![999i32].into_array(), 20, diff --git a/encodings/sparse/src/lib.rs b/encodings/sparse/src/lib.rs index b98616a5548..34df0e7a650 100644 --- a/encodings/sparse/src/lib.rs +++ b/encodings/sparse/src/lib.rs @@ -28,7 +28,6 @@ use vortex_array::scalar::ScalarValue; use vortex_array::scalar_fn::fns::operators::Operator; use vortex_array::serde::ArrayChildren; use vortex_array::stats::ArrayStats; -use vortex_array::stats::StatsSetRef; use vortex_array::validity::Validity; use vortex_array::vtable; use vortex_array::vtable::Array; @@ -60,7 +59,7 @@ mod ops; mod rules; mod slice; -vtable!(Sparse); +vtable!(Sparse, Sparse, SparseData); #[derive(Debug)] pub struct SparseMetadata { @@ -76,13 +75,13 @@ pub struct ProstPatchesMetadata { } impl VTable for Sparse { - type Array = SparseArray; + type ArrayData = SparseData; type Metadata = SparseMetadata; type OperationsVTable = Self; type ValidityVTable = Self; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Sparse } @@ -90,32 +89,32 @@ impl VTable for Sparse { Self::ID } - fn len(array: &SparseArray) -> usize { + fn len(array: &SparseData) -> usize { array.patches.array_len() } - fn dtype(array: &SparseArray) -> &DType { + fn dtype(array: &SparseData) -> &DType { array.fill_scalar().dtype() } - fn stats(array: &SparseArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &SparseData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &SparseArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.patches.array_hash(state, precision); array.fill_value.hash(state); } - fn array_eq(array: &SparseArray, other: &SparseArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.patches.array_eq(&other.patches, precision) && array.fill_value == other.fill_value } - fn nbuffers(_array: &SparseArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 1 } - fn buffer(array: &SparseArray, idx: usize) -> BufferHandle { + fn buffer(array: &Array, idx: usize) -> BufferHandle { match idx { 0 => { let fill_value_buffer = @@ -126,26 +125,26 @@ impl VTable for Sparse { } } - fn buffer_name(_array: &SparseArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { match idx { 0 => Some("fill_value".to_string()), _ => vortex_panic!("SparseArray buffer_name index {idx} out of bounds"), } } - fn nchildren(array: &SparseArray) -> usize { + fn nchildren(array: &Array) -> usize { patches_nchildren(array.patches()) } - fn child(array: &SparseArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { patches_child(array.patches(), idx) } - fn child_name(_array: &SparseArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { patches_child_name(idx).to_string() } - fn metadata(array: &SparseArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { let patches = array.patches().to_metadata(array.len(), array.dtype())?; Ok(SparseMetadata { @@ -194,7 +193,7 @@ impl VTable for Sparse { metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { vortex_ensure_eq!( children.len(), 2, @@ -209,7 +208,7 @@ impl VTable for Sparse { )?; let patch_values = children.get(1, dtype, metadata.patches.len()?)?; - SparseArray::try_new_from_patches( + SparseData::try_new_from_patches( Patches::new( len, metadata.patches.offset()?, @@ -221,7 +220,7 @@ impl VTable for Sparse { ) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure_eq!( children.len(), 2, @@ -267,7 +266,7 @@ impl VTable for Sparse { } #[derive(Clone, Debug)] -pub struct SparseArray { +pub struct SparseData { patches: Patches, fill_value: Scalar, stats_set: ArrayStats, @@ -278,9 +277,24 @@ pub struct Sparse; impl Sparse { pub const ID: ArrayId = ArrayId::new_ref("vortex.sparse"); + + /// Construct a new [`SparseArray`] from indices, values, length, and fill value. + pub fn try_new( + indices: ArrayRef, + values: ArrayRef, + len: usize, + fill_value: Scalar, + ) -> VortexResult { + Array::try_from_data(SparseData::try_new(indices, values, len, fill_value)?) + } + + /// Encode the given array as a [`SparseArray`]. + pub fn encode(array: &ArrayRef, fill_value: Option) -> VortexResult { + SparseData::encode(array, fill_value) + } } -impl SparseArray { +impl SparseData { pub fn try_new( indices: ArrayRef, values: ArrayRef, @@ -345,6 +359,24 @@ impl SparseArray { } } + /// Returns the length of the array. + #[inline] + pub fn len(&self) -> usize { + self.patches.array_len() + } + + /// Returns whether the array is empty. + #[inline] + pub fn is_empty(&self) -> bool { + self.patches.array_len() == 0 + } + + /// Returns the logical data type of the array. + #[inline] + pub fn dtype(&self) -> &DType { + self.fill_scalar().dtype() + } + #[inline] pub fn patches(&self) -> &Patches { &self.patches @@ -417,7 +449,7 @@ impl SparseArray { } }; - return Ok(SparseArray::try_new( + return Ok(SparseData::try_new( non_null_indices, non_null_values, array.len(), @@ -465,13 +497,13 @@ impl SparseArray { Mask::Values(values) => values.indices().iter().map(|v| *v as u64).collect(), }; - SparseArray::try_new(indices.into_array(), non_top_values, array.len(), fill) + SparseData::try_new(indices.into_array(), non_top_values, array.len(), fill) .map(|a| a.into_array()) } } impl ValidityVTable for Sparse { - fn validity(array: &SparseArray) -> VortexResult { + fn validity(array: &Array) -> VortexResult { let patches = unsafe { Patches::new_unchecked( array.patches.array_len(), @@ -488,7 +520,7 @@ impl ValidityVTable for Sparse { }; Ok(Validity::Array( - unsafe { SparseArray::new_unchecked(patches, array.fill_value.is_valid().into()) } + unsafe { SparseData::new_unchecked(patches, array.fill_value.is_valid().into()) } .into_array(), )) } @@ -512,6 +544,7 @@ mod test { use vortex_error::VortexExpect; use super::*; + use crate::Sparse; fn nullable_fill() -> Scalar { Scalar::null(DType::Primitive(PType::I32, Nullability::Nullable)) @@ -526,7 +559,7 @@ mod test { let mut values = buffer![100i32, 200, 300].into_array(); values = values.cast(fill_value.dtype().clone()).unwrap(); - SparseArray::try_new(buffer![2u64, 5, 8].into_array(), values, 10, fill_value) + Sparse::try_new(buffer![2u64, 5, 8].into_array(), values, 10, fill_value) .unwrap() .into_array() } @@ -549,7 +582,7 @@ mod test { #[test] pub fn test_scalar_at_again() { - let arr = SparseArray::try_new( + let arr = Sparse::try_new( ConstantArray::new(10u32, 1).into_array(), ConstantArray::new(Scalar::primitive(1234u32, Nullability::Nullable), 1).into_array(), 100, @@ -585,7 +618,7 @@ mod test { #[test] pub fn validity_mask_sliced_nonnull_fill() { - let sliced = SparseArray::try_new( + let sliced = Sparse::try_new( buffer![2u64, 5, 8].into_array(), ConstantArray::new( Scalar::null(DType::Primitive(PType::F32, Nullability::Nullable)), @@ -648,7 +681,7 @@ mod test { let values = buffer![15_u32, 135, 13531, 42].into_array(); let indices = buffer![10_u64, 11, 50, 100].into_array(); - SparseArray::try_new(indices, values, 100, 0_u32.into()).unwrap(); + Sparse::try_new(indices, values, 100, 0_u32.into()).unwrap(); } #[test] @@ -656,7 +689,7 @@ mod test { let values = buffer![15_u32, 135, 13531, 42].into_array(); let indices = buffer![10_u64, 11, 50, 100].into_array(); - SparseArray::try_new(indices, values, 101, 0_u32.into()).unwrap(); + Sparse::try_new(indices, values, 101, 0_u32.into()).unwrap(); } #[test] @@ -667,8 +700,8 @@ mod test { true, true, false, true, false, true, false, true, true, false, true, false, ]), ); - let sparse = SparseArray::encode(&original.clone().into_array(), None) - .vortex_expect("SparseArray::encode should succeed for test data"); + let sparse = Sparse::encode(&original.clone().into_array(), None) + .vortex_expect("Sparse::encode should succeed for test data"); assert_eq!( sparse.validity_mask().unwrap(), Mask::from_iter(vec![ @@ -683,8 +716,7 @@ mod test { let indices = buffer![0u8, 2, 4, 6, 8].into_array(); let values = PrimitiveArray::from_option_iter([Some(0i16), Some(1), None, None, Some(4)]) .into_array(); - let array = - SparseArray::try_new(indices, values, 10, Scalar::null_native::()).unwrap(); + let array = Sparse::try_new(indices, values, 10, Scalar::null_native::()).unwrap(); let actual = array.validity_mask().unwrap(); let expected = Mask::from_iter([ true, false, true, false, false, false, false, false, true, false, diff --git a/encodings/sparse/src/ops.rs b/encodings/sparse/src/ops.rs index 7371298a5f4..940573f879f 100644 --- a/encodings/sparse/src/ops.rs +++ b/encodings/sparse/src/ops.rs @@ -3,15 +3,15 @@ use vortex_array::ExecutionCtx; use vortex_array::scalar::Scalar; +use vortex_array::vtable::Array; use vortex_array::vtable::OperationsVTable; use vortex_error::VortexResult; use crate::Sparse; -use crate::SparseArray; impl OperationsVTable for Sparse { fn scalar_at( - array: &SparseArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -30,14 +30,14 @@ mod tests { use vortex_array::assert_arrays_eq; use vortex_buffer::buffer; - use super::*; + use crate::Sparse; #[test] fn slice_partially_invalid() { let values = buffer![0u64].into_array(); let indices = buffer![0u8].into_array(); - let sparse = SparseArray::try_new(indices, values, 1000, 999u64.into()).unwrap(); + let sparse = Sparse::try_new(indices, values, 1000, 999u64.into()).unwrap(); let sliced = sparse.slice(0..1000).unwrap(); let mut expected = vec![999u64; 1000]; expected[0] = 0; diff --git a/encodings/sparse/src/rules.rs b/encodings/sparse/src/rules.rs index 797ccbc20b8..1d4262ad19c 100644 --- a/encodings/sparse/src/rules.rs +++ b/encodings/sparse/src/rules.rs @@ -12,6 +12,7 @@ use vortex_error::VortexResult; use crate::Sparse; use crate::SparseArray; +use crate::SparseData; pub(crate) static RULES: ParentRuleSet = ParentRuleSet::new(&[ ParentRuleSet::lift(&CastReduceAdaptor(Sparse)), @@ -23,7 +24,7 @@ impl NotReduce for Sparse { let inverted_fill = array.fill_scalar().as_bool().invert().into_scalar(); let inverted_patches = array.patches().clone().map_values(|values| values.not())?; Ok(Some( - SparseArray::try_new_from_patches(inverted_patches, inverted_fill)?.into_array(), + SparseData::try_new_from_patches(inverted_patches, inverted_fill)?.into_array(), )) } } diff --git a/encodings/sparse/src/slice.rs b/encodings/sparse/src/slice.rs index e83d9d76a2f..37e65b0390a 100644 --- a/encodings/sparse/src/slice.rs +++ b/encodings/sparse/src/slice.rs @@ -12,6 +12,7 @@ use vortex_error::VortexResult; use crate::ConstantArray; use crate::Sparse; use crate::SparseArray; +use crate::SparseData; impl SliceKernel for Sparse { fn slice( @@ -35,7 +36,7 @@ impl SliceKernel for Sparse { // patches slice will ensure that dtype of patches is unchanged and the indices and // values match Ok(Some( - unsafe { SparseArray::new_unchecked(new_patches, array.fill_scalar().clone()) } + unsafe { SparseData::new_unchecked(new_patches, array.fill_scalar().clone()) } .into_array(), )) } diff --git a/encodings/zigzag/public-api.lock b/encodings/zigzag/public-api.lock index 3a93a0f5f5e..ce8716e9991 100644 --- a/encodings/zigzag/public-api.lock +++ b/encodings/zigzag/public-api.lock @@ -6,6 +6,8 @@ impl vortex_zigzag::ZigZag pub const vortex_zigzag::ZigZag::ID: vortex_array::vtable::dyn_::ArrayId +pub fn vortex_zigzag::ZigZag::try_new(encoded: vortex_array::array::ArrayRef) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_zigzag::ZigZag pub fn vortex_zigzag::ZigZag::clone(&self) -> vortex_zigzag::ZigZag @@ -24,7 +26,7 @@ pub fn vortex_zigzag::ZigZag::filter(array: &vortex_zigzag::ZigZagArray, mask: & impl vortex_array::arrays::slice::SliceReduce for vortex_zigzag::ZigZag -pub fn vortex_zigzag::ZigZag::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_zigzag::ZigZag::slice(array: &vortex_array::vtable::typed::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::kernel::CastReduce for vortex_zigzag::ZigZag @@ -36,7 +38,7 @@ pub fn vortex_zigzag::ZigZag::mask(array: &vortex_zigzag::ZigZagArray, mask: &vo impl vortex_array::vtable::VTable for vortex_zigzag::ZigZag -pub type vortex_zigzag::ZigZag::Array = vortex_zigzag::ZigZagArray +pub type vortex_zigzag::ZigZag::ArrayData = vortex_zigzag::ZigZagData pub type vortex_zigzag::ZigZag::Metadata = vortex_array::metadata::EmptyMetadata @@ -44,23 +46,23 @@ pub type vortex_zigzag::ZigZag::OperationsVTable = vortex_zigzag::ZigZag pub type vortex_zigzag::ZigZag::ValidityVTable = vortex_array::vtable::validity::ValidityVTableFromChild -pub fn vortex_zigzag::ZigZag::array_eq(array: &vortex_zigzag::ZigZagArray, other: &vortex_zigzag::ZigZagArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_zigzag::ZigZag::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_zigzag::ZigZag::array_hash(array: &vortex_zigzag::ZigZagArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_zigzag::ZigZag::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_zigzag::ZigZag::buffer(_array: &vortex_zigzag::ZigZagArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_zigzag::ZigZag::buffer(_array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_zigzag::ZigZag::buffer_name(_array: &vortex_zigzag::ZigZagArray, idx: usize) -> core::option::Option +pub fn vortex_zigzag::ZigZag::buffer_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> core::option::Option -pub fn vortex_zigzag::ZigZag::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_zigzag::ZigZag::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_zigzag::ZigZag::child(array: &vortex_zigzag::ZigZagArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_zigzag::ZigZag::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_zigzag::ZigZag::child_name(_array: &vortex_zigzag::ZigZagArray, idx: usize) -> alloc::string::String +pub fn vortex_zigzag::ZigZag::child_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_zigzag::ZigZag::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_zigzag::ZigZag::dtype(array: &vortex_zigzag::ZigZagArray) -> &vortex_array::dtype::DType +pub fn vortex_zigzag::ZigZag::dtype(array: &vortex_zigzag::ZigZagData) -> &vortex_array::dtype::DType pub fn vortex_zigzag::ZigZag::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult @@ -68,74 +70,68 @@ pub fn vortex_zigzag::ZigZag::execute_parent(array: &vortex_array::vtable::typed pub fn vortex_zigzag::ZigZag::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_zigzag::ZigZag::len(array: &vortex_zigzag::ZigZagArray) -> usize +pub fn vortex_zigzag::ZigZag::len(array: &vortex_zigzag::ZigZagData) -> usize -pub fn vortex_zigzag::ZigZag::metadata(_array: &vortex_zigzag::ZigZagArray) -> vortex_error::VortexResult +pub fn vortex_zigzag::ZigZag::metadata(_array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_zigzag::ZigZag::nbuffers(_array: &vortex_zigzag::ZigZagArray) -> usize +pub fn vortex_zigzag::ZigZag::nbuffers(_array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_zigzag::ZigZag::nchildren(_array: &vortex_zigzag::ZigZagArray) -> usize +pub fn vortex_zigzag::ZigZag::nchildren(_array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_zigzag::ZigZag::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_zigzag::ZigZag::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_zigzag::ZigZag::stats(array: &vortex_zigzag::ZigZagArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_zigzag::ZigZag::stats(array: &vortex_zigzag::ZigZagData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_zigzag::ZigZag::vtable(_array: &Self::Array) -> &Self +pub fn vortex_zigzag::ZigZag::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_zigzag::ZigZag::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_zigzag::ZigZag::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_zigzag::ZigZag -pub fn vortex_zigzag::ZigZag::scalar_at(array: &vortex_zigzag::ZigZagArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_zigzag::ZigZag::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::validity::ValidityChild for vortex_zigzag::ZigZag -pub fn vortex_zigzag::ZigZag::validity_child(array: &vortex_zigzag::ZigZagArray) -> &vortex_array::array::ArrayRef - -pub struct vortex_zigzag::ZigZagArray - -impl vortex_zigzag::ZigZagArray - -pub fn vortex_zigzag::ZigZagArray::encoded(&self) -> &vortex_array::array::ArrayRef +pub fn vortex_zigzag::ZigZag::validity_child(array: &vortex_zigzag::ZigZagData) -> &vortex_array::array::ArrayRef -pub fn vortex_zigzag::ZigZagArray::new(encoded: vortex_array::array::ArrayRef) -> Self +pub struct vortex_zigzag::ZigZagData -pub fn vortex_zigzag::ZigZagArray::ptype(&self) -> vortex_array::dtype::ptype::PType +impl vortex_zigzag::ZigZagData -pub fn vortex_zigzag::ZigZagArray::try_new(encoded: vortex_array::array::ArrayRef) -> vortex_error::VortexResult +pub fn vortex_zigzag::ZigZagData::dtype(&self) -> &vortex_array::dtype::DType -impl vortex_zigzag::ZigZagArray +pub fn vortex_zigzag::ZigZagData::encoded(&self) -> &vortex_array::array::ArrayRef -pub fn vortex_zigzag::ZigZagArray::to_array(&self) -> vortex_array::array::ArrayRef +pub fn vortex_zigzag::ZigZagData::is_empty(&self) -> bool -impl core::clone::Clone for vortex_zigzag::ZigZagArray +pub fn vortex_zigzag::ZigZagData::len(&self) -> usize -pub fn vortex_zigzag::ZigZagArray::clone(&self) -> vortex_zigzag::ZigZagArray +pub fn vortex_zigzag::ZigZagData::new(encoded: vortex_array::array::ArrayRef) -> Self -impl core::convert::AsRef for vortex_zigzag::ZigZagArray +pub fn vortex_zigzag::ZigZagData::ptype(&self) -> vortex_array::dtype::ptype::PType -pub fn vortex_zigzag::ZigZagArray::as_ref(&self) -> &dyn vortex_array::array::DynArray +pub fn vortex_zigzag::ZigZagData::try_new(encoded: vortex_array::array::ArrayRef) -> vortex_error::VortexResult -impl core::convert::From for vortex_array::array::ArrayRef +impl core::clone::Clone for vortex_zigzag::ZigZagData -pub fn vortex_array::array::ArrayRef::from(value: vortex_zigzag::ZigZagArray) -> vortex_array::array::ArrayRef +pub fn vortex_zigzag::ZigZagData::clone(&self) -> vortex_zigzag::ZigZagData -impl core::fmt::Debug for vortex_zigzag::ZigZagArray +impl core::convert::From for vortex_array::array::ArrayRef -pub fn vortex_zigzag::ZigZagArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::array::ArrayRef::from(value: vortex_zigzag::ZigZagData) -> vortex_array::array::ArrayRef -impl core::ops::deref::Deref for vortex_zigzag::ZigZagArray +impl core::fmt::Debug for vortex_zigzag::ZigZagData -pub type vortex_zigzag::ZigZagArray::Target = dyn vortex_array::array::DynArray +pub fn vortex_zigzag::ZigZagData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_zigzag::ZigZagArray::deref(&self) -> &Self::Target +impl vortex_array::array::IntoArray for vortex_zigzag::ZigZagData -impl vortex_array::array::IntoArray for vortex_zigzag::ZigZagArray +pub fn vortex_zigzag::ZigZagData::into_array(self) -> vortex_array::array::ArrayRef -pub fn vortex_zigzag::ZigZagArray::into_array(self) -> vortex_array::array::ArrayRef +pub fn vortex_zigzag::zigzag_decode(parray: vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_array::arrays::primitive::vtable::PrimitiveArray -pub fn vortex_zigzag::zigzag_decode(parray: vortex_array::arrays::primitive::array::PrimitiveArray) -> vortex_array::arrays::primitive::array::PrimitiveArray +pub fn vortex_zigzag::zigzag_encode(parray: vortex_array::arrays::primitive::vtable::PrimitiveArray) -> vortex_error::VortexResult -pub fn vortex_zigzag::zigzag_encode(parray: vortex_array::arrays::primitive::array::PrimitiveArray) -> vortex_error::VortexResult +pub type vortex_zigzag::ZigZagArray = vortex_array::vtable::typed::Array diff --git a/encodings/zigzag/src/array.rs b/encodings/zigzag/src/array.rs index 867596ea818..e507871d55d 100644 --- a/encodings/zigzag/src/array.rs +++ b/encodings/zigzag/src/array.rs @@ -20,7 +20,6 @@ use vortex_array::match_each_unsigned_integer_ptype; use vortex_array::scalar::Scalar; use vortex_array::serde::ArrayChildren; use vortex_array::stats::ArrayStats; -use vortex_array::stats::StatsSetRef; use vortex_array::vtable; use vortex_array::vtable::Array; use vortex_array::vtable::ArrayId; @@ -41,16 +40,16 @@ use crate::kernel::PARENT_KERNELS; use crate::rules::RULES; use crate::zigzag_decode; -vtable!(ZigZag); +vtable!(ZigZag, ZigZag, ZigZagData); impl VTable for ZigZag { - type Array = ZigZagArray; + type ArrayData = ZigZagData; type Metadata = EmptyMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromChild; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &ZigZag } @@ -58,58 +57,58 @@ impl VTable for ZigZag { Self::ID } - fn len(array: &ZigZagArray) -> usize { + fn len(array: &ZigZagData) -> usize { array.encoded.len() } - fn dtype(array: &ZigZagArray) -> &DType { + fn dtype(array: &ZigZagData) -> &DType { &array.dtype } - fn stats(array: &ZigZagArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &ZigZagData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &ZigZagArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.encoded.array_hash(state, precision); } - fn array_eq(array: &ZigZagArray, other: &ZigZagArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.encoded.array_eq(&other.encoded, precision) } - fn nbuffers(_array: &ZigZagArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &ZigZagArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("ZigZagArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &ZigZagArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { vortex_panic!("ZigZagArray buffer_name index {idx} out of bounds") } - fn nchildren(_array: &ZigZagArray) -> usize { + fn nchildren(_array: &Array) -> usize { 1 } - fn child(array: &ZigZagArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.encoded().clone(), _ => vortex_panic!("ZigZagArray child index {idx} out of bounds"), } } - fn child_name(_array: &ZigZagArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "encoded".to_string(), _ => vortex_panic!("ZigZagArray child_name index {idx} out of bounds"), } } - fn metadata(_array: &ZigZagArray) -> VortexResult { + fn metadata(_array: &Array) -> VortexResult { Ok(EmptyMetadata) } @@ -133,7 +132,7 @@ impl VTable for ZigZag { _metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { if children.len() != 1 { vortex_bail!("Expected 1 child, got {}", children.len()); } @@ -142,10 +141,10 @@ impl VTable for ZigZag { let encoded_type = DType::Primitive(ptype.to_unsigned(), dtype.nullability()); let encoded = children.get(0, &encoded_type, len)?; - ZigZagArray::try_new(encoded) + ZigZagData::try_new(encoded) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 1, "ZigZagArray expects exactly 1 child (encoded), got {}", @@ -180,7 +179,7 @@ impl VTable for ZigZag { } #[derive(Clone, Debug)] -pub struct ZigZagArray { +pub struct ZigZagData { dtype: DType, encoded: ArrayRef, stats_set: ArrayStats, @@ -191,9 +190,14 @@ pub struct ZigZag; impl ZigZag { pub const ID: ArrayId = ArrayId::new_ref("vortex.zigzag"); + + /// Construct a new [`ZigZagArray`] from an encoded unsigned integer array. + pub fn try_new(encoded: ArrayRef) -> VortexResult { + Array::try_from_data(ZigZagData::try_new(encoded)?) + } } -impl ZigZagArray { +impl ZigZagData { pub fn new(encoded: ArrayRef) -> Self { Self::try_new(encoded).vortex_expect("ZigZagArray new") } @@ -214,6 +218,24 @@ impl ZigZagArray { }) } + /// Returns the length of the array. + #[inline] + pub fn len(&self) -> usize { + self.encoded.len() + } + + /// Returns whether the array is empty. + #[inline] + pub fn is_empty(&self) -> bool { + self.encoded.is_empty() + } + + /// Returns the logical data type of the array. + #[inline] + pub fn dtype(&self) -> &DType { + &self.dtype + } + pub fn ptype(&self) -> PType { self.dtype().as_ptype() } @@ -225,7 +247,7 @@ impl ZigZagArray { impl OperationsVTable for ZigZag { fn scalar_at( - array: &ZigZagArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -249,7 +271,7 @@ impl OperationsVTable for ZigZag { } impl ValidityChild for ZigZag { - fn validity_child(array: &ZigZagArray) -> &ArrayRef { + fn validity_child(array: &ZigZagData) -> &ArrayRef { array.encoded() } } @@ -262,6 +284,7 @@ mod test { use vortex_buffer::buffer; use super::*; + use crate::ZigZagArray; use crate::zigzag_encode; #[test] @@ -269,7 +292,7 @@ mod test { let array = buffer![1i32, -5i32, 2, 3, 4, 5, 6, 7, 8, 9, 10] .into_array() .to_primitive(); - let zigzag = zigzag_encode(array.clone())?; + let zigzag = ZigZagArray::try_from_data(zigzag_encode(array.clone())?)?; assert_eq!( zigzag.statistics().compute_max::(), diff --git a/encodings/zigzag/src/compress.rs b/encodings/zigzag/src/compress.rs index 488c20f8023..20c3aed794f 100644 --- a/encodings/zigzag/src/compress.rs +++ b/encodings/zigzag/src/compress.rs @@ -6,16 +6,14 @@ use vortex_array::arrays::PrimitiveArray; use vortex_array::dtype::NativePType; use vortex_array::dtype::PType; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::BufferMut; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_panic; use zigzag::ZigZag as ExternalZigZag; -use crate::ZigZagArray; - -pub fn zigzag_encode(parray: PrimitiveArray) -> VortexResult { +use crate::ZigZagData; +pub fn zigzag_encode(parray: PrimitiveArray) -> VortexResult { let validity = parray.validity().clone(); let encoded = match parray.ptype() { PType::I8 => zigzag_encode_primitive::(parray.into_buffer_mut(), validity), @@ -27,7 +25,7 @@ pub fn zigzag_encode(parray: PrimitiveArray) -> VortexResult { parray.ptype() ), }; - ZigZagArray::try_new(encoded.into_array()) + ZigZagData::try_new(encoded.into_array()) } fn zigzag_encode_primitive( @@ -72,6 +70,7 @@ where #[cfg(test)] mod test { + use vortex_array::IntoArray; use vortex_array::ToCanonical; use vortex_array::assert_arrays_eq; @@ -80,7 +79,9 @@ mod test { #[test] fn test_compress_i8() { - let compressed = zigzag_encode(PrimitiveArray::from_iter(-100_i8..100)).unwrap(); + let compressed = zigzag_encode(PrimitiveArray::from_iter(-100_i8..100)) + .unwrap() + .into_array(); assert!(compressed.is::()); assert_arrays_eq!( compressed.to_primitive(), @@ -89,7 +90,9 @@ mod test { } #[test] fn test_compress_i16() { - let compressed = zigzag_encode(PrimitiveArray::from_iter(-100_i16..100)).unwrap(); + let compressed = zigzag_encode(PrimitiveArray::from_iter(-100_i16..100)) + .unwrap() + .into_array(); assert!(compressed.is::()); assert_arrays_eq!( compressed.to_primitive(), @@ -98,7 +101,9 @@ mod test { } #[test] fn test_compress_i32() { - let compressed = zigzag_encode(PrimitiveArray::from_iter(-100_i32..100)).unwrap(); + let compressed = zigzag_encode(PrimitiveArray::from_iter(-100_i32..100)) + .unwrap() + .into_array(); assert!(compressed.is::()); assert_arrays_eq!( compressed.to_primitive(), @@ -107,7 +112,9 @@ mod test { } #[test] fn test_compress_i64() { - let compressed = zigzag_encode(PrimitiveArray::from_iter(-100_i64..100)).unwrap(); + let compressed = zigzag_encode(PrimitiveArray::from_iter(-100_i64..100)) + .unwrap() + .into_array(); assert!(compressed.is::()); assert_arrays_eq!( compressed.to_primitive(), diff --git a/encodings/zigzag/src/compute/cast.rs b/encodings/zigzag/src/compute/cast.rs index 74a8c4a5442..993ce925b5d 100644 --- a/encodings/zigzag/src/compute/cast.rs +++ b/encodings/zigzag/src/compute/cast.rs @@ -10,7 +10,7 @@ use vortex_error::VortexResult; use crate::ZigZag; use crate::ZigZagArray; - +use crate::ZigZagData; impl CastReduce for ZigZag { fn cast(array: &ZigZagArray, dtype: &DType) -> VortexResult> { if !dtype.is_signed_int() { @@ -20,7 +20,7 @@ impl CastReduce for ZigZag { let new_encoded_dtype = DType::Primitive(dtype.as_ptype().to_unsigned(), dtype.nullability()); let new_encoded = array.encoded().cast(new_encoded_dtype)?; - Ok(Some(ZigZagArray::try_new(new_encoded)?.into_array())) + Ok(Some(ZigZagData::try_new(new_encoded)?.into_array())) } } @@ -123,10 +123,10 @@ mod tests { } #[rstest] - #[case(zigzag_encode(PrimitiveArray::from_iter([-100i32, -50, -1, 0, 1, 50, 100])).unwrap())] - #[case(zigzag_encode(PrimitiveArray::from_iter([-1000i64, -1, 0, 1, 1000])).unwrap())] - #[case(zigzag_encode(PrimitiveArray::from_option_iter([Some(-5i16), None, Some(0), Some(5), None])).unwrap())] - #[case(zigzag_encode(PrimitiveArray::from_iter([i32::MIN, -1, 0, 1, i32::MAX])).unwrap())] + #[case(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter([-100i32, -50, -1, 0, 1, 50, 100])).unwrap()).unwrap())] + #[case(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter([-1000i64, -1, 0, 1, 1000])).unwrap()).unwrap())] + #[case(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_option_iter([Some(-5i16), None, Some(0), Some(5), None])).unwrap()).unwrap())] + #[case(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter([i32::MIN, -1, 0, 1, i32::MAX])).unwrap()).unwrap())] fn test_cast_zigzag_conformance(#[case] array: ZigZagArray) { test_cast_conformance(&array.into_array()); } diff --git a/encodings/zigzag/src/compute/mod.rs b/encodings/zigzag/src/compute/mod.rs index 86e343208b7..31e7a271ae4 100644 --- a/encodings/zigzag/src/compute/mod.rs +++ b/encodings/zigzag/src/compute/mod.rs @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use crate::ZigZagData; mod cast; use vortex_array::ArrayRef; @@ -22,7 +23,7 @@ use crate::ZigZagArray; impl FilterReduce for ZigZag { fn filter(array: &ZigZagArray, mask: &Mask) -> VortexResult> { let encoded = array.encoded().filter(mask.clone())?; - Ok(Some(ZigZagArray::try_new(encoded)?.into_array())) + Ok(Some(ZigZagData::try_new(encoded)?.into_array())) } } @@ -33,7 +34,7 @@ impl TakeExecute for ZigZag { _ctx: &mut ExecutionCtx, ) -> VortexResult> { let encoded = array.encoded().take(indices.to_array())?; - Ok(Some(ZigZagArray::try_new(encoded)?.into_array())) + Ok(Some(ZigZagData::try_new(encoded)?.into_array())) } } @@ -44,7 +45,7 @@ impl MaskReduce for ZigZag { EmptyOptions, [array.encoded().clone(), mask.clone()], )?; - Ok(Some(ZigZagArray::try_new(masked_encoded)?.into_array())) + Ok(Some(ZigZagData::try_new(masked_encoded)?.into_array())) } } @@ -91,10 +92,10 @@ mod tests { #[test] pub fn nullable_scalar_at() -> VortexResult<()> { - let zigzag = zigzag_encode(PrimitiveArray::new( + let zigzag = ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::new( buffer![-189, -160, 1], Validity::AllValid, - ))?; + ))?)?; assert_eq!( zigzag.scalar_at(1)?, Scalar::primitive(-160, Nullability::Nullable) @@ -104,24 +105,25 @@ mod tests { #[test] fn take_zigzag() -> VortexResult<()> { - let zigzag = zigzag_encode(PrimitiveArray::new( + let zigzag = ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::new( buffer![-189, -160, 1], Validity::AllValid, - ))?; + ))?)?; let indices = buffer![0, 2].into_array(); let actual = zigzag.take(indices.to_array()).unwrap(); - let expected = zigzag_encode(PrimitiveArray::new(buffer![-189, 1], Validity::AllValid))?; + let expected = + zigzag_encode(PrimitiveArray::new(buffer![-189, 1], Validity::AllValid))?.into_array(); assert_arrays_eq!(actual, expected); Ok(()) } #[test] fn filter_zigzag() -> VortexResult<()> { - let zigzag = zigzag_encode(PrimitiveArray::new( + let zigzag = ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::new( buffer![-189, -160, 1], Validity::AllValid, - ))?; + ))?)?; let filter_mask = BitBuffer::from(vec![true, false, true]).into(); let actual = zigzag.filter(filter_mask).unwrap(); @@ -193,41 +195,29 @@ mod tests { #[rstest] // Basic ZigZag arrays - #[case::zigzag_i8(zigzag_encode(PrimitiveArray::from_iter([-128i8, -1, 0, 1, 127])).unwrap())] - #[case::zigzag_i16(zigzag_encode(PrimitiveArray::from_iter([-1000i16, -100, 0, 100, 1000])).unwrap() - )] - #[case::zigzag_i32(zigzag_encode(PrimitiveArray::from_iter([-100000i32, -1000, 0, 1000, 100000])).unwrap() - )] - #[case::zigzag_i64(zigzag_encode(PrimitiveArray::from_iter([-1000000i64, -10000, 0, 10000, 1000000])).unwrap() - )] + #[case::zigzag_i8(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter([-128i8, -1, 0, 1, 127])).unwrap()).unwrap())] + #[case::zigzag_i16(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter([-1000i16, -100, 0, 100, 1000])).unwrap()).unwrap())] + #[case::zigzag_i32(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter([-100000i32, -1000, 0, 1000, 100000])).unwrap()).unwrap())] + #[case::zigzag_i64(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter([-1000000i64, -10000, 0, 10000, 1000000])).unwrap()).unwrap())] // Nullable arrays - #[case::zigzag_nullable_i32(zigzag_encode(PrimitiveArray::from_option_iter([Some(-100i32), None, Some(0), Some(100), None])).unwrap() - )] - #[case::zigzag_nullable_i64(zigzag_encode(PrimitiveArray::from_option_iter([Some(-1000i64), None, Some(0), Some(1000), None])).unwrap() - )] + #[case::zigzag_nullable_i32(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_option_iter([Some(-100i32), None, Some(0), Some(100), None])).unwrap()).unwrap())] + #[case::zigzag_nullable_i64(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_option_iter([Some(-1000i64), None, Some(0), Some(1000), None])).unwrap()).unwrap())] // Edge cases - #[case::zigzag_single(zigzag_encode(PrimitiveArray::from_iter([-42i32])).unwrap())] - #[case::zigzag_alternating(zigzag_encode(PrimitiveArray::from_iter([-1i32, 1, -2, 2, -3, 3])).unwrap() - )] + #[case::zigzag_single(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter([-42i32])).unwrap()).unwrap())] + #[case::zigzag_alternating(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter([-1i32, 1, -2, 2, -3, 3])).unwrap()).unwrap())] // Large arrays - #[case::zigzag_large_i32(zigzag_encode(PrimitiveArray::from_iter(-500..500)).unwrap())] - #[case::zigzag_large_i64(zigzag_encode(PrimitiveArray::from_iter((-1000..1000).map(|i| i as i64 * 100))).unwrap() - )] + #[case::zigzag_large_i32(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter(-500..500)).unwrap()).unwrap())] + #[case::zigzag_large_i64(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter((-1000..1000).map(|i| i as i64 * 100))).unwrap()).unwrap())] fn test_zigzag_consistency(#[case] array: ZigZagArray) { test_array_consistency(&array.into_array()); } #[rstest] - #[case::zigzag_i8_basic(zigzag_encode(PrimitiveArray::from_iter([-10i8, -5, 0, 5, 10])).unwrap() - )] - #[case::zigzag_i16_basic(zigzag_encode(PrimitiveArray::from_iter([-100i16, -50, 0, 50, 100])).unwrap() - )] - #[case::zigzag_i32_basic(zigzag_encode(PrimitiveArray::from_iter([-1000i32, -500, 0, 500, 1000])).unwrap() - )] - #[case::zigzag_i64_basic(zigzag_encode(PrimitiveArray::from_iter([-10000i64, -5000, 0, 5000, 10000])).unwrap() - )] - #[case::zigzag_i32_large(zigzag_encode(PrimitiveArray::from_iter((-50..50).map(|i| i * 10))).unwrap() - )] + #[case::zigzag_i8_basic(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter([-10i8, -5, 0, 5, 10])).unwrap()).unwrap())] + #[case::zigzag_i16_basic(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter([-100i16, -50, 0, 50, 100])).unwrap()).unwrap())] + #[case::zigzag_i32_basic(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter([-1000i32, -500, 0, 500, 1000])).unwrap()).unwrap())] + #[case::zigzag_i64_basic(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter([-10000i64, -5000, 0, 5000, 10000])).unwrap()).unwrap())] + #[case::zigzag_i32_large(ZigZagArray::try_from_data(zigzag_encode(PrimitiveArray::from_iter((-50..50).map(|i| i * 10))).unwrap()).unwrap())] fn test_zigzag_binary_numeric(#[case] array: ZigZagArray) { test_binary_numeric_array(array.into_array()); } diff --git a/encodings/zigzag/src/slice.rs b/encodings/zigzag/src/slice.rs index 95f5e272c81..f2767d3b9d9 100644 --- a/encodings/zigzag/src/slice.rs +++ b/encodings/zigzag/src/slice.rs @@ -6,15 +6,16 @@ use std::ops::Range; use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::arrays::slice::SliceReduce; +use vortex_array::vtable::Array; use vortex_error::VortexResult; use crate::ZigZag; -use crate::ZigZagArray; +use crate::ZigZagData; impl SliceReduce for ZigZag { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { Ok(Some( - ZigZagArray::new(array.encoded().slice(range)?).into_array(), + ZigZagData::new(array.encoded().slice(range)?).into_array(), )) } } diff --git a/encodings/zstd/benches/listview_rebuild.rs b/encodings/zstd/benches/listview_rebuild.rs index 68147912f17..0e91342c8ac 100644 --- a/encodings/zstd/benches/listview_rebuild.rs +++ b/encodings/zstd/benches/listview_rebuild.rs @@ -10,13 +10,13 @@ use vortex_array::arrays::VarBinViewArray; use vortex_array::arrays::listview::ListViewRebuildMode; use vortex_array::validity::Validity; use vortex_buffer::Buffer; -use vortex_zstd::ZstdArray; +use vortex_zstd::ZstdData; #[divan::bench(sample_size = 1000)] fn rebuild_naive(bencher: Bencher) { let dudes = VarBinViewArray::from_iter_str(["Washington", "Adams", "Jefferson", "Madison"]) .into_array(); - let dudes = ZstdArray::from_array(dudes, 9, 1024).unwrap().into_array(); + let dudes = ZstdData::from_array(dudes, 9, 1024).unwrap().into_array(); let offsets = std::iter::repeat_n(0u32, 1024) .collect::>() diff --git a/encodings/zstd/public-api.lock b/encodings/zstd/public-api.lock index 7abfb2c9b6f..14a28fab712 100644 --- a/encodings/zstd/public-api.lock +++ b/encodings/zstd/public-api.lock @@ -6,6 +6,12 @@ impl vortex_zstd::Zstd pub const vortex_zstd::Zstd::ID: vortex_array::vtable::dyn_::ArrayId +pub fn vortex_zstd::Zstd::from_primitive(parray: &vortex_array::arrays::primitive::vtable::PrimitiveArray, level: i32, values_per_frame: usize) -> vortex_error::VortexResult + +pub fn vortex_zstd::Zstd::from_var_bin_view(vbv: &vortex_array::arrays::varbinview::vtable::VarBinViewArray, level: i32, values_per_frame: usize) -> vortex_error::VortexResult + +pub fn vortex_zstd::Zstd::from_var_bin_view_without_dict(vbv: &vortex_array::arrays::varbinview::vtable::VarBinViewArray, level: i32, values_per_frame: usize) -> vortex_error::VortexResult + impl core::clone::Clone for vortex_zstd::Zstd pub fn vortex_zstd::Zstd::clone(&self) -> vortex_zstd::Zstd @@ -16,7 +22,7 @@ pub fn vortex_zstd::Zstd::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core:: impl vortex_array::arrays::slice::SliceReduce for vortex_zstd::Zstd -pub fn vortex_zstd::Zstd::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_zstd::Zstd::slice(array: &vortex_array::vtable::typed::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::kernel::CastReduce for vortex_zstd::Zstd @@ -24,7 +30,7 @@ pub fn vortex_zstd::Zstd::cast(array: &vortex_zstd::ZstdArray, dtype: &vortex_ar impl vortex_array::vtable::VTable for vortex_zstd::Zstd -pub type vortex_zstd::Zstd::Array = vortex_zstd::ZstdArray +pub type vortex_zstd::Zstd::ArrayData = vortex_zstd::ZstdData pub type vortex_zstd::Zstd::Metadata = vortex_array::metadata::ProstMetadata @@ -32,105 +38,49 @@ pub type vortex_zstd::Zstd::OperationsVTable = vortex_zstd::Zstd pub type vortex_zstd::Zstd::ValidityVTable = vortex_array::vtable::validity::ValidityVTableFromValiditySliceHelper -pub fn vortex_zstd::Zstd::array_eq(array: &vortex_zstd::ZstdArray, other: &vortex_zstd::ZstdArray, precision: vortex_array::hash::Precision) -> bool +pub fn vortex_zstd::Zstd::array_eq(array: &vortex_array::vtable::typed::Array, other: &vortex_array::vtable::typed::Array, precision: vortex_array::hash::Precision) -> bool -pub fn vortex_zstd::Zstd::array_hash(array: &vortex_zstd::ZstdArray, state: &mut H, precision: vortex_array::hash::Precision) +pub fn vortex_zstd::Zstd::array_hash(array: &vortex_array::vtable::typed::Array, state: &mut H, precision: vortex_array::hash::Precision) -pub fn vortex_zstd::Zstd::buffer(array: &vortex_zstd::ZstdArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_zstd::Zstd::buffer(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_zstd::Zstd::buffer_name(array: &vortex_zstd::ZstdArray, idx: usize) -> core::option::Option +pub fn vortex_zstd::Zstd::buffer_name(array: &vortex_array::vtable::typed::Array, idx: usize) -> core::option::Option -pub fn vortex_zstd::Zstd::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_zstd::Zstd::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_zstd::Zstd::child(array: &vortex_zstd::ZstdArray, idx: usize) -> vortex_array::array::ArrayRef +pub fn vortex_zstd::Zstd::child(array: &vortex_array::vtable::typed::Array, idx: usize) -> vortex_array::array::ArrayRef -pub fn vortex_zstd::Zstd::child_name(_array: &vortex_zstd::ZstdArray, idx: usize) -> alloc::string::String +pub fn vortex_zstd::Zstd::child_name(_array: &vortex_array::vtable::typed::Array, idx: usize) -> alloc::string::String pub fn vortex_zstd::Zstd::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_zstd::Zstd::dtype(array: &vortex_zstd::ZstdArray) -> &vortex_array::dtype::DType +pub fn vortex_zstd::Zstd::dtype(array: &vortex_zstd::ZstdData) -> &vortex_array::dtype::DType pub fn vortex_zstd::Zstd::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult pub fn vortex_zstd::Zstd::id(&self) -> vortex_array::vtable::dyn_::ArrayId -pub fn vortex_zstd::Zstd::len(array: &vortex_zstd::ZstdArray) -> usize +pub fn vortex_zstd::Zstd::len(array: &vortex_zstd::ZstdData) -> usize -pub fn vortex_zstd::Zstd::metadata(array: &vortex_zstd::ZstdArray) -> vortex_error::VortexResult +pub fn vortex_zstd::Zstd::metadata(array: &vortex_array::vtable::typed::Array) -> vortex_error::VortexResult -pub fn vortex_zstd::Zstd::nbuffers(array: &vortex_zstd::ZstdArray) -> usize +pub fn vortex_zstd::Zstd::nbuffers(array: &vortex_array::vtable::typed::Array) -> usize -pub fn vortex_zstd::Zstd::nchildren(array: &vortex_zstd::ZstdArray) -> usize +pub fn vortex_zstd::Zstd::nchildren(array: &vortex_array::vtable::typed::Array) -> usize pub fn vortex_zstd::Zstd::reduce_parent(array: &vortex_array::vtable::typed::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_zstd::Zstd::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_zstd::Zstd::stats(array: &vortex_zstd::ZstdArray) -> vortex_array::stats::array::StatsSetRef<'_> +pub fn vortex_zstd::Zstd::stats(array: &vortex_zstd::ZstdData) -> &vortex_array::stats::array::ArrayStats -pub fn vortex_zstd::Zstd::vtable(_array: &Self::Array) -> &Self +pub fn vortex_zstd::Zstd::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_zstd::Zstd::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_zstd::Zstd::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::operations::OperationsVTable for vortex_zstd::Zstd -pub fn vortex_zstd::Zstd::scalar_at(array: &vortex_zstd::ZstdArray, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult - -pub struct vortex_zstd::ZstdArray - -impl vortex_zstd::ZstdArray - -pub fn vortex_zstd::ZstdArray::decompress(&self, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult - -pub fn vortex_zstd::ZstdArray::from_array(array: vortex_array::array::ArrayRef, level: i32, values_per_frame: usize) -> vortex_error::VortexResult - -pub fn vortex_zstd::ZstdArray::from_canonical(canonical: &vortex_array::canonical::Canonical, level: i32, values_per_frame: usize) -> vortex_error::VortexResult> - -pub fn vortex_zstd::ZstdArray::from_primitive(parray: &vortex_array::arrays::primitive::array::PrimitiveArray, level: i32, values_per_frame: usize) -> vortex_error::VortexResult - -pub fn vortex_zstd::ZstdArray::from_primitive_without_dict(parray: &vortex_array::arrays::primitive::array::PrimitiveArray, level: i32, values_per_frame: usize) -> vortex_error::VortexResult - -pub fn vortex_zstd::ZstdArray::from_var_bin_view(vbv: &vortex_array::arrays::varbinview::array::VarBinViewArray, level: i32, values_per_frame: usize) -> vortex_error::VortexResult - -pub fn vortex_zstd::ZstdArray::from_var_bin_view_without_dict(vbv: &vortex_array::arrays::varbinview::array::VarBinViewArray, level: i32, values_per_frame: usize) -> vortex_error::VortexResult - -pub fn vortex_zstd::ZstdArray::into_parts(self) -> vortex_zstd::ZstdArrayParts - -pub fn vortex_zstd::ZstdArray::new(dictionary: core::option::Option, frames: alloc::vec::Vec, dtype: vortex_array::dtype::DType, metadata: vortex_zstd::ZstdMetadata, n_rows: usize, validity: vortex_array::validity::Validity) -> Self - -impl vortex_zstd::ZstdArray - -pub fn vortex_zstd::ZstdArray::to_array(&self) -> vortex_array::array::ArrayRef - -impl core::clone::Clone for vortex_zstd::ZstdArray - -pub fn vortex_zstd::ZstdArray::clone(&self) -> vortex_zstd::ZstdArray - -impl core::convert::AsRef for vortex_zstd::ZstdArray - -pub fn vortex_zstd::ZstdArray::as_ref(&self) -> &dyn vortex_array::array::DynArray - -impl core::convert::From for vortex_array::array::ArrayRef - -pub fn vortex_array::array::ArrayRef::from(value: vortex_zstd::ZstdArray) -> vortex_array::array::ArrayRef - -impl core::fmt::Debug for vortex_zstd::ZstdArray - -pub fn vortex_zstd::ZstdArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result - -impl core::ops::deref::Deref for vortex_zstd::ZstdArray - -pub type vortex_zstd::ZstdArray::Target = dyn vortex_array::array::DynArray - -pub fn vortex_zstd::ZstdArray::deref(&self) -> &Self::Target - -impl vortex_array::array::IntoArray for vortex_zstd::ZstdArray - -pub fn vortex_zstd::ZstdArray::into_array(self) -> vortex_array::array::ArrayRef - -impl vortex_array::vtable::validity::ValiditySliceHelper for vortex_zstd::ZstdArray - -pub fn vortex_zstd::ZstdArray::unsliced_validity_and_slice(&self) -> (&vortex_array::validity::Validity, usize, usize) +pub fn vortex_zstd::Zstd::scalar_at(array: &vortex_array::vtable::typed::Array, index: usize, _ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult pub struct vortex_zstd::ZstdArrayParts @@ -182,6 +132,54 @@ pub fn vortex_zstd::ZstdBuffersMetadata::clear(&mut self) pub fn vortex_zstd::ZstdBuffersMetadata::encoded_len(&self) -> usize +pub struct vortex_zstd::ZstdData + +impl vortex_zstd::ZstdData + +pub fn vortex_zstd::ZstdData::decompress(&self, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult + +pub fn vortex_zstd::ZstdData::dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_zstd::ZstdData::from_array(array: vortex_array::array::ArrayRef, level: i32, values_per_frame: usize) -> vortex_error::VortexResult + +pub fn vortex_zstd::ZstdData::from_canonical(canonical: &vortex_array::canonical::Canonical, level: i32, values_per_frame: usize) -> vortex_error::VortexResult> + +pub fn vortex_zstd::ZstdData::from_primitive(parray: &vortex_array::arrays::primitive::vtable::PrimitiveArray, level: i32, values_per_frame: usize) -> vortex_error::VortexResult + +pub fn vortex_zstd::ZstdData::from_primitive_without_dict(parray: &vortex_array::arrays::primitive::vtable::PrimitiveArray, level: i32, values_per_frame: usize) -> vortex_error::VortexResult + +pub fn vortex_zstd::ZstdData::from_var_bin_view(vbv: &vortex_array::arrays::varbinview::vtable::VarBinViewArray, level: i32, values_per_frame: usize) -> vortex_error::VortexResult + +pub fn vortex_zstd::ZstdData::from_var_bin_view_without_dict(vbv: &vortex_array::arrays::varbinview::vtable::VarBinViewArray, level: i32, values_per_frame: usize) -> vortex_error::VortexResult + +pub fn vortex_zstd::ZstdData::into_parts(self) -> vortex_zstd::ZstdArrayParts + +pub fn vortex_zstd::ZstdData::is_empty(&self) -> bool + +pub fn vortex_zstd::ZstdData::len(&self) -> usize + +pub fn vortex_zstd::ZstdData::new(dictionary: core::option::Option, frames: alloc::vec::Vec, dtype: vortex_array::dtype::DType, metadata: vortex_zstd::ZstdMetadata, n_rows: usize, validity: vortex_array::validity::Validity) -> Self + +impl core::clone::Clone for vortex_zstd::ZstdData + +pub fn vortex_zstd::ZstdData::clone(&self) -> vortex_zstd::ZstdData + +impl core::convert::From for vortex_array::array::ArrayRef + +pub fn vortex_array::array::ArrayRef::from(value: vortex_zstd::ZstdData) -> vortex_array::array::ArrayRef + +impl core::fmt::Debug for vortex_zstd::ZstdData + +pub fn vortex_zstd::ZstdData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +impl vortex_array::array::IntoArray for vortex_zstd::ZstdData + +pub fn vortex_zstd::ZstdData::into_array(self) -> vortex_array::array::ArrayRef + +impl vortex_array::vtable::validity::ValiditySliceHelper for vortex_zstd::ZstdData + +pub fn vortex_zstd::ZstdData::unsliced_validity_and_slice(&self) -> (&vortex_array::validity::Validity, usize, usize) + pub struct vortex_zstd::ZstdFrameMetadata pub vortex_zstd::ZstdFrameMetadata::n_values: u64 @@ -231,3 +229,5 @@ pub fn vortex_zstd::ZstdMetadata::clear(&mut self) pub fn vortex_zstd::ZstdMetadata::encoded_len(&self) -> usize pub fn vortex_zstd::reconstruct_views(buffer: &vortex_buffer::ByteBuffer, max_buffer_len: usize) -> (alloc::vec::Vec, vortex_buffer::buffer::Buffer) + +pub type vortex_zstd::ZstdArray = vortex_array::vtable::typed::Array diff --git a/encodings/zstd/src/array.rs b/encodings/zstd/src/array.rs index 1f501856989..525e931025f 100644 --- a/encodings/zstd/src/array.rs +++ b/encodings/zstd/src/array.rs @@ -31,14 +31,12 @@ use vortex_array::dtype::DType; use vortex_array::scalar::Scalar; use vortex_array::serde::ArrayChildren; use vortex_array::stats::ArrayStats; -use vortex_array::stats::StatsSetRef; use vortex_array::validity::Validity; use vortex_array::vtable; use vortex_array::vtable::Array; use vortex_array::vtable::ArrayId; use vortex_array::vtable::OperationsVTable; use vortex_array::vtable::VTable; -use vortex_array::vtable::ValidityHelper; use vortex_array::vtable::ValiditySliceHelper; use vortex_array::vtable::ValidityVTableFromValiditySliceHelper; use vortex_array::vtable::validity_nchildren; @@ -83,16 +81,16 @@ type ViewLen = u32; // We then insert these values to the correct position using a primitive array // constructor. -vtable!(Zstd); +vtable!(Zstd, Zstd, ZstdData); impl VTable for Zstd { - type Array = ZstdArray; + type ArrayData = ZstdData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValiditySliceHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Zstd } @@ -100,19 +98,19 @@ impl VTable for Zstd { Self::ID } - fn len(array: &ZstdArray) -> usize { + fn len(array: &ZstdData) -> usize { array.slice_stop - array.slice_start } - fn dtype(array: &ZstdArray) -> &DType { + fn dtype(array: &ZstdData) -> &DType { &array.dtype } - fn stats(array: &ZstdArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &ZstdData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &ZstdArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { match &array.dictionary { Some(dict) => { true.hash(state); @@ -132,7 +130,7 @@ impl VTable for Zstd { array.slice_stop.hash(state); } - fn array_eq(array: &ZstdArray, other: &ZstdArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { if !match (&array.dictionary, &other.dictionary) { (Some(d1), Some(d2)) => d1.array_eq(d2, precision), (None, None) => true, @@ -157,11 +155,11 @@ impl VTable for Zstd { && array.slice_stop == other.slice_stop } - fn nbuffers(array: &ZstdArray) -> usize { + fn nbuffers(array: &Array) -> usize { array.dictionary.is_some() as usize + array.frames.len() } - fn buffer(array: &ZstdArray, idx: usize) -> BufferHandle { + fn buffer(array: &Array, idx: usize) -> BufferHandle { if let Some(dict) = &array.dictionary { if idx == 0 { return BufferHandle::new_host(dict.clone()); @@ -172,7 +170,7 @@ impl VTable for Zstd { } } - fn buffer_name(array: &ZstdArray, idx: usize) -> Option { + fn buffer_name(array: &Array, idx: usize) -> Option { if array.dictionary.is_some() { if idx == 0 { Some("dictionary".to_string()) @@ -184,23 +182,23 @@ impl VTable for Zstd { } } - fn nchildren(array: &ZstdArray) -> usize { + fn nchildren(array: &Array) -> usize { validity_nchildren(&array.unsliced_validity) } - fn child(array: &ZstdArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { validity_to_child(&array.unsliced_validity, array.unsliced_n_rows) .unwrap_or_else(|| vortex_panic!("ZstdArray child index {idx} out of bounds")) } - fn child_name(_array: &ZstdArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "validity".to_string(), _ => vortex_panic!("ZstdArray child_name index {idx} out of bounds"), } } - fn metadata(array: &ZstdArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(array.metadata.clone())) } @@ -224,7 +222,7 @@ impl VTable for Zstd { metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let validity = if children.is_empty() { Validity::from(dtype.nullability()) } else if children.len() == 1 { @@ -254,7 +252,7 @@ impl VTable for Zstd { ) }; - Ok(ZstdArray::new( + Ok(ZstdData::new( dictionary_buffer, compressed_buffers, dtype.clone(), @@ -264,7 +262,7 @@ impl VTable for Zstd { )) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() <= 1, "ZstdArray expects at most 1 child (validity), got {}", @@ -301,10 +299,41 @@ pub struct Zstd; impl Zstd { pub const ID: ArrayId = ArrayId::new_ref("vortex.zstd"); + + /// Compress a [`VarBinViewArray`] using Zstd without a dictionary. + pub fn from_var_bin_view_without_dict( + vbv: &VarBinViewArray, + level: i32, + values_per_frame: usize, + ) -> VortexResult { + Array::try_from_data(ZstdData::from_var_bin_view_without_dict( + vbv, + level, + values_per_frame, + )?) + } + + /// Compress a [`PrimitiveArray`] using Zstd. + pub fn from_primitive( + parray: &PrimitiveArray, + level: i32, + values_per_frame: usize, + ) -> VortexResult { + Array::try_from_data(ZstdData::from_primitive(parray, level, values_per_frame)?) + } + + /// Compress a [`VarBinViewArray`] using Zstd. + pub fn from_var_bin_view( + vbv: &VarBinViewArray, + level: i32, + values_per_frame: usize, + ) -> VortexResult { + Array::try_from_data(ZstdData::from_var_bin_view(vbv, level, values_per_frame)?) + } } #[derive(Clone, Debug)] -pub struct ZstdArray { +pub struct ZstdData { pub(crate) dictionary: Option, pub(crate) frames: Vec, pub(crate) metadata: ZstdMetadata, @@ -353,7 +382,7 @@ fn choose_max_dict_size(uncompressed_size: usize) -> usize { fn collect_valid_primitive(parray: &PrimitiveArray) -> VortexResult { let mask = parray.validity_mask()?; - Ok(parray.clone().into_array().filter(mask)?.to_primitive()) + Ok(parray.filter(mask)?.to_primitive()) } fn collect_valid_vbv(vbv: &VarBinViewArray) -> VortexResult<(ByteBuffer, Vec)> { @@ -433,7 +462,7 @@ pub fn reconstruct_views( (buffers, views.freeze()) } -impl ZstdArray { +impl ZstdData { pub fn new( dictionary: Option, frames: Vec, @@ -599,7 +628,7 @@ impl ZstdArray { frames: frame_metas, }; - Ok(ZstdArray::new( + Ok(ZstdData::new( dictionary, frames, dtype, @@ -690,7 +719,7 @@ impl ZstdArray { .try_into()?, frames: frame_metas, }; - Ok(ZstdArray::new( + Ok(ZstdData::new( dictionary, frames, dtype, @@ -706,12 +735,12 @@ impl ZstdArray { values_per_frame: usize, ) -> VortexResult> { match canonical { - Canonical::Primitive(parray) => Ok(Some(ZstdArray::from_primitive( + Canonical::Primitive(parray) => Ok(Some(ZstdData::from_primitive( parray, level, values_per_frame, )?)), - Canonical::VarBinView(vbv) => Ok(Some(ZstdArray::from_var_bin_view( + Canonical::VarBinView(vbv) => Ok(Some(ZstdData::from_var_bin_view( vbv, level, values_per_frame, @@ -917,12 +946,13 @@ impl ZstdArray { self.slice_stop ); - ZstdArray { + Array::try_from_data(ZstdData { slice_start: self.slice_start + start, slice_stop: self.slice_start + stop, stats_set: Default::default(), ..self.clone() - } + }) + .vortex_expect("ZstdData is always valid") } /// Consumes the array and returns its parts. @@ -939,7 +969,21 @@ impl ZstdArray { } } - pub(crate) fn dtype(&self) -> &DType { + /// Returns the length of the array. + #[inline] + pub fn len(&self) -> usize { + self.slice_stop - self.slice_start + } + + /// Returns whether the array is empty. + #[inline] + pub fn is_empty(&self) -> bool { + self.slice_stop == self.slice_start + } + + /// Returns the logical data type of the array. + #[inline] + pub fn dtype(&self) -> &DType { &self.dtype } @@ -956,14 +1000,18 @@ impl ZstdArray { } } -impl ValiditySliceHelper for ZstdArray { +impl ValiditySliceHelper for ZstdData { fn unsliced_validity_and_slice(&self) -> (&Validity, usize, usize) { (&self.unsliced_validity, self.slice_start, self.slice_stop) } } impl OperationsVTable for Zstd { - fn scalar_at(array: &ZstdArray, index: usize, _ctx: &mut ExecutionCtx) -> VortexResult { + fn scalar_at( + array: &Array, + index: usize, + _ctx: &mut ExecutionCtx, + ) -> VortexResult { let mut ctx = LEGACY_SESSION.create_execution_ctx(); array ._slice(index, index + 1) diff --git a/encodings/zstd/src/compute/cast.rs b/encodings/zstd/src/compute/cast.rs index f57637df88c..02d7ba436ef 100644 --- a/encodings/zstd/src/compute/cast.rs +++ b/encodings/zstd/src/compute/cast.rs @@ -7,11 +7,12 @@ use vortex_array::dtype::DType; use vortex_array::dtype::Nullability; use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_array::validity::Validity; +use vortex_array::vtable::ValiditySliceHelper; use vortex_error::VortexResult; use crate::Zstd; use crate::ZstdArray; - +use crate::ZstdData; impl CastReduce for Zstd { fn cast(array: &ZstdArray, dtype: &DType) -> VortexResult> { if !dtype.eq_ignore_nullability(array.dtype()) { @@ -33,7 +34,7 @@ impl CastReduce for Zstd { (Nullability::NonNullable, Nullability::Nullable) => { // nonnull => null, trivial cast by altering the validity Ok(Some( - ZstdArray::new( + ZstdData::new( array.dictionary.clone(), array.frames.clone(), dtype.clone(), @@ -41,13 +42,14 @@ impl CastReduce for Zstd { array.unsliced_n_rows(), array.unsliced_validity.clone(), ) + .into_array() .slice(array.slice_start()..array.slice_stop())?, )) } (Nullability::Nullable, Nullability::NonNullable) => { // null => non-null works if there are no nulls in the sliced range let has_nulls = !matches!( - array.validity()?, + array.sliced_validity()?, Validity::AllValid | Validity::NonNullable ); @@ -58,7 +60,7 @@ impl CastReduce for Zstd { // If there are no nulls, the cast is trivial Ok(Some( - ZstdArray::new( + ZstdData::new( array.dictionary.clone(), array.frames.clone(), dtype.clone(), @@ -66,6 +68,7 @@ impl CastReduce for Zstd { array.unsliced_n_rows(), array.unsliced_validity.clone(), ) + .into_array() .slice(array.slice_start()..array.slice_stop())?, )) } @@ -88,12 +91,12 @@ mod tests { use vortex_array::validity::Validity; use vortex_buffer::buffer; - use crate::ZstdArray; + use crate::Zstd; #[test] fn test_cast_zstd_i32_to_i64() { let values = PrimitiveArray::from_iter([1i32, 2, 3, 4, 5]); - let zstd = ZstdArray::from_primitive(&values, 0, 0).unwrap(); + let zstd = Zstd::from_primitive(&values, 0, 0).unwrap(); let casted = zstd .into_array() @@ -111,7 +114,7 @@ mod tests { #[test] fn test_cast_zstd_nullability_change() { let values = PrimitiveArray::from_iter([10u32, 20, 30, 40]); - let zstd = ZstdArray::from_primitive(&values, 0, 0).unwrap(); + let zstd = Zstd::from_primitive(&values, 0, 0).unwrap(); let casted = zstd .into_array() @@ -129,7 +132,7 @@ mod tests { buffer![10u32, 20, 30, 40, 50, 60], Validity::from_iter([true, true, true, true, true, true]), ); - let zstd = ZstdArray::from_primitive(&values, 0, 128).unwrap(); + let zstd = Zstd::from_primitive(&values, 0, 128).unwrap(); let sliced = zstd.slice(1..5).unwrap(); let casted = sliced .cast(DType::Primitive(PType::U32, Nullability::NonNullable)) @@ -153,7 +156,7 @@ mod tests { Some(50), Some(60), ]); - let zstd = ZstdArray::from_primitive(&values, 0, 128).unwrap(); + let zstd = Zstd::from_primitive(&values, 0, 128).unwrap(); let sliced = zstd.slice(1..5).unwrap(); let casted = sliced .cast(DType::Primitive(PType::U32, Nullability::NonNullable)) @@ -185,7 +188,7 @@ mod tests { Validity::NonNullable, ))] fn test_cast_zstd_conformance(#[case] values: PrimitiveArray) { - let zstd = ZstdArray::from_primitive(&values, 0, 0).unwrap(); + let zstd = Zstd::from_primitive(&values, 0, 0).unwrap(); test_cast_conformance(&zstd.into_array()); } } diff --git a/encodings/zstd/src/compute/mod.rs b/encodings/zstd/src/compute/mod.rs index 73e941b82c3..adf6937c246 100644 --- a/encodings/zstd/src/compute/mod.rs +++ b/encodings/zstd/src/compute/mod.rs @@ -11,27 +11,28 @@ mod tests { use vortex_array::compute::conformance::consistency::test_array_consistency; use vortex_buffer::buffer; + use crate::Zstd; use crate::ZstdArray; fn zstd_i32() -> ZstdArray { let values = PrimitiveArray::from_iter([100i32, 200, 300, 400, 500]); - ZstdArray::from_primitive(&values, 0, 0).unwrap() + Zstd::from_primitive(&values, 0, 0).unwrap() } fn zstd_f64() -> ZstdArray { let values = PrimitiveArray::from_iter([1.1f64, 2.2, 3.3, 4.4, 5.5]); - ZstdArray::from_primitive(&values, 0, 0).unwrap() + Zstd::from_primitive(&values, 0, 0).unwrap() } fn zstd_u32() -> ZstdArray { let values = PrimitiveArray::from_iter([10u32, 20, 30, 40, 50]); - ZstdArray::from_primitive(&values, 0, 0).unwrap() + Zstd::from_primitive(&values, 0, 0).unwrap() } fn zstd_nullable_i64() -> ZstdArray { let values = PrimitiveArray::from_option_iter([Some(1000i64), None, Some(3000), Some(4000), None]); - ZstdArray::from_primitive(&values, 0, 0).unwrap() + Zstd::from_primitive(&values, 0, 0).unwrap() } fn zstd_single() -> ZstdArray { @@ -39,7 +40,7 @@ mod tests { buffer![42i64], vortex_array::validity::Validity::NonNullable, ); - ZstdArray::from_primitive(&values, 0, 0).unwrap() + Zstd::from_primitive(&values, 0, 0).unwrap() } fn zstd_large() -> ZstdArray { @@ -47,7 +48,7 @@ mod tests { buffer![0u32..1000], vortex_array::validity::Validity::NonNullable, ); - ZstdArray::from_primitive(&values, 3, 0).unwrap() + Zstd::from_primitive(&values, 3, 0).unwrap() } fn zstd_all_same() -> ZstdArray { @@ -55,12 +56,12 @@ mod tests { buffer![42i32; 100], vortex_array::validity::Validity::NonNullable, ); - ZstdArray::from_primitive(&values, 0, 0).unwrap() + Zstd::from_primitive(&values, 0, 0).unwrap() } fn zstd_negative() -> ZstdArray { let values = PrimitiveArray::from_iter([-100i32, -50, 0, 50, 100]); - ZstdArray::from_primitive(&values, 0, 0).unwrap() + Zstd::from_primitive(&values, 0, 0).unwrap() } #[rstest] diff --git a/encodings/zstd/src/slice.rs b/encodings/zstd/src/slice.rs index ddc300f7233..7b5500d924b 100644 --- a/encodings/zstd/src/slice.rs +++ b/encodings/zstd/src/slice.rs @@ -6,13 +6,14 @@ use std::ops::Range; use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::arrays::slice::SliceReduce; +use vortex_array::vtable::Array; use vortex_error::VortexResult; use crate::Zstd; use crate::ZstdArray; impl SliceReduce for Zstd { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { Ok(Some(slice_zstd(array, range))) } } diff --git a/encodings/zstd/src/test.rs b/encodings/zstd/src/test.rs index d17fe512824..0574b70ddd6 100644 --- a/encodings/zstd/src/test.rs +++ b/encodings/zstd/src/test.rs @@ -2,6 +2,7 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors #![allow(clippy::cast_possible_truncation)] +use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::LEGACY_SESSION; use vortex_array::ToCanonical; @@ -14,21 +15,20 @@ use vortex_array::assert_nth_scalar; use vortex_array::dtype::DType; use vortex_array::dtype::Nullability; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::Alignment; use vortex_buffer::Buffer; use vortex_mask::Mask; -use crate::ZstdArray; +use crate::Zstd; #[test] fn test_zstd_compress_decompress() { let data: Vec = (0..200).collect(); let array = PrimitiveArray::from_iter(data.clone()); - let compressed = ZstdArray::from_primitive(&array, 3, 0).unwrap(); + let compressed = Zstd::from_primitive(&array, 3, 0).unwrap(); // this data should be compressible - assert!(compressed.frames.len() < array.nbytes() as usize); + assert!(compressed.frames.len() < array.into_array().nbytes() as usize); assert!(compressed.dictionary.is_none()); // check full decompression works @@ -55,7 +55,7 @@ fn test_zstd_empty() { Validity::NonNullable, ); - let compressed = ZstdArray::from_primitive(&array, 3, 100).unwrap(); + let compressed = Zstd::from_primitive(&array, 3, 100).unwrap(); assert_arrays_eq!(compressed, PrimitiveArray::from_iter(data)); } @@ -71,7 +71,7 @@ fn test_zstd_with_validity_and_multi_frame() { Validity::Array(BoolArray::from_iter(validity).into_array()), ); - let compressed = ZstdArray::from_primitive(&array, 0, 30).unwrap(); + let compressed = Zstd::from_primitive(&array, 0, 30).unwrap(); assert!(compressed.dictionary.is_none()); assert_nth_scalar!(compressed, 0, None::); assert_nth_scalar!(compressed, 3, 3); @@ -116,7 +116,7 @@ fn test_zstd_with_dict() { Validity::NonNullable, ); - let compressed = ZstdArray::from_primitive(&array, 0, 16).unwrap(); + let compressed = Zstd::from_primitive(&array, 0, 16).unwrap(); assert!(compressed.dictionary.is_some()); assert_nth_scalar!(compressed, 0, 0); assert_nth_scalar!(compressed, 199, 199); @@ -138,9 +138,9 @@ fn test_validity_vtable() { (0..5).collect::>(), Validity::Array(BoolArray::from_iter(mask_bools.clone()).into_array()), ); - let compressed = ZstdArray::from_primitive(&array, 3, 0).unwrap(); + let compressed = Zstd::from_primitive(&array, 3, 0).unwrap(); assert_eq!( - compressed.validity_mask().unwrap(), + DynArray::validity_mask(&compressed).unwrap(), Mask::from_iter(mask_bools) ); assert_eq!( @@ -160,7 +160,7 @@ fn test_zstd_var_bin_view() { ]; let array = VarBinViewArray::from_iter(data, DType::Utf8(Nullability::Nullable)); - let compressed = ZstdArray::from_var_bin_view(&array, 0, 3).unwrap(); + let compressed = Zstd::from_var_bin_view(&array, 0, 3).unwrap(); assert!(compressed.dictionary.is_none()); assert_nth_scalar!(compressed, 0, "foo"); assert_nth_scalar!(compressed, 1, "bar"); @@ -185,7 +185,7 @@ fn test_zstd_decompress_var_bin_view() { ]; let array = VarBinViewArray::from_iter(data, DType::Utf8(Nullability::Nullable)); - let compressed = ZstdArray::from_var_bin_view(&array, 0, 3).unwrap(); + let compressed = Zstd::from_var_bin_view(&array, 0, 3).unwrap(); assert!(compressed.dictionary.is_none()); assert_nth_scalar!(compressed, 0, "foo"); assert_nth_scalar!(compressed, 1, "bar"); @@ -205,8 +205,7 @@ fn test_zstd_decompress_var_bin_view() { #[test] fn test_sliced_array_children() { let data: Vec> = (0..10).map(|v| (v != 5).then_some(v)).collect(); - let compressed = - ZstdArray::from_primitive(&PrimitiveArray::from_option_iter(data), 0, 100).unwrap(); + let compressed = Zstd::from_primitive(&PrimitiveArray::from_option_iter(data), 0, 100).unwrap(); let sliced = compressed.slice(0..4).unwrap(); sliced.children(); } @@ -219,7 +218,7 @@ fn test_zstd_frame_start_buffer_alignment() { let aligned_buffer = Buffer::copy_from_aligned(&data, Alignment::new(8)); // u8 array now has a 8-byte alignment. let array = PrimitiveArray::new(aligned_buffer, Validity::NonNullable); - let compressed = ZstdArray::from_primitive(&array, 0, 1); + let compressed = Zstd::from_primitive(&array, 0, 1); assert!(compressed.is_ok()); } diff --git a/encodings/zstd/src/zstd_buffers.rs b/encodings/zstd/src/zstd_buffers.rs index b84f341a3fc..45854ed6a1d 100644 --- a/encodings/zstd/src/zstd_buffers.rs +++ b/encodings/zstd/src/zstd_buffers.rs @@ -11,6 +11,7 @@ use vortex_array::ArrayHash; use vortex_array::ArrayRef; use vortex_array::ExecutionCtx; use vortex_array::ExecutionResult; +use vortex_array::IntoArray; use vortex_array::Precision; use vortex_array::ProstMetadata; use vortex_array::buffer::BufferHandle; @@ -19,7 +20,6 @@ use vortex_array::scalar::Scalar; use vortex_array::serde::ArrayChildren; use vortex_array::session::ArraySessionExt; use vortex_array::stats::ArrayStats; -use vortex_array::stats::StatsSetRef; use vortex_array::vtable; use vortex_array::vtable::Array; use vortex_array::vtable::ArrayId; @@ -36,7 +36,7 @@ use vortex_session::VortexSession; use crate::ZstdBuffersMetadata; -vtable!(ZstdBuffers); +vtable!(ZstdBuffers, ZstdBuffers, ZstdBuffersData); #[derive(Clone, Debug)] pub struct ZstdBuffers; @@ -51,7 +51,7 @@ impl ZstdBuffers { /// `ZstdBuffersArray` compresses each buffer independently. This enables zero-conversion /// GPU decompression since the original buffer layout is preserved after decompression. #[derive(Clone, Debug)] -pub struct ZstdBuffersArray { +pub struct ZstdBuffersData { inner_encoding_id: ArrayId, inner_metadata: Vec, compressed_buffers: Vec, @@ -122,7 +122,25 @@ impl ZstdBuffersDecodePlan { } } -impl ZstdBuffersArray { +impl ZstdBuffersData { + /// Returns the length of the array. + #[inline] + pub fn len(&self) -> usize { + self.len + } + + /// Returns whether the array is empty. + #[inline] + pub fn is_empty(&self) -> bool { + self.len == 0 + } + + /// Returns the logical data type of the array. + #[inline] + pub fn dtype(&self) -> &DType { + &self.dtype + } + fn validate(&self) -> VortexResult<()> { vortex_ensure_eq!( self.compressed_buffers.len(), @@ -178,9 +196,10 @@ impl ZstdBuffersArray { len: array.len(), stats_set: Default::default(), }; + let compressed_ref = compressed.clone().into_array(); compressed .stats_set - .to_ref(compressed.as_ref()) + .to_ref(&*compressed_ref) .inherit_from(array.statistics()); Ok(compressed) } @@ -325,13 +344,13 @@ fn array_id_from_string(s: &str) -> ArrayId { } impl VTable for ZstdBuffers { - type Array = ZstdBuffersArray; + type ArrayData = ZstdBuffersData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = Self; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &ZstdBuffers } @@ -339,23 +358,19 @@ impl VTable for ZstdBuffers { Self::ID } - fn len(array: &ZstdBuffersArray) -> usize { + fn len(array: &ZstdBuffersData) -> usize { array.len } - fn dtype(array: &ZstdBuffersArray) -> &DType { + fn dtype(array: &ZstdBuffersData) -> &DType { &array.dtype } - fn stats(array: &ZstdBuffersArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &ZstdBuffersData) -> &ArrayStats { + &array.stats_set } - fn array_hash( - array: &ZstdBuffersArray, - state: &mut H, - precision: Precision, - ) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.inner_encoding_id.hash(state); array.inner_metadata.hash(state); for buf in &array.compressed_buffers { @@ -370,7 +385,7 @@ impl VTable for ZstdBuffers { } } - fn array_eq(array: &ZstdBuffersArray, other: &ZstdBuffersArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.inner_encoding_id == other.inner_encoding_id && array.inner_metadata == other.inner_metadata && array.compressed_buffers.len() == other.compressed_buffers.len() @@ -391,31 +406,31 @@ impl VTable for ZstdBuffers { .all(|(a, b)| a.array_eq(b, precision)) } - fn nbuffers(array: &ZstdBuffersArray) -> usize { + fn nbuffers(array: &Array) -> usize { array.compressed_buffers.len() } - fn buffer(array: &ZstdBuffersArray, idx: usize) -> BufferHandle { + fn buffer(array: &Array, idx: usize) -> BufferHandle { array.compressed_buffers[idx].clone() } - fn buffer_name(_array: &ZstdBuffersArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { Some(format!("compressed_{idx}")) } - fn nchildren(array: &ZstdBuffersArray) -> usize { + fn nchildren(array: &Array) -> usize { array.children.len() } - fn child(array: &ZstdBuffersArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { array.children[idx].clone() } - fn child_name(_array: &ZstdBuffersArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { format!("child_{idx}") } - fn metadata(array: &ZstdBuffersArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(ZstdBuffersMetadata { inner_encoding_id: array.inner_encoding_id.to_string(), inner_metadata: array.inner_metadata.clone(), @@ -444,14 +459,14 @@ impl VTable for ZstdBuffers { metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let compressed_buffers: Vec = buffers.to_vec(); let child_arrays: Vec = (0..children.len()) .map(|i| children.get(i, dtype, len)) .collect::>>()?; - let array = ZstdBuffersArray { + let data = ZstdBuffersData { inner_encoding_id: array_id_from_string(&metadata.0.inner_encoding_id), inner_metadata: metadata.0.inner_metadata.clone(), compressed_buffers, @@ -463,11 +478,11 @@ impl VTable for ZstdBuffers { stats_set: Default::default(), }; - array.validate()?; - Ok(array) + data.validate()?; + Ok(data) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { array.children = children; Ok(()) } @@ -483,7 +498,7 @@ impl VTable for ZstdBuffers { impl OperationsVTable for ZstdBuffers { fn scalar_at( - array: &ZstdBuffersArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -496,7 +511,7 @@ impl OperationsVTable for ZstdBuffers { } impl ValidityVTable for ZstdBuffers { - fn validity(array: &ZstdBuffersArray) -> VortexResult { + fn validity(array: &Array) -> VortexResult { if !array.dtype.is_nullable() { return Ok(vortex_array::validity::Validity::NonNullable); } @@ -563,7 +578,7 @@ mod tests { #[case::empty_primitive(make_empty_primitive_array())] #[case::inlined_varbinview(make_inlined_varbinview_array())] fn test_roundtrip(#[case] input: ArrayRef) -> VortexResult<()> { - let compressed = ZstdBuffersArray::compress(&input, 3)?; + let compressed = ZstdBuffersData::compress(&input, 3)?; assert_eq!(compressed.len, input.len()); assert_eq!(&compressed.dtype, input.dtype()); @@ -580,7 +595,8 @@ mod tests { let input = make_primitive_array(); input.statistics().set(Stat::Min, Precision::exact(0i32)); - let compressed = ZstdBuffersArray::compress(&input, 3)?; + let compressed = ZstdBuffersData::compress(&input, 3)?; + let compressed = ZstdBuffersArray::try_from_data(compressed)?; assert!(compressed.statistics().get(Stat::Min).is_some()); Ok(()) @@ -589,7 +605,7 @@ mod tests { #[test] fn test_validity_delegates_for_nullable_input() -> VortexResult<()> { let input = make_nullable_primitive_array(); - let compressed = ZstdBuffersArray::compress(&input, 3)?.into_array(); + let compressed = ZstdBuffersData::compress(&input, 3)?.into_array(); assert_eq!(compressed.all_valid()?, input.all_valid()?); assert_eq!(compressed.all_invalid()?, input.all_invalid()?); diff --git a/fuzz/fuzz_targets/file_io.rs b/fuzz/fuzz_targets/file_io.rs index a67ceb53fb3..b2877b62f33 100644 --- a/fuzz/fuzz_targets/file_io.rs +++ b/fuzz/fuzz_targets/file_io.rs @@ -113,7 +113,10 @@ fuzz_target!(|fuzz: FuzzFileAction| -> Corpus { .to_bool(); let true_count = bool_result.to_bit_buffer().true_count(); if true_count != expected_array.len() - && (bool_result.all_valid().vortex_expect("all_valid") + && (bool_result + .into_array() + .all_valid() + .vortex_expect("all_valid") || expected_array.all_valid().vortex_expect("all_valid")) { vortex_panic!( diff --git a/fuzz/src/array/fill_null.rs b/fuzz/src/array/fill_null.rs index 8dc89c8a682..23a58b494f8 100644 --- a/fuzz/src/array/fill_null.rs +++ b/fuzz/src/array/fill_null.rs @@ -3,6 +3,7 @@ use vortex_array::ArrayRef; use vortex_array::Canonical; +use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::ToCanonical; use vortex_array::arrays::BoolArray; @@ -17,7 +18,6 @@ use vortex_array::match_each_decimal_value_type; use vortex_array::match_each_native_ptype; use vortex_array::scalar::Scalar; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::Buffer; use vortex_buffer::BufferMut; use vortex_error::VortexExpect; @@ -175,6 +175,7 @@ fn fill_varbinview_array( fill_value: &Scalar, result_nullability: Nullability, ) -> ArrayRef { + let array_ref = array.clone().into_array(); match array.validity() { Validity::NonNullable | Validity::AllValid => array.clone().into_array(), Validity::AllInvalid => ConstantArray::new(fill_value.clone(), array.len()).into_array(), @@ -191,7 +192,7 @@ fn fill_varbinview_array( let strings: Vec = (0..array.len()) .map(|i| { if validity_bits.value(i) { - array + array_ref .scalar_at(i) .vortex_expect("scalar_at") .as_utf8() @@ -208,7 +209,7 @@ fn fill_varbinview_array( if result_nullability == Nullability::Nullable { VarBinViewArray::new_handle( result.to_varbinview().views_handle().clone(), - result.to_varbinview().buffers().clone(), + result.to_varbinview().data_buffers().clone(), result.dtype().as_nullable(), result_nullability.into(), ) @@ -225,7 +226,7 @@ fn fill_varbinview_array( let binaries: Vec> = (0..array.len()) .map(|i| { if validity_bits.value(i) { - array + array_ref .scalar_at(i) .vortex_expect("scalar_at") .as_binary() @@ -242,7 +243,7 @@ fn fill_varbinview_array( if result_nullability == Nullability::Nullable { VarBinViewArray::new_handle( result.to_varbinview().views_handle().clone(), - result.to_varbinview().buffers().clone(), + result.to_varbinview().data_buffers().clone(), result.dtype().as_nullable(), result_nullability.into(), ) diff --git a/fuzz/src/array/mask.rs b/fuzz/src/array/mask.rs index 170db177854..3b239421592 100644 --- a/fuzz/src/array/mask.rs +++ b/fuzz/src/array/mask.rs @@ -17,7 +17,6 @@ use vortex_array::arrays::VarBinViewArray; use vortex_array::dtype::Nullability; use vortex_array::match_each_decimal_value_type; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_mask::AllOr; @@ -83,7 +82,7 @@ pub fn mask_canonical_array(canonical: Canonical, mask: &Mask) -> VortexResult VortexResult { - if canonical.as_ref().is_invalid(index)? { - return Ok(Scalar::null(canonical.as_ref().dtype().clone())); + let canonical_ref = canonical.clone().into_array(); + if canonical_ref.is_invalid(index)? { + return Ok(Scalar::null(canonical_ref.dtype().clone())); } Ok(match canonical { Canonical::Null(_array) => Scalar::null(DType::Null), diff --git a/fuzz/src/fsst_like.rs b/fuzz/src/fsst_like.rs index f2f0f3bac48..a91255405c3 100644 --- a/fuzz/src/fsst_like.rs +++ b/fuzz/src/fsst_like.rs @@ -20,6 +20,7 @@ use vortex_array::dtype::Nullability; use vortex_array::scalar_fn::fns::like::Like; use vortex_array::scalar_fn::fns::like::LikeOptions; use vortex_array::session::ArraySession; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_fsst::FSSTArray; use vortex_fsst::fsst_compress; @@ -111,7 +112,13 @@ pub fn run_fsst_like_fuzz(fuzz: FuzzFsstLike) -> VortexFuzzResult { // Train FSST compressor and compress. let compressor = fsst_train_compressor(&varbin); - let fsst_array: FSSTArray = fsst_compress(varbin.clone(), &compressor); + let fsst_array: FSSTArray = vortex_array::vtable::Array::try_from_data(fsst_compress( + varbin.clone(), + varbin.len(), + varbin.dtype(), + &compressor, + )) + .vortex_expect("data is always valid"); let opts = LikeOptions { negated, diff --git a/java/testfiles/src/main.rs b/java/testfiles/src/main.rs index 206db638726..a1390156fa3 100644 --- a/java/testfiles/src/main.rs +++ b/java/testfiles/src/main.rs @@ -5,16 +5,20 @@ use std::path::Path; +use vortex::VortexSessionDefault; use vortex::array::arrays::StructArray; -use vortex::array::builders::{ArrayBuilder, DecimalBuilder, VarBinViewBuilder}; +use vortex::array::builders::ArrayBuilder; +use vortex::array::builders::DecimalBuilder; +use vortex::array::builders::VarBinViewBuilder; use vortex::array::validity::Validity; -use vortex::dtype::{DType, DecimalDType, Nullability}; +use vortex::dtype::DType; +use vortex::dtype::DecimalDType; +use vortex::dtype::Nullability; use vortex::file::WriteOptionsSessionExt; -use vortex::io::runtime::current::CurrentThreadRuntime; use vortex::io::runtime::BlockingRuntime; +use vortex::io::runtime::current::CurrentThreadRuntime; use vortex::io::session::RuntimeSessionExt; use vortex::session::VortexSession; -use vortex::VortexSessionDefault; /// Generate a test dataset with the following small set of rows: /// @@ -74,7 +78,8 @@ fn main() { 10, Validity::NonNullable, ) - .expect("Could not create struct array"); + .expect("Could not create struct array") + .to_array_ref(); // Save to file let minimal_path = Path::new(env!("CARGO_MANIFEST_DIR")) diff --git a/vortex-array/benches/dict_compare.rs b/vortex-array/benches/dict_compare.rs index 0b1945bf370..e8e03859bba 100644 --- a/vortex-array/benches/dict_compare.rs +++ b/vortex-array/benches/dict_compare.rs @@ -6,6 +6,7 @@ use std::str::from_utf8; use vortex_array::Canonical; +use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::RecursiveCanonical; use vortex_array::VortexSessionExecute; @@ -123,7 +124,7 @@ fn bench_compare_sliced_dict_primitive( ) { let primitive_arr = gen_primitive_for_dict::(codes_len.max(values_len), values_len); let dict = dict_encode(&primitive_arr.clone().into_array()).unwrap(); - let dict = dict.slice(0..codes_len).unwrap(); + let dict = dict.into_array().slice(0..codes_len).unwrap(); let value = primitive_arr.as_slice::()[0]; let session = VortexSession::empty(); @@ -144,7 +145,7 @@ fn bench_compare_sliced_dict_varbinview( ) { let varbin_arr = VarBinArray::from(gen_varbin_words(codes_len.max(values_len), values_len)); let dict = dict_encode(&varbin_arr.clone().into_array()).unwrap(); - let dict = dict.slice(0..codes_len).unwrap(); + let dict = dict.into_array().slice(0..codes_len).unwrap(); let bytes = varbin_arr.with_iterator(|i| i.next().unwrap().unwrap().to_vec()); let value = from_utf8(bytes.as_slice()).unwrap(); let session = VortexSession::empty(); diff --git a/vortex-array/benches/dict_compress.rs b/vortex-array/benches/dict_compress.rs index b52d66a031c..4a03d6745fc 100644 --- a/vortex-array/benches/dict_compress.rs +++ b/vortex-array/benches/dict_compress.rs @@ -6,6 +6,7 @@ use divan::Bencher; use rand::distr::Distribution; use rand::distr::StandardUniform; +use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::arrays::VarBinArray; use vortex_array::arrays::VarBinViewArray; @@ -70,7 +71,9 @@ where StandardUniform: Distribution, { let primitive_arr = gen_primitive_for_dict::(len, unique_values); - let dict = dict_encode(&primitive_arr.into_array()).unwrap(); + let dict = dict_encode(&primitive_arr.into_array()) + .unwrap() + .into_array(); bencher .with_inputs(|| &dict) @@ -80,7 +83,7 @@ where #[divan::bench(args = BENCH_ARGS)] fn decode_varbin(bencher: Bencher, (len, unique_values): (usize, usize)) { let varbin_arr = VarBinArray::from(gen_varbin_words(len, unique_values)); - let dict = dict_encode(&varbin_arr.into_array()).unwrap(); + let dict = dict_encode(&varbin_arr.into_array()).unwrap().into_array(); bencher .with_inputs(|| &dict) @@ -90,7 +93,9 @@ fn decode_varbin(bencher: Bencher, (len, unique_values): (usize, usize)) { #[divan::bench(args = BENCH_ARGS)] fn decode_varbinview(bencher: Bencher, (len, unique_values): (usize, usize)) { let varbinview_arr = VarBinViewArray::from_iter_str(gen_varbin_words(len, unique_values)); - let dict = dict_encode(&varbinview_arr.into_array()).unwrap(); + let dict = dict_encode(&varbinview_arr.into_array()) + .unwrap() + .into_array(); bencher .with_inputs(|| &dict) diff --git a/vortex-array/benches/filter_bool.rs b/vortex-array/benches/filter_bool.rs index 68971772da4..c346f653814 100644 --- a/vortex-array/benches/filter_bool.rs +++ b/vortex-array/benches/filter_bool.rs @@ -147,6 +147,7 @@ fn filter_random_by_mostly_true(bencher: Bencher, n: usize) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -166,6 +167,7 @@ fn filter_random_by_mostly_false(bencher: Bencher, n: usize) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -185,6 +187,7 @@ fn filter_random_by_random(bencher: Bencher, n: usize) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -204,6 +207,7 @@ fn filter_random_by_correlated_runs(bencher: Bencher, n: usize) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -223,6 +227,7 @@ fn filter_random_by_power_law(bencher: Bencher, n: usize) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -244,6 +249,7 @@ fn filter_powerlaw_by_mostly_true(bencher: Bencher, n: usize) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -263,6 +269,7 @@ fn filter_powerlaw_by_mostly_false(bencher: Bencher, n: usize) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -282,6 +289,7 @@ fn filter_powerlaw_by_random(bencher: Bencher, n: usize) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -301,6 +309,7 @@ fn filter_powerlaw_by_correlated_runs(bencher: Bencher, n: usize) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -320,6 +329,7 @@ fn filter_powerlaw_by_power_law(bencher: Bencher, n: usize) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -345,6 +355,7 @@ fn density_sweep_random(bencher: Bencher, density: f64) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -365,6 +376,7 @@ fn density_sweep_dense_runs(bencher: Bencher, density: f64) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -384,6 +396,7 @@ fn density_sweep_single_slice(bencher: Bencher, density: f64) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -407,6 +420,7 @@ fn filter_all_true(bencher: Bencher, n: usize) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -428,6 +442,7 @@ fn filter_one_false(bencher: Bencher, n: usize) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) @@ -447,6 +462,7 @@ fn filter_ultra_sparse(bencher: Bencher, n: usize) { }) .bench_refs(|(array, m, ctx)| { array + .clone() .filter(m.clone()) .unwrap() .execute::(ctx) diff --git a/vortex-array/benches/scalar_at_struct.rs b/vortex-array/benches/scalar_at_struct.rs index 3a54dea249e..444f295f7bd 100644 --- a/vortex-array/benches/scalar_at_struct.rs +++ b/vortex-array/benches/scalar_at_struct.rs @@ -8,6 +8,8 @@ use rand::RngExt; use rand::SeedableRng; use rand::distr::Uniform; use rand::rngs::StdRng; +use vortex_array::ArrayRef; +use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::arrays::StructArray; use vortex_array::dtype::FieldNames; @@ -39,6 +41,7 @@ fn scalar_at_struct_simple(bencher: Bencher) { Validity::NonNullable, ) .unwrap(); + let struct_array: ArrayRef = struct_array.into_array(); let indices: Vec = (0..NUM_ACCESSES) .map(|_| rng.random_range(0..ARRAY_SIZE)) @@ -72,8 +75,10 @@ fn scalar_at_struct_wide(bencher: Bencher) { "field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", ]); - let struct_array = - StructArray::try_new(field_names, fields, ARRAY_SIZE, Validity::NonNullable).unwrap(); + let struct_array: ArrayRef = + StructArray::try_new(field_names, fields, ARRAY_SIZE, Validity::NonNullable) + .unwrap() + .into_array(); let indices: Vec = (0..NUM_ACCESSES) .map(|_| rng.random_range(0..ARRAY_SIZE)) diff --git a/vortex-array/benches/take_fsl.rs b/vortex-array/benches/take_fsl.rs index e22a18f5210..e6e4ea9ee28 100644 --- a/vortex-array/benches/take_fsl.rs +++ b/vortex-array/benches/take_fsl.rs @@ -66,6 +66,7 @@ fn take_fsl_random(bencher: Bencher, num_indices: usize) .with_inputs(|| (&fsl, &indices_array, LEGACY_SESSION.create_execution_ctx())) .bench_refs(|(array, indices, execution_ctx)| { array + .clone() .take(indices.to_array()) .unwrap() .execute::(execution_ctx) @@ -91,6 +92,7 @@ fn take_fsl_nullable_random(bencher: Bencher, num_indice .with_inputs(|| (&fsl, &indices_array, LEGACY_SESSION.create_execution_ctx())) .bench_refs(|(array, indices, execution_ctx)| { array + .clone() .take(indices.to_array()) .unwrap() .execute::(execution_ctx) diff --git a/vortex-array/benches/take_struct.rs b/vortex-array/benches/take_struct.rs index 96acd2e01ef..1e37d8dbe98 100644 --- a/vortex-array/benches/take_struct.rs +++ b/vortex-array/benches/take_struct.rs @@ -42,7 +42,8 @@ fn take_struct_simple(bencher: Bencher) { ARRAY_SIZE, Validity::NonNullable, ) - .unwrap(); + .unwrap() + .into_array(); let indices: Buffer = (0..TAKE_SIZE) .map(|_| rng.random_range(0..ARRAY_SIZE) as u64) @@ -59,7 +60,7 @@ fn take_struct_simple(bencher: Bencher) { }) .bench_refs(|(array, indices, ctx)| { array - .take(indices.to_array()) + .take((*indices).clone()) .unwrap() .execute::(ctx) }); @@ -83,8 +84,9 @@ fn take_struct_wide(bencher: Bencher, width: usize) { "field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", ]); - let struct_array = - StructArray::try_new(field_names, fields, ARRAY_SIZE, Validity::NonNullable).unwrap(); + let struct_array = StructArray::try_new(field_names, fields, ARRAY_SIZE, Validity::NonNullable) + .unwrap() + .into_array(); let indices: Buffer = (0..TAKE_SIZE) .map(|_| rng.random_range(0..ARRAY_SIZE) as u64) @@ -101,7 +103,7 @@ fn take_struct_wide(bencher: Bencher, width: usize) { }) .bench_refs(|(array, indices, ctx)| { array - .take(indices.clone()) + .take((*indices).clone()) .unwrap() .execute::(ctx) }); @@ -124,7 +126,8 @@ fn take_struct_sequential_indices(bencher: Bencher) { ARRAY_SIZE, Validity::NonNullable, ) - .unwrap(); + .unwrap() + .into_array(); // Sequential indices for better cache performance let indices: Buffer = (0..TAKE_SIZE as u64).collect(); @@ -140,7 +143,7 @@ fn take_struct_sequential_indices(bencher: Bencher) { }) .bench_refs(|(array, indices, ctx)| { array - .take(indices.to_array()) + .take((*indices).clone()) .unwrap() .execute::(ctx) }); diff --git a/vortex-array/benches/varbinview_compact.rs b/vortex-array/benches/varbinview_compact.rs index 489be8d852d..87aaeac5aab 100644 --- a/vortex-array/benches/varbinview_compact.rs +++ b/vortex-array/benches/varbinview_compact.rs @@ -6,6 +6,7 @@ use rand::RngExt; use rand::SeedableRng; use rand::rngs::StdRng; use vortex_array::ArrayRef; +use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::ToCanonical; use vortex_array::arrays::VarBinViewArray; @@ -42,6 +43,7 @@ fn compact_impl(bencher: Bencher, (output_size, utilization_pct): (usize, usize) let base_array = build_varbinview_fixture(base_size); let indices = random_indices(output_size, base_size); let taken = base_array + .into_array() .take(indices) .vortex_expect("operation should succeed in benchmark"); let array = taken.to_varbinview(); @@ -57,7 +59,7 @@ fn compact_sliced_impl(bencher: Bencher, (output_size, utilization_pct): (usize, let base_size = (output_size * 100) / utilization_pct; let base_array = build_varbinview_fixture(base_size); let sliced = base_array - .as_ref() + .into_array() .slice(0..output_size) .vortex_expect("slice should succeed"); let array = sliced.to_varbinview(); diff --git a/vortex-array/public-api.lock b/vortex-array/public-api.lock index 094917f5137..46f0fc44011 100644 --- a/vortex-array/public-api.lock +++ b/vortex-array/public-api.lock @@ -866,7 +866,7 @@ pub fn vortex_array::arrays::Bool::filter(array: &vortex_array::arrays::BoolArra impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Bool -pub fn vortex_array::arrays::Bool::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Bool::slice(array: &vortex_array::arrays::BoolArray, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::arrays::bool::BoolMaskedValidityRule @@ -888,11 +888,11 @@ pub fn vortex_array::arrays::Bool::mask(array: &vortex_array::arrays::BoolArray, impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Bool -pub fn vortex_array::arrays::Bool::scalar_at(array: &vortex_array::arrays::BoolArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Bool -pub type vortex_array::arrays::Bool::Array = vortex_array::arrays::BoolArray +pub type vortex_array::arrays::Bool::ArrayData = vortex_array::arrays::BoolData pub type vortex_array::arrays::Bool::Metadata = vortex_array::ProstMetadata @@ -900,25 +900,25 @@ pub type vortex_array::arrays::Bool::OperationsVTable = vortex_array::arrays::Bo pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Bool::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Bool::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: &vortex_array::arrays::BoolArray, other: &vortex_array::arrays::BoolArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: &vortex_array::arrays::BoolArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Bool::buffer(array: &vortex_array::arrays::BoolArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Bool::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Bool::buffer_name(_array: &vortex_array::arrays::BoolArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Bool::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Bool::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Bool::child(array: &vortex_array::arrays::BoolArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Bool::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Bool::child_name(_array: &vortex_array::arrays::BoolArray, _idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Bool::child_name(_array: &vortex_array::vtable::Array, _idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Bool::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Bool::dtype(array: &vortex_array::arrays::BoolArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Bool::dtype(array: &vortex_array::arrays::BoolData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Bool::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -926,13 +926,13 @@ pub fn vortex_array::arrays::Bool::execute_parent(array: &vortex_array::vtable:: pub fn vortex_array::arrays::Bool::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Bool::len(array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::Bool::len(array: &vortex_array::arrays::BoolData) -> usize -pub fn vortex_array::arrays::Bool::metadata(array: &vortex_array::arrays::BoolArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Bool::nbuffers(_array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::Bool::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Bool::nchildren(array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::Bool::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Bool::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -940,105 +940,67 @@ pub fn vortex_array::arrays::Bool::reduce_parent(array: &vortex_array::vtable::A pub fn vortex_array::arrays::Bool::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Bool::stats(array: &vortex_array::arrays::BoolArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Bool::stats(array: &vortex_array::arrays::BoolData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Bool::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Bool::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Bool::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Bool::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub struct vortex_array::arrays::bool::BoolArray - -impl vortex_array::arrays::BoolArray - -pub fn vortex_array::arrays::BoolArray::from_indices>(length: usize, indices: I, validity: vortex_array::validity::Validity) -> Self - -pub fn vortex_array::arrays::BoolArray::into_bit_buffer(self) -> vortex_buffer::bit::buf::BitBuffer - -pub fn vortex_array::arrays::BoolArray::into_parts(self) -> vortex_array::arrays::bool::BoolArrayParts - -pub fn vortex_array::arrays::BoolArray::maybe_to_mask(&self) -> vortex_error::VortexResult> - -pub fn vortex_array::arrays::BoolArray::new(bits: vortex_buffer::bit::buf::BitBuffer, validity: vortex_array::validity::Validity) -> Self - -pub fn vortex_array::arrays::BoolArray::new_handle(handle: vortex_array::buffer::BufferHandle, offset: usize, len: usize, validity: vortex_array::validity::Validity) -> Self - -pub unsafe fn vortex_array::arrays::BoolArray::new_unchecked(bits: vortex_buffer::bit::buf::BitBuffer, validity: vortex_array::validity::Validity) -> Self - -pub fn vortex_array::arrays::BoolArray::to_bit_buffer(&self) -> vortex_buffer::bit::buf::BitBuffer - -pub fn vortex_array::arrays::BoolArray::to_mask(&self) -> vortex_mask::Mask - -pub fn vortex_array::arrays::BoolArray::to_mask_fill_null_false(&self) -> vortex_mask::Mask - -pub fn vortex_array::arrays::BoolArray::try_new(bits: vortex_buffer::bit::buf::BitBuffer, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult - -pub fn vortex_array::arrays::BoolArray::try_new_from_handle(bits: vortex_array::buffer::BufferHandle, offset: usize, len: usize, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult - -pub fn vortex_array::arrays::BoolArray::validate(bits: &vortex_buffer::bit::buf::BitBuffer, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> - -impl vortex_array::arrays::BoolArray - -pub fn vortex_array::arrays::BoolArray::patch(self, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult - -impl vortex_array::arrays::BoolArray - -pub fn vortex_array::arrays::BoolArray::to_array(&self) -> vortex_array::ArrayRef - -impl core::clone::Clone for vortex_array::arrays::BoolArray +pub struct vortex_array::arrays::bool::BoolArrayParts -pub fn vortex_array::arrays::BoolArray::clone(&self) -> vortex_array::arrays::BoolArray +pub vortex_array::arrays::bool::BoolArrayParts::bits: vortex_array::buffer::BufferHandle -impl core::convert::AsRef for vortex_array::arrays::BoolArray +pub vortex_array::arrays::bool::BoolArrayParts::len: usize -pub fn vortex_array::arrays::BoolArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub vortex_array::arrays::bool::BoolArrayParts::offset: usize -impl core::convert::From for vortex_array::ArrayRef +pub vortex_array::arrays::bool::BoolArrayParts::validity: vortex_array::validity::Validity -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::BoolArray) -> vortex_array::ArrayRef +pub struct vortex_array::arrays::bool::BoolData -impl core::convert::From for vortex_array::arrays::BoolArray +impl vortex_array::arrays::BoolData -pub fn vortex_array::arrays::BoolArray::from(value: vortex_buffer::bit::buf::BitBuffer) -> Self +pub fn vortex_array::arrays::BoolData::dtype(&self) -> &vortex_array::dtype::DType -impl core::fmt::Debug for vortex_array::arrays::BoolArray +pub fn vortex_array::arrays::BoolData::into_bit_buffer(self) -> vortex_buffer::bit::buf::BitBuffer -pub fn vortex_array::arrays::BoolArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::BoolData::into_parts(self) -> vortex_array::arrays::bool::BoolArrayParts -impl core::iter::traits::collect::FromIterator for vortex_array::arrays::BoolArray +pub fn vortex_array::arrays::BoolData::is_empty(&self) -> bool -pub fn vortex_array::arrays::BoolArray::from_iter>(iter: T) -> Self +pub fn vortex_array::arrays::BoolData::len(&self) -> usize -impl core::iter::traits::collect::FromIterator> for vortex_array::arrays::BoolArray +pub fn vortex_array::arrays::BoolData::maybe_to_mask(&self) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::BoolArray::from_iter>>(iter: I) -> Self +pub fn vortex_array::arrays::BoolData::to_bit_buffer(&self) -> vortex_buffer::bit::buf::BitBuffer -impl core::ops::deref::Deref for vortex_array::arrays::BoolArray +pub fn vortex_array::arrays::BoolData::to_mask(&self) -> vortex_mask::Mask -pub type vortex_array::arrays::BoolArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::arrays::BoolData::to_mask_fill_null_false(&self) -> vortex_mask::Mask -pub fn vortex_array::arrays::BoolArray::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::BoolData::validity(&self) -> &vortex_array::validity::Validity -impl vortex_array::Executable for vortex_array::arrays::BoolArray +pub fn vortex_array::arrays::BoolData::validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::arrays::BoolArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +impl core::clone::Clone for vortex_array::arrays::BoolData -impl vortex_array::IntoArray for vortex_array::arrays::BoolArray +pub fn vortex_array::arrays::BoolData::clone(&self) -> vortex_array::arrays::BoolData -pub fn vortex_array::arrays::BoolArray::into_array(self) -> vortex_array::ArrayRef +impl core::convert::From for vortex_array::ArrayRef -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::BoolArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::BoolData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::BoolArray::validity(&self) -> &vortex_array::validity::Validity +impl core::fmt::Debug for vortex_array::arrays::BoolData -pub struct vortex_array::arrays::bool::BoolArrayParts +pub fn vortex_array::arrays::BoolData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub vortex_array::arrays::bool::BoolArrayParts::bits: vortex_array::buffer::BufferHandle +impl vortex_array::IntoArray for vortex_array::arrays::BoolData -pub vortex_array::arrays::bool::BoolArrayParts::len: usize +pub fn vortex_array::arrays::BoolData::into_array(self) -> vortex_array::ArrayRef -pub vortex_array::arrays::bool::BoolArrayParts::offset: usize +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::BoolData -pub vortex_array::arrays::bool::BoolArrayParts::validity: vortex_array::validity::Validity +pub fn vortex_array::arrays::BoolData::validity(&self) -> &vortex_array::validity::Validity pub struct vortex_array::arrays::bool::BoolMaskedValidityRule @@ -1056,6 +1018,8 @@ pub type vortex_array::arrays::bool::BoolMaskedValidityRule::Parent = vortex_arr pub fn vortex_array::arrays::bool::BoolMaskedValidityRule::reduce_parent(&self, array: &vortex_array::arrays::BoolArray, parent: &vortex_array::arrays::MaskedArray, child_idx: usize) -> vortex_error::VortexResult> +pub type vortex_array::arrays::bool::BoolArray = vortex_array::vtable::Array + pub mod vortex_array::arrays::chunked pub struct vortex_array::arrays::chunked::Chunked @@ -1074,39 +1038,39 @@ pub fn vortex_array::arrays::Chunked::fmt(&self, f: &mut core::fmt::Formatter<'_ impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::take(array: &vortex_array::arrays::ChunkedArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterKernel for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::filter(array: &vortex_array::arrays::ChunkedArray, mask: &vortex_mask::Mask, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceKernel for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::slice(array: &Self::Array, range: core::ops::range::Range, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::cast(array: &vortex_array::arrays::ChunkedArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullReduce for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::fill_null(array: &vortex_array::arrays::ChunkedArray, fill_value: &vortex_array::scalar::Scalar) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskKernel for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::mask(array: &vortex_array::arrays::ChunkedArray, mask: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::zip::ZipKernel for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::zip(if_true: &vortex_array::arrays::ChunkedArray, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::zip(if_true: &vortex_array::vtable::Array, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::scalar_at(array: &vortex_array::arrays::ChunkedArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Chunked -pub type vortex_array::arrays::Chunked::Array = vortex_array::arrays::ChunkedArray +pub type vortex_array::arrays::Chunked::ArrayData = vortex_array::arrays::ChunkedData pub type vortex_array::arrays::Chunked::Metadata = vortex_array::EmptyMetadata @@ -1114,25 +1078,25 @@ pub type vortex_array::arrays::Chunked::OperationsVTable = vortex_array::arrays: pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::append_to_builder(array: &vortex_array::arrays::ChunkedArray, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: &vortex_array::arrays::ChunkedArray, other: &vortex_array::arrays::ChunkedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: &vortex_array::arrays::ChunkedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Chunked::buffer(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Chunked::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Chunked::buffer_name(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Chunked::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Chunked::build(dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::build(dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Chunked::child(array: &vortex_array::arrays::ChunkedArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Chunked::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Chunked::child_name(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Chunked::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Chunked::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Chunked::dtype(array: &vortex_array::arrays::ChunkedArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Chunked::dtype(array: &vortex_array::arrays::ChunkedData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Chunked::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -1140,13 +1104,13 @@ pub fn vortex_array::arrays::Chunked::execute_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Chunked::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Chunked::len(array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::Chunked::len(array: &vortex_array::arrays::ChunkedData) -> usize -pub fn vortex_array::arrays::Chunked::metadata(_array: &vortex_array::arrays::ChunkedArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Chunked::nbuffers(_array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::Chunked::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Chunked::nchildren(array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::Chunked::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Chunked::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -1154,75 +1118,65 @@ pub fn vortex_array::arrays::Chunked::reduce_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Chunked::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Chunked::stats(array: &vortex_array::arrays::ChunkedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Chunked::stats(array: &vortex_array::arrays::ChunkedData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Chunked::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Chunked::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Chunked::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::validity(array: &vortex_array::arrays::ChunkedArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub struct vortex_array::arrays::chunked::ChunkedArray +pub struct vortex_array::arrays::chunked::ChunkedData -impl vortex_array::arrays::ChunkedArray +impl vortex_array::arrays::ChunkedData -pub fn vortex_array::arrays::ChunkedArray::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ +pub fn vortex_array::arrays::ChunkedData::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ -pub fn vortex_array::arrays::ChunkedArray::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ +pub fn vortex_array::arrays::ChunkedData::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ -pub fn vortex_array::arrays::ChunkedArray::chunk(&self, idx: usize) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::ChunkedData::chunk(&self, idx: usize) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::ChunkedArray::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer +pub fn vortex_array::arrays::ChunkedData::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer -pub fn vortex_array::arrays::ChunkedArray::chunks(&self) -> &[vortex_array::ArrayRef] +pub fn vortex_array::arrays::ChunkedData::chunks(&self) -> &[vortex_array::ArrayRef] -pub fn vortex_array::arrays::ChunkedArray::nchunks(&self) -> usize +pub fn vortex_array::arrays::ChunkedData::dtype(&self) -> &vortex_array::dtype::DType -pub unsafe fn vortex_array::arrays::ChunkedArray::new_unchecked(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self +pub fn vortex_array::arrays::ChunkedData::is_empty(&self) -> bool -pub fn vortex_array::arrays::ChunkedArray::non_empty_chunks(&self) -> impl core::iter::traits::iterator::Iterator + '_ +pub fn vortex_array::arrays::ChunkedData::len(&self) -> usize -pub fn vortex_array::arrays::ChunkedArray::rechunk(&self, target_bytesize: u64, target_rowsize: usize) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ChunkedData::nchunks(&self) -> usize -pub fn vortex_array::arrays::ChunkedArray::try_new(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> vortex_error::VortexResult +pub unsafe fn vortex_array::arrays::ChunkedData::new_unchecked(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self -pub fn vortex_array::arrays::ChunkedArray::validate(chunks: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ChunkedData::non_empty_chunks(&self) -> impl core::iter::traits::iterator::Iterator + '_ -impl vortex_array::arrays::ChunkedArray +pub fn vortex_array::arrays::ChunkedData::rechunk(&self, target_bytesize: u64, target_rowsize: usize) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ChunkedArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ChunkedData::try_new(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> vortex_error::VortexResult -impl core::clone::Clone for vortex_array::arrays::ChunkedArray +pub fn vortex_array::arrays::ChunkedData::validate(chunks: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ChunkedArray::clone(&self) -> vortex_array::arrays::ChunkedArray +impl core::clone::Clone for vortex_array::arrays::ChunkedData -impl core::convert::AsRef for vortex_array::arrays::ChunkedArray +pub fn vortex_array::arrays::ChunkedData::clone(&self) -> vortex_array::arrays::ChunkedData -pub fn vortex_array::arrays::ChunkedArray::as_ref(&self) -> &dyn vortex_array::DynArray +impl core::convert::From for vortex_array::ArrayRef -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ChunkedData) -> vortex_array::ArrayRef -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ChunkedArray) -> vortex_array::ArrayRef +impl core::fmt::Debug for vortex_array::arrays::ChunkedData -impl core::fmt::Debug for vortex_array::arrays::ChunkedArray +pub fn vortex_array::arrays::ChunkedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::ChunkedArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::IntoArray for vortex_array::arrays::ChunkedData -impl core::iter::traits::collect::FromIterator> for vortex_array::arrays::ChunkedArray +pub fn vortex_array::arrays::ChunkedData::into_array(self) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::ChunkedArray::from_iter>(iter: T) -> Self - -impl core::ops::deref::Deref for vortex_array::arrays::ChunkedArray - -pub type vortex_array::arrays::ChunkedArray::Target = dyn vortex_array::DynArray - -pub fn vortex_array::arrays::ChunkedArray::deref(&self) -> &Self::Target - -impl vortex_array::IntoArray for vortex_array::arrays::ChunkedArray - -pub fn vortex_array::arrays::ChunkedArray::into_array(self) -> vortex_array::ArrayRef +pub type vortex_array::arrays::chunked::ChunkedArray = vortex_array::vtable::Array pub mod vortex_array::arrays::constant @@ -1246,39 +1200,39 @@ pub fn vortex_array::arrays::Constant::fmt(&self, f: &mut core::fmt::Formatter<' impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::take(array: &vortex_array::arrays::ConstantArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::filter(array: &vortex_array::arrays::ConstantArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::between::BetweenReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::between(array: &vortex_array::arrays::ConstantArray, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::between(array: &vortex_array::vtable::Array, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::cast(array: &vortex_array::arrays::ConstantArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::fill_null(array: &vortex_array::arrays::ConstantArray, fill_value: &vortex_array::scalar::Scalar) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::not::NotReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::invert(array: &vortex_array::arrays::ConstantArray) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::invert(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::scalar_at(array: &vortex_array::arrays::ConstantArray, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::scalar_at(array: &vortex_array::vtable::Array, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Constant -pub type vortex_array::arrays::Constant::Array = vortex_array::arrays::ConstantArray +pub type vortex_array::arrays::Constant::ArrayData = vortex_array::arrays::ConstantData pub type vortex_array::arrays::Constant::Metadata = vortex_array::scalar::Scalar @@ -1286,25 +1240,25 @@ pub type vortex_array::arrays::Constant::OperationsVTable = vortex_array::arrays pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::append_to_builder(array: &vortex_array::arrays::ConstantArray, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: &vortex_array::arrays::ConstantArray, other: &vortex_array::arrays::ConstantArray, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: &vortex_array::arrays::ConstantArray, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(array: &vortex_array::vtable::Array, state: &mut H, _precision: vortex_array::Precision) -pub fn vortex_array::arrays::Constant::buffer(array: &vortex_array::arrays::ConstantArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Constant::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Constant::buffer_name(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Constant::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Constant::build(_dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::build(_dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Constant::child(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Constant::child(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Constant::child_name(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Constant::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Constant::deserialize(_bytes: &[u8], dtype: &vortex_array::dtype::DType, _len: usize, buffers: &[vortex_array::buffer::BufferHandle], session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Constant::dtype(array: &vortex_array::arrays::ConstantArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Constant::dtype(array: &vortex_array::arrays::ConstantData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Constant::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -1312,13 +1266,13 @@ pub fn vortex_array::arrays::Constant::execute_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::Constant::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Constant::len(array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::Constant::len(array: &vortex_array::arrays::ConstantData) -> usize -pub fn vortex_array::arrays::Constant::metadata(array: &vortex_array::arrays::ConstantArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Constant::nbuffers(_array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::Constant::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Constant::nchildren(_array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::Constant::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Constant::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -1326,117 +1280,111 @@ pub fn vortex_array::arrays::Constant::reduce_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Constant::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Constant::stats(array: &vortex_array::arrays::ConstantArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Constant::stats(array: &vortex_array::arrays::ConstantData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Constant::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Constant::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Constant::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::with_children(_array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::validity(array: &vortex_array::arrays::ConstantArray) -> vortex_error::VortexResult - -pub struct vortex_array::arrays::constant::ConstantArray - -impl vortex_array::arrays::ConstantArray - -pub fn vortex_array::arrays::ConstantArray::into_parts(self) -> vortex_array::scalar::Scalar +pub fn vortex_array::arrays::Constant::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ConstantArray::new(scalar: S, len: usize) -> Self where S: core::convert::Into +pub struct vortex_array::arrays::constant::ConstantData -pub fn vortex_array::arrays::ConstantArray::scalar(&self) -> &vortex_array::scalar::Scalar +impl vortex_array::arrays::ConstantData -impl vortex_array::arrays::ConstantArray +pub fn vortex_array::arrays::ConstantData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::ConstantArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ConstantData::into_parts(self) -> vortex_array::scalar::Scalar -impl core::clone::Clone for vortex_array::arrays::ConstantArray +pub fn vortex_array::arrays::ConstantData::is_empty(&self) -> bool -pub fn vortex_array::arrays::ConstantArray::clone(&self) -> vortex_array::arrays::ConstantArray +pub fn vortex_array::arrays::ConstantData::len(&self) -> usize -impl core::convert::AsRef for vortex_array::arrays::ConstantArray +pub fn vortex_array::arrays::ConstantData::new(scalar: S, len: usize) -> Self where S: core::convert::Into -pub fn vortex_array::arrays::ConstantArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::ConstantData::scalar(&self) -> &vortex_array::scalar::Scalar -impl core::convert::From for vortex_array::ArrayRef +impl core::clone::Clone for vortex_array::arrays::ConstantData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ConstantArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ConstantData::clone(&self) -> vortex_array::arrays::ConstantData -impl core::fmt::Debug for vortex_array::arrays::ConstantArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::ConstantArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ConstantData) -> vortex_array::ArrayRef -impl core::ops::deref::Deref for vortex_array::arrays::ConstantArray +impl core::fmt::Debug for vortex_array::arrays::ConstantData -pub type vortex_array::arrays::ConstantArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::arrays::ConstantData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::ConstantArray::deref(&self) -> &Self::Target +impl vortex_array::IntoArray for vortex_array::arrays::ConstantData -impl vortex_array::IntoArray for vortex_array::arrays::ConstantArray +pub fn vortex_array::arrays::ConstantData::into_array(self) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::ConstantArray::into_array(self) -> vortex_array::ArrayRef +pub type vortex_array::arrays::constant::ConstantArray = vortex_array::vtable::Array pub mod vortex_array::arrays::datetime -pub struct vortex_array::arrays::datetime::TemporalArray +pub struct vortex_array::arrays::datetime::TemporalData -impl vortex_array::arrays::datetime::TemporalArray +impl vortex_array::arrays::datetime::TemporalData -pub fn vortex_array::arrays::datetime::TemporalArray::dtype(&self) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::datetime::TemporalData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::datetime::TemporalArray::ext_dtype(&self) -> vortex_array::dtype::extension::ExtDTypeRef +pub fn vortex_array::arrays::datetime::TemporalData::ext_dtype(&self) -> vortex_array::dtype::extension::ExtDTypeRef -pub fn vortex_array::arrays::datetime::TemporalArray::temporal_metadata(&self) -> vortex_array::extension::datetime::TemporalMetadata<'_> +pub fn vortex_array::arrays::datetime::TemporalData::temporal_metadata(&self) -> vortex_array::extension::datetime::TemporalMetadata<'_> -pub fn vortex_array::arrays::datetime::TemporalArray::temporal_values(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::datetime::TemporalData::temporal_values(&self) -> &vortex_array::ArrayRef -impl vortex_array::arrays::datetime::TemporalArray +pub fn vortex_array::arrays::datetime::TemporalData::to_array_ref(&self) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::datetime::TemporalArray::new_date(array: vortex_array::ArrayRef, time_unit: vortex_array::extension::datetime::TimeUnit) -> Self +impl vortex_array::arrays::datetime::TemporalData -pub fn vortex_array::arrays::datetime::TemporalArray::new_time(array: vortex_array::ArrayRef, time_unit: vortex_array::extension::datetime::TimeUnit) -> Self +pub fn vortex_array::arrays::datetime::TemporalData::new_date(array: vortex_array::ArrayRef, time_unit: vortex_array::extension::datetime::TimeUnit) -> Self -pub fn vortex_array::arrays::datetime::TemporalArray::new_timestamp(array: vortex_array::ArrayRef, time_unit: vortex_array::extension::datetime::TimeUnit, time_zone: core::option::Option>) -> Self +pub fn vortex_array::arrays::datetime::TemporalData::new_time(array: vortex_array::ArrayRef, time_unit: vortex_array::extension::datetime::TimeUnit) -> Self -impl core::clone::Clone for vortex_array::arrays::datetime::TemporalArray +pub fn vortex_array::arrays::datetime::TemporalData::new_timestamp(array: vortex_array::ArrayRef, time_unit: vortex_array::extension::datetime::TimeUnit, time_zone: core::option::Option>) -> Self -pub fn vortex_array::arrays::datetime::TemporalArray::clone(&self) -> vortex_array::arrays::datetime::TemporalArray +impl core::clone::Clone for vortex_array::arrays::datetime::TemporalData -impl core::convert::AsRef for vortex_array::arrays::datetime::TemporalArray +pub fn vortex_array::arrays::datetime::TemporalData::clone(&self) -> vortex_array::arrays::datetime::TemporalData -pub fn vortex_array::arrays::datetime::TemporalArray::as_ref(&self) -> &dyn vortex_array::DynArray +impl core::convert::From<&vortex_array::arrays::datetime::TemporalData> for vortex_array::arrays::ExtensionArray -impl core::convert::From<&vortex_array::arrays::datetime::TemporalArray> for vortex_array::arrays::ExtensionArray +pub fn vortex_array::arrays::ExtensionArray::from(value: &vortex_array::arrays::datetime::TemporalData) -> Self -pub fn vortex_array::arrays::ExtensionArray::from(value: &vortex_array::arrays::datetime::TemporalArray) -> Self +impl core::convert::From for vortex_array::ArrayRef -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::datetime::TemporalData) -> Self -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::datetime::TemporalArray) -> Self +impl core::convert::From for vortex_array::arrays::ExtensionArray -impl core::convert::From for vortex_array::arrays::ExtensionArray +pub fn vortex_array::arrays::ExtensionArray::from(value: vortex_array::arrays::datetime::TemporalData) -> Self -pub fn vortex_array::arrays::ExtensionArray::from(value: vortex_array::arrays::datetime::TemporalArray) -> Self +impl core::convert::TryFrom> for vortex_array::arrays::datetime::TemporalData -impl core::convert::TryFrom> for vortex_array::arrays::datetime::TemporalArray +pub type vortex_array::arrays::datetime::TemporalData::Error = vortex_error::VortexError -pub type vortex_array::arrays::datetime::TemporalArray::Error = vortex_error::VortexError +pub fn vortex_array::arrays::datetime::TemporalData::try_from(value: vortex_array::ArrayRef) -> core::result::Result -pub fn vortex_array::arrays::datetime::TemporalArray::try_from(value: vortex_array::ArrayRef) -> core::result::Result +impl core::convert::TryFrom> for vortex_array::arrays::datetime::TemporalData -impl core::convert::TryFrom for vortex_array::arrays::datetime::TemporalArray +pub type vortex_array::arrays::datetime::TemporalData::Error = vortex_error::VortexError -pub type vortex_array::arrays::datetime::TemporalArray::Error = vortex_error::VortexError +pub fn vortex_array::arrays::datetime::TemporalData::try_from(ext: vortex_array::arrays::ExtensionArray) -> core::result::Result -pub fn vortex_array::arrays::datetime::TemporalArray::try_from(ext: vortex_array::arrays::ExtensionArray) -> core::result::Result +impl core::fmt::Debug for vortex_array::arrays::datetime::TemporalData -impl core::fmt::Debug for vortex_array::arrays::datetime::TemporalArray +pub fn vortex_array::arrays::datetime::TemporalData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::datetime::TemporalArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::IntoArray for vortex_array::arrays::datetime::TemporalData -impl vortex_array::IntoArray for vortex_array::arrays::datetime::TemporalArray +pub fn vortex_array::arrays::datetime::TemporalData::into_array(self) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::datetime::TemporalArray::into_array(self) -> vortex_array::ArrayRef +pub type vortex_array::arrays::datetime::TemporalArray = vortex_array::arrays::datetime::TemporalData pub mod vortex_array::arrays::decimal @@ -1456,41 +1404,41 @@ pub fn vortex_array::arrays::Decimal::fmt(&self, f: &mut core::fmt::Formatter<'_ impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::take(array: &vortex_array::arrays::DecimalArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> 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, array: &vortex_array::arrays::DecimalArray, parent: &vortex_array::arrays::MaskedArray, _child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: &vortex_array::arrays::MaskedArray, _child_idx: usize) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::between::BetweenKernel for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::between(arr: &vortex_array::arrays::DecimalArray, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::between(arr: &vortex_array::vtable::Array, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastKernel for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::cast(array: &vortex_array::arrays::DecimalArray, dtype: &vortex_array::dtype::DType, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullKernel for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::fill_null(array: &vortex_array::arrays::DecimalArray, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::mask(array: &vortex_array::arrays::DecimalArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::scalar_at(array: &vortex_array::arrays::DecimalArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Decimal -pub type vortex_array::arrays::Decimal::Array = vortex_array::arrays::DecimalArray +pub type vortex_array::arrays::Decimal::ArrayData = vortex_array::arrays::DecimalData pub type vortex_array::arrays::Decimal::Metadata = vortex_array::ProstMetadata @@ -1498,25 +1446,25 @@ pub type vortex_array::arrays::Decimal::OperationsVTable = vortex_array::arrays: pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Decimal::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Decimal::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: &vortex_array::arrays::DecimalArray, other: &vortex_array::arrays::DecimalArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: &vortex_array::arrays::DecimalArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Decimal::buffer(array: &vortex_array::arrays::DecimalArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Decimal::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Decimal::buffer_name(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Decimal::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Decimal::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Decimal::child(array: &vortex_array::arrays::DecimalArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Decimal::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Decimal::child_name(_array: &vortex_array::arrays::DecimalArray, _idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Decimal::child_name(_array: &vortex_array::vtable::Array, _idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Decimal::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Decimal::dtype(array: &vortex_array::arrays::DecimalArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Decimal::dtype(array: &vortex_array::arrays::DecimalData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Decimal::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -1524,13 +1472,13 @@ pub fn vortex_array::arrays::Decimal::execute_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Decimal::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Decimal::len(array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::Decimal::len(array: &vortex_array::arrays::DecimalData) -> usize -pub fn vortex_array::arrays::Decimal::metadata(array: &vortex_array::arrays::DecimalArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Decimal::nbuffers(_array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::Decimal::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Decimal::nchildren(array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::Decimal::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Decimal::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -1538,97 +1486,89 @@ pub fn vortex_array::arrays::Decimal::reduce_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Decimal::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Decimal::stats(array: &vortex_array::arrays::DecimalArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Decimal::stats(array: &vortex_array::arrays::DecimalData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Decimal::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Decimal::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Decimal::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Decimal::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub struct vortex_array::arrays::decimal::DecimalArray - -impl vortex_array::arrays::DecimalArray - -pub fn vortex_array::arrays::DecimalArray::buffer(&self) -> vortex_buffer::buffer::Buffer - -pub fn vortex_array::arrays::DecimalArray::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle - -pub fn vortex_array::arrays::DecimalArray::decimal_dtype(&self) -> vortex_array::dtype::DecimalDType +pub struct vortex_array::arrays::decimal::DecimalArrayParts -pub fn vortex_array::arrays::DecimalArray::from_iter>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self +pub vortex_array::arrays::decimal::DecimalArrayParts::decimal_dtype: vortex_array::dtype::DecimalDType -pub fn vortex_array::arrays::DecimalArray::from_option_iter>>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self +pub vortex_array::arrays::decimal::DecimalArrayParts::validity: vortex_array::validity::Validity -pub fn vortex_array::arrays::DecimalArray::into_parts(self) -> vortex_array::arrays::decimal::DecimalArrayParts +pub vortex_array::arrays::decimal::DecimalArrayParts::values: vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::DecimalArray::new(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self +pub vortex_array::arrays::decimal::DecimalArrayParts::values_type: vortex_array::dtype::DecimalType -pub fn vortex_array::arrays::DecimalArray::new_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self +pub struct vortex_array::arrays::decimal::DecimalData -pub unsafe fn vortex_array::arrays::DecimalArray::new_unchecked(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self +impl vortex_array::arrays::DecimalData -pub unsafe fn vortex_array::arrays::DecimalArray::new_unchecked_from_byte_buffer(byte_buffer: vortex_buffer::ByteBuffer, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::DecimalData::buffer(&self) -> vortex_buffer::buffer::Buffer -pub unsafe fn vortex_array::arrays::DecimalArray::new_unchecked_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::DecimalData::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::DecimalArray::patch(self, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::DecimalData::decimal_dtype(&self) -> vortex_array::dtype::DecimalDType -pub fn vortex_array::arrays::DecimalArray::precision(&self) -> u8 +pub fn vortex_array::arrays::DecimalData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::DecimalArray::scale(&self) -> i8 +pub fn vortex_array::arrays::DecimalData::from_iter>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self -pub fn vortex_array::arrays::DecimalArray::try_new(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::DecimalData::from_option_iter>>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self -pub fn vortex_array::arrays::DecimalArray::try_new_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::DecimalData::into_parts(self) -> vortex_array::arrays::decimal::DecimalArrayParts -pub fn vortex_array::arrays::DecimalArray::values_type(&self) -> vortex_array::dtype::DecimalType +pub fn vortex_array::arrays::DecimalData::is_empty(&self) -> bool -impl vortex_array::arrays::DecimalArray +pub fn vortex_array::arrays::DecimalData::len(&self) -> usize -pub fn vortex_array::arrays::DecimalArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::DecimalData::new(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self -impl core::clone::Clone for vortex_array::arrays::DecimalArray +pub fn vortex_array::arrays::DecimalData::new_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::DecimalArray::clone(&self) -> vortex_array::arrays::DecimalArray +pub unsafe fn vortex_array::arrays::DecimalData::new_unchecked(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self -impl core::convert::AsRef for vortex_array::arrays::DecimalArray +pub unsafe fn vortex_array::arrays::DecimalData::new_unchecked_from_byte_buffer(byte_buffer: vortex_buffer::ByteBuffer, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::DecimalArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub unsafe fn vortex_array::arrays::DecimalData::new_unchecked_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::DecimalData::patch(self, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::DecimalArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::DecimalData::precision(&self) -> u8 -impl core::fmt::Debug for vortex_array::arrays::DecimalArray +pub fn vortex_array::arrays::DecimalData::scale(&self) -> i8 -pub fn vortex_array::arrays::DecimalArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::DecimalData::try_new(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl core::ops::deref::Deref for vortex_array::arrays::DecimalArray +pub fn vortex_array::arrays::DecimalData::try_new_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub type vortex_array::arrays::DecimalArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::arrays::DecimalData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::arrays::DecimalArray::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::DecimalData::validity_mask(&self) -> vortex_mask::Mask -impl vortex_array::Executable for vortex_array::arrays::DecimalArray +pub fn vortex_array::arrays::DecimalData::values_type(&self) -> vortex_array::dtype::DecimalType -pub fn vortex_array::arrays::DecimalArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +impl core::clone::Clone for vortex_array::arrays::DecimalData -impl vortex_array::IntoArray for vortex_array::arrays::DecimalArray +pub fn vortex_array::arrays::DecimalData::clone(&self) -> vortex_array::arrays::DecimalData -pub fn vortex_array::arrays::DecimalArray::into_array(self) -> vortex_array::ArrayRef +impl core::convert::From for vortex_array::ArrayRef -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::DecimalArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::DecimalData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::DecimalArray::validity(&self) -> &vortex_array::validity::Validity +impl core::fmt::Debug for vortex_array::arrays::DecimalData -pub struct vortex_array::arrays::decimal::DecimalArrayParts +pub fn vortex_array::arrays::DecimalData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub vortex_array::arrays::decimal::DecimalArrayParts::decimal_dtype: vortex_array::dtype::DecimalDType +impl vortex_array::IntoArray for vortex_array::arrays::DecimalData -pub vortex_array::arrays::decimal::DecimalArrayParts::validity: vortex_array::validity::Validity +pub fn vortex_array::arrays::DecimalData::into_array(self) -> vortex_array::ArrayRef -pub vortex_array::arrays::decimal::DecimalArrayParts::values: vortex_array::buffer::BufferHandle +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::DecimalData -pub vortex_array::arrays::decimal::DecimalArrayParts::values_type: vortex_array::dtype::DecimalType +pub fn vortex_array::arrays::DecimalData::validity(&self) -> &vortex_array::validity::Validity pub struct vortex_array::arrays::decimal::DecimalMaskedValidityRule @@ -1644,10 +1584,12 @@ impl vortex_array::optimizer::rules::ArrayParentReduceRule vortex_error::VortexResult> +pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: &vortex_array::arrays::MaskedArray, _child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::decimal::narrowed_decimal(decimal_array: vortex_array::arrays::DecimalArray) -> vortex_array::arrays::DecimalArray +pub type vortex_array::arrays::decimal::DecimalArray = vortex_array::vtable::Array + pub mod vortex_array::arrays::dict pub mod vortex_array::arrays::dict::vtable @@ -1668,43 +1610,43 @@ pub fn vortex_array::arrays::dict::Dict::fmt(&self, f: &mut core::fmt::Formatter impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::take(array: &vortex_array::arrays::dict::DictArray, indices: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::filter(array: &vortex_array::arrays::dict::DictArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::binary::CompareKernel for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::compare(lhs: &vortex_array::arrays::dict::DictArray, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::compare(lhs: &vortex_array::vtable::Array, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::cast(array: &vortex_array::arrays::dict::DictArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullKernel for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::fill_null(array: &vortex_array::arrays::dict::DictArray, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::like::LikeReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::like(array: &vortex_array::arrays::dict::DictArray, pattern: &vortex_array::ArrayRef, options: vortex_array::scalar_fn::fns::like::LikeOptions) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::like(array: &vortex_array::vtable::Array, pattern: &vortex_array::ArrayRef, options: vortex_array::scalar_fn::fns::like::LikeOptions) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::mask(array: &vortex_array::arrays::dict::DictArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::scalar_at(array: &vortex_array::arrays::dict::DictArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::dict::Dict -pub type vortex_array::arrays::dict::Dict::Array = vortex_array::arrays::dict::DictArray +pub type vortex_array::arrays::dict::Dict::ArrayData = vortex_array::arrays::dict::DictData pub type vortex_array::arrays::dict::Dict::Metadata = vortex_array::ProstMetadata @@ -1712,25 +1654,25 @@ pub type vortex_array::arrays::dict::Dict::OperationsVTable = vortex_array::arra pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::arrays::dict::DictArray, other: &vortex_array::arrays::dict::DictArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::arrays::dict::DictArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::dict::Dict::buffer(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::dict::Dict::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: &vortex_array::arrays::dict::DictArray, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::dict::Dict::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::child(array: &vortex_array::arrays::dict::DictArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::dict::Dict::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::dict::Dict::child_name(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::dict::Dict::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::dict::Dict::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::dtype(array: &vortex_array::arrays::dict::DictArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::dict::Dict::dtype(array: &vortex_array::arrays::dict::DictData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::dict::Dict::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -1738,13 +1680,13 @@ pub fn vortex_array::arrays::dict::Dict::execute_parent(array: &vortex_array::vt pub fn vortex_array::arrays::dict::Dict::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::dict::Dict::len(array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::len(array: &vortex_array::arrays::dict::DictData) -> usize -pub fn vortex_array::arrays::dict::Dict::metadata(array: &vortex_array::arrays::dict::DictArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::nbuffers(_array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::dict::Dict::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::dict::Dict::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -1752,15 +1694,17 @@ pub fn vortex_array::arrays::dict::Dict::reduce_parent(array: &vortex_array::vta pub fn vortex_array::arrays::dict::Dict::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::dict::Dict::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::dict::Dict::stats(array: &vortex_array::arrays::dict::DictData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::dict::Dict::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::dict::Dict::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::dict::Dict::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::validity(array: &vortex_array::arrays::dict::DictArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult + +pub type vortex_array::arrays::dict::vtable::DictArray = vortex_array::vtable::Array pub struct vortex_array::arrays::dict::Dict @@ -1778,43 +1722,43 @@ pub fn vortex_array::arrays::dict::Dict::fmt(&self, f: &mut core::fmt::Formatter impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::take(array: &vortex_array::arrays::dict::DictArray, indices: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::filter(array: &vortex_array::arrays::dict::DictArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::binary::CompareKernel for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::compare(lhs: &vortex_array::arrays::dict::DictArray, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::compare(lhs: &vortex_array::vtable::Array, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::cast(array: &vortex_array::arrays::dict::DictArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullKernel for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::fill_null(array: &vortex_array::arrays::dict::DictArray, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::like::LikeReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::like(array: &vortex_array::arrays::dict::DictArray, pattern: &vortex_array::ArrayRef, options: vortex_array::scalar_fn::fns::like::LikeOptions) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::like(array: &vortex_array::vtable::Array, pattern: &vortex_array::ArrayRef, options: vortex_array::scalar_fn::fns::like::LikeOptions) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::mask(array: &vortex_array::arrays::dict::DictArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::scalar_at(array: &vortex_array::arrays::dict::DictArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::dict::Dict -pub type vortex_array::arrays::dict::Dict::Array = vortex_array::arrays::dict::DictArray +pub type vortex_array::arrays::dict::Dict::ArrayData = vortex_array::arrays::dict::DictData pub type vortex_array::arrays::dict::Dict::Metadata = vortex_array::ProstMetadata @@ -1822,25 +1766,25 @@ pub type vortex_array::arrays::dict::Dict::OperationsVTable = vortex_array::arra pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::arrays::dict::DictArray, other: &vortex_array::arrays::dict::DictArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::arrays::dict::DictArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::dict::Dict::buffer(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::dict::Dict::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: &vortex_array::arrays::dict::DictArray, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::dict::Dict::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::child(array: &vortex_array::arrays::dict::DictArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::dict::Dict::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::dict::Dict::child_name(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::dict::Dict::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::dict::Dict::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::dtype(array: &vortex_array::arrays::dict::DictArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::dict::Dict::dtype(array: &vortex_array::arrays::dict::DictData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::dict::Dict::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -1848,13 +1792,13 @@ pub fn vortex_array::arrays::dict::Dict::execute_parent(array: &vortex_array::vt pub fn vortex_array::arrays::dict::Dict::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::dict::Dict::len(array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::len(array: &vortex_array::arrays::dict::DictData) -> usize -pub fn vortex_array::arrays::dict::Dict::metadata(array: &vortex_array::arrays::dict::DictArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::nbuffers(_array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::dict::Dict::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::dict::Dict::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -1862,81 +1806,71 @@ pub fn vortex_array::arrays::dict::Dict::reduce_parent(array: &vortex_array::vta pub fn vortex_array::arrays::dict::Dict::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::dict::Dict::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::dict::Dict::stats(array: &vortex_array::arrays::dict::DictData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::dict::Dict::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::dict::Dict::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::dict::Dict::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::validity(array: &vortex_array::arrays::dict::DictArray) -> vortex_error::VortexResult - -pub struct vortex_array::arrays::dict::DictArray - -impl vortex_array::arrays::dict::DictArray +pub fn vortex_array::arrays::dict::Dict::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::DictArray::codes(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::dict::DictArray::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult - -pub fn vortex_array::arrays::dict::DictArray::has_all_values_referenced(&self) -> bool - -pub fn vortex_array::arrays::dict::DictArray::into_parts(self) -> vortex_array::arrays::dict::DictArrayParts +pub struct vortex_array::arrays::dict::DictArrayParts -pub fn vortex_array::arrays::dict::DictArray::new(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self +pub vortex_array::arrays::dict::DictArrayParts::codes: vortex_array::ArrayRef -pub unsafe fn vortex_array::arrays::dict::DictArray::new_unchecked(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self +pub vortex_array::arrays::dict::DictArrayParts::dtype: vortex_array::dtype::DType -pub unsafe fn vortex_array::arrays::dict::DictArray::set_all_values_referenced(self, all_values_referenced: bool) -> Self +pub vortex_array::arrays::dict::DictArrayParts::values: vortex_array::ArrayRef -pub fn vortex_array::arrays::dict::DictArray::try_new(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> vortex_error::VortexResult +pub struct vortex_array::arrays::dict::DictData -pub fn vortex_array::arrays::dict::DictArray::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> +impl vortex_array::arrays::dict::DictData -pub fn vortex_array::arrays::dict::DictArray::values(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::dict::DictData::codes(&self) -> &vortex_array::ArrayRef -impl vortex_array::arrays::dict::DictArray +pub fn vortex_array::arrays::dict::DictData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::dict::DictArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::dict::DictData::has_all_values_referenced(&self) -> bool -impl core::clone::Clone for vortex_array::arrays::dict::DictArray +pub fn vortex_array::arrays::dict::DictData::into_parts(self) -> vortex_array::arrays::dict::DictArrayParts -pub fn vortex_array::arrays::dict::DictArray::clone(&self) -> vortex_array::arrays::dict::DictArray +pub fn vortex_array::arrays::dict::DictData::is_empty(&self) -> bool -impl core::convert::AsRef for vortex_array::arrays::dict::DictArray +pub fn vortex_array::arrays::dict::DictData::len(&self) -> usize -pub fn vortex_array::arrays::dict::DictArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::dict::DictData::new(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self -impl core::convert::From for vortex_array::ArrayRef +pub unsafe fn vortex_array::arrays::dict::DictData::new_unchecked(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::dict::DictArray) -> vortex_array::ArrayRef +pub unsafe fn vortex_array::arrays::dict::DictData::set_all_values_referenced(self, all_values_referenced: bool) -> Self -impl core::fmt::Debug for vortex_array::arrays::dict::DictArray +pub fn vortex_array::arrays::dict::DictData::try_new(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::DictArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::dict::DictData::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> -impl core::ops::deref::Deref for vortex_array::arrays::dict::DictArray +pub fn vortex_array::arrays::dict::DictData::values(&self) -> &vortex_array::ArrayRef -pub type vortex_array::arrays::dict::DictArray::Target = dyn vortex_array::DynArray +impl vortex_array::arrays::dict::DictData -pub fn vortex_array::arrays::dict::DictArray::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::dict::DictData::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult -impl vortex_array::IntoArray for vortex_array::arrays::dict::DictArray +impl core::clone::Clone for vortex_array::arrays::dict::DictData -pub fn vortex_array::arrays::dict::DictArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::dict::DictData::clone(&self) -> vortex_array::arrays::dict::DictData -impl vortex_array::arrow::FromArrowArray<&arrow_array::array::dictionary_array::DictionaryArray> for vortex_array::arrays::dict::DictArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::dict::DictArray::from_arrow(array: &arrow_array::array::dictionary_array::DictionaryArray, nullable: bool) -> vortex_error::VortexResult +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::dict::DictData) -> vortex_array::ArrayRef -pub struct vortex_array::arrays::dict::DictArrayParts +impl core::fmt::Debug for vortex_array::arrays::dict::DictData -pub vortex_array::arrays::dict::DictArrayParts::codes: vortex_array::ArrayRef +pub fn vortex_array::arrays::dict::DictData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub vortex_array::arrays::dict::DictArrayParts::dtype: vortex_array::dtype::DType +impl vortex_array::IntoArray for vortex_array::arrays::dict::DictData -pub vortex_array::arrays::dict::DictArrayParts::values: vortex_array::ArrayRef +pub fn vortex_array::arrays::dict::DictData::into_array(self) -> vortex_array::ArrayRef pub struct vortex_array::arrays::dict::DictMetadata @@ -1982,7 +1916,7 @@ impl vortex_array::kernel::ExecuteParentKernel for vortex_array::arrays::d pub type vortex_array::arrays::dict::TakeExecuteAdaptor::Parent = vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::TakeExecuteAdaptor::execute_parent(&self, array: &::Array, parent: ::Match, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::TakeExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: ::Match, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub struct vortex_array::arrays::dict::TakeReduceAdaptor(pub V) @@ -1998,11 +1932,11 @@ impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_arra pub type vortex_array::arrays::dict::TakeReduceAdaptor::Parent = vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::TakeReduceAdaptor::reduce_parent(&self, array: &::Array, parent: &vortex_array::arrays::dict::DictArray, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::TakeReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: &vortex_array::arrays::dict::DictArray, child_idx: usize) -> vortex_error::VortexResult> pub trait vortex_array::arrays::dict::TakeExecute: vortex_array::vtable::VTable -pub fn vortex_array::arrays::dict::TakeExecute::take(array: &Self::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::TakeExecute::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Bool @@ -2010,66 +1944,68 @@ pub fn vortex_array::arrays::Bool::take(array: &vortex_array::arrays::BoolArray, impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::take(array: &vortex_array::arrays::ChunkedArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::take(array: &vortex_array::arrays::DecimalArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::take(array: &vortex_array::arrays::ExtensionArray, indices: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::take(array: &vortex_array::arrays::FixedSizeListArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::List -pub fn vortex_array::arrays::List::take(array: &vortex_array::arrays::ListArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::take(array: &vortex_array::arrays::PrimitiveArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::take(array: &vortex_array::arrays::VarBinArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::take(array: &vortex_array::arrays::VarBinViewArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::take(array: &vortex_array::arrays::dict::DictArray, indices: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub trait vortex_array::arrays::dict::TakeReduce: vortex_array::vtable::VTable -pub fn vortex_array::arrays::dict::TakeReduce::take(array: &Self::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::TakeReduce::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::take(array: &vortex_array::arrays::ConstantArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::take(array: &vortex_array::arrays::ListViewArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::take(array: &vortex_array::arrays::MaskedArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::take(array: &vortex_array::arrays::StructArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::take(array: &vortex_array::arrays::null::NullArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> pub fn vortex_array::arrays::dict::take_canonical(values: vortex_array::Canonical, codes: &vortex_array::arrays::PrimitiveArray, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub type vortex_array::arrays::dict::DictArray = vortex_array::vtable::Array + pub mod vortex_array::arrays::extension pub struct vortex_array::arrays::extension::Extension @@ -2088,35 +2024,35 @@ pub fn vortex_array::arrays::Extension::fmt(&self, f: &mut core::fmt::Formatter< impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::take(array: &vortex_array::arrays::ExtensionArray, indices: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::filter(array: &vortex_array::arrays::ExtensionArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::binary::CompareKernel for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::compare(lhs: &vortex_array::arrays::ExtensionArray, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::compare(lhs: &vortex_array::vtable::Array, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::cast(array: &vortex_array::arrays::ExtensionArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::mask(array: &vortex_array::arrays::ExtensionArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::scalar_at(array: &vortex_array::arrays::ExtensionArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Extension -pub type vortex_array::arrays::Extension::Array = vortex_array::arrays::ExtensionArray +pub type vortex_array::arrays::Extension::ArrayData = vortex_array::arrays::ExtensionData pub type vortex_array::arrays::Extension::Metadata = vortex_array::EmptyMetadata @@ -2124,25 +2060,25 @@ pub type vortex_array::arrays::Extension::OperationsVTable = vortex_array::array pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::vtable::ValidityVTableFromChild -pub fn vortex_array::arrays::Extension::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Extension::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: &vortex_array::arrays::ExtensionArray, other: &vortex_array::arrays::ExtensionArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: &vortex_array::arrays::ExtensionArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Extension::buffer(_array: &vortex_array::arrays::ExtensionArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Extension::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Extension::buffer_name(_array: &vortex_array::arrays::ExtensionArray, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Extension::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Extension::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Extension::child(array: &vortex_array::arrays::ExtensionArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Extension::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Extension::child_name(_array: &vortex_array::arrays::ExtensionArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Extension::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Extension::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Extension::dtype(array: &vortex_array::arrays::ExtensionArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Extension::dtype(array: &vortex_array::arrays::ExtensionData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Extension::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -2150,13 +2086,13 @@ pub fn vortex_array::arrays::Extension::execute_parent(array: &vortex_array::vta pub fn vortex_array::arrays::Extension::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Extension::len(array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::Extension::len(array: &vortex_array::arrays::ExtensionData) -> usize -pub fn vortex_array::arrays::Extension::metadata(_array: &vortex_array::arrays::ExtensionArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Extension::nbuffers(_array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::Extension::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Extension::nchildren(_array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::Extension::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Extension::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -2164,77 +2100,53 @@ pub fn vortex_array::arrays::Extension::reduce_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::Extension::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Extension::stats(array: &vortex_array::arrays::ExtensionArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Extension::stats(array: &vortex_array::arrays::ExtensionData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Extension::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Extension::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Extension::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Extension::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityChild for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::validity_child(array: &vortex_array::arrays::ExtensionArray) -> &vortex_array::ArrayRef - -pub struct vortex_array::arrays::extension::ExtensionArray - -impl vortex_array::arrays::ExtensionArray - -pub fn vortex_array::arrays::ExtensionArray::ext_dtype(&self) -> &vortex_array::dtype::extension::ExtDTypeRef - -pub fn vortex_array::arrays::ExtensionArray::new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self - -pub unsafe fn vortex_array::arrays::ExtensionArray::new_unchecked(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self - -pub fn vortex_array::arrays::ExtensionArray::storage_array(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::Extension::validity_child(array: &vortex_array::arrays::ExtensionData) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::ExtensionArray::try_new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> vortex_error::VortexResult +pub struct vortex_array::arrays::extension::ExtensionData -impl vortex_array::arrays::ExtensionArray +impl vortex_array::arrays::ExtensionData -pub fn vortex_array::arrays::ExtensionArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ExtensionData::dtype(&self) -> &vortex_array::dtype::DType -impl core::clone::Clone for vortex_array::arrays::ExtensionArray +pub fn vortex_array::arrays::ExtensionData::ext_dtype(&self) -> &vortex_array::dtype::extension::ExtDTypeRef -pub fn vortex_array::arrays::ExtensionArray::clone(&self) -> vortex_array::arrays::ExtensionArray +pub fn vortex_array::arrays::ExtensionData::is_empty(&self) -> bool -impl core::convert::AsRef for vortex_array::arrays::ExtensionArray +pub fn vortex_array::arrays::ExtensionData::len(&self) -> usize -pub fn vortex_array::arrays::ExtensionArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::ExtensionData::new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self -impl core::convert::From<&vortex_array::arrays::datetime::TemporalArray> for vortex_array::arrays::ExtensionArray +pub unsafe fn vortex_array::arrays::ExtensionData::new_unchecked(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self -pub fn vortex_array::arrays::ExtensionArray::from(value: &vortex_array::arrays::datetime::TemporalArray) -> Self +pub fn vortex_array::arrays::ExtensionData::storage_array(&self) -> &vortex_array::ArrayRef -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::ExtensionData::try_new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> vortex_error::VortexResult -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ExtensionArray) -> vortex_array::ArrayRef +impl core::clone::Clone for vortex_array::arrays::ExtensionData -impl core::convert::From for vortex_array::arrays::ExtensionArray +pub fn vortex_array::arrays::ExtensionData::clone(&self) -> vortex_array::arrays::ExtensionData -pub fn vortex_array::arrays::ExtensionArray::from(value: vortex_array::arrays::datetime::TemporalArray) -> Self +impl core::convert::From for vortex_array::ArrayRef -impl core::convert::TryFrom for vortex_array::arrays::datetime::TemporalArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ExtensionData) -> vortex_array::ArrayRef -pub type vortex_array::arrays::datetime::TemporalArray::Error = vortex_error::VortexError +impl core::fmt::Debug for vortex_array::arrays::ExtensionData -pub fn vortex_array::arrays::datetime::TemporalArray::try_from(ext: vortex_array::arrays::ExtensionArray) -> core::result::Result +pub fn vortex_array::arrays::ExtensionData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::fmt::Debug for vortex_array::arrays::ExtensionArray +impl vortex_array::IntoArray for vortex_array::arrays::ExtensionData -pub fn vortex_array::arrays::ExtensionArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::ExtensionData::into_array(self) -> vortex_array::ArrayRef -impl core::ops::deref::Deref for vortex_array::arrays::ExtensionArray - -pub type vortex_array::arrays::ExtensionArray::Target = dyn vortex_array::DynArray - -pub fn vortex_array::arrays::ExtensionArray::deref(&self) -> &Self::Target - -impl vortex_array::Executable for vortex_array::arrays::ExtensionArray - -pub fn vortex_array::arrays::ExtensionArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult - -impl vortex_array::IntoArray for vortex_array::arrays::ExtensionArray - -pub fn vortex_array::arrays::ExtensionArray::into_array(self) -> vortex_array::ArrayRef +pub type vortex_array::arrays::extension::ExtensionArray = vortex_array::vtable::Array pub mod vortex_array::arrays::filter @@ -2254,11 +2166,11 @@ pub fn vortex_array::arrays::Filter::fmt(&self, f: &mut core::fmt::Formatter<'_> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Filter -pub fn vortex_array::arrays::Filter::scalar_at(array: &vortex_array::arrays::FilterArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Filter -pub type vortex_array::arrays::Filter::Array = vortex_array::arrays::FilterArray +pub type vortex_array::arrays::Filter::ArrayData = vortex_array::arrays::FilterData pub type vortex_array::arrays::Filter::Metadata = vortex_array::arrays::filter::vtable::FilterMetadata @@ -2266,25 +2178,25 @@ pub type vortex_array::arrays::Filter::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Filter -pub fn vortex_array::arrays::Filter::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: &vortex_array::arrays::FilterArray, other: &vortex_array::arrays::FilterArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: &vortex_array::arrays::FilterArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Filter::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Filter::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Filter::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Filter::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Filter::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::filter::vtable::FilterMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::filter::vtable::FilterMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Filter::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Filter::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Filter::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Filter::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Filter::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Filter::dtype(array: &vortex_array::arrays::FilterArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Filter::dtype(array: &vortex_array::arrays::FilterData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Filter::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -2292,13 +2204,13 @@ pub fn vortex_array::arrays::Filter::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Filter::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Filter::len(array: &vortex_array::arrays::FilterArray) -> usize +pub fn vortex_array::arrays::Filter::len(array: &vortex_array::arrays::FilterData) -> usize -pub fn vortex_array::arrays::Filter::metadata(array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Filter::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Filter::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Filter::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Filter::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Filter::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -2306,65 +2218,59 @@ pub fn vortex_array::arrays::Filter::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Filter::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Filter::stats(array: &vortex_array::arrays::FilterArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Filter::stats(array: &vortex_array::arrays::FilterData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Filter::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Filter::vtable(_array: &vortex_array::arrays::FilterData) -> &Self -pub fn vortex_array::arrays::Filter::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Filter -pub fn vortex_array::arrays::Filter::validity(array: &vortex_array::arrays::FilterArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub struct vortex_array::arrays::filter::FilterArray - -impl vortex_array::arrays::FilterArray - -pub fn vortex_array::arrays::FilterArray::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::FilterArray::filter_mask(&self) -> &vortex_mask::Mask +pub struct vortex_array::arrays::filter::FilterArrayParts -pub fn vortex_array::arrays::FilterArray::into_parts(self) -> vortex_array::arrays::filter::FilterArrayParts +pub vortex_array::arrays::filter::FilterArrayParts::child: vortex_array::ArrayRef -pub fn vortex_array::arrays::FilterArray::new(array: vortex_array::ArrayRef, mask: vortex_mask::Mask) -> Self +pub vortex_array::arrays::filter::FilterArrayParts::mask: vortex_mask::Mask -pub fn vortex_array::arrays::FilterArray::try_new(array: vortex_array::ArrayRef, mask: vortex_mask::Mask) -> vortex_error::VortexResult +pub struct vortex_array::arrays::filter::FilterData -impl vortex_array::arrays::FilterArray +impl vortex_array::arrays::FilterData -pub fn vortex_array::arrays::FilterArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FilterData::child(&self) -> &vortex_array::ArrayRef -impl core::clone::Clone for vortex_array::arrays::FilterArray +pub fn vortex_array::arrays::FilterData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::FilterArray::clone(&self) -> vortex_array::arrays::FilterArray +pub fn vortex_array::arrays::FilterData::filter_mask(&self) -> &vortex_mask::Mask -impl core::convert::AsRef for vortex_array::arrays::FilterArray +pub fn vortex_array::arrays::FilterData::is_empty(&self) -> bool -pub fn vortex_array::arrays::FilterArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::FilterData::len(&self) -> usize -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::FilterData::new(array: vortex_array::ArrayRef, mask: vortex_mask::Mask) -> Self -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::FilterArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FilterData::try_new(array: vortex_array::ArrayRef, mask: vortex_mask::Mask) -> vortex_error::VortexResult -impl core::fmt::Debug for vortex_array::arrays::FilterArray +impl vortex_array::arrays::FilterData -pub fn vortex_array::arrays::FilterArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::FilterData::into_parts(self) -> vortex_array::arrays::filter::FilterArrayParts -impl core::ops::deref::Deref for vortex_array::arrays::FilterArray +impl core::clone::Clone for vortex_array::arrays::FilterData -pub type vortex_array::arrays::FilterArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::arrays::FilterData::clone(&self) -> vortex_array::arrays::FilterData -pub fn vortex_array::arrays::FilterArray::deref(&self) -> &Self::Target +impl core::convert::From for vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::FilterArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::FilterData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::FilterArray::into_array(self) -> vortex_array::ArrayRef +impl core::fmt::Debug for vortex_array::arrays::FilterData -pub struct vortex_array::arrays::filter::FilterArrayParts +pub fn vortex_array::arrays::FilterData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub vortex_array::arrays::filter::FilterArrayParts::child: vortex_array::ArrayRef +impl vortex_array::IntoArray for vortex_array::arrays::FilterData -pub vortex_array::arrays::filter::FilterArrayParts::mask: vortex_mask::Mask +pub fn vortex_array::arrays::FilterData::into_array(self) -> vortex_array::ArrayRef pub struct vortex_array::arrays::filter::FilterExecuteAdaptor(pub V) @@ -2380,7 +2286,7 @@ impl vortex_array::kernel::ExecuteParentKernel for vortex_array::arrays::f pub type vortex_array::arrays::filter::FilterExecuteAdaptor::Parent = vortex_array::arrays::Filter -pub fn vortex_array::arrays::filter::FilterExecuteAdaptor::execute_parent(&self, array: &::Array, parent: ::Match, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::filter::FilterExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: ::Match, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub struct vortex_array::arrays::filter::FilterReduceAdaptor(pub V) @@ -2396,27 +2302,27 @@ impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_arra pub type vortex_array::arrays::filter::FilterReduceAdaptor::Parent = vortex_array::arrays::Filter -pub fn vortex_array::arrays::filter::FilterReduceAdaptor::reduce_parent(&self, array: &::Array, parent: &vortex_array::arrays::FilterArray, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::filter::FilterReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: &vortex_array::arrays::FilterArray, child_idx: usize) -> vortex_error::VortexResult> pub trait vortex_array::arrays::filter::FilterKernel: vortex_array::vtable::VTable -pub fn vortex_array::arrays::filter::FilterKernel::filter(array: &Self::Array, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::filter::FilterKernel::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterKernel for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::filter(array: &vortex_array::arrays::ChunkedArray, mask: &vortex_mask::Mask, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterKernel for vortex_array::arrays::List -pub fn vortex_array::arrays::List::filter(array: &vortex_array::arrays::ListArray, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterKernel for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::filter(array: &vortex_array::arrays::VarBinArray, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub trait vortex_array::arrays::filter::FilterReduce: vortex_array::vtable::VTable -pub fn vortex_array::arrays::filter::FilterReduce::filter(array: &Self::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::filter::FilterReduce::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::Bool @@ -2424,23 +2330,25 @@ pub fn vortex_array::arrays::Bool::filter(array: &vortex_array::arrays::BoolArra impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::filter(array: &vortex_array::arrays::ConstantArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::filter(array: &vortex_array::arrays::ExtensionArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::filter(array: &vortex_array::arrays::MaskedArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::filter(array: &vortex_array::arrays::dict::DictArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::filter(_array: &vortex_array::arrays::null::NullArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::filter(_array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> + +pub type vortex_array::arrays::filter::FilterArray = vortex_array::vtable::Array pub mod vortex_array::arrays::fixed_size_list @@ -2460,27 +2368,27 @@ pub fn vortex_array::arrays::FixedSizeList::fmt(&self, f: &mut core::fmt::Format impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::take(array: &vortex_array::arrays::FixedSizeListArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::cast(array: &vortex_array::arrays::FixedSizeListArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::mask(array: &vortex_array::arrays::FixedSizeListArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::scalar_at(array: &vortex_array::arrays::FixedSizeListArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::FixedSizeList -pub type vortex_array::arrays::FixedSizeList::Array = vortex_array::arrays::FixedSizeListArray +pub type vortex_array::arrays::FixedSizeList::ArrayData = vortex_array::arrays::FixedSizeListData pub type vortex_array::arrays::FixedSizeList::Metadata = vortex_array::EmptyMetadata @@ -2488,25 +2396,25 @@ pub type vortex_array::arrays::FixedSizeList::OperationsVTable = vortex_array::a pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: &vortex_array::arrays::FixedSizeListArray, other: &vortex_array::arrays::FixedSizeListArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: &vortex_array::arrays::FixedSizeListArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::FixedSizeList::buffer(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::FixedSizeList::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::FixedSizeList::buffer_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::FixedSizeList::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::FixedSizeList::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeList::child(array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FixedSizeList::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::FixedSizeList::child_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::FixedSizeList::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::FixedSizeList::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeList::dtype(array: &vortex_array::arrays::FixedSizeListArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::FixedSizeList::dtype(array: &vortex_array::arrays::FixedSizeListData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::FixedSizeList::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -2514,13 +2422,13 @@ pub fn vortex_array::arrays::FixedSizeList::execute_parent(array: &vortex_array: pub fn vortex_array::arrays::FixedSizeList::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::FixedSizeList::len(array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeList::len(array: &vortex_array::arrays::FixedSizeListData) -> usize -pub fn vortex_array::arrays::FixedSizeList::metadata(_array: &vortex_array::arrays::FixedSizeListArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeList::nbuffers(_array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeList::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::FixedSizeList::nchildren(array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeList::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::FixedSizeList::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -2528,69 +2436,65 @@ pub fn vortex_array::arrays::FixedSizeList::reduce_parent(array: &vortex_array:: pub fn vortex_array::arrays::FixedSizeList::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::FixedSizeList::stats(array: &vortex_array::arrays::FixedSizeListArray) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::arrays::FixedSizeList::vtable(_array: &Self::Array) -> &Self - -pub fn vortex_array::arrays::FixedSizeList::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeList::stats(array: &vortex_array::arrays::FixedSizeListData) -> &vortex_array::stats::ArrayStats -pub struct vortex_array::arrays::fixed_size_list::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeList::vtable(_array: &vortex_array::arrays::FixedSizeListData) -> &Self -impl vortex_array::arrays::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeList::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeListArray::elements(&self) -> &vortex_array::ArrayRef +pub struct vortex_array::arrays::fixed_size_list::FixedSizeListData -pub fn vortex_array::arrays::FixedSizeListArray::fixed_size_list_elements_at(&self, index: usize) -> vortex_error::VortexResult +impl vortex_array::arrays::FixedSizeListData -pub fn vortex_array::arrays::FixedSizeListArray::into_parts(self) -> (vortex_array::ArrayRef, vortex_array::validity::Validity, vortex_array::dtype::DType) +pub fn vortex_array::arrays::FixedSizeListData::dtype(&self) -> &vortex_array::dtype::DType -pub const fn vortex_array::arrays::FixedSizeListArray::list_size(&self) -> u32 +pub fn vortex_array::arrays::FixedSizeListData::elements(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::FixedSizeListArray::new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self +pub fn vortex_array::arrays::FixedSizeListData::into_parts(self) -> (vortex_array::ArrayRef, vortex_array::validity::Validity, vortex_array::dtype::DType) -pub unsafe fn vortex_array::arrays::FixedSizeListArray::new_unchecked(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self +pub fn vortex_array::arrays::FixedSizeListData::is_empty(&self) -> bool -pub fn vortex_array::arrays::FixedSizeListArray::try_new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeListData::len(&self) -> usize -pub fn vortex_array::arrays::FixedSizeListArray::validate(elements: &vortex_array::ArrayRef, len: usize, list_size: u32, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub const fn vortex_array::arrays::FixedSizeListData::list_size(&self) -> u32 -impl vortex_array::arrays::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeListData::new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self -pub fn vortex_array::arrays::FixedSizeListArray::to_array(&self) -> vortex_array::ArrayRef +pub unsafe fn vortex_array::arrays::FixedSizeListData::new_unchecked(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self -impl core::clone::Clone for vortex_array::arrays::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeListData::try_new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeListArray::clone(&self) -> vortex_array::arrays::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeListData::validate(elements: &vortex_array::ArrayRef, len: usize, list_size: u32, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -impl core::convert::AsRef for vortex_array::arrays::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeListData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::arrays::FixedSizeListArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::FixedSizeListData::validity_mask(&self) -> vortex_mask::Mask -impl core::convert::From for vortex_array::ArrayRef +impl vortex_array::arrays::FixedSizeListData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::FixedSizeListArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FixedSizeListData::fixed_size_list_elements_at(&self, index: usize) -> vortex_error::VortexResult -impl core::fmt::Debug for vortex_array::arrays::FixedSizeListArray +impl core::clone::Clone for vortex_array::arrays::FixedSizeListData -pub fn vortex_array::arrays::FixedSizeListArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::FixedSizeListData::clone(&self) -> vortex_array::arrays::FixedSizeListData -impl core::ops::deref::Deref for vortex_array::arrays::FixedSizeListArray +impl core::convert::From for vortex_array::ArrayRef -pub type vortex_array::arrays::FixedSizeListArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::FixedSizeListData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::FixedSizeListArray::deref(&self) -> &Self::Target +impl core::fmt::Debug for vortex_array::arrays::FixedSizeListData -impl vortex_array::Executable for vortex_array::arrays::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeListData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::FixedSizeListArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +impl vortex_array::IntoArray for vortex_array::arrays::FixedSizeListData -impl vortex_array::IntoArray for vortex_array::arrays::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeListData::into_array(self) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::FixedSizeListArray::into_array(self) -> vortex_array::ArrayRef +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::FixedSizeListData -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeListData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::arrays::FixedSizeListArray::validity(&self) -> &vortex_array::validity::Validity +pub type vortex_array::arrays::fixed_size_list::FixedSizeListArray = vortex_array::vtable::Array pub mod vortex_array::arrays::list @@ -2610,31 +2514,31 @@ pub fn vortex_array::arrays::List::fmt(&self, f: &mut core::fmt::Formatter<'_>) impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::List -pub fn vortex_array::arrays::List::take(array: &vortex_array::arrays::ListArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterKernel for vortex_array::arrays::List -pub fn vortex_array::arrays::List::filter(array: &vortex_array::arrays::ListArray, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::List -pub fn vortex_array::arrays::List::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::List -pub fn vortex_array::arrays::List::cast(array: &vortex_array::arrays::ListArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::List -pub fn vortex_array::arrays::List::mask(array: &vortex_array::arrays::ListArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::List -pub fn vortex_array::arrays::List::scalar_at(array: &vortex_array::arrays::ListArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::List -pub type vortex_array::arrays::List::Array = vortex_array::arrays::ListArray +pub type vortex_array::arrays::List::ArrayData = vortex_array::arrays::ListData pub type vortex_array::arrays::List::Metadata = vortex_array::ProstMetadata @@ -2642,25 +2546,25 @@ pub type vortex_array::arrays::List::OperationsVTable = vortex_array::arrays::Li pub type vortex_array::arrays::List::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::List::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: &vortex_array::arrays::ListArray, other: &vortex_array::arrays::ListArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: &vortex_array::arrays::ListArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::List::buffer(_array: &vortex_array::arrays::ListArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::List::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::List::buffer_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::List::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::List::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::List::child(array: &vortex_array::arrays::ListArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::List::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::List::child_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::List::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::List::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::List::dtype(array: &vortex_array::arrays::ListArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::List::dtype(array: &vortex_array::arrays::ListData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::List::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -2668,13 +2572,13 @@ pub fn vortex_array::arrays::List::execute_parent(array: &vortex_array::vtable:: pub fn vortex_array::arrays::List::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::List::len(array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::List::len(array: &vortex_array::arrays::ListData) -> usize -pub fn vortex_array::arrays::List::metadata(array: &vortex_array::arrays::ListArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::List::nbuffers(_array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::List::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::List::nchildren(array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::List::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::List::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -2682,83 +2586,83 @@ pub fn vortex_array::arrays::List::reduce_parent(array: &vortex_array::vtable::A pub fn vortex_array::arrays::List::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::List::stats(array: &vortex_array::arrays::ListArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::List::stats(array: &vortex_array::arrays::ListData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::List::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::List::vtable(_array: &vortex_array::arrays::ListData) -> &Self -pub fn vortex_array::arrays::List::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub struct vortex_array::arrays::list::ListArray +pub struct vortex_array::arrays::list::ListArrayParts -impl vortex_array::arrays::ListArray +pub vortex_array::arrays::list::ListArrayParts::dtype: vortex_array::dtype::DType -pub fn vortex_array::arrays::ListArray::element_dtype(&self) -> &alloc::sync::Arc +pub vortex_array::arrays::list::ListArrayParts::elements: vortex_array::ArrayRef -pub fn vortex_array::arrays::ListArray::elements(&self) -> &vortex_array::ArrayRef +pub vortex_array::arrays::list::ListArrayParts::offsets: vortex_array::ArrayRef -pub fn vortex_array::arrays::ListArray::into_parts(self) -> vortex_array::arrays::list::ListArrayParts +pub vortex_array::arrays::list::ListArrayParts::validity: vortex_array::validity::Validity -pub fn vortex_array::arrays::ListArray::list_elements_at(&self, index: usize) -> vortex_error::VortexResult +pub struct vortex_array::arrays::list::ListData -pub fn vortex_array::arrays::ListArray::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self +impl vortex_array::arrays::ListData -pub unsafe fn vortex_array::arrays::ListArray::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::ListData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::ListArray::offset_at(&self, index: usize) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListData::element_dtype(&self) -> &alloc::sync::Arc -pub fn vortex_array::arrays::ListArray::offsets(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::ListData::elements(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::ListArray::reset_offsets(&self, recurse: bool) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListData::into_parts(self) -> vortex_array::arrays::list::ListArrayParts -pub fn vortex_array::arrays::ListArray::sliced_elements(&self) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListData::is_empty(&self) -> bool -pub fn vortex_array::arrays::ListArray::try_new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListData::len(&self) -> usize -pub fn vortex_array::arrays::ListArray::validate(elements: &vortex_array::ArrayRef, offsets: &vortex_array::ArrayRef, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListData::list_elements_at(&self, index: usize) -> vortex_error::VortexResult -impl vortex_array::arrays::ListArray +pub fn vortex_array::arrays::ListData::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::ListArray::to_array(&self) -> vortex_array::ArrayRef +pub unsafe fn vortex_array::arrays::ListData::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self -impl core::clone::Clone for vortex_array::arrays::ListArray +pub fn vortex_array::arrays::ListData::offset_at(&self, index: usize) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListArray::clone(&self) -> vortex_array::arrays::ListArray +pub fn vortex_array::arrays::ListData::offsets(&self) -> &vortex_array::ArrayRef -impl core::convert::AsRef for vortex_array::arrays::ListArray +pub fn vortex_array::arrays::ListData::sliced_elements(&self) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::ListData::try_new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::ListData::validate(elements: &vortex_array::ArrayRef, offsets: &vortex_array::ArrayRef, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ListArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListData::validity(&self) -> &vortex_array::validity::Validity -impl core::fmt::Debug for vortex_array::arrays::ListArray +pub fn vortex_array::arrays::ListData::validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::arrays::ListArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::arrays::ListData -impl core::ops::deref::Deref for vortex_array::arrays::ListArray +pub fn vortex_array::arrays::ListData::reset_offsets(&self, recurse: bool) -> vortex_error::VortexResult -pub type vortex_array::arrays::ListArray::Target = dyn vortex_array::DynArray +impl core::clone::Clone for vortex_array::arrays::ListData -pub fn vortex_array::arrays::ListArray::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::ListData::clone(&self) -> vortex_array::arrays::ListData -impl vortex_array::IntoArray for vortex_array::arrays::ListArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::ListArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ListData) -> vortex_array::ArrayRef -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::ListArray +impl core::fmt::Debug for vortex_array::arrays::ListData -pub fn vortex_array::arrays::ListArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::ListData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub struct vortex_array::arrays::list::ListArrayParts +impl vortex_array::IntoArray for vortex_array::arrays::ListData -pub vortex_array::arrays::list::ListArrayParts::dtype: vortex_array::dtype::DType +pub fn vortex_array::arrays::ListData::into_array(self) -> vortex_array::ArrayRef -pub vortex_array::arrays::list::ListArrayParts::elements: vortex_array::ArrayRef +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::ListData -pub vortex_array::arrays::list::ListArrayParts::offsets: vortex_array::ArrayRef +pub fn vortex_array::arrays::ListData::validity(&self) -> &vortex_array::validity::Validity -pub vortex_array::arrays::list::ListArrayParts::validity: vortex_array::validity::Validity +pub type vortex_array::arrays::list::ListArray = vortex_array::vtable::Array pub mod vortex_array::arrays::listview @@ -2788,27 +2692,27 @@ pub fn vortex_array::arrays::ListView::fmt(&self, f: &mut core::fmt::Formatter<' impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::take(array: &vortex_array::arrays::ListViewArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::cast(array: &vortex_array::arrays::ListViewArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::mask(array: &vortex_array::arrays::ListViewArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::scalar_at(array: &vortex_array::arrays::ListViewArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::ListView -pub type vortex_array::arrays::ListView::Array = vortex_array::arrays::ListViewArray +pub type vortex_array::arrays::ListView::ArrayData = vortex_array::arrays::ListViewData pub type vortex_array::arrays::ListView::Metadata = vortex_array::ProstMetadata @@ -2816,25 +2720,25 @@ pub type vortex_array::arrays::ListView::OperationsVTable = vortex_array::arrays pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::ListView::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: &vortex_array::arrays::ListViewArray, other: &vortex_array::arrays::ListViewArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: &vortex_array::arrays::ListViewArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::ListView::buffer(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::ListView::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::ListView::buffer_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::ListView::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::ListView::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListView::child(array: &vortex_array::arrays::ListViewArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListView::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::ListView::child_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::ListView::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::ListView::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListView::dtype(array: &vortex_array::arrays::ListViewArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::ListView::dtype(array: &vortex_array::arrays::ListViewData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::ListView::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -2842,13 +2746,13 @@ pub fn vortex_array::arrays::ListView::execute_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::ListView::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::ListView::len(array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListView::len(array: &vortex_array::arrays::ListViewData) -> usize -pub fn vortex_array::arrays::ListView::metadata(array: &vortex_array::arrays::ListViewArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListView::nbuffers(_array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListView::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::ListView::nchildren(array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListView::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::ListView::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -2856,97 +2760,85 @@ pub fn vortex_array::arrays::ListView::reduce_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::ListView::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ListView::stats(array: &vortex_array::arrays::ListViewArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ListView::stats(array: &vortex_array::arrays::ListViewData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::ListView::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::ListView::vtable(_array: &vortex_array::arrays::ListViewData) -> &Self -pub fn vortex_array::arrays::ListView::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub struct vortex_array::arrays::listview::ListViewArray - -impl vortex_array::arrays::ListViewArray - -pub fn vortex_array::arrays::ListViewArray::elements(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::ListViewArray::into_parts(self) -> vortex_array::arrays::listview::ListViewArrayParts - -pub fn vortex_array::arrays::ListViewArray::is_zero_copy_to_list(&self) -> bool - -pub fn vortex_array::arrays::ListViewArray::list_elements_at(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::arrays::ListViewArray::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self +pub struct vortex_array::arrays::listview::ListViewArrayParts -pub unsafe fn vortex_array::arrays::ListViewArray::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self +pub vortex_array::arrays::listview::ListViewArrayParts::elements: vortex_array::ArrayRef -pub fn vortex_array::arrays::ListViewArray::offset_at(&self, index: usize) -> usize +pub vortex_array::arrays::listview::ListViewArrayParts::elements_dtype: alloc::sync::Arc -pub fn vortex_array::arrays::ListViewArray::offsets(&self) -> &vortex_array::ArrayRef +pub vortex_array::arrays::listview::ListViewArrayParts::offsets: vortex_array::ArrayRef -pub fn vortex_array::arrays::ListViewArray::size_at(&self, index: usize) -> usize +pub vortex_array::arrays::listview::ListViewArrayParts::sizes: vortex_array::ArrayRef -pub fn vortex_array::arrays::ListViewArray::sizes(&self) -> &vortex_array::ArrayRef +pub vortex_array::arrays::listview::ListViewArrayParts::validity: vortex_array::validity::Validity -pub fn vortex_array::arrays::ListViewArray::try_new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub struct vortex_array::arrays::listview::ListViewData -pub fn vortex_array::arrays::ListViewArray::validate(elements: &vortex_array::ArrayRef, offsets: &vortex_array::ArrayRef, sizes: &vortex_array::ArrayRef, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +impl vortex_array::arrays::ListViewData -pub fn vortex_array::arrays::ListViewArray::verify_is_zero_copy_to_list(&self) -> bool +pub fn vortex_array::arrays::ListViewData::dtype(&self) -> &vortex_array::dtype::DType -pub unsafe fn vortex_array::arrays::ListViewArray::with_zero_copy_to_list(self, is_zctl: bool) -> Self +pub fn vortex_array::arrays::ListViewData::elements(&self) -> &vortex_array::ArrayRef -impl vortex_array::arrays::ListViewArray +pub fn vortex_array::arrays::ListViewData::into_parts(self) -> vortex_array::arrays::listview::ListViewArrayParts -pub fn vortex_array::arrays::ListViewArray::rebuild(&self, mode: vortex_array::arrays::listview::ListViewRebuildMode) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListViewData::is_empty(&self) -> bool -impl vortex_array::arrays::ListViewArray +pub fn vortex_array::arrays::ListViewData::is_zero_copy_to_list(&self) -> bool -pub fn vortex_array::arrays::ListViewArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListViewData::len(&self) -> usize -impl core::clone::Clone for vortex_array::arrays::ListViewArray +pub fn vortex_array::arrays::ListViewData::list_elements_at(&self, index: usize) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListViewArray::clone(&self) -> vortex_array::arrays::ListViewArray +pub fn vortex_array::arrays::ListViewData::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self -impl core::convert::AsRef for vortex_array::arrays::ListViewArray +pub unsafe fn vortex_array::arrays::ListViewData::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::ListViewArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::ListViewData::offset_at(&self, index: usize) -> usize -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::ListViewData::offsets(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ListViewArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListViewData::size_at(&self, index: usize) -> usize -impl core::fmt::Debug for vortex_array::arrays::ListViewArray +pub fn vortex_array::arrays::ListViewData::sizes(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::ListViewArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::ListViewData::try_new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl core::ops::deref::Deref for vortex_array::arrays::ListViewArray +pub fn vortex_array::arrays::ListViewData::validate(elements: &vortex_array::ArrayRef, offsets: &vortex_array::ArrayRef, sizes: &vortex_array::ArrayRef, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -pub type vortex_array::arrays::ListViewArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::arrays::ListViewData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::arrays::ListViewArray::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::ListViewData::validity_mask(&self) -> vortex_mask::Mask -impl vortex_array::Executable for vortex_array::arrays::ListViewArray +pub fn vortex_array::arrays::ListViewData::verify_is_zero_copy_to_list(&self) -> bool -pub fn vortex_array::arrays::ListViewArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub unsafe fn vortex_array::arrays::ListViewData::with_zero_copy_to_list(self, is_zctl: bool) -> Self -impl vortex_array::IntoArray for vortex_array::arrays::ListViewArray +impl core::clone::Clone for vortex_array::arrays::ListViewData -pub fn vortex_array::arrays::ListViewArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListViewData::clone(&self) -> vortex_array::arrays::ListViewData -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::ListViewArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::ListViewArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ListViewData) -> vortex_array::ArrayRef -pub struct vortex_array::arrays::listview::ListViewArrayParts +impl core::fmt::Debug for vortex_array::arrays::ListViewData -pub vortex_array::arrays::listview::ListViewArrayParts::elements: vortex_array::ArrayRef +pub fn vortex_array::arrays::ListViewData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub vortex_array::arrays::listview::ListViewArrayParts::elements_dtype: alloc::sync::Arc +impl vortex_array::IntoArray for vortex_array::arrays::ListViewData -pub vortex_array::arrays::listview::ListViewArrayParts::offsets: vortex_array::ArrayRef +pub fn vortex_array::arrays::ListViewData::into_array(self) -> vortex_array::ArrayRef -pub vortex_array::arrays::listview::ListViewArrayParts::sizes: vortex_array::ArrayRef +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::ListViewData -pub vortex_array::arrays::listview::ListViewArrayParts::validity: vortex_array::validity::Validity +pub fn vortex_array::arrays::ListViewData::validity(&self) -> &vortex_array::validity::Validity pub fn vortex_array::arrays::listview::list_from_list_view(list_view: vortex_array::arrays::ListViewArray) -> vortex_error::VortexResult @@ -2954,6 +2846,8 @@ pub fn vortex_array::arrays::listview::list_view_from_list(list: vortex_array::a pub fn vortex_array::arrays::listview::recursive_list_from_list_view(array: vortex_array::ArrayRef) -> vortex_error::VortexResult +pub type vortex_array::arrays::listview::ListViewArray = vortex_array::vtable::Array + pub mod vortex_array::arrays::masked pub struct vortex_array::arrays::masked::Masked @@ -2972,27 +2866,27 @@ pub fn vortex_array::arrays::Masked::fmt(&self, f: &mut core::fmt::Formatter<'_> impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::take(array: &vortex_array::arrays::MaskedArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::filter(array: &vortex_array::arrays::MaskedArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::mask(array: &vortex_array::arrays::MaskedArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::scalar_at(array: &vortex_array::arrays::MaskedArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Masked -pub type vortex_array::arrays::Masked::Array = vortex_array::arrays::MaskedArray +pub type vortex_array::arrays::Masked::ArrayData = vortex_array::arrays::MaskedData pub type vortex_array::arrays::Masked::Metadata = vortex_array::EmptyMetadata @@ -3000,25 +2894,25 @@ pub type vortex_array::arrays::Masked::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Masked::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: &vortex_array::arrays::MaskedArray, other: &vortex_array::arrays::MaskedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: &vortex_array::arrays::MaskedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Masked::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Masked::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Masked::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Masked::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Masked::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Masked::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Masked::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Masked::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Masked::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Masked::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Masked::dtype(array: &vortex_array::arrays::MaskedArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Masked::dtype(array: &vortex_array::arrays::MaskedData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Masked::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -3026,13 +2920,13 @@ pub fn vortex_array::arrays::Masked::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Masked::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Masked::len(array: &vortex_array::arrays::MaskedArray) -> usize +pub fn vortex_array::arrays::Masked::len(array: &vortex_array::arrays::MaskedData) -> usize -pub fn vortex_array::arrays::Masked::metadata(_array: &vortex_array::arrays::MaskedArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Masked::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Masked::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Masked::nchildren(array: &Self::Array) -> usize +pub fn vortex_array::arrays::Masked::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Masked::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -3040,56 +2934,54 @@ pub fn vortex_array::arrays::Masked::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Masked::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Masked::stats(array: &vortex_array::arrays::MaskedArray) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::arrays::Masked::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Masked::stats(array: &vortex_array::arrays::MaskedData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Masked::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::vtable(_array: &Self::ArrayData) -> &Self -pub struct vortex_array::arrays::masked::MaskedArray +pub fn vortex_array::arrays::Masked::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -impl vortex_array::arrays::MaskedArray +pub struct vortex_array::arrays::masked::MaskedData -pub fn vortex_array::arrays::MaskedArray::child(&self) -> &vortex_array::ArrayRef +impl vortex_array::arrays::MaskedData -pub fn vortex_array::arrays::MaskedArray::try_new(child: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::MaskedData::child(&self) -> &vortex_array::ArrayRef -impl vortex_array::arrays::MaskedArray +pub fn vortex_array::arrays::MaskedData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::MaskedArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::MaskedData::is_empty(&self) -> bool -impl core::clone::Clone for vortex_array::arrays::MaskedArray +pub fn vortex_array::arrays::MaskedData::len(&self) -> usize -pub fn vortex_array::arrays::MaskedArray::clone(&self) -> vortex_array::arrays::MaskedArray +pub fn vortex_array::arrays::MaskedData::try_new(child: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl core::convert::AsRef for vortex_array::arrays::MaskedArray +pub fn vortex_array::arrays::MaskedData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::arrays::MaskedArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::MaskedData::validity_mask(&self) -> vortex_mask::Mask -impl core::convert::From for vortex_array::ArrayRef +impl core::clone::Clone for vortex_array::arrays::MaskedData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::MaskedArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::MaskedData::clone(&self) -> vortex_array::arrays::MaskedData -impl core::fmt::Debug for vortex_array::arrays::MaskedArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::MaskedArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::MaskedData) -> vortex_array::ArrayRef -impl core::ops::deref::Deref for vortex_array::arrays::MaskedArray +impl core::fmt::Debug for vortex_array::arrays::MaskedData -pub type vortex_array::arrays::MaskedArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::arrays::MaskedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::MaskedArray::deref(&self) -> &Self::Target +impl vortex_array::IntoArray for vortex_array::arrays::MaskedData -impl vortex_array::IntoArray for vortex_array::arrays::MaskedArray +pub fn vortex_array::arrays::MaskedData::into_array(self) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::MaskedArray::into_array(self) -> vortex_array::ArrayRef +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::MaskedData -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::MaskedArray - -pub fn vortex_array::arrays::MaskedArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::MaskedData::validity(&self) -> &vortex_array::validity::Validity pub fn vortex_array::arrays::masked::mask_validity_canonical(canonical: vortex_array::Canonical, validity_mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub type vortex_array::arrays::masked::MaskedArray = vortex_array::vtable::Array + pub mod vortex_array::arrays::null pub struct vortex_array::arrays::null::Null @@ -3112,31 +3004,31 @@ pub fn vortex_array::arrays::null::Null::fmt(&self, f: &mut core::fmt::Formatter impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::take(array: &vortex_array::arrays::null::NullArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::filter(_array: &vortex_array::arrays::null::NullArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::filter(_array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::slice(_array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::slice(_array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::cast(array: &vortex_array::arrays::null::NullArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::mask(array: &vortex_array::arrays::null::NullArray, _mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::mask(array: &vortex_array::vtable::Array, _mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::scalar_at(_array: &vortex_array::arrays::null::NullArray, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::scalar_at(_array: &vortex_array::vtable::Array, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::null::Null -pub type vortex_array::arrays::null::Null::Array = vortex_array::arrays::null::NullArray +pub type vortex_array::arrays::null::Null::ArrayData = vortex_array::arrays::null::NullData pub type vortex_array::arrays::null::Null::Metadata = vortex_array::EmptyMetadata @@ -3144,25 +3036,25 @@ pub type vortex_array::arrays::null::Null::OperationsVTable = vortex_array::arra pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(array: &vortex_array::arrays::null::NullArray, other: &vortex_array::arrays::null::NullArray, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(array: &vortex_array::arrays::null::NullArray, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(array: &vortex_array::vtable::Array, state: &mut H, _precision: vortex_array::Precision) -pub fn vortex_array::arrays::null::Null::buffer(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::null::Null::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::null::Null::buffer_name(_array: &vortex_array::arrays::null::NullArray, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::null::Null::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::null::Null::build(_dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::build(_dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::null::Null::child(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::null::Null::child(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::null::Null::child_name(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::null::Null::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::null::Null::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::null::Null::dtype(_array: &vortex_array::arrays::null::NullArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::null::Null::dtype(_array: &vortex_array::arrays::null::NullData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::null::Null::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -3170,13 +3062,13 @@ pub fn vortex_array::arrays::null::Null::execute_parent(array: &vortex_array::vt pub fn vortex_array::arrays::null::Null::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::null::Null::len(array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::Null::len(array: &vortex_array::arrays::null::NullData) -> usize -pub fn vortex_array::arrays::null::Null::metadata(_array: &vortex_array::arrays::null::NullArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::null::Null::nbuffers(_array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::Null::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::null::Null::nchildren(_array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::Null::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::null::Null::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -3184,55 +3076,45 @@ pub fn vortex_array::arrays::null::Null::reduce_parent(array: &vortex_array::vta pub fn vortex_array::arrays::null::Null::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::null::Null::stats(array: &vortex_array::arrays::null::NullArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::null::Null::stats(array: &vortex_array::arrays::null::NullData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::null::Null::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::null::Null::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::null::Null::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::with_children(_array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::validity(_array: &vortex_array::arrays::null::NullArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::validity(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub struct vortex_array::arrays::null::NullArray +pub struct vortex_array::arrays::null::NullData -impl vortex_array::arrays::null::NullArray +impl vortex_array::arrays::null::NullData -pub fn vortex_array::arrays::null::NullArray::new(len: usize) -> Self +pub fn vortex_array::arrays::null::NullData::dtype(&self) -> &vortex_array::dtype::DType -impl vortex_array::arrays::null::NullArray +pub fn vortex_array::arrays::null::NullData::is_empty(&self) -> bool -pub fn vortex_array::arrays::null::NullArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::null::NullData::len(&self) -> usize -impl core::clone::Clone for vortex_array::arrays::null::NullArray +pub fn vortex_array::arrays::null::NullData::new(len: usize) -> Self -pub fn vortex_array::arrays::null::NullArray::clone(&self) -> vortex_array::arrays::null::NullArray +impl core::clone::Clone for vortex_array::arrays::null::NullData -impl core::convert::AsRef for vortex_array::arrays::null::NullArray +pub fn vortex_array::arrays::null::NullData::clone(&self) -> vortex_array::arrays::null::NullData -pub fn vortex_array::arrays::null::NullArray::as_ref(&self) -> &dyn vortex_array::DynArray +impl core::convert::From for vortex_array::ArrayRef -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::null::NullData) -> vortex_array::ArrayRef -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::null::NullArray) -> vortex_array::ArrayRef +impl core::fmt::Debug for vortex_array::arrays::null::NullData -impl core::fmt::Debug for vortex_array::arrays::null::NullArray +pub fn vortex_array::arrays::null::NullData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::null::NullArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::IntoArray for vortex_array::arrays::null::NullData -impl core::ops::deref::Deref for vortex_array::arrays::null::NullArray +pub fn vortex_array::arrays::null::NullData::into_array(self) -> vortex_array::ArrayRef -pub type vortex_array::arrays::null::NullArray::Target = dyn vortex_array::DynArray - -pub fn vortex_array::arrays::null::NullArray::deref(&self) -> &Self::Target - -impl vortex_array::Executable for vortex_array::arrays::null::NullArray - -pub fn vortex_array::arrays::null::NullArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult - -impl vortex_array::IntoArray for vortex_array::arrays::null::NullArray - -pub fn vortex_array::arrays::null::NullArray::into_array(self) -> vortex_array::ArrayRef +pub type vortex_array::arrays::null::NullArray = vortex_array::vtable::Array pub mod vortex_array::arrays::primitive @@ -3318,41 +3200,41 @@ pub fn vortex_array::arrays::Primitive::fmt(&self, f: &mut core::fmt::Formatter< impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::take(array: &vortex_array::arrays::PrimitiveArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> 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, array: &vortex_array::arrays::PrimitiveArray, parent: &vortex_array::arrays::MaskedArray, _child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: &vortex_array::arrays::MaskedArray, _child_idx: usize) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::between::BetweenKernel for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::between(arr: &vortex_array::arrays::PrimitiveArray, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::between(arr: &vortex_array::vtable::Array, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastKernel for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::cast(array: &vortex_array::arrays::PrimitiveArray, dtype: &vortex_array::dtype::DType, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullKernel for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::fill_null(array: &vortex_array::arrays::PrimitiveArray, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::mask(array: &vortex_array::arrays::PrimitiveArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::scalar_at(array: &vortex_array::arrays::PrimitiveArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Primitive -pub type vortex_array::arrays::Primitive::Array = vortex_array::arrays::PrimitiveArray +pub type vortex_array::arrays::Primitive::ArrayData = vortex_array::arrays::PrimitiveData pub type vortex_array::arrays::Primitive::Metadata = vortex_array::EmptyMetadata @@ -3360,25 +3242,25 @@ pub type vortex_array::arrays::Primitive::OperationsVTable = vortex_array::array pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Primitive::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Primitive::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: &vortex_array::arrays::PrimitiveArray, other: &vortex_array::arrays::PrimitiveArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: &vortex_array::arrays::PrimitiveArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Primitive::buffer(array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Primitive::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Primitive::buffer_name(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Primitive::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Primitive::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Primitive::child(array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Primitive::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Primitive::child_name(_array: &vortex_array::arrays::PrimitiveArray, _idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Primitive::child_name(_array: &vortex_array::vtable::Array, _idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Primitive::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Primitive::dtype(array: &vortex_array::arrays::PrimitiveArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Primitive::dtype(array: &vortex_array::arrays::PrimitiveData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Primitive::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -3386,13 +3268,13 @@ pub fn vortex_array::arrays::Primitive::execute_parent(array: &vortex_array::vta pub fn vortex_array::arrays::Primitive::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Primitive::len(array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::Primitive::len(array: &vortex_array::arrays::PrimitiveData) -> usize -pub fn vortex_array::arrays::Primitive::metadata(_array: &vortex_array::arrays::PrimitiveArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Primitive::nbuffers(_array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::Primitive::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Primitive::nchildren(array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::Primitive::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Primitive::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -3400,129 +3282,93 @@ pub fn vortex_array::arrays::Primitive::reduce_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::Primitive::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Primitive::stats(array: &vortex_array::arrays::PrimitiveArray) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::arrays::Primitive::vtable(_array: &Self::Array) -> &Self - -pub fn vortex_array::arrays::Primitive::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> - -pub struct vortex_array::arrays::primitive::PrimitiveArray - -impl vortex_array::arrays::PrimitiveArray - -pub fn vortex_array::arrays::PrimitiveArray::as_slice(&self) -> &[T] - -pub fn vortex_array::arrays::PrimitiveArray::narrow(&self) -> vortex_error::VortexResult - -pub fn vortex_array::arrays::PrimitiveArray::reinterpret_cast(&self, ptype: vortex_array::dtype::PType) -> Self - -impl vortex_array::arrays::PrimitiveArray - -pub fn vortex_array::arrays::PrimitiveArray::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle - -pub fn vortex_array::arrays::PrimitiveArray::from_buffer_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self - -pub fn vortex_array::arrays::PrimitiveArray::from_byte_buffer(buffer: vortex_buffer::ByteBuffer, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self - -pub fn vortex_array::arrays::PrimitiveArray::from_values_byte_buffer(valid_elems_buffer: vortex_buffer::ByteBuffer, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity, n_rows: usize) -> Self - -pub fn vortex_array::arrays::PrimitiveArray::map_each(self, f: F) -> vortex_array::arrays::PrimitiveArray where T: vortex_array::dtype::NativePType, R: vortex_array::dtype::NativePType, F: core::ops::function::FnMut(T) -> R - -pub fn vortex_array::arrays::PrimitiveArray::map_each_with_validity(self, f: F) -> vortex_error::VortexResult where T: vortex_array::dtype::NativePType, R: vortex_array::dtype::NativePType, F: core::ops::function::FnMut((T, bool)) -> R - -pub fn vortex_array::arrays::PrimitiveArray::ptype(&self) -> vortex_array::dtype::PType - -impl vortex_array::arrays::PrimitiveArray - -pub fn vortex_array::arrays::PrimitiveArray::empty(nullability: vortex_array::dtype::Nullability) -> Self +pub fn vortex_array::arrays::Primitive::stats(array: &vortex_array::arrays::PrimitiveData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::PrimitiveArray::new(buffer: impl core::convert::Into>, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::Primitive::vtable(_array: &Self::ArrayData) -> &Self -pub unsafe fn vortex_array::arrays::PrimitiveArray::new_unchecked(buffer: vortex_buffer::buffer::Buffer, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::Primitive::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub unsafe fn vortex_array::arrays::PrimitiveArray::new_unchecked_from_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self - -pub fn vortex_array::arrays::PrimitiveArray::try_new(buffer: vortex_buffer::buffer::Buffer, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub struct vortex_array::arrays::primitive::PrimitiveArrayParts -pub fn vortex_array::arrays::PrimitiveArray::validate(buffer: &vortex_buffer::buffer::Buffer, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub vortex_array::arrays::primitive::PrimitiveArrayParts::buffer: vortex_array::buffer::BufferHandle -impl vortex_array::arrays::PrimitiveArray +pub vortex_array::arrays::primitive::PrimitiveArrayParts::ptype: vortex_array::dtype::PType -pub fn vortex_array::arrays::PrimitiveArray::from_option_iter>>(iter: I) -> Self +pub vortex_array::arrays::primitive::PrimitiveArrayParts::validity: vortex_array::validity::Validity -pub fn vortex_array::arrays::PrimitiveArray::into_buffer(self) -> vortex_buffer::buffer::Buffer +pub struct vortex_array::arrays::primitive::PrimitiveData -pub fn vortex_array::arrays::PrimitiveArray::into_buffer_mut(self) -> vortex_buffer::buffer_mut::BufferMut +impl vortex_array::arrays::PrimitiveData -pub fn vortex_array::arrays::PrimitiveArray::to_buffer(&self) -> vortex_buffer::buffer::Buffer +pub fn vortex_array::arrays::PrimitiveData::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::PrimitiveArray::try_into_buffer_mut(self) -> core::result::Result, vortex_buffer::buffer::Buffer> +pub fn vortex_array::arrays::PrimitiveData::dtype(&self) -> &vortex_array::dtype::DType -impl vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::from_buffer_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::PrimitiveArray::into_parts(self) -> vortex_array::arrays::primitive::PrimitiveArrayParts +pub fn vortex_array::arrays::PrimitiveData::from_byte_buffer(buffer: vortex_buffer::ByteBuffer, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self -impl vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::from_values_byte_buffer(valid_elems_buffer: vortex_buffer::ByteBuffer, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity, n_rows: usize) -> Self -pub fn vortex_array::arrays::PrimitiveArray::patch(self, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::PrimitiveData::into_buffer(self) -> vortex_buffer::buffer::Buffer -impl vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::into_buffer_mut(self) -> vortex_buffer::buffer_mut::BufferMut -pub fn vortex_array::arrays::PrimitiveArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::PrimitiveData::is_empty(&self) -> bool -impl vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::len(&self) -> usize -pub fn vortex_array::arrays::PrimitiveArray::top_value(&self) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::PrimitiveData::map_each(self, f: F) -> Self where T: vortex_array::dtype::NativePType, R: vortex_array::dtype::NativePType, F: core::ops::function::FnMut(T) -> R -impl core::clone::Clone for vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::map_each_with_validity(self, f: F) -> vortex_error::VortexResult where T: vortex_array::dtype::NativePType, R: vortex_array::dtype::NativePType, F: core::ops::function::FnMut((T, bool)) -> R -pub fn vortex_array::arrays::PrimitiveArray::clone(&self) -> vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::ptype(&self) -> vortex_array::dtype::PType -impl core::convert::AsRef for vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::to_buffer(&self) -> vortex_buffer::buffer::Buffer -pub fn vortex_array::arrays::PrimitiveArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::PrimitiveData::try_into_buffer_mut(self) -> core::result::Result, vortex_buffer::buffer::Buffer> -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::PrimitiveData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::PrimitiveArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::PrimitiveData::validity_mask(&self) -> vortex_mask::Mask -impl core::fmt::Debug for vortex_array::arrays::PrimitiveArray +impl vortex_array::arrays::PrimitiveData -pub fn vortex_array::arrays::PrimitiveArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::PrimitiveData::empty(nullability: vortex_array::dtype::Nullability) -> Self -impl core::ops::deref::Deref for vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::new(buffer: impl core::convert::Into>, validity: vortex_array::validity::Validity) -> Self -pub type vortex_array::arrays::PrimitiveArray::Target = dyn vortex_array::DynArray +pub unsafe fn vortex_array::arrays::PrimitiveData::new_unchecked(buffer: vortex_buffer::buffer::Buffer, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::PrimitiveArray::deref(&self) -> &Self::Target +pub unsafe fn vortex_array::arrays::PrimitiveData::new_unchecked_from_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self -impl vortex_array::Executable for vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::try_new(buffer: vortex_buffer::buffer::Buffer, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub fn vortex_array::arrays::PrimitiveArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::PrimitiveData::validate(buffer: &vortex_buffer::buffer::Buffer, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -impl vortex_array::IntoArray for vortex_array::arrays::PrimitiveArray +impl vortex_array::arrays::PrimitiveData -pub fn vortex_array::arrays::PrimitiveArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::PrimitiveData::into_parts(self) -> vortex_array::arrays::primitive::PrimitiveArrayParts -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::PrimitiveArray +impl core::clone::Clone for vortex_array::arrays::PrimitiveData -pub fn vortex_array::arrays::PrimitiveArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::PrimitiveData::clone(&self) -> vortex_array::arrays::PrimitiveData -impl core::iter::traits::collect::FromIterator for vortex_array::arrays::PrimitiveArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::PrimitiveArray::from_iter>(iter: I) -> Self +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::PrimitiveData) -> vortex_array::ArrayRef -impl vortex_array::accessor::ArrayAccessor for vortex_array::arrays::PrimitiveArray +impl core::fmt::Debug for vortex_array::arrays::PrimitiveData -pub fn vortex_array::arrays::PrimitiveArray::with_iterator(&self, f: F) -> R where F: for<'a> core::ops::function::FnOnce(&mut dyn core::iter::traits::iterator::Iterator>) -> R +pub fn vortex_array::arrays::PrimitiveData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub struct vortex_array::arrays::primitive::PrimitiveArrayParts +impl vortex_array::IntoArray for vortex_array::arrays::PrimitiveData -pub vortex_array::arrays::primitive::PrimitiveArrayParts::buffer: vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::PrimitiveData::into_array(self) -> vortex_array::ArrayRef -pub vortex_array::arrays::primitive::PrimitiveArrayParts::ptype: vortex_array::dtype::PType +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::PrimitiveData -pub vortex_array::arrays::primitive::PrimitiveArrayParts::validity: vortex_array::validity::Validity +pub fn vortex_array::arrays::PrimitiveData::validity(&self) -> &vortex_array::validity::Validity pub struct vortex_array::arrays::primitive::PrimitiveMaskedValidityRule @@ -3538,12 +3384,14 @@ impl vortex_array::optimizer::rules::ArrayParentReduceRule vortex_error::VortexResult> +pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: &vortex_array::arrays::MaskedArray, _child_idx: usize) -> vortex_error::VortexResult> pub fn vortex_array::arrays::primitive::chunk_range(chunk_idx: usize, offset: usize, array_len: usize) -> core::ops::range::Range pub fn vortex_array::arrays::primitive::patch_chunk(decoded_values: &mut [T], patches_indices: &[I], patches_values: &[T], patches_offset: usize, chunk_offsets_slice: &[C], chunk_idx: usize, offset_within_chunk: usize) where T: vortex_array::dtype::NativePType, I: vortex_array::dtype::UnsignedPType, C: vortex_array::dtype::UnsignedPType +pub type vortex_array::arrays::primitive::PrimitiveArray = vortex_array::vtable::Array + pub mod vortex_array::arrays::scalar_fn pub struct vortex_array::arrays::scalar_fn::AnyScalarFn @@ -3554,7 +3402,7 @@ pub fn vortex_array::arrays::scalar_fn::AnyScalarFn::fmt(&self, f: &mut core::fm impl vortex_array::matcher::Matcher for vortex_array::arrays::scalar_fn::AnyScalarFn -pub type vortex_array::arrays::scalar_fn::AnyScalarFn::Match<'a> = &'a vortex_array::arrays::scalar_fn::ScalarFnArray +pub type vortex_array::arrays::scalar_fn::AnyScalarFn::Match<'a> = &'a vortex_array::vtable::Array pub fn vortex_array::arrays::scalar_fn::AnyScalarFn::matches(array: &dyn vortex_array::DynArray) -> bool @@ -3578,69 +3426,49 @@ pub fn vortex_array::arrays::scalar_fn::ExactScalarFn::matches(array: &dyn vo pub fn vortex_array::arrays::scalar_fn::ExactScalarFn::try_match(array: &dyn vortex_array::DynArray) -> core::option::Option -pub struct vortex_array::arrays::scalar_fn::ScalarFnArray - -impl vortex_array::arrays::scalar_fn::ScalarFnArray - -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::children(&self) -> &[vortex_array::ArrayRef] - -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::scalar_fn(&self) -> &vortex_array::scalar_fn::ScalarFnRef - -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::try_new(scalar_fn: vortex_array::scalar_fn::ScalarFnRef, children: alloc::vec::Vec, len: usize) -> vortex_error::VortexResult - -impl vortex_array::arrays::scalar_fn::ScalarFnArray - -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::to_array(&self) -> vortex_array::ArrayRef - -impl core::clone::Clone for vortex_array::arrays::scalar_fn::ScalarFnArray - -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::clone(&self) -> vortex_array::arrays::scalar_fn::ScalarFnArray - -impl core::convert::AsRef for vortex_array::arrays::scalar_fn::ScalarFnArray - -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub struct vortex_array::arrays::scalar_fn::ScalarFnArrayView<'a, F: vortex_array::scalar_fn::ScalarFnVTable> -impl core::convert::From for vortex_array::ArrayRef +pub vortex_array::arrays::scalar_fn::ScalarFnArrayView::options: &'a ::Options -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::ArrayRef +pub vortex_array::arrays::scalar_fn::ScalarFnArrayView::vtable: &'a F -impl core::fmt::Debug for vortex_array::arrays::scalar_fn::ScalarFnArray +impl core::ops::deref::Deref for vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, F> -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub type vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, F>::Target = dyn vortex_array::DynArray -impl core::ops::deref::Deref for vortex_array::arrays::scalar_fn::ScalarFnArray +pub fn vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, F>::deref(&self) -> &Self::Target -pub type vortex_array::arrays::scalar_fn::ScalarFnArray::Target = dyn vortex_array::DynArray +pub struct vortex_array::arrays::scalar_fn::ScalarFnData -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::deref(&self) -> &Self::Target +impl vortex_array::arrays::ScalarFnData -impl vortex_array::IntoArray for vortex_array::arrays::scalar_fn::ScalarFnArray +pub fn vortex_array::arrays::ScalarFnData::children(&self) -> &[vortex_array::ArrayRef] -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ScalarFnData::dtype(&self) -> &vortex_array::dtype::DType -impl vortex_array::scalar_fn::ReduceNode for vortex_array::arrays::scalar_fn::ScalarFnArray +pub fn vortex_array::arrays::ScalarFnData::is_empty(&self) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::as_any(&self) -> &dyn core::any::Any +pub fn vortex_array::arrays::ScalarFnData::len(&self) -> usize -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::child(&self, idx: usize) -> vortex_array::scalar_fn::ReduceNodeRef +pub fn vortex_array::arrays::ScalarFnData::scalar_fn(&self) -> &vortex_array::scalar_fn::ScalarFnRef -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::child_count(&self) -> usize +pub fn vortex_array::arrays::ScalarFnData::try_new(scalar_fn: vortex_array::scalar_fn::ScalarFnRef, children: alloc::vec::Vec, len: usize) -> vortex_error::VortexResult -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::node_dtype(&self) -> vortex_error::VortexResult +impl core::clone::Clone for vortex_array::arrays::ScalarFnData -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::scalar_fn(&self) -> core::option::Option<&vortex_array::scalar_fn::ScalarFnRef> +pub fn vortex_array::arrays::ScalarFnData::clone(&self) -> vortex_array::arrays::ScalarFnData -pub struct vortex_array::arrays::scalar_fn::ScalarFnArrayView<'a, F: vortex_array::scalar_fn::ScalarFnVTable> +impl core::convert::From for vortex_array::ArrayRef -pub vortex_array::arrays::scalar_fn::ScalarFnArrayView::options: &'a ::Options +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ScalarFnData) -> vortex_array::ArrayRef -pub vortex_array::arrays::scalar_fn::ScalarFnArrayView::vtable: &'a F +impl core::fmt::Debug for vortex_array::arrays::ScalarFnData -impl core::ops::deref::Deref for vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, F> +pub fn vortex_array::arrays::ScalarFnData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub type vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, F>::Target = dyn vortex_array::DynArray +impl vortex_array::IntoArray for vortex_array::arrays::ScalarFnData -pub fn vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, F>::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::ScalarFnData::into_array(self) -> vortex_array::ArrayRef pub struct vortex_array::arrays::scalar_fn::ScalarFnVTable @@ -3654,11 +3482,11 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::fmt(&self, f: &mut core: impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::scalar_fn::ScalarFnVTable -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::scalar_at(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::scalar_fn::ScalarFnVTable -pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::Array = vortex_array::arrays::scalar_fn::ScalarFnArray +pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ArrayData = vortex_array::arrays::ScalarFnData pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::Metadata = vortex_array::arrays::scalar_fn::metadata::ScalarFnMetadata @@ -3666,25 +3494,25 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::OperationsVTable = vor pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vortex_array::arrays::scalar_fn::ScalarFnVTable -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, other: &vortex_array::arrays::scalar_fn::ScalarFnArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer_name(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::scalar_fn::metadata::ScalarFnMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::scalar_fn::metadata::ScalarFnMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child_name(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child_name(array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::dtype(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::dtype(array: &vortex_array::arrays::ScalarFnData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -3692,13 +3520,13 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::execute_parent(array: &v pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::len(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::len(array: &vortex_array::arrays::ScalarFnData) -> usize -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::metadata(array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nbuffers(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nchildren(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -3706,15 +3534,15 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce_parent(array: &vo pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::ScalarFnData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::vtable(array: &Self::Array) -> &Self +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::vtable(array: &vortex_array::arrays::ScalarFnData) -> &Self -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::scalar_fn::ScalarFnVTable -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validity(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult pub trait vortex_array::arrays::scalar_fn::ScalarFnArrayExt: vortex_array::scalar_fn::ScalarFnVTable @@ -3724,6 +3552,8 @@ impl vortex_array::arrays::scalar_fn pub fn V::try_new_array(&self, len: usize, options: Self::Options, children: impl core::convert::Into>) -> vortex_error::VortexResult +pub type vortex_array::arrays::scalar_fn::ScalarFnArray = vortex_array::vtable::Array + pub mod vortex_array::arrays::shared pub struct vortex_array::arrays::shared::Shared @@ -3742,11 +3572,11 @@ pub fn vortex_array::arrays::Shared::fmt(&self, f: &mut core::fmt::Formatter<'_> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Shared -pub fn vortex_array::arrays::Shared::scalar_at(array: &vortex_array::arrays::SharedArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Shared -pub type vortex_array::arrays::Shared::Array = vortex_array::arrays::SharedArray +pub type vortex_array::arrays::Shared::ArrayData = vortex_array::arrays::SharedData pub type vortex_array::arrays::Shared::Metadata = vortex_array::EmptyMetadata @@ -3754,25 +3584,25 @@ pub type vortex_array::arrays::Shared::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Shared -pub fn vortex_array::arrays::Shared::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: &vortex_array::arrays::SharedArray, other: &vortex_array::arrays::SharedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: &vortex_array::arrays::SharedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Shared::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Shared::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Shared::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Shared::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Shared::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Shared::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Shared::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Shared::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Shared::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Shared::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Shared::dtype(array: &vortex_array::arrays::SharedArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Shared::dtype(array: &vortex_array::arrays::SharedData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Shared::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -3780,13 +3610,13 @@ pub fn vortex_array::arrays::Shared::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Shared::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Shared::len(array: &vortex_array::arrays::SharedArray) -> usize +pub fn vortex_array::arrays::Shared::len(array: &vortex_array::arrays::SharedData) -> usize -pub fn vortex_array::arrays::Shared::metadata(_array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Shared::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Shared::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Shared::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Shared::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Shared::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -3794,55 +3624,49 @@ pub fn vortex_array::arrays::Shared::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Shared::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Shared::stats(array: &vortex_array::arrays::SharedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Shared::stats(array: &vortex_array::arrays::SharedData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Shared::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Shared::vtable(_array: &vortex_array::arrays::SharedData) -> &Self -pub fn vortex_array::arrays::Shared::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Shared -pub fn vortex_array::arrays::Shared::validity(array: &vortex_array::arrays::SharedArray) -> vortex_error::VortexResult - -pub struct vortex_array::arrays::shared::SharedArray - -impl vortex_array::arrays::SharedArray - -pub fn vortex_array::arrays::SharedArray::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub async fn vortex_array::arrays::SharedArray::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> +pub struct vortex_array::arrays::shared::SharedData -pub fn vortex_array::arrays::SharedArray::new(source: vortex_array::ArrayRef) -> Self +impl vortex_array::arrays::SharedData -impl vortex_array::arrays::SharedArray +pub fn vortex_array::arrays::SharedData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::SharedArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::SharedData::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult -impl core::clone::Clone for vortex_array::arrays::SharedArray +pub async fn vortex_array::arrays::SharedData::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> -pub fn vortex_array::arrays::SharedArray::clone(&self) -> vortex_array::arrays::SharedArray +pub fn vortex_array::arrays::SharedData::is_empty(&self) -> bool -impl core::convert::AsRef for vortex_array::arrays::SharedArray +pub fn vortex_array::arrays::SharedData::len(&self) -> usize -pub fn vortex_array::arrays::SharedArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::SharedData::new(source: vortex_array::ArrayRef) -> Self -impl core::convert::From for vortex_array::ArrayRef +impl core::clone::Clone for vortex_array::arrays::SharedData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::SharedArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::SharedData::clone(&self) -> vortex_array::arrays::SharedData -impl core::fmt::Debug for vortex_array::arrays::SharedArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::SharedArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::SharedData) -> vortex_array::ArrayRef -impl core::ops::deref::Deref for vortex_array::arrays::SharedArray +impl core::fmt::Debug for vortex_array::arrays::SharedData -pub type vortex_array::arrays::SharedArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::arrays::SharedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::SharedArray::deref(&self) -> &Self::Target +impl vortex_array::IntoArray for vortex_array::arrays::SharedData -impl vortex_array::IntoArray for vortex_array::arrays::SharedArray +pub fn vortex_array::arrays::SharedData::into_array(self) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::SharedArray::into_array(self) -> vortex_array::ArrayRef +pub type vortex_array::arrays::shared::SharedArray = vortex_array::vtable::Array pub mod vortex_array::arrays::slice @@ -3862,15 +3686,15 @@ pub fn vortex_array::arrays::slice::Slice::fmt(&self, f: &mut core::fmt::Formatt impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::Slice::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::Slice::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::Slice::scalar_at(array: &vortex_array::arrays::slice::SliceArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::slice::Slice -pub type vortex_array::arrays::slice::Slice::Array = vortex_array::arrays::slice::SliceArray +pub type vortex_array::arrays::slice::Slice::ArrayData = vortex_array::arrays::SliceData pub type vortex_array::arrays::slice::Slice::Metadata = vortex_array::arrays::slice::SliceMetadata @@ -3878,25 +3702,25 @@ pub type vortex_array::arrays::slice::Slice::OperationsVTable = vortex_array::ar pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: &vortex_array::arrays::slice::SliceArray, other: &vortex_array::arrays::slice::SliceArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: &vortex_array::arrays::slice::SliceArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::slice::Slice::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::slice::Slice::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::slice::Slice::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::slice::Slice::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::slice::Slice::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::slice::SliceMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::slice::SliceMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::slice::Slice::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::slice::Slice::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::slice::Slice::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::slice::Slice::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::slice::Slice::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::slice::Slice::dtype(array: &vortex_array::arrays::slice::SliceArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::slice::Slice::dtype(array: &vortex_array::arrays::SliceData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::slice::Slice::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -3904,13 +3728,13 @@ pub fn vortex_array::arrays::slice::Slice::execute_parent(array: &vortex_array:: pub fn vortex_array::arrays::slice::Slice::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::slice::Slice::len(array: &vortex_array::arrays::slice::SliceArray) -> usize +pub fn vortex_array::arrays::slice::Slice::len(array: &vortex_array::arrays::SliceData) -> usize -pub fn vortex_array::arrays::slice::Slice::metadata(array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::slice::Slice::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::slice::Slice::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::slice::Slice::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::slice::Slice::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::slice::Slice::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -3918,65 +3742,59 @@ pub fn vortex_array::arrays::slice::Slice::reduce_parent(array: &vortex_array::v pub fn vortex_array::arrays::slice::Slice::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::slice::Slice::stats(array: &vortex_array::arrays::slice::SliceArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::slice::Slice::stats(array: &vortex_array::arrays::SliceData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::slice::Slice::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::slice::Slice::vtable(_array: &vortex_array::arrays::SliceData) -> &Self -pub fn vortex_array::arrays::slice::Slice::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::Slice::validity(array: &vortex_array::arrays::slice::SliceArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub struct vortex_array::arrays::slice::SliceArray - -impl vortex_array::arrays::slice::SliceArray - -pub fn vortex_array::arrays::slice::SliceArray::child(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::slice::SliceArray::into_parts(self) -> vortex_array::arrays::slice::SliceArrayParts +pub struct vortex_array::arrays::slice::SliceArrayParts -pub fn vortex_array::arrays::slice::SliceArray::new(child: vortex_array::ArrayRef, range: core::ops::range::Range) -> Self +pub vortex_array::arrays::slice::SliceArrayParts::child: vortex_array::ArrayRef -pub fn vortex_array::arrays::slice::SliceArray::slice_range(&self) -> &core::ops::range::Range +pub vortex_array::arrays::slice::SliceArrayParts::range: core::ops::range::Range -pub fn vortex_array::arrays::slice::SliceArray::try_new(child: vortex_array::ArrayRef, range: core::ops::range::Range) -> vortex_error::VortexResult +pub struct vortex_array::arrays::slice::SliceData -impl vortex_array::arrays::slice::SliceArray +impl vortex_array::arrays::SliceData -pub fn vortex_array::arrays::slice::SliceArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::SliceData::child(&self) -> &vortex_array::ArrayRef -impl core::clone::Clone for vortex_array::arrays::slice::SliceArray +pub fn vortex_array::arrays::SliceData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::slice::SliceArray::clone(&self) -> vortex_array::arrays::slice::SliceArray +pub fn vortex_array::arrays::SliceData::is_empty(&self) -> bool -impl core::convert::AsRef for vortex_array::arrays::slice::SliceArray +pub fn vortex_array::arrays::SliceData::len(&self) -> usize -pub fn vortex_array::arrays::slice::SliceArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::SliceData::new(child: vortex_array::ArrayRef, range: core::ops::range::Range) -> Self -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::SliceData::slice_range(&self) -> &core::ops::range::Range -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::slice::SliceArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::SliceData::try_new(child: vortex_array::ArrayRef, range: core::ops::range::Range) -> vortex_error::VortexResult -impl core::fmt::Debug for vortex_array::arrays::slice::SliceArray +impl vortex_array::arrays::SliceData -pub fn vortex_array::arrays::slice::SliceArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::SliceData::into_parts(self) -> vortex_array::arrays::slice::SliceArrayParts -impl core::ops::deref::Deref for vortex_array::arrays::slice::SliceArray +impl core::clone::Clone for vortex_array::arrays::SliceData -pub type vortex_array::arrays::slice::SliceArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::arrays::SliceData::clone(&self) -> vortex_array::arrays::SliceData -pub fn vortex_array::arrays::slice::SliceArray::deref(&self) -> &Self::Target +impl core::convert::From for vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::slice::SliceArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::SliceData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::slice::SliceArray::into_array(self) -> vortex_array::ArrayRef +impl core::fmt::Debug for vortex_array::arrays::SliceData -pub struct vortex_array::arrays::slice::SliceArrayParts +pub fn vortex_array::arrays::SliceData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub vortex_array::arrays::slice::SliceArrayParts::child: vortex_array::ArrayRef +impl vortex_array::IntoArray for vortex_array::arrays::SliceData -pub vortex_array::arrays::slice::SliceArrayParts::range: core::ops::range::Range +pub fn vortex_array::arrays::SliceData::into_array(self) -> vortex_array::ArrayRef pub struct vortex_array::arrays::slice::SliceExecuteAdaptor(pub V) @@ -3992,7 +3810,7 @@ impl vortex_array::kernel::ExecuteParentKernel for vortex_array::arrays::s pub type vortex_array::arrays::slice::SliceExecuteAdaptor::Parent = vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::SliceExecuteAdaptor::execute_parent(&self, array: &::Array, parent: ::Match, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::SliceExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: ::Match, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub struct vortex_array::arrays::slice::SliceMetadata(_) @@ -4014,79 +3832,81 @@ impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_arra pub type vortex_array::arrays::slice::SliceReduceAdaptor::Parent = vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::SliceReduceAdaptor::reduce_parent(&self, array: &::Array, parent: ::Match, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::SliceReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: ::Match, child_idx: usize) -> vortex_error::VortexResult> pub trait vortex_array::arrays::slice::SliceKernel: vortex_array::vtable::VTable -pub fn vortex_array::arrays::slice::SliceKernel::slice(array: &Self::Array, range: core::ops::range::Range, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::SliceKernel::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceKernel for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::slice(array: &Self::Array, range: core::ops::range::Range, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub trait vortex_array::arrays::slice::SliceReduce: vortex_array::vtable::VTable -pub fn vortex_array::arrays::slice::SliceReduce::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::SliceReduce::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Bool -pub fn vortex_array::arrays::Bool::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Bool::slice(array: &vortex_array::arrays::BoolArray, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::List -pub fn vortex_array::arrays::List::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::slice(_array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::slice(_array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::Slice::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::Slice::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> + +pub type vortex_array::arrays::slice::SliceArray = vortex_array::vtable::Array pub mod vortex_array::arrays::struct_ @@ -4106,31 +3926,31 @@ pub fn vortex_array::arrays::Struct::fmt(&self, f: &mut core::fmt::Formatter<'_> impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::take(array: &vortex_array::arrays::StructArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastKernel for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::cast(array: &vortex_array::arrays::StructArray, dtype: &vortex_array::dtype::DType, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::mask(array: &vortex_array::arrays::StructArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::zip::ZipKernel for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::zip(if_true: &vortex_array::arrays::StructArray, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::zip(if_true: &vortex_array::vtable::Array, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::scalar_at(array: &vortex_array::arrays::StructArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Struct -pub type vortex_array::arrays::Struct::Array = vortex_array::arrays::StructArray +pub type vortex_array::arrays::Struct::ArrayData = vortex_array::arrays::StructData pub type vortex_array::arrays::Struct::Metadata = vortex_array::EmptyMetadata @@ -4138,25 +3958,25 @@ pub type vortex_array::arrays::Struct::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Struct::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Struct::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: &vortex_array::arrays::StructArray, other: &vortex_array::arrays::StructArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: &vortex_array::arrays::StructArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Struct::buffer(_array: &vortex_array::arrays::StructArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Struct::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Struct::buffer_name(_array: &vortex_array::arrays::StructArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Struct::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Struct::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Struct::child(array: &vortex_array::arrays::StructArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Struct::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Struct::child_name(array: &vortex_array::arrays::StructArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Struct::child_name(array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Struct::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Struct::dtype(array: &vortex_array::arrays::StructArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Struct::dtype(array: &vortex_array::arrays::StructData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Struct::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -4164,13 +3984,13 @@ pub fn vortex_array::arrays::Struct::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Struct::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Struct::len(array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::Struct::len(array: &vortex_array::arrays::StructData) -> usize -pub fn vortex_array::arrays::Struct::metadata(_array: &vortex_array::arrays::StructArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Struct::nbuffers(_array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::Struct::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Struct::nchildren(array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::Struct::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Struct::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -4178,103 +3998,95 @@ pub fn vortex_array::arrays::Struct::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Struct::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Struct::stats(array: &vortex_array::arrays::StructArray) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::arrays::Struct::vtable(_array: &Self::Array) -> &Self - -pub fn vortex_array::arrays::Struct::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Struct::stats(array: &vortex_array::arrays::StructData) -> &vortex_array::stats::ArrayStats -pub struct vortex_array::arrays::struct_::StructArray +pub fn vortex_array::arrays::Struct::vtable(_array: &Self::ArrayData) -> &Self -impl vortex_array::arrays::StructArray +pub fn vortex_array::arrays::Struct::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::StructArray::from_fields>(items: &[(N, vortex_array::ArrayRef)]) -> vortex_error::VortexResult - -pub fn vortex_array::arrays::StructArray::into_fields(self) -> alloc::vec::Vec - -pub fn vortex_array::arrays::StructArray::into_parts(self) -> vortex_array::arrays::struct_::StructArrayParts +pub struct vortex_array::arrays::struct_::StructArrayParts -pub fn vortex_array::arrays::StructArray::names(&self) -> &vortex_array::dtype::FieldNames +pub vortex_array::arrays::struct_::StructArrayParts::fields: alloc::sync::Arc<[vortex_array::ArrayRef]> -pub fn vortex_array::arrays::StructArray::new(names: vortex_array::dtype::FieldNames, fields: impl core::convert::Into>, length: usize, validity: vortex_array::validity::Validity) -> Self +pub vortex_array::arrays::struct_::StructArrayParts::struct_fields: vortex_array::dtype::StructFields -pub fn vortex_array::arrays::StructArray::new_fieldless_with_len(len: usize) -> Self +pub vortex_array::arrays::struct_::StructArrayParts::validity: vortex_array::validity::Validity -pub unsafe fn vortex_array::arrays::StructArray::new_unchecked(fields: impl core::convert::Into>, dtype: vortex_array::dtype::StructFields, length: usize, validity: vortex_array::validity::Validity) -> Self +pub struct vortex_array::arrays::struct_::StructData -pub fn vortex_array::arrays::StructArray::project(&self, projection: &[vortex_array::dtype::FieldName]) -> vortex_error::VortexResult +impl vortex_array::arrays::StructData -pub fn vortex_array::arrays::StructArray::remove_column(&mut self, name: impl core::convert::Into) -> core::option::Option +pub fn vortex_array::arrays::StructData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::StructArray::struct_fields(&self) -> &vortex_array::dtype::StructFields +pub fn vortex_array::arrays::StructData::from_fields>(items: &[(N, vortex_array::ArrayRef)]) -> vortex_error::VortexResult -pub fn vortex_array::arrays::StructArray::try_from_iter, A: vortex_array::IntoArray, T: core::iter::traits::collect::IntoIterator>(iter: T) -> vortex_error::VortexResult +pub fn vortex_array::arrays::StructData::into_fields(self) -> alloc::vec::Vec -pub fn vortex_array::arrays::StructArray::try_from_iter_with_validity, A: vortex_array::IntoArray, T: core::iter::traits::collect::IntoIterator>(iter: T, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::StructData::into_parts(self) -> vortex_array::arrays::struct_::StructArrayParts -pub fn vortex_array::arrays::StructArray::try_new(names: vortex_array::dtype::FieldNames, fields: impl core::convert::Into>, length: usize, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::StructData::is_empty(&self) -> bool -pub fn vortex_array::arrays::StructArray::try_new_with_dtype(fields: impl core::convert::Into>, dtype: vortex_array::dtype::StructFields, length: usize, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::StructData::len(&self) -> usize -pub fn vortex_array::arrays::StructArray::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> +pub fn vortex_array::arrays::StructData::names(&self) -> &vortex_array::dtype::FieldNames -pub fn vortex_array::arrays::StructArray::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> +pub fn vortex_array::arrays::StructData::new(names: vortex_array::dtype::FieldNames, fields: impl core::convert::Into>, length: usize, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::StructArray::unmasked_fields(&self) -> &alloc::sync::Arc<[vortex_array::ArrayRef]> +pub fn vortex_array::arrays::StructData::new_fieldless_with_len(len: usize) -> Self -pub fn vortex_array::arrays::StructArray::validate(fields: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::StructFields, length: usize, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub unsafe fn vortex_array::arrays::StructData::new_unchecked(fields: impl core::convert::Into>, dtype: vortex_array::dtype::StructFields, length: usize, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::StructArray::with_column(&self, name: impl core::convert::Into, array: vortex_array::ArrayRef) -> vortex_error::VortexResult +pub fn vortex_array::arrays::StructData::project(&self, projection: &[vortex_array::dtype::FieldName]) -> vortex_error::VortexResult -impl vortex_array::arrays::StructArray +pub fn vortex_array::arrays::StructData::remove_column(&mut self, name: impl core::convert::Into) -> core::option::Option -pub fn vortex_array::arrays::StructArray::into_record_batch_with_schema(self, schema: impl core::convert::AsRef) -> vortex_error::VortexResult +pub fn vortex_array::arrays::StructData::struct_fields(&self) -> &vortex_array::dtype::StructFields -impl vortex_array::arrays::StructArray +pub fn vortex_array::arrays::StructData::try_from_iter, A: vortex_array::IntoArray, T: core::iter::traits::collect::IntoIterator>(iter: T) -> vortex_error::VortexResult -pub fn vortex_array::arrays::StructArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::StructData::try_from_iter_with_validity, A: vortex_array::IntoArray, T: core::iter::traits::collect::IntoIterator>(iter: T, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl core::clone::Clone for vortex_array::arrays::StructArray +pub fn vortex_array::arrays::StructData::try_new(names: vortex_array::dtype::FieldNames, fields: impl core::convert::Into>, length: usize, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub fn vortex_array::arrays::StructArray::clone(&self) -> vortex_array::arrays::StructArray +pub fn vortex_array::arrays::StructData::try_new_with_dtype(fields: impl core::convert::Into>, dtype: vortex_array::dtype::StructFields, length: usize, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl core::convert::AsRef for vortex_array::arrays::StructArray +pub fn vortex_array::arrays::StructData::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> -pub fn vortex_array::arrays::StructArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::StructData::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::StructData::unmasked_fields(&self) -> &alloc::sync::Arc<[vortex_array::ArrayRef]> -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::StructArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::StructData::validate(fields: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::StructFields, length: usize, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -impl core::fmt::Debug for vortex_array::arrays::StructArray +pub fn vortex_array::arrays::StructData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::arrays::StructArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::StructData::validity_mask(&self) -> vortex_mask::Mask -impl core::ops::deref::Deref for vortex_array::arrays::StructArray +impl vortex_array::arrays::StructData -pub type vortex_array::arrays::StructArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::arrays::StructData::with_column(&self, name: impl core::convert::Into, array: vortex_array::ArrayRef) -> vortex_error::VortexResult -pub fn vortex_array::arrays::StructArray::deref(&self) -> &Self::Target +impl core::clone::Clone for vortex_array::arrays::StructData -impl vortex_array::Executable for vortex_array::arrays::StructArray +pub fn vortex_array::arrays::StructData::clone(&self) -> vortex_array::arrays::StructData -pub fn vortex_array::arrays::StructArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +impl core::convert::From for vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::StructArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::StructData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::StructArray::into_array(self) -> vortex_array::ArrayRef +impl core::fmt::Debug for vortex_array::arrays::StructData -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::StructArray +pub fn vortex_array::arrays::StructData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::StructArray::validity(&self) -> &vortex_array::validity::Validity +impl vortex_array::IntoArray for vortex_array::arrays::StructData -pub struct vortex_array::arrays::struct_::StructArrayParts +pub fn vortex_array::arrays::StructData::into_array(self) -> vortex_array::ArrayRef -pub vortex_array::arrays::struct_::StructArrayParts::fields: alloc::sync::Arc<[vortex_array::ArrayRef]> +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::StructData -pub vortex_array::arrays::struct_::StructArrayParts::struct_fields: vortex_array::dtype::StructFields +pub fn vortex_array::arrays::StructData::validity(&self) -> &vortex_array::validity::Validity -pub vortex_array::arrays::struct_::StructArrayParts::validity: vortex_array::validity::Validity +pub type vortex_array::arrays::struct_::StructArray = vortex_array::vtable::Array pub mod vortex_array::arrays::varbin @@ -4312,7 +4124,7 @@ pub const vortex_array::arrays::VarBin::ID: vortex_array::vtable::ArrayId impl vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::_slice(array: &vortex_array::arrays::VarBinArray, range: core::ops::range::Range) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::_slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult impl core::clone::Clone for vortex_array::arrays::VarBin @@ -4324,35 +4136,35 @@ pub fn vortex_array::arrays::VarBin::fmt(&self, f: &mut core::fmt::Formatter<'_> impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::take(array: &vortex_array::arrays::VarBinArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterKernel for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::filter(array: &vortex_array::arrays::VarBinArray, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::binary::CompareKernel for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::compare(lhs: &vortex_array::arrays::VarBinArray, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::compare(lhs: &vortex_array::vtable::Array, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::cast(array: &vortex_array::arrays::VarBinArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::mask(array: &vortex_array::arrays::VarBinArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::scalar_at(array: &vortex_array::arrays::VarBinArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::VarBin -pub type vortex_array::arrays::VarBin::Array = vortex_array::arrays::VarBinArray +pub type vortex_array::arrays::VarBin::ArrayData = vortex_array::arrays::VarBinData pub type vortex_array::arrays::VarBin::Metadata = vortex_array::ProstMetadata @@ -4360,25 +4172,25 @@ pub type vortex_array::arrays::VarBin::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::VarBin::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: &vortex_array::arrays::VarBinArray, other: &vortex_array::arrays::VarBinArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: &vortex_array::arrays::VarBinArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::VarBin::buffer(array: &vortex_array::arrays::VarBinArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::VarBin::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::VarBin::buffer_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::VarBin::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::VarBin::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBin::child(array: &vortex_array::arrays::VarBinArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBin::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBin::child_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::VarBin::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::VarBin::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBin::dtype(array: &vortex_array::arrays::VarBinArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::VarBin::dtype(array: &vortex_array::arrays::VarBinData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::VarBin::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -4386,13 +4198,13 @@ pub fn vortex_array::arrays::VarBin::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::VarBin::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::VarBin::len(array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBin::len(array: &vortex_array::arrays::VarBinData) -> usize -pub fn vortex_array::arrays::VarBin::metadata(array: &vortex_array::arrays::VarBinArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBin::nbuffers(_array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBin::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::VarBin::nchildren(array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBin::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::VarBin::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -4400,142 +4212,134 @@ pub fn vortex_array::arrays::VarBin::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::VarBin::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::VarBin::stats(array: &vortex_array::arrays::VarBinArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::VarBin::stats(array: &vortex_array::arrays::VarBinData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::VarBin::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::VarBin::vtable(_array: &vortex_array::arrays::VarBinData) -> &Self -pub fn vortex_array::arrays::VarBin::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub struct vortex_array::arrays::varbin::VarBinArray +pub struct vortex_array::arrays::varbin::VarBinData -impl vortex_array::arrays::VarBinArray +impl vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::bytes(&self) -> &vortex_buffer::ByteBuffer +pub fn vortex_array::arrays::VarBinData::bytes(&self) -> &vortex_buffer::ByteBuffer -pub fn vortex_array::arrays::VarBinArray::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer +pub fn vortex_array::arrays::VarBinData::bytes_handle(&self) -> &vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::VarBinArray::bytes_handle(&self) -> &vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::VarBinData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::VarBinArray::from_iter, I: core::iter::traits::collect::IntoIterator>>(iter: I, dtype: vortex_array::dtype::DType) -> Self +pub fn vortex_array::arrays::VarBinData::from_iter, I: core::iter::traits::collect::IntoIterator>>(iter: I, dtype: vortex_array::dtype::DType) -> Self -pub fn vortex_array::arrays::VarBinArray::from_iter_nonnull, I: core::iter::traits::collect::IntoIterator>(iter: I, dtype: vortex_array::dtype::DType) -> Self +pub fn vortex_array::arrays::VarBinData::from_iter_nonnull, I: core::iter::traits::collect::IntoIterator>(iter: I, dtype: vortex_array::dtype::DType) -> Self -pub fn vortex_array::arrays::VarBinArray::from_vec>(vec: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self +pub fn vortex_array::arrays::VarBinData::from_vec>(vec: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self -pub fn vortex_array::arrays::VarBinArray::into_parts(self) -> (vortex_array::dtype::DType, vortex_array::buffer::BufferHandle, vortex_array::ArrayRef, vortex_array::validity::Validity) +pub fn vortex_array::arrays::VarBinData::is_empty(&self) -> bool -pub fn vortex_array::arrays::VarBinArray::new(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinData::len(&self) -> usize -pub fn vortex_array::arrays::VarBinArray::new_from_handle(offset: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinData::new(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub unsafe fn vortex_array::arrays::VarBinArray::new_unchecked(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinData::new_from_handle(offset: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub unsafe fn vortex_array::arrays::VarBinArray::new_unchecked_from_handle(offsets: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub unsafe fn vortex_array::arrays::VarBinData::new_unchecked(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::VarBinArray::offset_at(&self, index: usize) -> usize +pub unsafe fn vortex_array::arrays::VarBinData::new_unchecked_from_handle(offsets: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::VarBinArray::offsets(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinData::offsets(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBinArray::sliced_bytes(&self) -> vortex_buffer::ByteBuffer +pub fn vortex_array::arrays::VarBinData::sliced_bytes(&self) -> vortex_buffer::ByteBuffer -pub fn vortex_array::arrays::VarBinArray::try_new(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinData::try_new(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinArray::try_new_from_handle(offsets: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinData::try_new_from_handle(offsets: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinArray::validate(offsets: &vortex_array::ArrayRef, bytes: &vortex_array::buffer::BufferHandle, dtype: &vortex_array::dtype::DType, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinData::validate(offsets: &vortex_array::ArrayRef, bytes: &vortex_array::buffer::BufferHandle, dtype: &vortex_array::dtype::DType, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -impl vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::arrays::VarBinArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinData::validity_mask(&self) -> vortex_mask::Mask -impl core::clone::Clone for vortex_array::arrays::VarBinArray +impl vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::clone(&self) -> vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer -impl core::convert::AsRef for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::into_parts(self) -> (vortex_array::dtype::DType, vortex_array::buffer::BufferHandle, vortex_array::ArrayRef, vortex_array::validity::Validity) -pub fn vortex_array::arrays::VarBinArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::VarBinData::offset_at(&self, index: usize) -> usize -impl core::convert::From> for vortex_array::arrays::VarBinArray +impl core::clone::Clone for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec<&[u8]>) -> Self +pub fn vortex_array::arrays::VarBinData::clone(&self) -> vortex_array::arrays::VarBinData -impl core::convert::From> for vortex_array::arrays::VarBinArray +impl core::convert::From> for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec<&str>) -> Self +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec<&[u8]>) -> Self -impl core::convert::From> for vortex_array::arrays::VarBinArray +impl core::convert::From> for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec) -> Self +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec<&str>) -> Self -impl core::convert::From>> for vortex_array::arrays::VarBinArray +impl core::convert::From> for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec>) -> Self +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec) -> Self -impl core::convert::From>> for vortex_array::arrays::VarBinArray +impl core::convert::From>> for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec>) -> Self +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec>) -> Self -impl core::convert::From>> for vortex_array::arrays::VarBinArray +impl core::convert::From>> for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec>) -> Self +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec>) -> Self -impl core::convert::From>> for vortex_array::arrays::VarBinArray +impl core::convert::From>> for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec>) -> Self +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec>) -> Self -impl core::convert::From>>> for vortex_array::arrays::VarBinArray +impl core::convert::From>> for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec>>) -> Self +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec>) -> Self -impl core::convert::From for vortex_array::ArrayRef +impl core::convert::From>>> for vortex_array::arrays::VarBinData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::VarBinArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec>>) -> Self -impl core::fmt::Debug for vortex_array::arrays::VarBinArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBinArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::VarBinData) -> vortex_array::ArrayRef -impl core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinArray +impl core::fmt::Debug for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::from_iter>>(iter: T) -> Self +pub fn vortex_array::arrays::VarBinData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::iter::traits::collect::FromIterator>> for vortex_array::arrays::VarBinArray +impl core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::from_iter>>>(iter: T) -> Self +pub fn vortex_array::arrays::VarBinData::from_iter>>(iter: T) -> Self -impl core::ops::deref::Deref for vortex_array::arrays::VarBinArray +impl core::iter::traits::collect::FromIterator>> for vortex_array::arrays::VarBinData -pub type vortex_array::arrays::VarBinArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::arrays::VarBinData::from_iter>>>(iter: T) -> Self -pub fn vortex_array::arrays::VarBinArray::deref(&self) -> &Self::Target +impl vortex_array::IntoArray for vortex_array::arrays::VarBinData -impl vortex_array::IntoArray for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::into_array(self) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBinArray::into_array(self) -> vortex_array::ArrayRef +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::VarBinData -impl vortex_array::accessor::ArrayAccessor<[u8]> for &vortex_array::arrays::VarBinArray - -pub fn &vortex_array::arrays::VarBinArray::with_iterator(&self, f: F) -> R where F: for<'a> core::ops::function::FnOnce(&mut dyn core::iter::traits::iterator::Iterator>) -> R - -impl vortex_array::accessor::ArrayAccessor<[u8]> for vortex_array::arrays::VarBinArray - -pub fn vortex_array::arrays::VarBinArray::with_iterator(&self, f: F) -> R where F: for<'a> core::ops::function::FnOnce(&mut dyn core::iter::traits::iterator::Iterator>) -> R - -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::arrays::VarBinArray::validity(&self) -> &vortex_array::validity::Validity +impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinData -impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::from_iter>>(iter: T) -> Self -pub fn vortex_array::arrays::VarBinArray::from_iter>>(iter: T) -> Self +impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinData -impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinArray - -pub fn vortex_array::arrays::VarBinArray::from_iter>>(iter: T) -> Self +pub fn vortex_array::arrays::VarBinData::from_iter>>(iter: T) -> Self pub fn vortex_array::arrays::varbin::varbin_scalar(value: vortex_buffer::ByteBuffer, dtype: &vortex_array::dtype::DType) -> vortex_array::scalar::Scalar +pub type vortex_array::arrays::varbin::VarBinArray = vortex_array::vtable::Array + pub mod vortex_array::arrays::varbinview pub mod vortex_array::arrays::varbinview::build_views @@ -4736,31 +4540,31 @@ pub fn vortex_array::arrays::VarBinView::fmt(&self, f: &mut core::fmt::Formatter impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::take(array: &vortex_array::arrays::VarBinViewArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::cast(array: &vortex_array::arrays::VarBinViewArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::mask(array: &vortex_array::arrays::VarBinViewArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::zip::ZipKernel for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::zip(if_true: &vortex_array::arrays::VarBinViewArray, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::zip(if_true: &vortex_array::vtable::Array, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::scalar_at(array: &vortex_array::arrays::VarBinViewArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::VarBinView -pub type vortex_array::arrays::VarBinView::Array = vortex_array::arrays::VarBinViewArray +pub type vortex_array::arrays::VarBinView::ArrayData = vortex_array::arrays::VarBinViewData pub type vortex_array::arrays::VarBinView::Metadata = vortex_array::EmptyMetadata @@ -4768,25 +4572,25 @@ pub type vortex_array::arrays::VarBinView::OperationsVTable = vortex_array::arra pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::VarBinView::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinView::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: &vortex_array::arrays::VarBinViewArray, other: &vortex_array::arrays::VarBinViewArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: &vortex_array::arrays::VarBinViewArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::VarBinView::buffer(array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::VarBinView::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::VarBinView::buffer_name(array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::VarBinView::buffer_name(array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::VarBinView::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinView::child(array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinView::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBinView::child_name(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::VarBinView::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::VarBinView::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinView::dtype(array: &vortex_array::arrays::VarBinViewArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::VarBinView::dtype(array: &vortex_array::arrays::VarBinViewData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::VarBinView::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -4794,13 +4598,13 @@ pub fn vortex_array::arrays::VarBinView::execute_parent(array: &vortex_array::vt pub fn vortex_array::arrays::VarBinView::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::VarBinView::len(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinView::len(array: &vortex_array::arrays::VarBinViewData) -> usize -pub fn vortex_array::arrays::VarBinView::metadata(_array: &vortex_array::arrays::VarBinViewArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinView::nbuffers(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinView::nbuffers(array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::VarBinView::nchildren(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinView::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::VarBinView::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -4808,155 +4612,133 @@ pub fn vortex_array::arrays::VarBinView::reduce_parent(array: &vortex_array::vta pub fn vortex_array::arrays::VarBinView::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::VarBinView::stats(array: &vortex_array::arrays::VarBinViewArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::VarBinView::stats(array: &vortex_array::arrays::VarBinViewData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::VarBinView::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::VarBinView::vtable(_array: &vortex_array::arrays::VarBinViewData) -> &Self -pub fn vortex_array::arrays::VarBinView::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinView::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub struct vortex_array::arrays::varbinview::VarBinViewArray +pub struct vortex_array::arrays::varbinview::VarBinViewArrayParts -impl vortex_array::arrays::VarBinViewArray +pub vortex_array::arrays::varbinview::VarBinViewArrayParts::buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]> -pub fn vortex_array::arrays::VarBinViewArray::buffer(&self, idx: usize) -> &vortex_buffer::ByteBuffer +pub vortex_array::arrays::varbinview::VarBinViewArrayParts::dtype: vortex_array::dtype::DType -pub fn vortex_array::arrays::VarBinViewArray::buffers(&self) -> &alloc::sync::Arc<[vortex_array::buffer::BufferHandle]> +pub vortex_array::arrays::varbinview::VarBinViewArrayParts::validity: vortex_array::validity::Validity -pub fn vortex_array::arrays::VarBinViewArray::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer +pub vortex_array::arrays::varbinview::VarBinViewArrayParts::views: vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::VarBinViewArray::from_iter, I: core::iter::traits::collect::IntoIterator>>(iter: I, dtype: vortex_array::dtype::DType) -> Self +pub struct vortex_array::arrays::varbinview::VarBinViewData -pub fn vortex_array::arrays::VarBinViewArray::from_iter_bin, I: core::iter::traits::collect::IntoIterator>(iter: I) -> Self +impl vortex_array::arrays::VarBinViewData -pub fn vortex_array::arrays::VarBinViewArray::from_iter_nullable_bin, I: core::iter::traits::collect::IntoIterator>>(iter: I) -> Self +pub fn vortex_array::arrays::VarBinViewData::buffer(&self, idx: usize) -> &vortex_buffer::ByteBuffer -pub fn vortex_array::arrays::VarBinViewArray::from_iter_nullable_str, I: core::iter::traits::collect::IntoIterator>>(iter: I) -> Self +pub fn vortex_array::arrays::VarBinViewData::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer -pub fn vortex_array::arrays::VarBinViewArray::from_iter_str, I: core::iter::traits::collect::IntoIterator>(iter: I) -> Self +pub fn vortex_array::arrays::VarBinViewData::data_buffers(&self) -> &alloc::sync::Arc<[vortex_array::buffer::BufferHandle]> -pub fn vortex_array::arrays::VarBinViewArray::into_parts(self) -> vortex_array::arrays::varbinview::VarBinViewArrayParts +pub fn vortex_array::arrays::VarBinViewData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::VarBinViewArray::nbuffers(&self) -> usize +pub fn vortex_array::arrays::VarBinViewData::from_iter, I: core::iter::traits::collect::IntoIterator>>(iter: I, dtype: vortex_array::dtype::DType) -> Self -pub fn vortex_array::arrays::VarBinViewArray::new(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinViewData::from_iter_bin, I: core::iter::traits::collect::IntoIterator>(iter: I) -> Self -pub fn vortex_array::arrays::VarBinViewArray::new_handle(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinViewData::from_iter_nullable_bin, I: core::iter::traits::collect::IntoIterator>>(iter: I) -> Self -pub unsafe fn vortex_array::arrays::VarBinViewArray::new_handle_unchecked(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinViewData::from_iter_nullable_str, I: core::iter::traits::collect::IntoIterator>>(iter: I) -> Self -pub unsafe fn vortex_array::arrays::VarBinViewArray::new_unchecked(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinViewData::from_iter_str, I: core::iter::traits::collect::IntoIterator>(iter: I) -> Self -pub fn vortex_array::arrays::VarBinViewArray::try_new(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinViewData::into_parts(self) -> vortex_array::arrays::varbinview::VarBinViewArrayParts -pub fn vortex_array::arrays::VarBinViewArray::try_new_handle(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinViewData::is_empty(&self) -> bool -pub fn vortex_array::arrays::VarBinViewArray::validate(views: &vortex_buffer::buffer::Buffer, buffers: &alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: &vortex_array::dtype::DType, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinViewData::len(&self) -> usize -pub fn vortex_array::arrays::VarBinViewArray::views(&self) -> &[vortex_array::arrays::varbinview::BinaryView] +pub fn vortex_array::arrays::VarBinViewData::new(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::VarBinViewArray::views_handle(&self) -> &vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::VarBinViewData::new_handle(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -impl vortex_array::arrays::VarBinViewArray +pub unsafe fn vortex_array::arrays::VarBinViewData::new_handle_unchecked(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::VarBinViewArray::compact_buffers(&self) -> vortex_error::VortexResult +pub unsafe fn vortex_array::arrays::VarBinViewData::new_unchecked(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::VarBinViewArray::compact_with_threshold(&self, buffer_utilization_threshold: f64) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinViewData::try_new(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl vortex_array::arrays::VarBinViewArray +pub fn vortex_array::arrays::VarBinViewData::try_new_handle(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinViewArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinViewData::validate(views: &vortex_buffer::buffer::Buffer, buffers: &alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: &vortex_array::dtype::DType, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -impl core::clone::Clone for vortex_array::arrays::VarBinViewArray +pub fn vortex_array::arrays::VarBinViewData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::arrays::VarBinViewArray::clone(&self) -> vortex_array::arrays::VarBinViewArray +pub fn vortex_array::arrays::VarBinViewData::validity_mask(&self) -> vortex_mask::Mask -impl core::convert::AsRef for vortex_array::arrays::VarBinViewArray +pub fn vortex_array::arrays::VarBinViewData::views(&self) -> &[vortex_array::arrays::varbinview::BinaryView] -pub fn vortex_array::arrays::VarBinViewArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::VarBinViewData::views_handle(&self) -> &vortex_array::buffer::BufferHandle -impl core::convert::From for vortex_array::ArrayRef +impl core::clone::Clone for vortex_array::arrays::VarBinViewData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::VarBinViewArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinViewData::clone(&self) -> vortex_array::arrays::VarBinViewData -impl core::fmt::Debug for vortex_array::arrays::VarBinViewArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBinViewArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::VarBinViewData) -> vortex_array::ArrayRef -impl core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinViewArray +impl core::fmt::Debug for vortex_array::arrays::VarBinViewData -pub fn vortex_array::arrays::VarBinViewArray::from_iter>>(iter: T) -> Self +pub fn vortex_array::arrays::VarBinViewData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::iter::traits::collect::FromIterator>> for vortex_array::arrays::VarBinViewArray +impl core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinViewData -pub fn vortex_array::arrays::VarBinViewArray::from_iter>>>(iter: T) -> Self +pub fn vortex_array::arrays::VarBinViewData::from_iter>>(iter: T) -> Self -impl core::ops::deref::Deref for vortex_array::arrays::VarBinViewArray +impl core::iter::traits::collect::FromIterator>> for vortex_array::arrays::VarBinViewData -pub type vortex_array::arrays::VarBinViewArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::arrays::VarBinViewData::from_iter>>>(iter: T) -> Self -pub fn vortex_array::arrays::VarBinViewArray::deref(&self) -> &Self::Target +impl vortex_array::IntoArray for vortex_array::arrays::VarBinViewData -impl vortex_array::Executable for vortex_array::arrays::VarBinViewArray +pub fn vortex_array::arrays::VarBinViewData::into_array(self) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBinViewArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::VarBinViewData -impl vortex_array::IntoArray for vortex_array::arrays::VarBinViewArray +pub fn vortex_array::arrays::VarBinViewData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::arrays::VarBinViewArray::into_array(self) -> vortex_array::ArrayRef +impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinViewData -impl vortex_array::accessor::ArrayAccessor<[u8]> for &vortex_array::arrays::VarBinViewArray +pub fn vortex_array::arrays::VarBinViewData::from_iter>>(iter: T) -> Self -pub fn &vortex_array::arrays::VarBinViewArray::with_iterator(&self, f: F) -> R where F: for<'a> core::ops::function::FnOnce(&mut dyn core::iter::traits::iterator::Iterator>) -> R +impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinViewData -impl vortex_array::accessor::ArrayAccessor<[u8]> for vortex_array::arrays::VarBinViewArray +pub fn vortex_array::arrays::VarBinViewData::from_iter>>(iter: T) -> Self -pub fn vortex_array::arrays::VarBinViewArray::with_iterator core::ops::function::FnOnce(&mut dyn core::iter::traits::iterator::Iterator>) -> R, R>(&self, f: F) -> R +pub type vortex_array::arrays::varbinview::VarBinViewArray = vortex_array::vtable::Array -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::VarBinViewArray +pub mod vortex_array::arrays::variant -pub fn vortex_array::arrays::VarBinViewArray::validity(&self) -> &vortex_array::validity::Validity +pub struct vortex_array::arrays::variant::Variant -impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinViewArray +impl vortex_array::arrays::Variant -pub fn vortex_array::arrays::VarBinViewArray::from_iter>>(iter: T) -> Self +pub const vortex_array::arrays::Variant::ID: vortex_array::vtable::ArrayId -impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinViewArray +impl core::clone::Clone for vortex_array::arrays::Variant -pub fn vortex_array::arrays::VarBinViewArray::from_iter>>(iter: T) -> Self +pub fn vortex_array::arrays::Variant::clone(&self) -> vortex_array::arrays::Variant -pub struct vortex_array::arrays::varbinview::VarBinViewArrayParts +impl core::fmt::Debug for vortex_array::arrays::Variant -pub vortex_array::arrays::varbinview::VarBinViewArrayParts::buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]> - -pub vortex_array::arrays::varbinview::VarBinViewArrayParts::dtype: vortex_array::dtype::DType - -pub vortex_array::arrays::varbinview::VarBinViewArrayParts::validity: vortex_array::validity::Validity - -pub vortex_array::arrays::varbinview::VarBinViewArrayParts::views: vortex_array::buffer::BufferHandle - -pub mod vortex_array::arrays::variant - -pub struct vortex_array::arrays::variant::Variant - -impl vortex_array::arrays::Variant - -pub const vortex_array::arrays::Variant::ID: vortex_array::vtable::ArrayId - -impl core::clone::Clone for vortex_array::arrays::Variant - -pub fn vortex_array::arrays::Variant::clone(&self) -> vortex_array::arrays::Variant - -impl core::fmt::Debug for vortex_array::arrays::Variant - -pub fn vortex_array::arrays::Variant::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::Variant::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Variant -pub fn vortex_array::arrays::Variant::scalar_at(array: &::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Variant -pub type vortex_array::arrays::Variant::Array = vortex_array::arrays::variant::VariantArray +pub type vortex_array::arrays::Variant::ArrayData = vortex_array::arrays::variant::VariantData pub type vortex_array::arrays::Variant::Metadata = vortex_array::EmptyMetadata @@ -4964,25 +4746,25 @@ pub type vortex_array::arrays::Variant::OperationsVTable = vortex_array::arrays: pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::Variant -pub fn vortex_array::arrays::Variant::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: &Self::Array, other: &Self::Array, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: &Self::Array, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Variant::buffer(_array: &Self::Array, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Variant::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Variant::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Variant::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Variant::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Variant::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Variant::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Variant::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Variant::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Variant::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Variant::dtype(array: &Self::Array) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Variant::dtype(array: &Self::ArrayData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Variant::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -4990,13 +4772,13 @@ pub fn vortex_array::arrays::Variant::execute_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Variant::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Variant::len(array: &Self::Array) -> usize +pub fn vortex_array::arrays::Variant::len(array: &Self::ArrayData) -> usize -pub fn vortex_array::arrays::Variant::metadata(_array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Variant::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Variant::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Variant::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Variant::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Variant::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -5004,53 +4786,47 @@ pub fn vortex_array::arrays::Variant::reduce_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Variant::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Variant::stats(array: &Self::Array) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Variant::stats(array: &Self::ArrayData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Variant::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Variant::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Variant::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Variant -pub fn vortex_array::arrays::Variant::validity(array: &::Array) -> vortex_error::VortexResult - -pub struct vortex_array::arrays::variant::VariantArray - -impl vortex_array::arrays::variant::VariantArray - -pub fn vortex_array::arrays::variant::VariantArray::child(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::Variant::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::variant::VariantArray::new(child: vortex_array::ArrayRef) -> Self +pub struct vortex_array::arrays::variant::VariantData -impl vortex_array::arrays::variant::VariantArray +impl vortex_array::arrays::variant::VariantData -pub fn vortex_array::arrays::variant::VariantArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::variant::VariantData::child(&self) -> &vortex_array::ArrayRef -impl core::clone::Clone for vortex_array::arrays::variant::VariantArray +pub fn vortex_array::arrays::variant::VariantData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::variant::VariantArray::clone(&self) -> vortex_array::arrays::variant::VariantArray +pub fn vortex_array::arrays::variant::VariantData::is_empty(&self) -> bool -impl core::convert::AsRef for vortex_array::arrays::variant::VariantArray +pub fn vortex_array::arrays::variant::VariantData::len(&self) -> usize -pub fn vortex_array::arrays::variant::VariantArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::variant::VariantData::new(child: vortex_array::ArrayRef) -> Self -impl core::convert::From for vortex_array::ArrayRef +impl core::clone::Clone for vortex_array::arrays::variant::VariantData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::variant::VariantArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::variant::VariantData::clone(&self) -> vortex_array::arrays::variant::VariantData -impl core::fmt::Debug for vortex_array::arrays::variant::VariantArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::variant::VariantArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::variant::VariantData) -> vortex_array::ArrayRef -impl core::ops::deref::Deref for vortex_array::arrays::variant::VariantArray +impl core::fmt::Debug for vortex_array::arrays::variant::VariantData -pub type vortex_array::arrays::variant::VariantArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::arrays::variant::VariantData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::variant::VariantArray::deref(&self) -> &Self::Target +impl vortex_array::IntoArray for vortex_array::arrays::variant::VariantData -impl vortex_array::IntoArray for vortex_array::arrays::variant::VariantArray +pub fn vortex_array::arrays::variant::VariantData::into_array(self) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::variant::VariantArray::into_array(self) -> vortex_array::ArrayRef +pub type vortex_array::arrays::variant::VariantArray = vortex_array::vtable::Array pub struct vortex_array::arrays::Bool @@ -5076,7 +4852,7 @@ pub fn vortex_array::arrays::Bool::filter(array: &vortex_array::arrays::BoolArra impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Bool -pub fn vortex_array::arrays::Bool::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Bool::slice(array: &vortex_array::arrays::BoolArray, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::arrays::bool::BoolMaskedValidityRule @@ -5098,11 +4874,11 @@ pub fn vortex_array::arrays::Bool::mask(array: &vortex_array::arrays::BoolArray, impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Bool -pub fn vortex_array::arrays::Bool::scalar_at(array: &vortex_array::arrays::BoolArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Bool -pub type vortex_array::arrays::Bool::Array = vortex_array::arrays::BoolArray +pub type vortex_array::arrays::Bool::ArrayData = vortex_array::arrays::BoolData pub type vortex_array::arrays::Bool::Metadata = vortex_array::ProstMetadata @@ -5110,25 +4886,25 @@ pub type vortex_array::arrays::Bool::OperationsVTable = vortex_array::arrays::Bo pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Bool::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Bool::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: &vortex_array::arrays::BoolArray, other: &vortex_array::arrays::BoolArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: &vortex_array::arrays::BoolArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Bool::buffer(array: &vortex_array::arrays::BoolArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Bool::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Bool::buffer_name(_array: &vortex_array::arrays::BoolArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Bool::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Bool::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Bool::child(array: &vortex_array::arrays::BoolArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Bool::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Bool::child_name(_array: &vortex_array::arrays::BoolArray, _idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Bool::child_name(_array: &vortex_array::vtable::Array, _idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Bool::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Bool::dtype(array: &vortex_array::arrays::BoolArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Bool::dtype(array: &vortex_array::arrays::BoolData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Bool::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5136,13 +4912,13 @@ pub fn vortex_array::arrays::Bool::execute_parent(array: &vortex_array::vtable:: pub fn vortex_array::arrays::Bool::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Bool::len(array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::Bool::len(array: &vortex_array::arrays::BoolData) -> usize -pub fn vortex_array::arrays::Bool::metadata(array: &vortex_array::arrays::BoolArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Bool::nbuffers(_array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::Bool::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Bool::nchildren(array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::Bool::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Bool::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -5150,95 +4926,57 @@ pub fn vortex_array::arrays::Bool::reduce_parent(array: &vortex_array::vtable::A pub fn vortex_array::arrays::Bool::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Bool::stats(array: &vortex_array::arrays::BoolArray) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::arrays::Bool::vtable(_array: &Self::Array) -> &Self - -pub fn vortex_array::arrays::Bool::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> - -pub struct vortex_array::arrays::BoolArray - -impl vortex_array::arrays::BoolArray - -pub fn vortex_array::arrays::BoolArray::from_indices>(length: usize, indices: I, validity: vortex_array::validity::Validity) -> Self - -pub fn vortex_array::arrays::BoolArray::into_bit_buffer(self) -> vortex_buffer::bit::buf::BitBuffer - -pub fn vortex_array::arrays::BoolArray::into_parts(self) -> vortex_array::arrays::bool::BoolArrayParts - -pub fn vortex_array::arrays::BoolArray::maybe_to_mask(&self) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Bool::stats(array: &vortex_array::arrays::BoolData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::BoolArray::new(bits: vortex_buffer::bit::buf::BitBuffer, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::Bool::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::BoolArray::new_handle(handle: vortex_array::buffer::BufferHandle, offset: usize, len: usize, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::Bool::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub unsafe fn vortex_array::arrays::BoolArray::new_unchecked(bits: vortex_buffer::bit::buf::BitBuffer, validity: vortex_array::validity::Validity) -> Self +pub struct vortex_array::arrays::BoolData -pub fn vortex_array::arrays::BoolArray::to_bit_buffer(&self) -> vortex_buffer::bit::buf::BitBuffer +impl vortex_array::arrays::BoolData -pub fn vortex_array::arrays::BoolArray::to_mask(&self) -> vortex_mask::Mask +pub fn vortex_array::arrays::BoolData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::BoolArray::to_mask_fill_null_false(&self) -> vortex_mask::Mask +pub fn vortex_array::arrays::BoolData::into_bit_buffer(self) -> vortex_buffer::bit::buf::BitBuffer -pub fn vortex_array::arrays::BoolArray::try_new(bits: vortex_buffer::bit::buf::BitBuffer, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::BoolData::into_parts(self) -> vortex_array::arrays::bool::BoolArrayParts -pub fn vortex_array::arrays::BoolArray::try_new_from_handle(bits: vortex_array::buffer::BufferHandle, offset: usize, len: usize, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::BoolData::is_empty(&self) -> bool -pub fn vortex_array::arrays::BoolArray::validate(bits: &vortex_buffer::bit::buf::BitBuffer, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::BoolData::len(&self) -> usize -impl vortex_array::arrays::BoolArray +pub fn vortex_array::arrays::BoolData::maybe_to_mask(&self) -> vortex_error::VortexResult> -pub fn vortex_array::arrays::BoolArray::patch(self, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::BoolData::to_bit_buffer(&self) -> vortex_buffer::bit::buf::BitBuffer -impl vortex_array::arrays::BoolArray +pub fn vortex_array::arrays::BoolData::to_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::arrays::BoolArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::BoolData::to_mask_fill_null_false(&self) -> vortex_mask::Mask -impl core::clone::Clone for vortex_array::arrays::BoolArray +pub fn vortex_array::arrays::BoolData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::arrays::BoolArray::clone(&self) -> vortex_array::arrays::BoolArray +pub fn vortex_array::arrays::BoolData::validity_mask(&self) -> vortex_mask::Mask -impl core::convert::AsRef for vortex_array::arrays::BoolArray +impl core::clone::Clone for vortex_array::arrays::BoolData -pub fn vortex_array::arrays::BoolArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::BoolData::clone(&self) -> vortex_array::arrays::BoolData -impl core::convert::From for vortex_array::ArrayRef +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::BoolArray) -> vortex_array::ArrayRef +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::BoolData) -> vortex_array::ArrayRef -impl core::convert::From for vortex_array::arrays::BoolArray +impl core::fmt::Debug for vortex_array::arrays::BoolData -pub fn vortex_array::arrays::BoolArray::from(value: vortex_buffer::bit::buf::BitBuffer) -> Self +pub fn vortex_array::arrays::BoolData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::fmt::Debug for vortex_array::arrays::BoolArray +impl vortex_array::IntoArray for vortex_array::arrays::BoolData -pub fn vortex_array::arrays::BoolArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::BoolData::into_array(self) -> vortex_array::ArrayRef -impl core::iter::traits::collect::FromIterator for vortex_array::arrays::BoolArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::BoolData -pub fn vortex_array::arrays::BoolArray::from_iter>(iter: T) -> Self - -impl core::iter::traits::collect::FromIterator> for vortex_array::arrays::BoolArray - -pub fn vortex_array::arrays::BoolArray::from_iter>>(iter: I) -> Self - -impl core::ops::deref::Deref for vortex_array::arrays::BoolArray - -pub type vortex_array::arrays::BoolArray::Target = dyn vortex_array::DynArray - -pub fn vortex_array::arrays::BoolArray::deref(&self) -> &Self::Target - -impl vortex_array::Executable for vortex_array::arrays::BoolArray - -pub fn vortex_array::arrays::BoolArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult - -impl vortex_array::IntoArray for vortex_array::arrays::BoolArray - -pub fn vortex_array::arrays::BoolArray::into_array(self) -> vortex_array::ArrayRef - -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::BoolArray - -pub fn vortex_array::arrays::BoolArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::BoolData::validity(&self) -> &vortex_array::validity::Validity pub struct vortex_array::arrays::Chunked @@ -5256,39 +4994,39 @@ pub fn vortex_array::arrays::Chunked::fmt(&self, f: &mut core::fmt::Formatter<'_ impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::take(array: &vortex_array::arrays::ChunkedArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterKernel for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::filter(array: &vortex_array::arrays::ChunkedArray, mask: &vortex_mask::Mask, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceKernel for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::slice(array: &Self::Array, range: core::ops::range::Range, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::cast(array: &vortex_array::arrays::ChunkedArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullReduce for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::fill_null(array: &vortex_array::arrays::ChunkedArray, fill_value: &vortex_array::scalar::Scalar) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskKernel for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::mask(array: &vortex_array::arrays::ChunkedArray, mask: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::zip::ZipKernel for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::zip(if_true: &vortex_array::arrays::ChunkedArray, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::zip(if_true: &vortex_array::vtable::Array, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::scalar_at(array: &vortex_array::arrays::ChunkedArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Chunked -pub type vortex_array::arrays::Chunked::Array = vortex_array::arrays::ChunkedArray +pub type vortex_array::arrays::Chunked::ArrayData = vortex_array::arrays::ChunkedData pub type vortex_array::arrays::Chunked::Metadata = vortex_array::EmptyMetadata @@ -5296,25 +5034,25 @@ pub type vortex_array::arrays::Chunked::OperationsVTable = vortex_array::arrays: pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::append_to_builder(array: &vortex_array::arrays::ChunkedArray, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: &vortex_array::arrays::ChunkedArray, other: &vortex_array::arrays::ChunkedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: &vortex_array::arrays::ChunkedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Chunked::buffer(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Chunked::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Chunked::buffer_name(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Chunked::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Chunked::build(dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::build(dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Chunked::child(array: &vortex_array::arrays::ChunkedArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Chunked::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Chunked::child_name(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Chunked::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Chunked::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Chunked::dtype(array: &vortex_array::arrays::ChunkedArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Chunked::dtype(array: &vortex_array::arrays::ChunkedData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Chunked::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5322,13 +5060,13 @@ pub fn vortex_array::arrays::Chunked::execute_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Chunked::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Chunked::len(array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::Chunked::len(array: &vortex_array::arrays::ChunkedData) -> usize -pub fn vortex_array::arrays::Chunked::metadata(_array: &vortex_array::arrays::ChunkedArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Chunked::nbuffers(_array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::Chunked::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Chunked::nchildren(array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::Chunked::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Chunked::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -5336,75 +5074,63 @@ pub fn vortex_array::arrays::Chunked::reduce_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Chunked::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Chunked::stats(array: &vortex_array::arrays::ChunkedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Chunked::stats(array: &vortex_array::arrays::ChunkedData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Chunked::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Chunked::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Chunked::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::validity(array: &vortex_array::arrays::ChunkedArray) -> vortex_error::VortexResult - -pub struct vortex_array::arrays::ChunkedArray - -impl vortex_array::arrays::ChunkedArray - -pub fn vortex_array::arrays::ChunkedArray::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ +pub fn vortex_array::arrays::Chunked::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ChunkedArray::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ +pub struct vortex_array::arrays::ChunkedData -pub fn vortex_array::arrays::ChunkedArray::chunk(&self, idx: usize) -> &vortex_array::ArrayRef +impl vortex_array::arrays::ChunkedData -pub fn vortex_array::arrays::ChunkedArray::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer +pub fn vortex_array::arrays::ChunkedData::array_iterator(&self) -> impl vortex_array::iter::ArrayIterator + '_ -pub fn vortex_array::arrays::ChunkedArray::chunks(&self) -> &[vortex_array::ArrayRef] +pub fn vortex_array::arrays::ChunkedData::array_stream(&self) -> impl vortex_array::stream::ArrayStream + '_ -pub fn vortex_array::arrays::ChunkedArray::nchunks(&self) -> usize +pub fn vortex_array::arrays::ChunkedData::chunk(&self, idx: usize) -> &vortex_array::ArrayRef -pub unsafe fn vortex_array::arrays::ChunkedArray::new_unchecked(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self +pub fn vortex_array::arrays::ChunkedData::chunk_offsets(&self) -> vortex_buffer::buffer::Buffer -pub fn vortex_array::arrays::ChunkedArray::non_empty_chunks(&self) -> impl core::iter::traits::iterator::Iterator + '_ +pub fn vortex_array::arrays::ChunkedData::chunks(&self) -> &[vortex_array::ArrayRef] -pub fn vortex_array::arrays::ChunkedArray::rechunk(&self, target_bytesize: u64, target_rowsize: usize) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ChunkedData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::ChunkedArray::try_new(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ChunkedData::is_empty(&self) -> bool -pub fn vortex_array::arrays::ChunkedArray::validate(chunks: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ChunkedData::len(&self) -> usize -impl vortex_array::arrays::ChunkedArray +pub fn vortex_array::arrays::ChunkedData::nchunks(&self) -> usize -pub fn vortex_array::arrays::ChunkedArray::to_array(&self) -> vortex_array::ArrayRef +pub unsafe fn vortex_array::arrays::ChunkedData::new_unchecked(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self -impl core::clone::Clone for vortex_array::arrays::ChunkedArray +pub fn vortex_array::arrays::ChunkedData::non_empty_chunks(&self) -> impl core::iter::traits::iterator::Iterator + '_ -pub fn vortex_array::arrays::ChunkedArray::clone(&self) -> vortex_array::arrays::ChunkedArray +pub fn vortex_array::arrays::ChunkedData::rechunk(&self, target_bytesize: u64, target_rowsize: usize) -> vortex_error::VortexResult -impl core::convert::AsRef for vortex_array::arrays::ChunkedArray +pub fn vortex_array::arrays::ChunkedData::try_new(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ChunkedArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::ChunkedData::validate(chunks: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult<()> -impl core::convert::From for vortex_array::ArrayRef +impl core::clone::Clone for vortex_array::arrays::ChunkedData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ChunkedArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ChunkedData::clone(&self) -> vortex_array::arrays::ChunkedData -impl core::fmt::Debug for vortex_array::arrays::ChunkedArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::ChunkedArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ChunkedData) -> vortex_array::ArrayRef -impl core::iter::traits::collect::FromIterator> for vortex_array::arrays::ChunkedArray +impl core::fmt::Debug for vortex_array::arrays::ChunkedData -pub fn vortex_array::arrays::ChunkedArray::from_iter>(iter: T) -> Self +pub fn vortex_array::arrays::ChunkedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::ops::deref::Deref for vortex_array::arrays::ChunkedArray +impl vortex_array::IntoArray for vortex_array::arrays::ChunkedData -pub type vortex_array::arrays::ChunkedArray::Target = dyn vortex_array::DynArray - -pub fn vortex_array::arrays::ChunkedArray::deref(&self) -> &Self::Target - -impl vortex_array::IntoArray for vortex_array::arrays::ChunkedArray - -pub fn vortex_array::arrays::ChunkedArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ChunkedData::into_array(self) -> vortex_array::ArrayRef pub struct vortex_array::arrays::Constant @@ -5426,39 +5152,39 @@ pub fn vortex_array::arrays::Constant::fmt(&self, f: &mut core::fmt::Formatter<' impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::take(array: &vortex_array::arrays::ConstantArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::filter(array: &vortex_array::arrays::ConstantArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::between::BetweenReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::between(array: &vortex_array::arrays::ConstantArray, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::between(array: &vortex_array::vtable::Array, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::cast(array: &vortex_array::arrays::ConstantArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::fill_null(array: &vortex_array::arrays::ConstantArray, fill_value: &vortex_array::scalar::Scalar) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::not::NotReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::invert(array: &vortex_array::arrays::ConstantArray) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::invert(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::scalar_at(array: &vortex_array::arrays::ConstantArray, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::scalar_at(array: &vortex_array::vtable::Array, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Constant -pub type vortex_array::arrays::Constant::Array = vortex_array::arrays::ConstantArray +pub type vortex_array::arrays::Constant::ArrayData = vortex_array::arrays::ConstantData pub type vortex_array::arrays::Constant::Metadata = vortex_array::scalar::Scalar @@ -5466,25 +5192,25 @@ pub type vortex_array::arrays::Constant::OperationsVTable = vortex_array::arrays pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::append_to_builder(array: &vortex_array::arrays::ConstantArray, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: &vortex_array::arrays::ConstantArray, other: &vortex_array::arrays::ConstantArray, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: &vortex_array::arrays::ConstantArray, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(array: &vortex_array::vtable::Array, state: &mut H, _precision: vortex_array::Precision) -pub fn vortex_array::arrays::Constant::buffer(array: &vortex_array::arrays::ConstantArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Constant::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Constant::buffer_name(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Constant::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Constant::build(_dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::build(_dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Constant::child(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Constant::child(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Constant::child_name(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Constant::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Constant::deserialize(_bytes: &[u8], dtype: &vortex_array::dtype::DType, _len: usize, buffers: &[vortex_array::buffer::BufferHandle], session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Constant::dtype(array: &vortex_array::arrays::ConstantArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Constant::dtype(array: &vortex_array::arrays::ConstantData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Constant::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5492,13 +5218,13 @@ pub fn vortex_array::arrays::Constant::execute_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::Constant::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Constant::len(array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::Constant::len(array: &vortex_array::arrays::ConstantData) -> usize -pub fn vortex_array::arrays::Constant::metadata(array: &vortex_array::arrays::ConstantArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Constant::nbuffers(_array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::Constant::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Constant::nchildren(_array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::Constant::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Constant::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -5506,55 +5232,47 @@ pub fn vortex_array::arrays::Constant::reduce_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Constant::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Constant::stats(array: &vortex_array::arrays::ConstantArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Constant::stats(array: &vortex_array::arrays::ConstantData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Constant::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Constant::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Constant::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::with_children(_array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::validity(array: &vortex_array::arrays::ConstantArray) -> vortex_error::VortexResult - -pub struct vortex_array::arrays::ConstantArray +pub fn vortex_array::arrays::Constant::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -impl vortex_array::arrays::ConstantArray +pub struct vortex_array::arrays::ConstantData -pub fn vortex_array::arrays::ConstantArray::into_parts(self) -> vortex_array::scalar::Scalar +impl vortex_array::arrays::ConstantData -pub fn vortex_array::arrays::ConstantArray::new(scalar: S, len: usize) -> Self where S: core::convert::Into +pub fn vortex_array::arrays::ConstantData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::ConstantArray::scalar(&self) -> &vortex_array::scalar::Scalar +pub fn vortex_array::arrays::ConstantData::into_parts(self) -> vortex_array::scalar::Scalar -impl vortex_array::arrays::ConstantArray +pub fn vortex_array::arrays::ConstantData::is_empty(&self) -> bool -pub fn vortex_array::arrays::ConstantArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ConstantData::len(&self) -> usize -impl core::clone::Clone for vortex_array::arrays::ConstantArray +pub fn vortex_array::arrays::ConstantData::new(scalar: S, len: usize) -> Self where S: core::convert::Into -pub fn vortex_array::arrays::ConstantArray::clone(&self) -> vortex_array::arrays::ConstantArray +pub fn vortex_array::arrays::ConstantData::scalar(&self) -> &vortex_array::scalar::Scalar -impl core::convert::AsRef for vortex_array::arrays::ConstantArray +impl core::clone::Clone for vortex_array::arrays::ConstantData -pub fn vortex_array::arrays::ConstantArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::ConstantData::clone(&self) -> vortex_array::arrays::ConstantData -impl core::convert::From for vortex_array::ArrayRef +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ConstantArray) -> vortex_array::ArrayRef +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ConstantData) -> vortex_array::ArrayRef -impl core::fmt::Debug for vortex_array::arrays::ConstantArray +impl core::fmt::Debug for vortex_array::arrays::ConstantData -pub fn vortex_array::arrays::ConstantArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::ConstantData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::ops::deref::Deref for vortex_array::arrays::ConstantArray +impl vortex_array::IntoArray for vortex_array::arrays::ConstantData -pub type vortex_array::arrays::ConstantArray::Target = dyn vortex_array::DynArray - -pub fn vortex_array::arrays::ConstantArray::deref(&self) -> &Self::Target - -impl vortex_array::IntoArray for vortex_array::arrays::ConstantArray - -pub fn vortex_array::arrays::ConstantArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ConstantData::into_array(self) -> vortex_array::ArrayRef pub struct vortex_array::arrays::Decimal @@ -5572,41 +5290,41 @@ pub fn vortex_array::arrays::Decimal::fmt(&self, f: &mut core::fmt::Formatter<'_ impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::take(array: &vortex_array::arrays::DecimalArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> 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, array: &vortex_array::arrays::DecimalArray, parent: &vortex_array::arrays::MaskedArray, _child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: &vortex_array::arrays::MaskedArray, _child_idx: usize) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::between::BetweenKernel for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::between(arr: &vortex_array::arrays::DecimalArray, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::between(arr: &vortex_array::vtable::Array, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastKernel for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::cast(array: &vortex_array::arrays::DecimalArray, dtype: &vortex_array::dtype::DType, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullKernel for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::fill_null(array: &vortex_array::arrays::DecimalArray, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::mask(array: &vortex_array::arrays::DecimalArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::scalar_at(array: &vortex_array::arrays::DecimalArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Decimal -pub type vortex_array::arrays::Decimal::Array = vortex_array::arrays::DecimalArray +pub type vortex_array::arrays::Decimal::ArrayData = vortex_array::arrays::DecimalData pub type vortex_array::arrays::Decimal::Metadata = vortex_array::ProstMetadata @@ -5614,25 +5332,25 @@ pub type vortex_array::arrays::Decimal::OperationsVTable = vortex_array::arrays: pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Decimal::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Decimal::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: &vortex_array::arrays::DecimalArray, other: &vortex_array::arrays::DecimalArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: &vortex_array::arrays::DecimalArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Decimal::buffer(array: &vortex_array::arrays::DecimalArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Decimal::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Decimal::buffer_name(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Decimal::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Decimal::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Decimal::child(array: &vortex_array::arrays::DecimalArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Decimal::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Decimal::child_name(_array: &vortex_array::arrays::DecimalArray, _idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Decimal::child_name(_array: &vortex_array::vtable::Array, _idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Decimal::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Decimal::dtype(array: &vortex_array::arrays::DecimalArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Decimal::dtype(array: &vortex_array::arrays::DecimalData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Decimal::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5640,13 +5358,13 @@ pub fn vortex_array::arrays::Decimal::execute_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Decimal::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Decimal::len(array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::Decimal::len(array: &vortex_array::arrays::DecimalData) -> usize -pub fn vortex_array::arrays::Decimal::metadata(array: &vortex_array::arrays::DecimalArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Decimal::nbuffers(_array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::Decimal::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Decimal::nchildren(array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::Decimal::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Decimal::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -5654,87 +5372,79 @@ pub fn vortex_array::arrays::Decimal::reduce_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Decimal::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Decimal::stats(array: &vortex_array::arrays::DecimalArray) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::arrays::Decimal::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Decimal::stats(array: &vortex_array::arrays::DecimalData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Decimal::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Decimal::vtable(_array: &Self::ArrayData) -> &Self -pub struct vortex_array::arrays::DecimalArray +pub fn vortex_array::arrays::Decimal::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -impl vortex_array::arrays::DecimalArray +pub struct vortex_array::arrays::DecimalData -pub fn vortex_array::arrays::DecimalArray::buffer(&self) -> vortex_buffer::buffer::Buffer +impl vortex_array::arrays::DecimalData -pub fn vortex_array::arrays::DecimalArray::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::DecimalData::buffer(&self) -> vortex_buffer::buffer::Buffer -pub fn vortex_array::arrays::DecimalArray::decimal_dtype(&self) -> vortex_array::dtype::DecimalDType +pub fn vortex_array::arrays::DecimalData::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::DecimalArray::from_iter>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self +pub fn vortex_array::arrays::DecimalData::decimal_dtype(&self) -> vortex_array::dtype::DecimalDType -pub fn vortex_array::arrays::DecimalArray::from_option_iter>>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self +pub fn vortex_array::arrays::DecimalData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::DecimalArray::into_parts(self) -> vortex_array::arrays::decimal::DecimalArrayParts +pub fn vortex_array::arrays::DecimalData::from_iter>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self -pub fn vortex_array::arrays::DecimalArray::new(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::DecimalData::from_option_iter>>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self -pub fn vortex_array::arrays::DecimalArray::new_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::DecimalData::into_parts(self) -> vortex_array::arrays::decimal::DecimalArrayParts -pub unsafe fn vortex_array::arrays::DecimalArray::new_unchecked(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::DecimalData::is_empty(&self) -> bool -pub unsafe fn vortex_array::arrays::DecimalArray::new_unchecked_from_byte_buffer(byte_buffer: vortex_buffer::ByteBuffer, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::DecimalData::len(&self) -> usize -pub unsafe fn vortex_array::arrays::DecimalArray::new_unchecked_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::DecimalData::new(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::DecimalArray::patch(self, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::DecimalData::new_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::DecimalArray::precision(&self) -> u8 +pub unsafe fn vortex_array::arrays::DecimalData::new_unchecked(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::DecimalArray::scale(&self) -> i8 +pub unsafe fn vortex_array::arrays::DecimalData::new_unchecked_from_byte_buffer(byte_buffer: vortex_buffer::ByteBuffer, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::DecimalArray::try_new(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub unsafe fn vortex_array::arrays::DecimalData::new_unchecked_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::DecimalArray::try_new_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::DecimalData::patch(self, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_array::arrays::DecimalArray::values_type(&self) -> vortex_array::dtype::DecimalType +pub fn vortex_array::arrays::DecimalData::precision(&self) -> u8 -impl vortex_array::arrays::DecimalArray +pub fn vortex_array::arrays::DecimalData::scale(&self) -> i8 -pub fn vortex_array::arrays::DecimalArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::DecimalData::try_new(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl core::clone::Clone for vortex_array::arrays::DecimalArray +pub fn vortex_array::arrays::DecimalData::try_new_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub fn vortex_array::arrays::DecimalArray::clone(&self) -> vortex_array::arrays::DecimalArray +pub fn vortex_array::arrays::DecimalData::validity(&self) -> &vortex_array::validity::Validity -impl core::convert::AsRef for vortex_array::arrays::DecimalArray +pub fn vortex_array::arrays::DecimalData::validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::arrays::DecimalArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::DecimalData::values_type(&self) -> vortex_array::dtype::DecimalType -impl core::convert::From for vortex_array::ArrayRef +impl core::clone::Clone for vortex_array::arrays::DecimalData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::DecimalArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::DecimalData::clone(&self) -> vortex_array::arrays::DecimalData -impl core::fmt::Debug for vortex_array::arrays::DecimalArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::DecimalArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::DecimalData) -> vortex_array::ArrayRef -impl core::ops::deref::Deref for vortex_array::arrays::DecimalArray +impl core::fmt::Debug for vortex_array::arrays::DecimalData -pub type vortex_array::arrays::DecimalArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::arrays::DecimalData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::DecimalArray::deref(&self) -> &Self::Target +impl vortex_array::IntoArray for vortex_array::arrays::DecimalData -impl vortex_array::Executable for vortex_array::arrays::DecimalArray - -pub fn vortex_array::arrays::DecimalArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult - -impl vortex_array::IntoArray for vortex_array::arrays::DecimalArray +pub fn vortex_array::arrays::DecimalData::into_array(self) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::DecimalArray::into_array(self) -> vortex_array::ArrayRef +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::DecimalData -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::DecimalArray - -pub fn vortex_array::arrays::DecimalArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::DecimalData::validity(&self) -> &vortex_array::validity::Validity pub struct vortex_array::arrays::Dict @@ -5752,43 +5462,43 @@ pub fn vortex_array::arrays::dict::Dict::fmt(&self, f: &mut core::fmt::Formatter impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::take(array: &vortex_array::arrays::dict::DictArray, indices: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::filter(array: &vortex_array::arrays::dict::DictArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::binary::CompareKernel for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::compare(lhs: &vortex_array::arrays::dict::DictArray, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::compare(lhs: &vortex_array::vtable::Array, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::cast(array: &vortex_array::arrays::dict::DictArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullKernel for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::fill_null(array: &vortex_array::arrays::dict::DictArray, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::like::LikeReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::like(array: &vortex_array::arrays::dict::DictArray, pattern: &vortex_array::ArrayRef, options: vortex_array::scalar_fn::fns::like::LikeOptions) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::like(array: &vortex_array::vtable::Array, pattern: &vortex_array::ArrayRef, options: vortex_array::scalar_fn::fns::like::LikeOptions) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::mask(array: &vortex_array::arrays::dict::DictArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::scalar_at(array: &vortex_array::arrays::dict::DictArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::dict::Dict -pub type vortex_array::arrays::dict::Dict::Array = vortex_array::arrays::dict::DictArray +pub type vortex_array::arrays::dict::Dict::ArrayData = vortex_array::arrays::dict::DictData pub type vortex_array::arrays::dict::Dict::Metadata = vortex_array::ProstMetadata @@ -5796,25 +5506,25 @@ pub type vortex_array::arrays::dict::Dict::OperationsVTable = vortex_array::arra pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::arrays::dict::DictArray, other: &vortex_array::arrays::dict::DictArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::arrays::dict::DictArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::dict::Dict::buffer(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::dict::Dict::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: &vortex_array::arrays::dict::DictArray, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::dict::Dict::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::child(array: &vortex_array::arrays::dict::DictArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::dict::Dict::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::dict::Dict::child_name(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::dict::Dict::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::dict::Dict::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::dtype(array: &vortex_array::arrays::dict::DictArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::dict::Dict::dtype(array: &vortex_array::arrays::dict::DictData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::dict::Dict::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5822,13 +5532,13 @@ pub fn vortex_array::arrays::dict::Dict::execute_parent(array: &vortex_array::vt pub fn vortex_array::arrays::dict::Dict::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::dict::Dict::len(array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::len(array: &vortex_array::arrays::dict::DictData) -> usize -pub fn vortex_array::arrays::dict::Dict::metadata(array: &vortex_array::arrays::dict::DictArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::nbuffers(_array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::dict::Dict::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::dict::Dict::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -5836,73 +5546,63 @@ pub fn vortex_array::arrays::dict::Dict::reduce_parent(array: &vortex_array::vta pub fn vortex_array::arrays::dict::Dict::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::dict::Dict::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::dict::Dict::stats(array: &vortex_array::arrays::dict::DictData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::dict::Dict::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::dict::Dict::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::dict::Dict::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::validity(array: &vortex_array::arrays::dict::DictArray) -> vortex_error::VortexResult - -pub struct vortex_array::arrays::DictArray - -impl vortex_array::arrays::dict::DictArray - -pub fn vortex_array::arrays::dict::DictArray::codes(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::dict::Dict::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::DictArray::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult +pub struct vortex_array::arrays::DictData -pub fn vortex_array::arrays::dict::DictArray::has_all_values_referenced(&self) -> bool +impl vortex_array::arrays::dict::DictData -pub fn vortex_array::arrays::dict::DictArray::into_parts(self) -> vortex_array::arrays::dict::DictArrayParts +pub fn vortex_array::arrays::dict::DictData::codes(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::dict::DictArray::new(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self +pub fn vortex_array::arrays::dict::DictData::dtype(&self) -> &vortex_array::dtype::DType -pub unsafe fn vortex_array::arrays::dict::DictArray::new_unchecked(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self +pub fn vortex_array::arrays::dict::DictData::has_all_values_referenced(&self) -> bool -pub unsafe fn vortex_array::arrays::dict::DictArray::set_all_values_referenced(self, all_values_referenced: bool) -> Self +pub fn vortex_array::arrays::dict::DictData::into_parts(self) -> vortex_array::arrays::dict::DictArrayParts -pub fn vortex_array::arrays::dict::DictArray::try_new(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::DictData::is_empty(&self) -> bool -pub fn vortex_array::arrays::dict::DictArray::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::DictData::len(&self) -> usize -pub fn vortex_array::arrays::dict::DictArray::values(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::dict::DictData::new(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self -impl vortex_array::arrays::dict::DictArray +pub unsafe fn vortex_array::arrays::dict::DictData::new_unchecked(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self -pub fn vortex_array::arrays::dict::DictArray::to_array(&self) -> vortex_array::ArrayRef +pub unsafe fn vortex_array::arrays::dict::DictData::set_all_values_referenced(self, all_values_referenced: bool) -> Self -impl core::clone::Clone for vortex_array::arrays::dict::DictArray +pub fn vortex_array::arrays::dict::DictData::try_new(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::DictArray::clone(&self) -> vortex_array::arrays::dict::DictArray +pub fn vortex_array::arrays::dict::DictData::validate_all_values_referenced(&self) -> vortex_error::VortexResult<()> -impl core::convert::AsRef for vortex_array::arrays::dict::DictArray +pub fn vortex_array::arrays::dict::DictData::values(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::dict::DictArray::as_ref(&self) -> &dyn vortex_array::DynArray +impl vortex_array::arrays::dict::DictData -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::dict::DictData::compute_referenced_values_mask(&self, referenced: bool) -> vortex_error::VortexResult -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::dict::DictArray) -> vortex_array::ArrayRef +impl core::clone::Clone for vortex_array::arrays::dict::DictData -impl core::fmt::Debug for vortex_array::arrays::dict::DictArray +pub fn vortex_array::arrays::dict::DictData::clone(&self) -> vortex_array::arrays::dict::DictData -pub fn vortex_array::arrays::dict::DictArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::convert::From for vortex_array::ArrayRef -impl core::ops::deref::Deref for vortex_array::arrays::dict::DictArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::dict::DictData) -> vortex_array::ArrayRef -pub type vortex_array::arrays::dict::DictArray::Target = dyn vortex_array::DynArray +impl core::fmt::Debug for vortex_array::arrays::dict::DictData -pub fn vortex_array::arrays::dict::DictArray::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::dict::DictData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl vortex_array::IntoArray for vortex_array::arrays::dict::DictArray +impl vortex_array::IntoArray for vortex_array::arrays::dict::DictData -pub fn vortex_array::arrays::dict::DictArray::into_array(self) -> vortex_array::ArrayRef - -impl vortex_array::arrow::FromArrowArray<&arrow_array::array::dictionary_array::DictionaryArray> for vortex_array::arrays::dict::DictArray - -pub fn vortex_array::arrays::dict::DictArray::from_arrow(array: &arrow_array::array::dictionary_array::DictionaryArray, nullable: bool) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::DictData::into_array(self) -> vortex_array::ArrayRef pub struct vortex_array::arrays::Extension @@ -5920,35 +5620,35 @@ pub fn vortex_array::arrays::Extension::fmt(&self, f: &mut core::fmt::Formatter< impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::take(array: &vortex_array::arrays::ExtensionArray, indices: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::filter(array: &vortex_array::arrays::ExtensionArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::binary::CompareKernel for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::compare(lhs: &vortex_array::arrays::ExtensionArray, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::compare(lhs: &vortex_array::vtable::Array, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::cast(array: &vortex_array::arrays::ExtensionArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::mask(array: &vortex_array::arrays::ExtensionArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::scalar_at(array: &vortex_array::arrays::ExtensionArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Extension -pub type vortex_array::arrays::Extension::Array = vortex_array::arrays::ExtensionArray +pub type vortex_array::arrays::Extension::ArrayData = vortex_array::arrays::ExtensionData pub type vortex_array::arrays::Extension::Metadata = vortex_array::EmptyMetadata @@ -5956,25 +5656,25 @@ pub type vortex_array::arrays::Extension::OperationsVTable = vortex_array::array pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::vtable::ValidityVTableFromChild -pub fn vortex_array::arrays::Extension::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Extension::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: &vortex_array::arrays::ExtensionArray, other: &vortex_array::arrays::ExtensionArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: &vortex_array::arrays::ExtensionArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Extension::buffer(_array: &vortex_array::arrays::ExtensionArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Extension::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Extension::buffer_name(_array: &vortex_array::arrays::ExtensionArray, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Extension::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Extension::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Extension::child(array: &vortex_array::arrays::ExtensionArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Extension::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Extension::child_name(_array: &vortex_array::arrays::ExtensionArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Extension::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Extension::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Extension::dtype(array: &vortex_array::arrays::ExtensionArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Extension::dtype(array: &vortex_array::arrays::ExtensionData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Extension::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -5982,13 +5682,13 @@ pub fn vortex_array::arrays::Extension::execute_parent(array: &vortex_array::vta pub fn vortex_array::arrays::Extension::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Extension::len(array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::Extension::len(array: &vortex_array::arrays::ExtensionData) -> usize -pub fn vortex_array::arrays::Extension::metadata(_array: &vortex_array::arrays::ExtensionArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Extension::nbuffers(_array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::Extension::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Extension::nchildren(_array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::Extension::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Extension::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -5996,77 +5696,51 @@ pub fn vortex_array::arrays::Extension::reduce_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::Extension::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Extension::stats(array: &vortex_array::arrays::ExtensionArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Extension::stats(array: &vortex_array::arrays::ExtensionData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Extension::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Extension::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Extension::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Extension::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityChild for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::validity_child(array: &vortex_array::arrays::ExtensionArray) -> &vortex_array::ArrayRef - -pub struct vortex_array::arrays::ExtensionArray - -impl vortex_array::arrays::ExtensionArray - -pub fn vortex_array::arrays::ExtensionArray::ext_dtype(&self) -> &vortex_array::dtype::extension::ExtDTypeRef - -pub fn vortex_array::arrays::ExtensionArray::new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self - -pub unsafe fn vortex_array::arrays::ExtensionArray::new_unchecked(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self - -pub fn vortex_array::arrays::ExtensionArray::storage_array(&self) -> &vortex_array::ArrayRef - -pub fn vortex_array::arrays::ExtensionArray::try_new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> vortex_error::VortexResult - -impl vortex_array::arrays::ExtensionArray - -pub fn vortex_array::arrays::ExtensionArray::to_array(&self) -> vortex_array::ArrayRef - -impl core::clone::Clone for vortex_array::arrays::ExtensionArray - -pub fn vortex_array::arrays::ExtensionArray::clone(&self) -> vortex_array::arrays::ExtensionArray - -impl core::convert::AsRef for vortex_array::arrays::ExtensionArray +pub fn vortex_array::arrays::Extension::validity_child(array: &vortex_array::arrays::ExtensionData) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::ExtensionArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub struct vortex_array::arrays::ExtensionData -impl core::convert::From<&vortex_array::arrays::datetime::TemporalArray> for vortex_array::arrays::ExtensionArray +impl vortex_array::arrays::ExtensionData -pub fn vortex_array::arrays::ExtensionArray::from(value: &vortex_array::arrays::datetime::TemporalArray) -> Self +pub fn vortex_array::arrays::ExtensionData::dtype(&self) -> &vortex_array::dtype::DType -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::ExtensionData::ext_dtype(&self) -> &vortex_array::dtype::extension::ExtDTypeRef -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ExtensionArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ExtensionData::is_empty(&self) -> bool -impl core::convert::From for vortex_array::arrays::ExtensionArray +pub fn vortex_array::arrays::ExtensionData::len(&self) -> usize -pub fn vortex_array::arrays::ExtensionArray::from(value: vortex_array::arrays::datetime::TemporalArray) -> Self +pub fn vortex_array::arrays::ExtensionData::new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self -impl core::convert::TryFrom for vortex_array::arrays::datetime::TemporalArray +pub unsafe fn vortex_array::arrays::ExtensionData::new_unchecked(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self -pub type vortex_array::arrays::datetime::TemporalArray::Error = vortex_error::VortexError +pub fn vortex_array::arrays::ExtensionData::storage_array(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::datetime::TemporalArray::try_from(ext: vortex_array::arrays::ExtensionArray) -> core::result::Result +pub fn vortex_array::arrays::ExtensionData::try_new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> vortex_error::VortexResult -impl core::fmt::Debug for vortex_array::arrays::ExtensionArray +impl core::clone::Clone for vortex_array::arrays::ExtensionData -pub fn vortex_array::arrays::ExtensionArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::ExtensionData::clone(&self) -> vortex_array::arrays::ExtensionData -impl core::ops::deref::Deref for vortex_array::arrays::ExtensionArray +impl core::convert::From for vortex_array::ArrayRef -pub type vortex_array::arrays::ExtensionArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ExtensionData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::ExtensionArray::deref(&self) -> &Self::Target +impl core::fmt::Debug for vortex_array::arrays::ExtensionData -impl vortex_array::Executable for vortex_array::arrays::ExtensionArray - -pub fn vortex_array::arrays::ExtensionArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ExtensionData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl vortex_array::IntoArray for vortex_array::arrays::ExtensionArray +impl vortex_array::IntoArray for vortex_array::arrays::ExtensionData -pub fn vortex_array::arrays::ExtensionArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ExtensionData::into_array(self) -> vortex_array::ArrayRef pub struct vortex_array::arrays::Filter @@ -6084,11 +5758,11 @@ pub fn vortex_array::arrays::Filter::fmt(&self, f: &mut core::fmt::Formatter<'_> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Filter -pub fn vortex_array::arrays::Filter::scalar_at(array: &vortex_array::arrays::FilterArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Filter -pub type vortex_array::arrays::Filter::Array = vortex_array::arrays::FilterArray +pub type vortex_array::arrays::Filter::ArrayData = vortex_array::arrays::FilterData pub type vortex_array::arrays::Filter::Metadata = vortex_array::arrays::filter::vtable::FilterMetadata @@ -6096,25 +5770,25 @@ pub type vortex_array::arrays::Filter::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Filter -pub fn vortex_array::arrays::Filter::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: &vortex_array::arrays::FilterArray, other: &vortex_array::arrays::FilterArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: &vortex_array::arrays::FilterArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Filter::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Filter::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Filter::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Filter::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Filter::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::filter::vtable::FilterMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::filter::vtable::FilterMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Filter::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Filter::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Filter::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Filter::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Filter::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Filter::dtype(array: &vortex_array::arrays::FilterArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Filter::dtype(array: &vortex_array::arrays::FilterData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Filter::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -6122,13 +5796,13 @@ pub fn vortex_array::arrays::Filter::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Filter::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Filter::len(array: &vortex_array::arrays::FilterArray) -> usize +pub fn vortex_array::arrays::Filter::len(array: &vortex_array::arrays::FilterData) -> usize -pub fn vortex_array::arrays::Filter::metadata(array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Filter::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Filter::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Filter::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Filter::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Filter::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -6136,59 +5810,53 @@ pub fn vortex_array::arrays::Filter::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Filter::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Filter::stats(array: &vortex_array::arrays::FilterArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Filter::stats(array: &vortex_array::arrays::FilterData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Filter::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Filter::vtable(_array: &vortex_array::arrays::FilterData) -> &Self -pub fn vortex_array::arrays::Filter::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Filter -pub fn vortex_array::arrays::Filter::validity(array: &vortex_array::arrays::FilterArray) -> vortex_error::VortexResult - -pub struct vortex_array::arrays::FilterArray +pub fn vortex_array::arrays::Filter::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -impl vortex_array::arrays::FilterArray +pub struct vortex_array::arrays::FilterData -pub fn vortex_array::arrays::FilterArray::child(&self) -> &vortex_array::ArrayRef +impl vortex_array::arrays::FilterData -pub fn vortex_array::arrays::FilterArray::filter_mask(&self) -> &vortex_mask::Mask +pub fn vortex_array::arrays::FilterData::child(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::FilterArray::into_parts(self) -> vortex_array::arrays::filter::FilterArrayParts +pub fn vortex_array::arrays::FilterData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::FilterArray::new(array: vortex_array::ArrayRef, mask: vortex_mask::Mask) -> Self +pub fn vortex_array::arrays::FilterData::filter_mask(&self) -> &vortex_mask::Mask -pub fn vortex_array::arrays::FilterArray::try_new(array: vortex_array::ArrayRef, mask: vortex_mask::Mask) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FilterData::is_empty(&self) -> bool -impl vortex_array::arrays::FilterArray +pub fn vortex_array::arrays::FilterData::len(&self) -> usize -pub fn vortex_array::arrays::FilterArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FilterData::new(array: vortex_array::ArrayRef, mask: vortex_mask::Mask) -> Self -impl core::clone::Clone for vortex_array::arrays::FilterArray +pub fn vortex_array::arrays::FilterData::try_new(array: vortex_array::ArrayRef, mask: vortex_mask::Mask) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FilterArray::clone(&self) -> vortex_array::arrays::FilterArray +impl vortex_array::arrays::FilterData -impl core::convert::AsRef for vortex_array::arrays::FilterArray +pub fn vortex_array::arrays::FilterData::into_parts(self) -> vortex_array::arrays::filter::FilterArrayParts -pub fn vortex_array::arrays::FilterArray::as_ref(&self) -> &dyn vortex_array::DynArray +impl core::clone::Clone for vortex_array::arrays::FilterData -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::FilterData::clone(&self) -> vortex_array::arrays::FilterData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::FilterArray) -> vortex_array::ArrayRef +impl core::convert::From for vortex_array::ArrayRef -impl core::fmt::Debug for vortex_array::arrays::FilterArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::FilterData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::FilterArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::fmt::Debug for vortex_array::arrays::FilterData -impl core::ops::deref::Deref for vortex_array::arrays::FilterArray +pub fn vortex_array::arrays::FilterData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub type vortex_array::arrays::FilterArray::Target = dyn vortex_array::DynArray +impl vortex_array::IntoArray for vortex_array::arrays::FilterData -pub fn vortex_array::arrays::FilterArray::deref(&self) -> &Self::Target - -impl vortex_array::IntoArray for vortex_array::arrays::FilterArray - -pub fn vortex_array::arrays::FilterArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FilterData::into_array(self) -> vortex_array::ArrayRef pub struct vortex_array::arrays::FixedSizeList @@ -6206,27 +5874,27 @@ pub fn vortex_array::arrays::FixedSizeList::fmt(&self, f: &mut core::fmt::Format impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::take(array: &vortex_array::arrays::FixedSizeListArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::cast(array: &vortex_array::arrays::FixedSizeListArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::mask(array: &vortex_array::arrays::FixedSizeListArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::scalar_at(array: &vortex_array::arrays::FixedSizeListArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::FixedSizeList -pub type vortex_array::arrays::FixedSizeList::Array = vortex_array::arrays::FixedSizeListArray +pub type vortex_array::arrays::FixedSizeList::ArrayData = vortex_array::arrays::FixedSizeListData pub type vortex_array::arrays::FixedSizeList::Metadata = vortex_array::EmptyMetadata @@ -6234,25 +5902,25 @@ pub type vortex_array::arrays::FixedSizeList::OperationsVTable = vortex_array::a pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: &vortex_array::arrays::FixedSizeListArray, other: &vortex_array::arrays::FixedSizeListArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: &vortex_array::arrays::FixedSizeListArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::FixedSizeList::buffer(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::FixedSizeList::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::FixedSizeList::buffer_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::FixedSizeList::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::FixedSizeList::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeList::child(array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FixedSizeList::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::FixedSizeList::child_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::FixedSizeList::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::FixedSizeList::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeList::dtype(array: &vortex_array::arrays::FixedSizeListArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::FixedSizeList::dtype(array: &vortex_array::arrays::FixedSizeListData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::FixedSizeList::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -6260,13 +5928,13 @@ pub fn vortex_array::arrays::FixedSizeList::execute_parent(array: &vortex_array: pub fn vortex_array::arrays::FixedSizeList::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::FixedSizeList::len(array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeList::len(array: &vortex_array::arrays::FixedSizeListData) -> usize -pub fn vortex_array::arrays::FixedSizeList::metadata(_array: &vortex_array::arrays::FixedSizeListArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeList::nbuffers(_array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeList::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::FixedSizeList::nchildren(array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeList::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::FixedSizeList::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -6274,69 +5942,63 @@ pub fn vortex_array::arrays::FixedSizeList::reduce_parent(array: &vortex_array:: pub fn vortex_array::arrays::FixedSizeList::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::FixedSizeList::stats(array: &vortex_array::arrays::FixedSizeListArray) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::arrays::FixedSizeList::vtable(_array: &Self::Array) -> &Self - -pub fn vortex_array::arrays::FixedSizeList::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeList::stats(array: &vortex_array::arrays::FixedSizeListData) -> &vortex_array::stats::ArrayStats -pub struct vortex_array::arrays::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeList::vtable(_array: &vortex_array::arrays::FixedSizeListData) -> &Self -impl vortex_array::arrays::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeList::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeListArray::elements(&self) -> &vortex_array::ArrayRef +pub struct vortex_array::arrays::FixedSizeListData -pub fn vortex_array::arrays::FixedSizeListArray::fixed_size_list_elements_at(&self, index: usize) -> vortex_error::VortexResult +impl vortex_array::arrays::FixedSizeListData -pub fn vortex_array::arrays::FixedSizeListArray::into_parts(self) -> (vortex_array::ArrayRef, vortex_array::validity::Validity, vortex_array::dtype::DType) +pub fn vortex_array::arrays::FixedSizeListData::dtype(&self) -> &vortex_array::dtype::DType -pub const fn vortex_array::arrays::FixedSizeListArray::list_size(&self) -> u32 +pub fn vortex_array::arrays::FixedSizeListData::elements(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::FixedSizeListArray::new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self +pub fn vortex_array::arrays::FixedSizeListData::into_parts(self) -> (vortex_array::ArrayRef, vortex_array::validity::Validity, vortex_array::dtype::DType) -pub unsafe fn vortex_array::arrays::FixedSizeListArray::new_unchecked(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self +pub fn vortex_array::arrays::FixedSizeListData::is_empty(&self) -> bool -pub fn vortex_array::arrays::FixedSizeListArray::try_new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeListData::len(&self) -> usize -pub fn vortex_array::arrays::FixedSizeListArray::validate(elements: &vortex_array::ArrayRef, len: usize, list_size: u32, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub const fn vortex_array::arrays::FixedSizeListData::list_size(&self) -> u32 -impl vortex_array::arrays::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeListData::new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self -pub fn vortex_array::arrays::FixedSizeListArray::to_array(&self) -> vortex_array::ArrayRef +pub unsafe fn vortex_array::arrays::FixedSizeListData::new_unchecked(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self -impl core::clone::Clone for vortex_array::arrays::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeListData::try_new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeListArray::clone(&self) -> vortex_array::arrays::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeListData::validate(elements: &vortex_array::ArrayRef, len: usize, list_size: u32, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -impl core::convert::AsRef for vortex_array::arrays::FixedSizeListArray +pub fn vortex_array::arrays::FixedSizeListData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::arrays::FixedSizeListArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::FixedSizeListData::validity_mask(&self) -> vortex_mask::Mask -impl core::convert::From for vortex_array::ArrayRef +impl vortex_array::arrays::FixedSizeListData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::FixedSizeListArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FixedSizeListData::fixed_size_list_elements_at(&self, index: usize) -> vortex_error::VortexResult -impl core::fmt::Debug for vortex_array::arrays::FixedSizeListArray +impl core::clone::Clone for vortex_array::arrays::FixedSizeListData -pub fn vortex_array::arrays::FixedSizeListArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::FixedSizeListData::clone(&self) -> vortex_array::arrays::FixedSizeListData -impl core::ops::deref::Deref for vortex_array::arrays::FixedSizeListArray +impl core::convert::From for vortex_array::ArrayRef -pub type vortex_array::arrays::FixedSizeListArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::FixedSizeListData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::FixedSizeListArray::deref(&self) -> &Self::Target +impl core::fmt::Debug for vortex_array::arrays::FixedSizeListData -impl vortex_array::Executable for vortex_array::arrays::FixedSizeListArray - -pub fn vortex_array::arrays::FixedSizeListArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeListData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl vortex_array::IntoArray for vortex_array::arrays::FixedSizeListArray +impl vortex_array::IntoArray for vortex_array::arrays::FixedSizeListData -pub fn vortex_array::arrays::FixedSizeListArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FixedSizeListData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::FixedSizeListArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::FixedSizeListData -pub fn vortex_array::arrays::FixedSizeListArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::FixedSizeListData::validity(&self) -> &vortex_array::validity::Validity pub struct vortex_array::arrays::List @@ -6354,31 +6016,31 @@ pub fn vortex_array::arrays::List::fmt(&self, f: &mut core::fmt::Formatter<'_>) impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::List -pub fn vortex_array::arrays::List::take(array: &vortex_array::arrays::ListArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterKernel for vortex_array::arrays::List -pub fn vortex_array::arrays::List::filter(array: &vortex_array::arrays::ListArray, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::List -pub fn vortex_array::arrays::List::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::List -pub fn vortex_array::arrays::List::cast(array: &vortex_array::arrays::ListArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::List -pub fn vortex_array::arrays::List::mask(array: &vortex_array::arrays::ListArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::List -pub fn vortex_array::arrays::List::scalar_at(array: &vortex_array::arrays::ListArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::List -pub type vortex_array::arrays::List::Array = vortex_array::arrays::ListArray +pub type vortex_array::arrays::List::ArrayData = vortex_array::arrays::ListData pub type vortex_array::arrays::List::Metadata = vortex_array::ProstMetadata @@ -6386,25 +6048,25 @@ pub type vortex_array::arrays::List::OperationsVTable = vortex_array::arrays::Li pub type vortex_array::arrays::List::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::List::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: &vortex_array::arrays::ListArray, other: &vortex_array::arrays::ListArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: &vortex_array::arrays::ListArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::List::buffer(_array: &vortex_array::arrays::ListArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::List::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::List::buffer_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::List::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::List::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::List::child(array: &vortex_array::arrays::ListArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::List::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::List::child_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::List::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::List::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::List::dtype(array: &vortex_array::arrays::ListArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::List::dtype(array: &vortex_array::arrays::ListData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::List::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -6412,13 +6074,13 @@ pub fn vortex_array::arrays::List::execute_parent(array: &vortex_array::vtable:: pub fn vortex_array::arrays::List::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::List::len(array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::List::len(array: &vortex_array::arrays::ListData) -> usize -pub fn vortex_array::arrays::List::metadata(array: &vortex_array::arrays::ListArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::List::nbuffers(_array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::List::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::List::nchildren(array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::List::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::List::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -6426,73 +6088,71 @@ pub fn vortex_array::arrays::List::reduce_parent(array: &vortex_array::vtable::A pub fn vortex_array::arrays::List::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::List::stats(array: &vortex_array::arrays::ListArray) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::arrays::List::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::List::stats(array: &vortex_array::arrays::ListData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::List::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::vtable(_array: &vortex_array::arrays::ListData) -> &Self -pub struct vortex_array::arrays::ListArray +pub fn vortex_array::arrays::List::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -impl vortex_array::arrays::ListArray +pub struct vortex_array::arrays::ListData -pub fn vortex_array::arrays::ListArray::element_dtype(&self) -> &alloc::sync::Arc +impl vortex_array::arrays::ListData -pub fn vortex_array::arrays::ListArray::elements(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::ListData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::ListArray::into_parts(self) -> vortex_array::arrays::list::ListArrayParts +pub fn vortex_array::arrays::ListData::element_dtype(&self) -> &alloc::sync::Arc -pub fn vortex_array::arrays::ListArray::list_elements_at(&self, index: usize) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListData::elements(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::ListArray::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::ListData::into_parts(self) -> vortex_array::arrays::list::ListArrayParts -pub unsafe fn vortex_array::arrays::ListArray::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::ListData::is_empty(&self) -> bool -pub fn vortex_array::arrays::ListArray::offset_at(&self, index: usize) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListData::len(&self) -> usize -pub fn vortex_array::arrays::ListArray::offsets(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::ListData::list_elements_at(&self, index: usize) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListArray::reset_offsets(&self, recurse: bool) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListData::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::ListArray::sliced_elements(&self) -> vortex_error::VortexResult +pub unsafe fn vortex_array::arrays::ListData::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::ListArray::try_new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListData::offset_at(&self, index: usize) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListArray::validate(elements: &vortex_array::ArrayRef, offsets: &vortex_array::ArrayRef, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListData::offsets(&self) -> &vortex_array::ArrayRef -impl vortex_array::arrays::ListArray +pub fn vortex_array::arrays::ListData::sliced_elements(&self) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListData::try_new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl core::clone::Clone for vortex_array::arrays::ListArray +pub fn vortex_array::arrays::ListData::validate(elements: &vortex_array::ArrayRef, offsets: &vortex_array::ArrayRef, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListArray::clone(&self) -> vortex_array::arrays::ListArray +pub fn vortex_array::arrays::ListData::validity(&self) -> &vortex_array::validity::Validity -impl core::convert::AsRef for vortex_array::arrays::ListArray +pub fn vortex_array::arrays::ListData::validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::arrays::ListArray::as_ref(&self) -> &dyn vortex_array::DynArray +impl vortex_array::arrays::ListData -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::ListData::reset_offsets(&self, recurse: bool) -> vortex_error::VortexResult -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ListArray) -> vortex_array::ArrayRef +impl core::clone::Clone for vortex_array::arrays::ListData -impl core::fmt::Debug for vortex_array::arrays::ListArray +pub fn vortex_array::arrays::ListData::clone(&self) -> vortex_array::arrays::ListData -pub fn vortex_array::arrays::ListArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::convert::From for vortex_array::ArrayRef -impl core::ops::deref::Deref for vortex_array::arrays::ListArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ListData) -> vortex_array::ArrayRef -pub type vortex_array::arrays::ListArray::Target = dyn vortex_array::DynArray +impl core::fmt::Debug for vortex_array::arrays::ListData -pub fn vortex_array::arrays::ListArray::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::ListData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl vortex_array::IntoArray for vortex_array::arrays::ListArray +impl vortex_array::IntoArray for vortex_array::arrays::ListData -pub fn vortex_array::arrays::ListArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::ListArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::ListData -pub fn vortex_array::arrays::ListArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::ListData::validity(&self) -> &vortex_array::validity::Validity pub struct vortex_array::arrays::ListView @@ -6510,27 +6170,27 @@ pub fn vortex_array::arrays::ListView::fmt(&self, f: &mut core::fmt::Formatter<' impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::take(array: &vortex_array::arrays::ListViewArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::cast(array: &vortex_array::arrays::ListViewArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::mask(array: &vortex_array::arrays::ListViewArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::scalar_at(array: &vortex_array::arrays::ListViewArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::ListView -pub type vortex_array::arrays::ListView::Array = vortex_array::arrays::ListViewArray +pub type vortex_array::arrays::ListView::ArrayData = vortex_array::arrays::ListViewData pub type vortex_array::arrays::ListView::Metadata = vortex_array::ProstMetadata @@ -6538,25 +6198,25 @@ pub type vortex_array::arrays::ListView::OperationsVTable = vortex_array::arrays pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::ListView::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: &vortex_array::arrays::ListViewArray, other: &vortex_array::arrays::ListViewArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: &vortex_array::arrays::ListViewArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::ListView::buffer(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::ListView::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::ListView::buffer_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::ListView::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::ListView::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListView::child(array: &vortex_array::arrays::ListViewArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListView::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::ListView::child_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::ListView::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::ListView::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListView::dtype(array: &vortex_array::arrays::ListViewArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::ListView::dtype(array: &vortex_array::arrays::ListViewData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::ListView::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -6564,13 +6224,13 @@ pub fn vortex_array::arrays::ListView::execute_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::ListView::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::ListView::len(array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListView::len(array: &vortex_array::arrays::ListViewData) -> usize -pub fn vortex_array::arrays::ListView::metadata(array: &vortex_array::arrays::ListViewArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListView::nbuffers(_array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListView::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::ListView::nchildren(array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListView::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::ListView::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -6578,85 +6238,73 @@ pub fn vortex_array::arrays::ListView::reduce_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::ListView::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ListView::stats(array: &vortex_array::arrays::ListViewArray) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::arrays::ListView::vtable(_array: &Self::Array) -> &Self - -pub fn vortex_array::arrays::ListView::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> - -pub struct vortex_array::arrays::ListViewArray - -impl vortex_array::arrays::ListViewArray +pub fn vortex_array::arrays::ListView::stats(array: &vortex_array::arrays::ListViewData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::ListViewArray::elements(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::ListView::vtable(_array: &vortex_array::arrays::ListViewData) -> &Self -pub fn vortex_array::arrays::ListViewArray::into_parts(self) -> vortex_array::arrays::listview::ListViewArrayParts +pub fn vortex_array::arrays::ListView::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListViewArray::is_zero_copy_to_list(&self) -> bool +pub struct vortex_array::arrays::ListViewData -pub fn vortex_array::arrays::ListViewArray::list_elements_at(&self, index: usize) -> vortex_error::VortexResult +impl vortex_array::arrays::ListViewData -pub fn vortex_array::arrays::ListViewArray::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::ListViewData::dtype(&self) -> &vortex_array::dtype::DType -pub unsafe fn vortex_array::arrays::ListViewArray::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::ListViewData::elements(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::ListViewArray::offset_at(&self, index: usize) -> usize +pub fn vortex_array::arrays::ListViewData::into_parts(self) -> vortex_array::arrays::listview::ListViewArrayParts -pub fn vortex_array::arrays::ListViewArray::offsets(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::ListViewData::is_empty(&self) -> bool -pub fn vortex_array::arrays::ListViewArray::size_at(&self, index: usize) -> usize +pub fn vortex_array::arrays::ListViewData::is_zero_copy_to_list(&self) -> bool -pub fn vortex_array::arrays::ListViewArray::sizes(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::ListViewData::len(&self) -> usize -pub fn vortex_array::arrays::ListViewArray::try_new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListViewData::list_elements_at(&self, index: usize) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListViewArray::validate(elements: &vortex_array::ArrayRef, offsets: &vortex_array::ArrayRef, sizes: &vortex_array::ArrayRef, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListViewData::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::ListViewArray::verify_is_zero_copy_to_list(&self) -> bool +pub unsafe fn vortex_array::arrays::ListViewData::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self -pub unsafe fn vortex_array::arrays::ListViewArray::with_zero_copy_to_list(self, is_zctl: bool) -> Self +pub fn vortex_array::arrays::ListViewData::offset_at(&self, index: usize) -> usize -impl vortex_array::arrays::ListViewArray +pub fn vortex_array::arrays::ListViewData::offsets(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::ListViewArray::rebuild(&self, mode: vortex_array::arrays::listview::ListViewRebuildMode) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListViewData::size_at(&self, index: usize) -> usize -impl vortex_array::arrays::ListViewArray +pub fn vortex_array::arrays::ListViewData::sizes(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::ListViewArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListViewData::try_new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl core::clone::Clone for vortex_array::arrays::ListViewArray +pub fn vortex_array::arrays::ListViewData::validate(elements: &vortex_array::ArrayRef, offsets: &vortex_array::ArrayRef, sizes: &vortex_array::ArrayRef, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListViewArray::clone(&self) -> vortex_array::arrays::ListViewArray +pub fn vortex_array::arrays::ListViewData::validity(&self) -> &vortex_array::validity::Validity -impl core::convert::AsRef for vortex_array::arrays::ListViewArray +pub fn vortex_array::arrays::ListViewData::validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::arrays::ListViewArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::ListViewData::verify_is_zero_copy_to_list(&self) -> bool -impl core::convert::From for vortex_array::ArrayRef +pub unsafe fn vortex_array::arrays::ListViewData::with_zero_copy_to_list(self, is_zctl: bool) -> Self -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ListViewArray) -> vortex_array::ArrayRef +impl core::clone::Clone for vortex_array::arrays::ListViewData -impl core::fmt::Debug for vortex_array::arrays::ListViewArray +pub fn vortex_array::arrays::ListViewData::clone(&self) -> vortex_array::arrays::ListViewData -pub fn vortex_array::arrays::ListViewArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::convert::From for vortex_array::ArrayRef -impl core::ops::deref::Deref for vortex_array::arrays::ListViewArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ListViewData) -> vortex_array::ArrayRef -pub type vortex_array::arrays::ListViewArray::Target = dyn vortex_array::DynArray +impl core::fmt::Debug for vortex_array::arrays::ListViewData -pub fn vortex_array::arrays::ListViewArray::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::ListViewData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl vortex_array::Executable for vortex_array::arrays::ListViewArray - -pub fn vortex_array::arrays::ListViewArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult - -impl vortex_array::IntoArray for vortex_array::arrays::ListViewArray +impl vortex_array::IntoArray for vortex_array::arrays::ListViewData -pub fn vortex_array::arrays::ListViewArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListViewData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::ListViewArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::ListViewData -pub fn vortex_array::arrays::ListViewArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::ListViewData::validity(&self) -> &vortex_array::validity::Validity pub struct vortex_array::arrays::Masked @@ -6674,27 +6322,27 @@ pub fn vortex_array::arrays::Masked::fmt(&self, f: &mut core::fmt::Formatter<'_> impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::take(array: &vortex_array::arrays::MaskedArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::filter(array: &vortex_array::arrays::MaskedArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::mask(array: &vortex_array::arrays::MaskedArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::scalar_at(array: &vortex_array::arrays::MaskedArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Masked -pub type vortex_array::arrays::Masked::Array = vortex_array::arrays::MaskedArray +pub type vortex_array::arrays::Masked::ArrayData = vortex_array::arrays::MaskedData pub type vortex_array::arrays::Masked::Metadata = vortex_array::EmptyMetadata @@ -6702,25 +6350,25 @@ pub type vortex_array::arrays::Masked::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Masked::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: &vortex_array::arrays::MaskedArray, other: &vortex_array::arrays::MaskedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: &vortex_array::arrays::MaskedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Masked::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Masked::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Masked::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Masked::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Masked::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Masked::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Masked::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Masked::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Masked::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Masked::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Masked::dtype(array: &vortex_array::arrays::MaskedArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Masked::dtype(array: &vortex_array::arrays::MaskedData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Masked::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -6728,13 +6376,13 @@ pub fn vortex_array::arrays::Masked::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Masked::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Masked::len(array: &vortex_array::arrays::MaskedArray) -> usize +pub fn vortex_array::arrays::Masked::len(array: &vortex_array::arrays::MaskedData) -> usize -pub fn vortex_array::arrays::Masked::metadata(_array: &vortex_array::arrays::MaskedArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Masked::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Masked::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Masked::nchildren(array: &Self::Array) -> usize +pub fn vortex_array::arrays::Masked::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Masked::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -6742,53 +6390,49 @@ pub fn vortex_array::arrays::Masked::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Masked::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Masked::stats(array: &vortex_array::arrays::MaskedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Masked::stats(array: &vortex_array::arrays::MaskedData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Masked::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Masked::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Masked::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub struct vortex_array::arrays::MaskedArray +pub struct vortex_array::arrays::MaskedData -impl vortex_array::arrays::MaskedArray +impl vortex_array::arrays::MaskedData -pub fn vortex_array::arrays::MaskedArray::child(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::MaskedData::child(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::MaskedArray::try_new(child: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::MaskedData::dtype(&self) -> &vortex_array::dtype::DType -impl vortex_array::arrays::MaskedArray +pub fn vortex_array::arrays::MaskedData::is_empty(&self) -> bool -pub fn vortex_array::arrays::MaskedArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::MaskedData::len(&self) -> usize -impl core::clone::Clone for vortex_array::arrays::MaskedArray +pub fn vortex_array::arrays::MaskedData::try_new(child: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub fn vortex_array::arrays::MaskedArray::clone(&self) -> vortex_array::arrays::MaskedArray +pub fn vortex_array::arrays::MaskedData::validity(&self) -> &vortex_array::validity::Validity -impl core::convert::AsRef for vortex_array::arrays::MaskedArray +pub fn vortex_array::arrays::MaskedData::validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::arrays::MaskedArray::as_ref(&self) -> &dyn vortex_array::DynArray +impl core::clone::Clone for vortex_array::arrays::MaskedData -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::MaskedData::clone(&self) -> vortex_array::arrays::MaskedData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::MaskedArray) -> vortex_array::ArrayRef +impl core::convert::From for vortex_array::ArrayRef -impl core::fmt::Debug for vortex_array::arrays::MaskedArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::MaskedData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::MaskedArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::fmt::Debug for vortex_array::arrays::MaskedData -impl core::ops::deref::Deref for vortex_array::arrays::MaskedArray +pub fn vortex_array::arrays::MaskedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub type vortex_array::arrays::MaskedArray::Target = dyn vortex_array::DynArray +impl vortex_array::IntoArray for vortex_array::arrays::MaskedData -pub fn vortex_array::arrays::MaskedArray::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::MaskedData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::MaskedArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::MaskedData -pub fn vortex_array::arrays::MaskedArray::into_array(self) -> vortex_array::ArrayRef - -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::MaskedArray - -pub fn vortex_array::arrays::MaskedArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::MaskedData::validity(&self) -> &vortex_array::validity::Validity pub struct vortex_array::arrays::Null @@ -6810,31 +6454,31 @@ pub fn vortex_array::arrays::null::Null::fmt(&self, f: &mut core::fmt::Formatter impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::take(array: &vortex_array::arrays::null::NullArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::filter(_array: &vortex_array::arrays::null::NullArray, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::filter(_array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::slice(_array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::slice(_array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::cast(array: &vortex_array::arrays::null::NullArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::mask(array: &vortex_array::arrays::null::NullArray, _mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::mask(array: &vortex_array::vtable::Array, _mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::scalar_at(_array: &vortex_array::arrays::null::NullArray, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::scalar_at(_array: &vortex_array::vtable::Array, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::null::Null -pub type vortex_array::arrays::null::Null::Array = vortex_array::arrays::null::NullArray +pub type vortex_array::arrays::null::Null::ArrayData = vortex_array::arrays::null::NullData pub type vortex_array::arrays::null::Null::Metadata = vortex_array::EmptyMetadata @@ -6842,25 +6486,25 @@ pub type vortex_array::arrays::null::Null::OperationsVTable = vortex_array::arra pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(array: &vortex_array::arrays::null::NullArray, other: &vortex_array::arrays::null::NullArray, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(array: &vortex_array::arrays::null::NullArray, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(array: &vortex_array::vtable::Array, state: &mut H, _precision: vortex_array::Precision) -pub fn vortex_array::arrays::null::Null::buffer(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::null::Null::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::null::Null::buffer_name(_array: &vortex_array::arrays::null::NullArray, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::null::Null::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::null::Null::build(_dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::build(_dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::null::Null::child(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::null::Null::child(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::null::Null::child_name(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::null::Null::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::null::Null::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::null::Null::dtype(_array: &vortex_array::arrays::null::NullArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::null::Null::dtype(_array: &vortex_array::arrays::null::NullData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::null::Null::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -6868,13 +6512,13 @@ pub fn vortex_array::arrays::null::Null::execute_parent(array: &vortex_array::vt pub fn vortex_array::arrays::null::Null::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::null::Null::len(array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::Null::len(array: &vortex_array::arrays::null::NullData) -> usize -pub fn vortex_array::arrays::null::Null::metadata(_array: &vortex_array::arrays::null::NullArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::null::Null::nbuffers(_array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::Null::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::null::Null::nchildren(_array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::Null::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::null::Null::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -6882,55 +6526,43 @@ pub fn vortex_array::arrays::null::Null::reduce_parent(array: &vortex_array::vta pub fn vortex_array::arrays::null::Null::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::null::Null::stats(array: &vortex_array::arrays::null::NullArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::null::Null::stats(array: &vortex_array::arrays::null::NullData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::null::Null::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::null::Null::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::null::Null::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::with_children(_array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::validity(_array: &vortex_array::arrays::null::NullArray) -> vortex_error::VortexResult - -pub struct vortex_array::arrays::NullArray - -impl vortex_array::arrays::null::NullArray +pub fn vortex_array::arrays::null::Null::validity(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::null::NullArray::new(len: usize) -> Self +pub struct vortex_array::arrays::NullData -impl vortex_array::arrays::null::NullArray +impl vortex_array::arrays::null::NullData -pub fn vortex_array::arrays::null::NullArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::null::NullData::dtype(&self) -> &vortex_array::dtype::DType -impl core::clone::Clone for vortex_array::arrays::null::NullArray +pub fn vortex_array::arrays::null::NullData::is_empty(&self) -> bool -pub fn vortex_array::arrays::null::NullArray::clone(&self) -> vortex_array::arrays::null::NullArray +pub fn vortex_array::arrays::null::NullData::len(&self) -> usize -impl core::convert::AsRef for vortex_array::arrays::null::NullArray +pub fn vortex_array::arrays::null::NullData::new(len: usize) -> Self -pub fn vortex_array::arrays::null::NullArray::as_ref(&self) -> &dyn vortex_array::DynArray +impl core::clone::Clone for vortex_array::arrays::null::NullData -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::null::NullData::clone(&self) -> vortex_array::arrays::null::NullData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::null::NullArray) -> vortex_array::ArrayRef +impl core::convert::From for vortex_array::ArrayRef -impl core::fmt::Debug for vortex_array::arrays::null::NullArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::null::NullData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::null::NullArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::fmt::Debug for vortex_array::arrays::null::NullData -impl core::ops::deref::Deref for vortex_array::arrays::null::NullArray +pub fn vortex_array::arrays::null::NullData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub type vortex_array::arrays::null::NullArray::Target = dyn vortex_array::DynArray +impl vortex_array::IntoArray for vortex_array::arrays::null::NullData -pub fn vortex_array::arrays::null::NullArray::deref(&self) -> &Self::Target - -impl vortex_array::Executable for vortex_array::arrays::null::NullArray - -pub fn vortex_array::arrays::null::NullArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult - -impl vortex_array::IntoArray for vortex_array::arrays::null::NullArray - -pub fn vortex_array::arrays::null::NullArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::null::NullData::into_array(self) -> vortex_array::ArrayRef pub struct vortex_array::arrays::Primitive @@ -6948,41 +6580,41 @@ pub fn vortex_array::arrays::Primitive::fmt(&self, f: &mut core::fmt::Formatter< impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::take(array: &vortex_array::arrays::PrimitiveArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> 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, array: &vortex_array::arrays::PrimitiveArray, parent: &vortex_array::arrays::MaskedArray, _child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: &vortex_array::arrays::MaskedArray, _child_idx: usize) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::between::BetweenKernel for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::between(arr: &vortex_array::arrays::PrimitiveArray, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::between(arr: &vortex_array::vtable::Array, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastKernel for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::cast(array: &vortex_array::arrays::PrimitiveArray, dtype: &vortex_array::dtype::DType, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullKernel for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::fill_null(array: &vortex_array::arrays::PrimitiveArray, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::mask(array: &vortex_array::arrays::PrimitiveArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::scalar_at(array: &vortex_array::arrays::PrimitiveArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Primitive -pub type vortex_array::arrays::Primitive::Array = vortex_array::arrays::PrimitiveArray +pub type vortex_array::arrays::Primitive::ArrayData = vortex_array::arrays::PrimitiveData pub type vortex_array::arrays::Primitive::Metadata = vortex_array::EmptyMetadata @@ -6990,25 +6622,25 @@ pub type vortex_array::arrays::Primitive::OperationsVTable = vortex_array::array pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Primitive::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Primitive::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: &vortex_array::arrays::PrimitiveArray, other: &vortex_array::arrays::PrimitiveArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: &vortex_array::arrays::PrimitiveArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Primitive::buffer(array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Primitive::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Primitive::buffer_name(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Primitive::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Primitive::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Primitive::child(array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Primitive::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Primitive::child_name(_array: &vortex_array::arrays::PrimitiveArray, _idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Primitive::child_name(_array: &vortex_array::vtable::Array, _idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Primitive::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Primitive::dtype(array: &vortex_array::arrays::PrimitiveArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Primitive::dtype(array: &vortex_array::arrays::PrimitiveData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Primitive::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -7016,13 +6648,13 @@ pub fn vortex_array::arrays::Primitive::execute_parent(array: &vortex_array::vta pub fn vortex_array::arrays::Primitive::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Primitive::len(array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::Primitive::len(array: &vortex_array::arrays::PrimitiveData) -> usize -pub fn vortex_array::arrays::Primitive::metadata(_array: &vortex_array::arrays::PrimitiveArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Primitive::nbuffers(_array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::Primitive::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Primitive::nchildren(array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::Primitive::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Primitive::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -7030,173 +6662,117 @@ pub fn vortex_array::arrays::Primitive::reduce_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::Primitive::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Primitive::stats(array: &vortex_array::arrays::PrimitiveArray) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::arrays::Primitive::vtable(_array: &Self::Array) -> &Self - -pub fn vortex_array::arrays::Primitive::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> - -pub struct vortex_array::arrays::PrimitiveArray - -impl vortex_array::arrays::PrimitiveArray - -pub fn vortex_array::arrays::PrimitiveArray::as_slice(&self) -> &[T] - -pub fn vortex_array::arrays::PrimitiveArray::narrow(&self) -> vortex_error::VortexResult - -pub fn vortex_array::arrays::PrimitiveArray::reinterpret_cast(&self, ptype: vortex_array::dtype::PType) -> Self - -impl vortex_array::arrays::PrimitiveArray - -pub fn vortex_array::arrays::PrimitiveArray::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle - -pub fn vortex_array::arrays::PrimitiveArray::from_buffer_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self - -pub fn vortex_array::arrays::PrimitiveArray::from_byte_buffer(buffer: vortex_buffer::ByteBuffer, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self - -pub fn vortex_array::arrays::PrimitiveArray::from_values_byte_buffer(valid_elems_buffer: vortex_buffer::ByteBuffer, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity, n_rows: usize) -> Self - -pub fn vortex_array::arrays::PrimitiveArray::map_each(self, f: F) -> vortex_array::arrays::PrimitiveArray where T: vortex_array::dtype::NativePType, R: vortex_array::dtype::NativePType, F: core::ops::function::FnMut(T) -> R - -pub fn vortex_array::arrays::PrimitiveArray::map_each_with_validity(self, f: F) -> vortex_error::VortexResult where T: vortex_array::dtype::NativePType, R: vortex_array::dtype::NativePType, F: core::ops::function::FnMut((T, bool)) -> R - -pub fn vortex_array::arrays::PrimitiveArray::ptype(&self) -> vortex_array::dtype::PType - -impl vortex_array::arrays::PrimitiveArray - -pub fn vortex_array::arrays::PrimitiveArray::empty(nullability: vortex_array::dtype::Nullability) -> Self - -pub fn vortex_array::arrays::PrimitiveArray::new(buffer: impl core::convert::Into>, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::Primitive::stats(array: &vortex_array::arrays::PrimitiveData) -> &vortex_array::stats::ArrayStats -pub unsafe fn vortex_array::arrays::PrimitiveArray::new_unchecked(buffer: vortex_buffer::buffer::Buffer, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::Primitive::vtable(_array: &Self::ArrayData) -> &Self -pub unsafe fn vortex_array::arrays::PrimitiveArray::new_unchecked_from_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::Primitive::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::PrimitiveArray::try_new(buffer: vortex_buffer::buffer::Buffer, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub struct vortex_array::arrays::PrimitiveData -pub fn vortex_array::arrays::PrimitiveArray::validate(buffer: &vortex_buffer::buffer::Buffer, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +impl vortex_array::arrays::PrimitiveData -impl vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::buffer_handle(&self) -> &vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::PrimitiveArray::from_option_iter>>(iter: I) -> Self +pub fn vortex_array::arrays::PrimitiveData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::PrimitiveArray::into_buffer(self) -> vortex_buffer::buffer::Buffer +pub fn vortex_array::arrays::PrimitiveData::from_buffer_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::PrimitiveArray::into_buffer_mut(self) -> vortex_buffer::buffer_mut::BufferMut +pub fn vortex_array::arrays::PrimitiveData::from_byte_buffer(buffer: vortex_buffer::ByteBuffer, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::PrimitiveArray::to_buffer(&self) -> vortex_buffer::buffer::Buffer +pub fn vortex_array::arrays::PrimitiveData::from_values_byte_buffer(valid_elems_buffer: vortex_buffer::ByteBuffer, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity, n_rows: usize) -> Self -pub fn vortex_array::arrays::PrimitiveArray::try_into_buffer_mut(self) -> core::result::Result, vortex_buffer::buffer::Buffer> +pub fn vortex_array::arrays::PrimitiveData::into_buffer(self) -> vortex_buffer::buffer::Buffer -impl vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::into_buffer_mut(self) -> vortex_buffer::buffer_mut::BufferMut -pub fn vortex_array::arrays::PrimitiveArray::into_parts(self) -> vortex_array::arrays::primitive::PrimitiveArrayParts +pub fn vortex_array::arrays::PrimitiveData::is_empty(&self) -> bool -impl vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::len(&self) -> usize -pub fn vortex_array::arrays::PrimitiveArray::patch(self, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::PrimitiveData::map_each(self, f: F) -> Self where T: vortex_array::dtype::NativePType, R: vortex_array::dtype::NativePType, F: core::ops::function::FnMut(T) -> R -impl vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::map_each_with_validity(self, f: F) -> vortex_error::VortexResult where T: vortex_array::dtype::NativePType, R: vortex_array::dtype::NativePType, F: core::ops::function::FnMut((T, bool)) -> R -pub fn vortex_array::arrays::PrimitiveArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::PrimitiveData::ptype(&self) -> vortex_array::dtype::PType -impl vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::to_buffer(&self) -> vortex_buffer::buffer::Buffer -pub fn vortex_array::arrays::PrimitiveArray::top_value(&self) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::PrimitiveData::try_into_buffer_mut(self) -> core::result::Result, vortex_buffer::buffer::Buffer> -impl core::clone::Clone for vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::arrays::PrimitiveArray::clone(&self) -> vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::validity_mask(&self) -> vortex_mask::Mask -impl core::convert::AsRef for vortex_array::arrays::PrimitiveArray +impl vortex_array::arrays::PrimitiveData -pub fn vortex_array::arrays::PrimitiveArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::PrimitiveData::empty(nullability: vortex_array::dtype::Nullability) -> Self -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::PrimitiveData::new(buffer: impl core::convert::Into>, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::PrimitiveArray) -> vortex_array::ArrayRef +pub unsafe fn vortex_array::arrays::PrimitiveData::new_unchecked(buffer: vortex_buffer::buffer::Buffer, validity: vortex_array::validity::Validity) -> Self -impl core::fmt::Debug for vortex_array::arrays::PrimitiveArray +pub unsafe fn vortex_array::arrays::PrimitiveData::new_unchecked_from_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::PrimitiveArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::PrimitiveData::try_new(buffer: vortex_buffer::buffer::Buffer, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl core::ops::deref::Deref for vortex_array::arrays::PrimitiveArray +pub fn vortex_array::arrays::PrimitiveData::validate(buffer: &vortex_buffer::buffer::Buffer, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -pub type vortex_array::arrays::PrimitiveArray::Target = dyn vortex_array::DynArray +impl vortex_array::arrays::PrimitiveData -pub fn vortex_array::arrays::PrimitiveArray::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::PrimitiveData::into_parts(self) -> vortex_array::arrays::primitive::PrimitiveArrayParts -impl vortex_array::Executable for vortex_array::arrays::PrimitiveArray - -pub fn vortex_array::arrays::PrimitiveArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult - -impl vortex_array::IntoArray for vortex_array::arrays::PrimitiveArray - -pub fn vortex_array::arrays::PrimitiveArray::into_array(self) -> vortex_array::ArrayRef - -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::PrimitiveArray - -pub fn vortex_array::arrays::PrimitiveArray::validity(&self) -> &vortex_array::validity::Validity - -impl core::iter::traits::collect::FromIterator for vortex_array::arrays::PrimitiveArray +impl core::clone::Clone for vortex_array::arrays::PrimitiveData -pub fn vortex_array::arrays::PrimitiveArray::from_iter>(iter: I) -> Self +pub fn vortex_array::arrays::PrimitiveData::clone(&self) -> vortex_array::arrays::PrimitiveData -impl vortex_array::accessor::ArrayAccessor for vortex_array::arrays::PrimitiveArray - -pub fn vortex_array::arrays::PrimitiveArray::with_iterator(&self, f: F) -> R where F: for<'a> core::ops::function::FnOnce(&mut dyn core::iter::traits::iterator::Iterator>) -> R - -pub struct vortex_array::arrays::ScalarFnArray +impl core::convert::From for vortex_array::ArrayRef -impl vortex_array::arrays::scalar_fn::ScalarFnArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::PrimitiveData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::children(&self) -> &[vortex_array::ArrayRef] +impl core::fmt::Debug for vortex_array::arrays::PrimitiveData -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::scalar_fn(&self) -> &vortex_array::scalar_fn::ScalarFnRef +pub fn vortex_array::arrays::PrimitiveData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::try_new(scalar_fn: vortex_array::scalar_fn::ScalarFnRef, children: alloc::vec::Vec, len: usize) -> vortex_error::VortexResult +impl vortex_array::IntoArray for vortex_array::arrays::PrimitiveData -impl vortex_array::arrays::scalar_fn::ScalarFnArray +pub fn vortex_array::arrays::PrimitiveData::into_array(self) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::to_array(&self) -> vortex_array::ArrayRef +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::PrimitiveData -impl core::clone::Clone for vortex_array::arrays::scalar_fn::ScalarFnArray +pub fn vortex_array::arrays::PrimitiveData::validity(&self) -> &vortex_array::validity::Validity -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::clone(&self) -> vortex_array::arrays::scalar_fn::ScalarFnArray +pub struct vortex_array::arrays::ScalarFnData -impl core::convert::AsRef for vortex_array::arrays::scalar_fn::ScalarFnArray +impl vortex_array::arrays::ScalarFnData -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::ScalarFnData::children(&self) -> &[vortex_array::ArrayRef] -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::ScalarFnData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ScalarFnData::is_empty(&self) -> bool -impl core::fmt::Debug for vortex_array::arrays::scalar_fn::ScalarFnArray +pub fn vortex_array::arrays::ScalarFnData::len(&self) -> usize -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::ScalarFnData::scalar_fn(&self) -> &vortex_array::scalar_fn::ScalarFnRef -impl core::ops::deref::Deref for vortex_array::arrays::scalar_fn::ScalarFnArray +pub fn vortex_array::arrays::ScalarFnData::try_new(scalar_fn: vortex_array::scalar_fn::ScalarFnRef, children: alloc::vec::Vec, len: usize) -> vortex_error::VortexResult -pub type vortex_array::arrays::scalar_fn::ScalarFnArray::Target = dyn vortex_array::DynArray +impl core::clone::Clone for vortex_array::arrays::ScalarFnData -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::ScalarFnData::clone(&self) -> vortex_array::arrays::ScalarFnData -impl vortex_array::IntoArray for vortex_array::arrays::scalar_fn::ScalarFnArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::ScalarFnData) -> vortex_array::ArrayRef -impl vortex_array::scalar_fn::ReduceNode for vortex_array::arrays::scalar_fn::ScalarFnArray +impl core::fmt::Debug for vortex_array::arrays::ScalarFnData -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::as_any(&self) -> &dyn core::any::Any +pub fn vortex_array::arrays::ScalarFnData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::child(&self, idx: usize) -> vortex_array::scalar_fn::ReduceNodeRef +impl vortex_array::IntoArray for vortex_array::arrays::ScalarFnData -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::child_count(&self) -> usize - -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::node_dtype(&self) -> vortex_error::VortexResult - -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::scalar_fn(&self) -> core::option::Option<&vortex_array::scalar_fn::ScalarFnRef> +pub fn vortex_array::arrays::ScalarFnData::into_array(self) -> vortex_array::ArrayRef pub struct vortex_array::arrays::ScalarFnVTable @@ -7210,11 +6786,11 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::fmt(&self, f: &mut core: impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::scalar_fn::ScalarFnVTable -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::scalar_at(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::scalar_fn::ScalarFnVTable -pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::Array = vortex_array::arrays::scalar_fn::ScalarFnArray +pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ArrayData = vortex_array::arrays::ScalarFnData pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::Metadata = vortex_array::arrays::scalar_fn::metadata::ScalarFnMetadata @@ -7222,25 +6798,25 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::OperationsVTable = vor pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vortex_array::arrays::scalar_fn::ScalarFnVTable -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, other: &vortex_array::arrays::scalar_fn::ScalarFnArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer_name(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::scalar_fn::metadata::ScalarFnMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::scalar_fn::metadata::ScalarFnMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child_name(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child_name(array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::dtype(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::dtype(array: &vortex_array::arrays::ScalarFnData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -7248,13 +6824,13 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::execute_parent(array: &v pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::len(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::len(array: &vortex_array::arrays::ScalarFnData) -> usize -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::metadata(array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nbuffers(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nchildren(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -7262,15 +6838,15 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce_parent(array: &vo pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::ScalarFnData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::vtable(array: &Self::Array) -> &Self +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::vtable(array: &vortex_array::arrays::ScalarFnData) -> &Self -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::scalar_fn::ScalarFnVTable -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validity(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult pub struct vortex_array::arrays::Shared @@ -7288,11 +6864,11 @@ pub fn vortex_array::arrays::Shared::fmt(&self, f: &mut core::fmt::Formatter<'_> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Shared -pub fn vortex_array::arrays::Shared::scalar_at(array: &vortex_array::arrays::SharedArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Shared -pub type vortex_array::arrays::Shared::Array = vortex_array::arrays::SharedArray +pub type vortex_array::arrays::Shared::ArrayData = vortex_array::arrays::SharedData pub type vortex_array::arrays::Shared::Metadata = vortex_array::EmptyMetadata @@ -7300,25 +6876,25 @@ pub type vortex_array::arrays::Shared::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Shared -pub fn vortex_array::arrays::Shared::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: &vortex_array::arrays::SharedArray, other: &vortex_array::arrays::SharedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: &vortex_array::arrays::SharedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Shared::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Shared::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Shared::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Shared::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Shared::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Shared::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Shared::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Shared::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Shared::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Shared::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Shared::dtype(array: &vortex_array::arrays::SharedArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Shared::dtype(array: &vortex_array::arrays::SharedData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Shared::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -7326,13 +6902,13 @@ pub fn vortex_array::arrays::Shared::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Shared::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Shared::len(array: &vortex_array::arrays::SharedArray) -> usize +pub fn vortex_array::arrays::Shared::len(array: &vortex_array::arrays::SharedData) -> usize -pub fn vortex_array::arrays::Shared::metadata(_array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Shared::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Shared::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Shared::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Shared::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Shared::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -7340,55 +6916,47 @@ pub fn vortex_array::arrays::Shared::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Shared::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Shared::stats(array: &vortex_array::arrays::SharedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Shared::stats(array: &vortex_array::arrays::SharedData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Shared::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Shared::vtable(_array: &vortex_array::arrays::SharedData) -> &Self -pub fn vortex_array::arrays::Shared::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Shared -pub fn vortex_array::arrays::Shared::validity(array: &vortex_array::arrays::SharedArray) -> vortex_error::VortexResult - -pub struct vortex_array::arrays::SharedArray - -impl vortex_array::arrays::SharedArray +pub fn vortex_array::arrays::Shared::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::SharedArray::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult +pub struct vortex_array::arrays::SharedData -pub async fn vortex_array::arrays::SharedArray::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> +impl vortex_array::arrays::SharedData -pub fn vortex_array::arrays::SharedArray::new(source: vortex_array::ArrayRef) -> Self +pub fn vortex_array::arrays::SharedData::dtype(&self) -> &vortex_array::dtype::DType -impl vortex_array::arrays::SharedArray +pub fn vortex_array::arrays::SharedData::get_or_compute(&self, f: impl core::ops::function::FnOnce(&vortex_array::ArrayRef) -> vortex_error::VortexResult) -> vortex_error::VortexResult -pub fn vortex_array::arrays::SharedArray::to_array(&self) -> vortex_array::ArrayRef +pub async fn vortex_array::arrays::SharedData::get_or_compute_async(&self, f: F) -> vortex_error::VortexResult where F: core::ops::function::FnOnce(vortex_array::ArrayRef) -> Fut, Fut: core::future::future::Future> -impl core::clone::Clone for vortex_array::arrays::SharedArray +pub fn vortex_array::arrays::SharedData::is_empty(&self) -> bool -pub fn vortex_array::arrays::SharedArray::clone(&self) -> vortex_array::arrays::SharedArray +pub fn vortex_array::arrays::SharedData::len(&self) -> usize -impl core::convert::AsRef for vortex_array::arrays::SharedArray +pub fn vortex_array::arrays::SharedData::new(source: vortex_array::ArrayRef) -> Self -pub fn vortex_array::arrays::SharedArray::as_ref(&self) -> &dyn vortex_array::DynArray +impl core::clone::Clone for vortex_array::arrays::SharedData -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::SharedData::clone(&self) -> vortex_array::arrays::SharedData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::SharedArray) -> vortex_array::ArrayRef +impl core::convert::From for vortex_array::ArrayRef -impl core::fmt::Debug for vortex_array::arrays::SharedArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::SharedData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::SharedArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::fmt::Debug for vortex_array::arrays::SharedData -impl core::ops::deref::Deref for vortex_array::arrays::SharedArray +pub fn vortex_array::arrays::SharedData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub type vortex_array::arrays::SharedArray::Target = dyn vortex_array::DynArray +impl vortex_array::IntoArray for vortex_array::arrays::SharedData -pub fn vortex_array::arrays::SharedArray::deref(&self) -> &Self::Target - -impl vortex_array::IntoArray for vortex_array::arrays::SharedArray - -pub fn vortex_array::arrays::SharedArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::SharedData::into_array(self) -> vortex_array::ArrayRef pub struct vortex_array::arrays::Slice @@ -7406,15 +6974,15 @@ pub fn vortex_array::arrays::slice::Slice::fmt(&self, f: &mut core::fmt::Formatt impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::Slice::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::Slice::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::Slice::scalar_at(array: &vortex_array::arrays::slice::SliceArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::slice::Slice -pub type vortex_array::arrays::slice::Slice::Array = vortex_array::arrays::slice::SliceArray +pub type vortex_array::arrays::slice::Slice::ArrayData = vortex_array::arrays::SliceData pub type vortex_array::arrays::slice::Slice::Metadata = vortex_array::arrays::slice::SliceMetadata @@ -7422,25 +6990,25 @@ pub type vortex_array::arrays::slice::Slice::OperationsVTable = vortex_array::ar pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: &vortex_array::arrays::slice::SliceArray, other: &vortex_array::arrays::slice::SliceArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: &vortex_array::arrays::slice::SliceArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::slice::Slice::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::slice::Slice::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::slice::Slice::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::slice::Slice::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::slice::Slice::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::slice::SliceMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::slice::SliceMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::slice::Slice::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::slice::Slice::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::slice::Slice::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::slice::Slice::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::slice::Slice::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::slice::Slice::dtype(array: &vortex_array::arrays::slice::SliceArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::slice::Slice::dtype(array: &vortex_array::arrays::SliceData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::slice::Slice::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -7448,13 +7016,13 @@ pub fn vortex_array::arrays::slice::Slice::execute_parent(array: &vortex_array:: pub fn vortex_array::arrays::slice::Slice::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::slice::Slice::len(array: &vortex_array::arrays::slice::SliceArray) -> usize +pub fn vortex_array::arrays::slice::Slice::len(array: &vortex_array::arrays::SliceData) -> usize -pub fn vortex_array::arrays::slice::Slice::metadata(array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::slice::Slice::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::slice::Slice::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::slice::Slice::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::slice::Slice::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::slice::Slice::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -7462,59 +7030,53 @@ pub fn vortex_array::arrays::slice::Slice::reduce_parent(array: &vortex_array::v pub fn vortex_array::arrays::slice::Slice::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::slice::Slice::stats(array: &vortex_array::arrays::slice::SliceArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::slice::Slice::stats(array: &vortex_array::arrays::SliceData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::slice::Slice::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::slice::Slice::vtable(_array: &vortex_array::arrays::SliceData) -> &Self -pub fn vortex_array::arrays::slice::Slice::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::Slice::validity(array: &vortex_array::arrays::slice::SliceArray) -> vortex_error::VortexResult - -pub struct vortex_array::arrays::SliceArray - -impl vortex_array::arrays::slice::SliceArray +pub fn vortex_array::arrays::slice::Slice::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::slice::SliceArray::child(&self) -> &vortex_array::ArrayRef +pub struct vortex_array::arrays::SliceData -pub fn vortex_array::arrays::slice::SliceArray::into_parts(self) -> vortex_array::arrays::slice::SliceArrayParts +impl vortex_array::arrays::SliceData -pub fn vortex_array::arrays::slice::SliceArray::new(child: vortex_array::ArrayRef, range: core::ops::range::Range) -> Self +pub fn vortex_array::arrays::SliceData::child(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::slice::SliceArray::slice_range(&self) -> &core::ops::range::Range +pub fn vortex_array::arrays::SliceData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::slice::SliceArray::try_new(child: vortex_array::ArrayRef, range: core::ops::range::Range) -> vortex_error::VortexResult +pub fn vortex_array::arrays::SliceData::is_empty(&self) -> bool -impl vortex_array::arrays::slice::SliceArray +pub fn vortex_array::arrays::SliceData::len(&self) -> usize -pub fn vortex_array::arrays::slice::SliceArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::SliceData::new(child: vortex_array::ArrayRef, range: core::ops::range::Range) -> Self -impl core::clone::Clone for vortex_array::arrays::slice::SliceArray +pub fn vortex_array::arrays::SliceData::slice_range(&self) -> &core::ops::range::Range -pub fn vortex_array::arrays::slice::SliceArray::clone(&self) -> vortex_array::arrays::slice::SliceArray +pub fn vortex_array::arrays::SliceData::try_new(child: vortex_array::ArrayRef, range: core::ops::range::Range) -> vortex_error::VortexResult -impl core::convert::AsRef for vortex_array::arrays::slice::SliceArray +impl vortex_array::arrays::SliceData -pub fn vortex_array::arrays::slice::SliceArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::SliceData::into_parts(self) -> vortex_array::arrays::slice::SliceArrayParts -impl core::convert::From for vortex_array::ArrayRef +impl core::clone::Clone for vortex_array::arrays::SliceData -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::slice::SliceArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::SliceData::clone(&self) -> vortex_array::arrays::SliceData -impl core::fmt::Debug for vortex_array::arrays::slice::SliceArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::slice::SliceArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::SliceData) -> vortex_array::ArrayRef -impl core::ops::deref::Deref for vortex_array::arrays::slice::SliceArray +impl core::fmt::Debug for vortex_array::arrays::SliceData -pub type vortex_array::arrays::slice::SliceArray::Target = dyn vortex_array::DynArray +pub fn vortex_array::arrays::SliceData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::slice::SliceArray::deref(&self) -> &Self::Target +impl vortex_array::IntoArray for vortex_array::arrays::SliceData -impl vortex_array::IntoArray for vortex_array::arrays::slice::SliceArray - -pub fn vortex_array::arrays::slice::SliceArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::SliceData::into_array(self) -> vortex_array::ArrayRef pub struct vortex_array::arrays::Struct @@ -7532,31 +7094,31 @@ pub fn vortex_array::arrays::Struct::fmt(&self, f: &mut core::fmt::Formatter<'_> impl vortex_array::arrays::dict::TakeReduce for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::take(array: &vortex_array::arrays::StructArray, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastKernel for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::cast(array: &vortex_array::arrays::StructArray, dtype: &vortex_array::dtype::DType, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::mask(array: &vortex_array::arrays::StructArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::zip::ZipKernel for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::zip(if_true: &vortex_array::arrays::StructArray, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::zip(if_true: &vortex_array::vtable::Array, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::scalar_at(array: &vortex_array::arrays::StructArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Struct -pub type vortex_array::arrays::Struct::Array = vortex_array::arrays::StructArray +pub type vortex_array::arrays::Struct::ArrayData = vortex_array::arrays::StructData pub type vortex_array::arrays::Struct::Metadata = vortex_array::EmptyMetadata @@ -7564,25 +7126,25 @@ pub type vortex_array::arrays::Struct::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Struct::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Struct::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: &vortex_array::arrays::StructArray, other: &vortex_array::arrays::StructArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: &vortex_array::arrays::StructArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Struct::buffer(_array: &vortex_array::arrays::StructArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Struct::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Struct::buffer_name(_array: &vortex_array::arrays::StructArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Struct::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Struct::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Struct::child(array: &vortex_array::arrays::StructArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Struct::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Struct::child_name(array: &vortex_array::arrays::StructArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Struct::child_name(array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Struct::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Struct::dtype(array: &vortex_array::arrays::StructArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Struct::dtype(array: &vortex_array::arrays::StructData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Struct::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -7590,13 +7152,13 @@ pub fn vortex_array::arrays::Struct::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Struct::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Struct::len(array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::Struct::len(array: &vortex_array::arrays::StructData) -> usize -pub fn vortex_array::arrays::Struct::metadata(_array: &vortex_array::arrays::StructArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Struct::nbuffers(_array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::Struct::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Struct::nchildren(array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::Struct::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Struct::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -7604,155 +7166,143 @@ pub fn vortex_array::arrays::Struct::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Struct::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Struct::stats(array: &vortex_array::arrays::StructArray) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::arrays::Struct::vtable(_array: &Self::Array) -> &Self - -pub fn vortex_array::arrays::Struct::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> - -pub struct vortex_array::arrays::StructArray +pub fn vortex_array::arrays::Struct::stats(array: &vortex_array::arrays::StructData) -> &vortex_array::stats::ArrayStats -impl vortex_array::arrays::StructArray +pub fn vortex_array::arrays::Struct::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::StructArray::from_fields>(items: &[(N, vortex_array::ArrayRef)]) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::StructArray::into_fields(self) -> alloc::vec::Vec +pub struct vortex_array::arrays::StructData -pub fn vortex_array::arrays::StructArray::into_parts(self) -> vortex_array::arrays::struct_::StructArrayParts +impl vortex_array::arrays::StructData -pub fn vortex_array::arrays::StructArray::names(&self) -> &vortex_array::dtype::FieldNames +pub fn vortex_array::arrays::StructData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::StructArray::new(names: vortex_array::dtype::FieldNames, fields: impl core::convert::Into>, length: usize, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::StructData::from_fields>(items: &[(N, vortex_array::ArrayRef)]) -> vortex_error::VortexResult -pub fn vortex_array::arrays::StructArray::new_fieldless_with_len(len: usize) -> Self +pub fn vortex_array::arrays::StructData::into_fields(self) -> alloc::vec::Vec -pub unsafe fn vortex_array::arrays::StructArray::new_unchecked(fields: impl core::convert::Into>, dtype: vortex_array::dtype::StructFields, length: usize, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::StructData::into_parts(self) -> vortex_array::arrays::struct_::StructArrayParts -pub fn vortex_array::arrays::StructArray::project(&self, projection: &[vortex_array::dtype::FieldName]) -> vortex_error::VortexResult +pub fn vortex_array::arrays::StructData::is_empty(&self) -> bool -pub fn vortex_array::arrays::StructArray::remove_column(&mut self, name: impl core::convert::Into) -> core::option::Option +pub fn vortex_array::arrays::StructData::len(&self) -> usize -pub fn vortex_array::arrays::StructArray::struct_fields(&self) -> &vortex_array::dtype::StructFields +pub fn vortex_array::arrays::StructData::names(&self) -> &vortex_array::dtype::FieldNames -pub fn vortex_array::arrays::StructArray::try_from_iter, A: vortex_array::IntoArray, T: core::iter::traits::collect::IntoIterator>(iter: T) -> vortex_error::VortexResult +pub fn vortex_array::arrays::StructData::new(names: vortex_array::dtype::FieldNames, fields: impl core::convert::Into>, length: usize, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::StructArray::try_from_iter_with_validity, A: vortex_array::IntoArray, T: core::iter::traits::collect::IntoIterator>(iter: T, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::StructData::new_fieldless_with_len(len: usize) -> Self -pub fn vortex_array::arrays::StructArray::try_new(names: vortex_array::dtype::FieldNames, fields: impl core::convert::Into>, length: usize, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub unsafe fn vortex_array::arrays::StructData::new_unchecked(fields: impl core::convert::Into>, dtype: vortex_array::dtype::StructFields, length: usize, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::StructArray::try_new_with_dtype(fields: impl core::convert::Into>, dtype: vortex_array::dtype::StructFields, length: usize, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::StructData::project(&self, projection: &[vortex_array::dtype::FieldName]) -> vortex_error::VortexResult -pub fn vortex_array::arrays::StructArray::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> +pub fn vortex_array::arrays::StructData::remove_column(&mut self, name: impl core::convert::Into) -> core::option::Option -pub fn vortex_array::arrays::StructArray::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> +pub fn vortex_array::arrays::StructData::struct_fields(&self) -> &vortex_array::dtype::StructFields -pub fn vortex_array::arrays::StructArray::unmasked_fields(&self) -> &alloc::sync::Arc<[vortex_array::ArrayRef]> +pub fn vortex_array::arrays::StructData::try_from_iter, A: vortex_array::IntoArray, T: core::iter::traits::collect::IntoIterator>(iter: T) -> vortex_error::VortexResult -pub fn vortex_array::arrays::StructArray::validate(fields: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::StructFields, length: usize, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::StructData::try_from_iter_with_validity, A: vortex_array::IntoArray, T: core::iter::traits::collect::IntoIterator>(iter: T, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub fn vortex_array::arrays::StructArray::with_column(&self, name: impl core::convert::Into, array: vortex_array::ArrayRef) -> vortex_error::VortexResult +pub fn vortex_array::arrays::StructData::try_new(names: vortex_array::dtype::FieldNames, fields: impl core::convert::Into>, length: usize, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl vortex_array::arrays::StructArray +pub fn vortex_array::arrays::StructData::try_new_with_dtype(fields: impl core::convert::Into>, dtype: vortex_array::dtype::StructFields, length: usize, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub fn vortex_array::arrays::StructArray::into_record_batch_with_schema(self, schema: impl core::convert::AsRef) -> vortex_error::VortexResult +pub fn vortex_array::arrays::StructData::unmasked_field_by_name(&self, name: impl core::convert::AsRef) -> vortex_error::VortexResult<&vortex_array::ArrayRef> -impl vortex_array::arrays::StructArray +pub fn vortex_array::arrays::StructData::unmasked_field_by_name_opt(&self, name: impl core::convert::AsRef) -> core::option::Option<&vortex_array::ArrayRef> -pub fn vortex_array::arrays::StructArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::StructData::unmasked_fields(&self) -> &alloc::sync::Arc<[vortex_array::ArrayRef]> -impl core::clone::Clone for vortex_array::arrays::StructArray +pub fn vortex_array::arrays::StructData::validate(fields: &[vortex_array::ArrayRef], dtype: &vortex_array::dtype::StructFields, length: usize, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::StructArray::clone(&self) -> vortex_array::arrays::StructArray +pub fn vortex_array::arrays::StructData::validity(&self) -> &vortex_array::validity::Validity -impl core::convert::AsRef for vortex_array::arrays::StructArray +pub fn vortex_array::arrays::StructData::validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::arrays::StructArray::as_ref(&self) -> &dyn vortex_array::DynArray +impl vortex_array::arrays::StructData -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::StructData::with_column(&self, name: impl core::convert::Into, array: vortex_array::ArrayRef) -> vortex_error::VortexResult -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::StructArray) -> vortex_array::ArrayRef +impl core::clone::Clone for vortex_array::arrays::StructData -impl core::fmt::Debug for vortex_array::arrays::StructArray +pub fn vortex_array::arrays::StructData::clone(&self) -> vortex_array::arrays::StructData -pub fn vortex_array::arrays::StructArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::convert::From for vortex_array::ArrayRef -impl core::ops::deref::Deref for vortex_array::arrays::StructArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::StructData) -> vortex_array::ArrayRef -pub type vortex_array::arrays::StructArray::Target = dyn vortex_array::DynArray +impl core::fmt::Debug for vortex_array::arrays::StructData -pub fn vortex_array::arrays::StructArray::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::StructData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl vortex_array::Executable for vortex_array::arrays::StructArray - -pub fn vortex_array::arrays::StructArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult - -impl vortex_array::IntoArray for vortex_array::arrays::StructArray +impl vortex_array::IntoArray for vortex_array::arrays::StructData -pub fn vortex_array::arrays::StructArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::StructData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::StructArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::StructData -pub fn vortex_array::arrays::StructArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::StructData::validity(&self) -> &vortex_array::validity::Validity -pub struct vortex_array::arrays::TemporalArray +pub struct vortex_array::arrays::TemporalData -impl vortex_array::arrays::datetime::TemporalArray +impl vortex_array::arrays::datetime::TemporalData -pub fn vortex_array::arrays::datetime::TemporalArray::dtype(&self) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::datetime::TemporalData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::datetime::TemporalArray::ext_dtype(&self) -> vortex_array::dtype::extension::ExtDTypeRef +pub fn vortex_array::arrays::datetime::TemporalData::ext_dtype(&self) -> vortex_array::dtype::extension::ExtDTypeRef -pub fn vortex_array::arrays::datetime::TemporalArray::temporal_metadata(&self) -> vortex_array::extension::datetime::TemporalMetadata<'_> +pub fn vortex_array::arrays::datetime::TemporalData::temporal_metadata(&self) -> vortex_array::extension::datetime::TemporalMetadata<'_> -pub fn vortex_array::arrays::datetime::TemporalArray::temporal_values(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::datetime::TemporalData::temporal_values(&self) -> &vortex_array::ArrayRef -impl vortex_array::arrays::datetime::TemporalArray +pub fn vortex_array::arrays::datetime::TemporalData::to_array_ref(&self) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::datetime::TemporalArray::new_date(array: vortex_array::ArrayRef, time_unit: vortex_array::extension::datetime::TimeUnit) -> Self +impl vortex_array::arrays::datetime::TemporalData -pub fn vortex_array::arrays::datetime::TemporalArray::new_time(array: vortex_array::ArrayRef, time_unit: vortex_array::extension::datetime::TimeUnit) -> Self +pub fn vortex_array::arrays::datetime::TemporalData::new_date(array: vortex_array::ArrayRef, time_unit: vortex_array::extension::datetime::TimeUnit) -> Self -pub fn vortex_array::arrays::datetime::TemporalArray::new_timestamp(array: vortex_array::ArrayRef, time_unit: vortex_array::extension::datetime::TimeUnit, time_zone: core::option::Option>) -> Self +pub fn vortex_array::arrays::datetime::TemporalData::new_time(array: vortex_array::ArrayRef, time_unit: vortex_array::extension::datetime::TimeUnit) -> Self -impl core::clone::Clone for vortex_array::arrays::datetime::TemporalArray +pub fn vortex_array::arrays::datetime::TemporalData::new_timestamp(array: vortex_array::ArrayRef, time_unit: vortex_array::extension::datetime::TimeUnit, time_zone: core::option::Option>) -> Self -pub fn vortex_array::arrays::datetime::TemporalArray::clone(&self) -> vortex_array::arrays::datetime::TemporalArray +impl core::clone::Clone for vortex_array::arrays::datetime::TemporalData -impl core::convert::AsRef for vortex_array::arrays::datetime::TemporalArray +pub fn vortex_array::arrays::datetime::TemporalData::clone(&self) -> vortex_array::arrays::datetime::TemporalData -pub fn vortex_array::arrays::datetime::TemporalArray::as_ref(&self) -> &dyn vortex_array::DynArray +impl core::convert::From<&vortex_array::arrays::datetime::TemporalData> for vortex_array::arrays::ExtensionArray -impl core::convert::From<&vortex_array::arrays::datetime::TemporalArray> for vortex_array::arrays::ExtensionArray +pub fn vortex_array::arrays::ExtensionArray::from(value: &vortex_array::arrays::datetime::TemporalData) -> Self -pub fn vortex_array::arrays::ExtensionArray::from(value: &vortex_array::arrays::datetime::TemporalArray) -> Self +impl core::convert::From for vortex_array::ArrayRef -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::datetime::TemporalData) -> Self -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::datetime::TemporalArray) -> Self +impl core::convert::From for vortex_array::arrays::ExtensionArray -impl core::convert::From for vortex_array::arrays::ExtensionArray +pub fn vortex_array::arrays::ExtensionArray::from(value: vortex_array::arrays::datetime::TemporalData) -> Self -pub fn vortex_array::arrays::ExtensionArray::from(value: vortex_array::arrays::datetime::TemporalArray) -> Self +impl core::convert::TryFrom> for vortex_array::arrays::datetime::TemporalData -impl core::convert::TryFrom> for vortex_array::arrays::datetime::TemporalArray +pub type vortex_array::arrays::datetime::TemporalData::Error = vortex_error::VortexError -pub type vortex_array::arrays::datetime::TemporalArray::Error = vortex_error::VortexError +pub fn vortex_array::arrays::datetime::TemporalData::try_from(value: vortex_array::ArrayRef) -> core::result::Result -pub fn vortex_array::arrays::datetime::TemporalArray::try_from(value: vortex_array::ArrayRef) -> core::result::Result +impl core::convert::TryFrom> for vortex_array::arrays::datetime::TemporalData -impl core::convert::TryFrom for vortex_array::arrays::datetime::TemporalArray +pub type vortex_array::arrays::datetime::TemporalData::Error = vortex_error::VortexError -pub type vortex_array::arrays::datetime::TemporalArray::Error = vortex_error::VortexError +pub fn vortex_array::arrays::datetime::TemporalData::try_from(ext: vortex_array::arrays::ExtensionArray) -> core::result::Result -pub fn vortex_array::arrays::datetime::TemporalArray::try_from(ext: vortex_array::arrays::ExtensionArray) -> core::result::Result +impl core::fmt::Debug for vortex_array::arrays::datetime::TemporalData -impl core::fmt::Debug for vortex_array::arrays::datetime::TemporalArray +pub fn vortex_array::arrays::datetime::TemporalData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::datetime::TemporalArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl vortex_array::IntoArray for vortex_array::arrays::datetime::TemporalData -impl vortex_array::IntoArray for vortex_array::arrays::datetime::TemporalArray - -pub fn vortex_array::arrays::datetime::TemporalArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::datetime::TemporalData::into_array(self) -> vortex_array::ArrayRef pub struct vortex_array::arrays::VarBin @@ -7762,7 +7312,7 @@ pub const vortex_array::arrays::VarBin::ID: vortex_array::vtable::ArrayId impl vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::_slice(array: &vortex_array::arrays::VarBinArray, range: core::ops::range::Range) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::_slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult impl core::clone::Clone for vortex_array::arrays::VarBin @@ -7774,35 +7324,35 @@ pub fn vortex_array::arrays::VarBin::fmt(&self, f: &mut core::fmt::Formatter<'_> impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::take(array: &vortex_array::arrays::VarBinArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::filter::FilterKernel for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::filter(array: &vortex_array::arrays::VarBinArray, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::filter(array: &vortex_array::vtable::Array, mask: &vortex_mask::Mask, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::binary::CompareKernel for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::compare(lhs: &vortex_array::arrays::VarBinArray, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::compare(lhs: &vortex_array::vtable::Array, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::cast(array: &vortex_array::arrays::VarBinArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::mask(array: &vortex_array::arrays::VarBinArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::scalar_at(array: &vortex_array::arrays::VarBinArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::VarBin -pub type vortex_array::arrays::VarBin::Array = vortex_array::arrays::VarBinArray +pub type vortex_array::arrays::VarBin::ArrayData = vortex_array::arrays::VarBinData pub type vortex_array::arrays::VarBin::Metadata = vortex_array::ProstMetadata @@ -7810,25 +7360,25 @@ pub type vortex_array::arrays::VarBin::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::VarBin::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: &vortex_array::arrays::VarBinArray, other: &vortex_array::arrays::VarBinArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: &vortex_array::arrays::VarBinArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::VarBin::buffer(array: &vortex_array::arrays::VarBinArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::VarBin::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::VarBin::buffer_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::VarBin::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::VarBin::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBin::child(array: &vortex_array::arrays::VarBinArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBin::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBin::child_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::VarBin::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::VarBin::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBin::dtype(array: &vortex_array::arrays::VarBinArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::VarBin::dtype(array: &vortex_array::arrays::VarBinData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::VarBin::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -7836,13 +7386,13 @@ pub fn vortex_array::arrays::VarBin::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::VarBin::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::VarBin::len(array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBin::len(array: &vortex_array::arrays::VarBinData) -> usize -pub fn vortex_array::arrays::VarBin::metadata(array: &vortex_array::arrays::VarBinArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBin::nbuffers(_array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBin::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::VarBin::nchildren(array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBin::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::VarBin::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -7850,139 +7400,129 @@ pub fn vortex_array::arrays::VarBin::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::VarBin::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::VarBin::stats(array: &vortex_array::arrays::VarBinArray) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::arrays::VarBin::vtable(_array: &Self::Array) -> &Self - -pub fn vortex_array::arrays::VarBin::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> - -pub struct vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBin::stats(array: &vortex_array::arrays::VarBinData) -> &vortex_array::stats::ArrayStats -impl vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBin::vtable(_array: &vortex_array::arrays::VarBinData) -> &Self -pub fn vortex_array::arrays::VarBinArray::bytes(&self) -> &vortex_buffer::ByteBuffer +pub fn vortex_array::arrays::VarBin::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinArray::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer +pub struct vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::bytes_handle(&self) -> &vortex_array::buffer::BufferHandle +impl vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::from_iter, I: core::iter::traits::collect::IntoIterator>>(iter: I, dtype: vortex_array::dtype::DType) -> Self +pub fn vortex_array::arrays::VarBinData::bytes(&self) -> &vortex_buffer::ByteBuffer -pub fn vortex_array::arrays::VarBinArray::from_iter_nonnull, I: core::iter::traits::collect::IntoIterator>(iter: I, dtype: vortex_array::dtype::DType) -> Self +pub fn vortex_array::arrays::VarBinData::bytes_handle(&self) -> &vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::VarBinArray::from_vec>(vec: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self +pub fn vortex_array::arrays::VarBinData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::VarBinArray::into_parts(self) -> (vortex_array::dtype::DType, vortex_array::buffer::BufferHandle, vortex_array::ArrayRef, vortex_array::validity::Validity) +pub fn vortex_array::arrays::VarBinData::from_iter, I: core::iter::traits::collect::IntoIterator>>(iter: I, dtype: vortex_array::dtype::DType) -> Self -pub fn vortex_array::arrays::VarBinArray::new(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinData::from_iter_nonnull, I: core::iter::traits::collect::IntoIterator>(iter: I, dtype: vortex_array::dtype::DType) -> Self -pub fn vortex_array::arrays::VarBinArray::new_from_handle(offset: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinData::from_vec>(vec: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self -pub unsafe fn vortex_array::arrays::VarBinArray::new_unchecked(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinData::is_empty(&self) -> bool -pub unsafe fn vortex_array::arrays::VarBinArray::new_unchecked_from_handle(offsets: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinData::len(&self) -> usize -pub fn vortex_array::arrays::VarBinArray::offset_at(&self, index: usize) -> usize +pub fn vortex_array::arrays::VarBinData::new(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::VarBinArray::offsets(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinData::new_from_handle(offset: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::VarBinArray::sliced_bytes(&self) -> vortex_buffer::ByteBuffer +pub unsafe fn vortex_array::arrays::VarBinData::new_unchecked(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::VarBinArray::try_new(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub unsafe fn vortex_array::arrays::VarBinData::new_unchecked_from_handle(offsets: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::VarBinArray::try_new_from_handle(offsets: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinData::offsets(&self) -> &vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBinArray::validate(offsets: &vortex_array::ArrayRef, bytes: &vortex_array::buffer::BufferHandle, dtype: &vortex_array::dtype::DType, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinData::sliced_bytes(&self) -> vortex_buffer::ByteBuffer -impl vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::try_new(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinData::try_new_from_handle(offsets: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl core::clone::Clone for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::validate(offsets: &vortex_array::ArrayRef, bytes: &vortex_array::buffer::BufferHandle, dtype: &vortex_array::dtype::DType, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinArray::clone(&self) -> vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::validity(&self) -> &vortex_array::validity::Validity -impl core::convert::AsRef for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::arrays::VarBinArray::as_ref(&self) -> &dyn vortex_array::DynArray +impl vortex_array::arrays::VarBinData -impl core::convert::From> for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec<&[u8]>) -> Self +pub fn vortex_array::arrays::VarBinData::into_parts(self) -> (vortex_array::dtype::DType, vortex_array::buffer::BufferHandle, vortex_array::ArrayRef, vortex_array::validity::Validity) -impl core::convert::From> for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::offset_at(&self, index: usize) -> usize -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec<&str>) -> Self +impl core::clone::Clone for vortex_array::arrays::VarBinData -impl core::convert::From> for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::clone(&self) -> vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec) -> Self +impl core::convert::From> for vortex_array::arrays::VarBinData -impl core::convert::From>> for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec<&[u8]>) -> Self -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec>) -> Self +impl core::convert::From> for vortex_array::arrays::VarBinData -impl core::convert::From>> for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec<&str>) -> Self -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec>) -> Self +impl core::convert::From> for vortex_array::arrays::VarBinData -impl core::convert::From>> for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec) -> Self -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec>) -> Self +impl core::convert::From>> for vortex_array::arrays::VarBinData -impl core::convert::From>> for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec>) -> Self -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec>) -> Self +impl core::convert::From>> for vortex_array::arrays::VarBinData -impl core::convert::From>>> for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec>) -> Self -pub fn vortex_array::arrays::VarBinArray::from(value: alloc::vec::Vec>>) -> Self +impl core::convert::From>> for vortex_array::arrays::VarBinData -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec>) -> Self -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::VarBinArray) -> vortex_array::ArrayRef +impl core::convert::From>> for vortex_array::arrays::VarBinData -impl core::fmt::Debug for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec>) -> Self -pub fn vortex_array::arrays::VarBinArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::convert::From>>> for vortex_array::arrays::VarBinData -impl core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::from(value: alloc::vec::Vec>>) -> Self -pub fn vortex_array::arrays::VarBinArray::from_iter>>(iter: T) -> Self +impl core::convert::From for vortex_array::ArrayRef -impl core::iter::traits::collect::FromIterator>> for vortex_array::arrays::VarBinArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::VarBinData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBinArray::from_iter>>>(iter: T) -> Self +impl core::fmt::Debug for vortex_array::arrays::VarBinData -impl core::ops::deref::Deref for vortex_array::arrays::VarBinArray +pub fn vortex_array::arrays::VarBinData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub type vortex_array::arrays::VarBinArray::Target = dyn vortex_array::DynArray +impl core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::VarBinData::from_iter>>(iter: T) -> Self -impl vortex_array::IntoArray for vortex_array::arrays::VarBinArray +impl core::iter::traits::collect::FromIterator>> for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinData::from_iter>>>(iter: T) -> Self -impl vortex_array::accessor::ArrayAccessor<[u8]> for &vortex_array::arrays::VarBinArray - -pub fn &vortex_array::arrays::VarBinArray::with_iterator(&self, f: F) -> R where F: for<'a> core::ops::function::FnOnce(&mut dyn core::iter::traits::iterator::Iterator>) -> R - -impl vortex_array::accessor::ArrayAccessor<[u8]> for vortex_array::arrays::VarBinArray +impl vortex_array::IntoArray for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::with_iterator(&self, f: F) -> R where F: for<'a> core::ops::function::FnOnce(&mut dyn core::iter::traits::iterator::Iterator>) -> R +pub fn vortex_array::arrays::VarBinData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::VarBinArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::VarBinData::validity(&self) -> &vortex_array::validity::Validity -impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinArray +impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::from_iter>>(iter: T) -> Self +pub fn vortex_array::arrays::VarBinData::from_iter>>(iter: T) -> Self -impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinArray +impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::from_iter>>(iter: T) -> Self +pub fn vortex_array::arrays::VarBinData::from_iter>>(iter: T) -> Self pub struct vortex_array::arrays::VarBinView @@ -8000,31 +7540,31 @@ pub fn vortex_array::arrays::VarBinView::fmt(&self, f: &mut core::fmt::Formatter impl vortex_array::arrays::dict::TakeExecute for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::take(array: &vortex_array::arrays::VarBinViewArray, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::take(array: &vortex_array::vtable::Array, indices: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::arrays::slice::SliceReduce for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::slice(array: &Self::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::slice(array: &vortex_array::vtable::Array, range: core::ops::range::Range) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::cast(array: &vortex_array::arrays::VarBinViewArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::mask(array: &vortex_array::arrays::VarBinViewArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::zip::ZipKernel for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::zip(if_true: &vortex_array::arrays::VarBinViewArray, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::zip(if_true: &vortex_array::vtable::Array, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::scalar_at(array: &vortex_array::arrays::VarBinViewArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::VarBinView -pub type vortex_array::arrays::VarBinView::Array = vortex_array::arrays::VarBinViewArray +pub type vortex_array::arrays::VarBinView::ArrayData = vortex_array::arrays::VarBinViewData pub type vortex_array::arrays::VarBinView::Metadata = vortex_array::EmptyMetadata @@ -8032,25 +7572,25 @@ pub type vortex_array::arrays::VarBinView::OperationsVTable = vortex_array::arra pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::VarBinView::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinView::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: &vortex_array::arrays::VarBinViewArray, other: &vortex_array::arrays::VarBinViewArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: &vortex_array::arrays::VarBinViewArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::VarBinView::buffer(array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::VarBinView::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::VarBinView::buffer_name(array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::VarBinView::buffer_name(array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::VarBinView::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinView::child(array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinView::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBinView::child_name(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::VarBinView::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::VarBinView::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinView::dtype(array: &vortex_array::arrays::VarBinViewArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::VarBinView::dtype(array: &vortex_array::arrays::VarBinViewData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::VarBinView::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -8058,13 +7598,13 @@ pub fn vortex_array::arrays::VarBinView::execute_parent(array: &vortex_array::vt pub fn vortex_array::arrays::VarBinView::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::VarBinView::len(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinView::len(array: &vortex_array::arrays::VarBinViewData) -> usize -pub fn vortex_array::arrays::VarBinView::metadata(_array: &vortex_array::arrays::VarBinViewArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinView::nbuffers(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinView::nbuffers(array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::VarBinView::nchildren(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinView::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::VarBinView::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -8072,121 +7612,97 @@ pub fn vortex_array::arrays::VarBinView::reduce_parent(array: &vortex_array::vta pub fn vortex_array::arrays::VarBinView::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::VarBinView::stats(array: &vortex_array::arrays::VarBinViewArray) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::arrays::VarBinView::vtable(_array: &Self::Array) -> &Self - -pub fn vortex_array::arrays::VarBinView::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> - -pub struct vortex_array::arrays::VarBinViewArray - -impl vortex_array::arrays::VarBinViewArray - -pub fn vortex_array::arrays::VarBinViewArray::buffer(&self, idx: usize) -> &vortex_buffer::ByteBuffer - -pub fn vortex_array::arrays::VarBinViewArray::buffers(&self) -> &alloc::sync::Arc<[vortex_array::buffer::BufferHandle]> - -pub fn vortex_array::arrays::VarBinViewArray::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer - -pub fn vortex_array::arrays::VarBinViewArray::from_iter, I: core::iter::traits::collect::IntoIterator>>(iter: I, dtype: vortex_array::dtype::DType) -> Self - -pub fn vortex_array::arrays::VarBinViewArray::from_iter_bin, I: core::iter::traits::collect::IntoIterator>(iter: I) -> Self - -pub fn vortex_array::arrays::VarBinViewArray::from_iter_nullable_bin, I: core::iter::traits::collect::IntoIterator>>(iter: I) -> Self +pub fn vortex_array::arrays::VarBinView::stats(array: &vortex_array::arrays::VarBinViewData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::VarBinViewArray::from_iter_nullable_str, I: core::iter::traits::collect::IntoIterator>>(iter: I) -> Self +pub fn vortex_array::arrays::VarBinView::vtable(_array: &vortex_array::arrays::VarBinViewData) -> &Self -pub fn vortex_array::arrays::VarBinViewArray::from_iter_str, I: core::iter::traits::collect::IntoIterator>(iter: I) -> Self +pub fn vortex_array::arrays::VarBinView::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinViewArray::into_parts(self) -> vortex_array::arrays::varbinview::VarBinViewArrayParts +pub struct vortex_array::arrays::VarBinViewData -pub fn vortex_array::arrays::VarBinViewArray::nbuffers(&self) -> usize +impl vortex_array::arrays::VarBinViewData -pub fn vortex_array::arrays::VarBinViewArray::new(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinViewData::buffer(&self, idx: usize) -> &vortex_buffer::ByteBuffer -pub fn vortex_array::arrays::VarBinViewArray::new_handle(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinViewData::bytes_at(&self, index: usize) -> vortex_buffer::ByteBuffer -pub unsafe fn vortex_array::arrays::VarBinViewArray::new_handle_unchecked(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinViewData::data_buffers(&self) -> &alloc::sync::Arc<[vortex_array::buffer::BufferHandle]> -pub unsafe fn vortex_array::arrays::VarBinViewArray::new_unchecked(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self +pub fn vortex_array::arrays::VarBinViewData::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::arrays::VarBinViewArray::try_new(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinViewData::from_iter, I: core::iter::traits::collect::IntoIterator>>(iter: I, dtype: vortex_array::dtype::DType) -> Self -pub fn vortex_array::arrays::VarBinViewArray::try_new_handle(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinViewData::from_iter_bin, I: core::iter::traits::collect::IntoIterator>(iter: I) -> Self -pub fn vortex_array::arrays::VarBinViewArray::validate(views: &vortex_buffer::buffer::Buffer, buffers: &alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: &vortex_array::dtype::DType, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinViewData::from_iter_nullable_bin, I: core::iter::traits::collect::IntoIterator>>(iter: I) -> Self -pub fn vortex_array::arrays::VarBinViewArray::views(&self) -> &[vortex_array::arrays::varbinview::BinaryView] +pub fn vortex_array::arrays::VarBinViewData::from_iter_nullable_str, I: core::iter::traits::collect::IntoIterator>>(iter: I) -> Self -pub fn vortex_array::arrays::VarBinViewArray::views_handle(&self) -> &vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::VarBinViewData::from_iter_str, I: core::iter::traits::collect::IntoIterator>(iter: I) -> Self -impl vortex_array::arrays::VarBinViewArray +pub fn vortex_array::arrays::VarBinViewData::into_parts(self) -> vortex_array::arrays::varbinview::VarBinViewArrayParts -pub fn vortex_array::arrays::VarBinViewArray::compact_buffers(&self) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinViewData::is_empty(&self) -> bool -pub fn vortex_array::arrays::VarBinViewArray::compact_with_threshold(&self, buffer_utilization_threshold: f64) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinViewData::len(&self) -> usize -impl vortex_array::arrays::VarBinViewArray +pub fn vortex_array::arrays::VarBinViewData::new(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::VarBinViewArray::to_array(&self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinViewData::new_handle(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -impl core::clone::Clone for vortex_array::arrays::VarBinViewArray +pub unsafe fn vortex_array::arrays::VarBinViewData::new_handle_unchecked(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::arrays::VarBinViewArray::clone(&self) -> vortex_array::arrays::VarBinViewArray +pub unsafe fn vortex_array::arrays::VarBinViewData::new_unchecked(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -impl core::convert::AsRef for vortex_array::arrays::VarBinViewArray +pub fn vortex_array::arrays::VarBinViewData::try_new(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinViewArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::arrays::VarBinViewData::try_new_handle(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl core::convert::From for vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinViewData::validate(views: &vortex_buffer::buffer::Buffer, buffers: &alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: &vortex_array::dtype::DType, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::VarBinViewArray) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinViewData::validity(&self) -> &vortex_array::validity::Validity -impl core::fmt::Debug for vortex_array::arrays::VarBinViewArray +pub fn vortex_array::arrays::VarBinViewData::validity_mask(&self) -> vortex_mask::Mask -pub fn vortex_array::arrays::VarBinViewArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::arrays::VarBinViewData::views(&self) -> &[vortex_array::arrays::varbinview::BinaryView] -impl core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinViewArray +pub fn vortex_array::arrays::VarBinViewData::views_handle(&self) -> &vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::VarBinViewArray::from_iter>>(iter: T) -> Self +impl core::clone::Clone for vortex_array::arrays::VarBinViewData -impl core::iter::traits::collect::FromIterator>> for vortex_array::arrays::VarBinViewArray +pub fn vortex_array::arrays::VarBinViewData::clone(&self) -> vortex_array::arrays::VarBinViewData -pub fn vortex_array::arrays::VarBinViewArray::from_iter>>>(iter: T) -> Self +impl core::convert::From for vortex_array::ArrayRef -impl core::ops::deref::Deref for vortex_array::arrays::VarBinViewArray +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::VarBinViewData) -> vortex_array::ArrayRef -pub type vortex_array::arrays::VarBinViewArray::Target = dyn vortex_array::DynArray +impl core::fmt::Debug for vortex_array::arrays::VarBinViewData -pub fn vortex_array::arrays::VarBinViewArray::deref(&self) -> &Self::Target +pub fn vortex_array::arrays::VarBinViewData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl vortex_array::Executable for vortex_array::arrays::VarBinViewArray - -pub fn vortex_array::arrays::VarBinViewArray::execute(array: vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult - -impl vortex_array::IntoArray for vortex_array::arrays::VarBinViewArray +impl core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinViewData -pub fn vortex_array::arrays::VarBinViewArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinViewData::from_iter>>(iter: T) -> Self -impl vortex_array::accessor::ArrayAccessor<[u8]> for &vortex_array::arrays::VarBinViewArray +impl core::iter::traits::collect::FromIterator>> for vortex_array::arrays::VarBinViewData -pub fn &vortex_array::arrays::VarBinViewArray::with_iterator(&self, f: F) -> R where F: for<'a> core::ops::function::FnOnce(&mut dyn core::iter::traits::iterator::Iterator>) -> R +pub fn vortex_array::arrays::VarBinViewData::from_iter>>>(iter: T) -> Self -impl vortex_array::accessor::ArrayAccessor<[u8]> for vortex_array::arrays::VarBinViewArray +impl vortex_array::IntoArray for vortex_array::arrays::VarBinViewData -pub fn vortex_array::arrays::VarBinViewArray::with_iterator core::ops::function::FnOnce(&mut dyn core::iter::traits::iterator::Iterator>) -> R, R>(&self, f: F) -> R +pub fn vortex_array::arrays::VarBinViewData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::VarBinViewArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::VarBinViewData -pub fn vortex_array::arrays::VarBinViewArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::VarBinViewData::validity(&self) -> &vortex_array::validity::Validity -impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinViewArray +impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinViewData -pub fn vortex_array::arrays::VarBinViewArray::from_iter>>(iter: T) -> Self +pub fn vortex_array::arrays::VarBinViewData::from_iter>>(iter: T) -> Self -impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinViewArray +impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::arrays::VarBinViewData -pub fn vortex_array::arrays::VarBinViewArray::from_iter>>(iter: T) -> Self +pub fn vortex_array::arrays::VarBinViewData::from_iter>>(iter: T) -> Self pub struct vortex_array::arrays::Variant @@ -8204,11 +7720,11 @@ pub fn vortex_array::arrays::Variant::fmt(&self, f: &mut core::fmt::Formatter<'_ impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Variant -pub fn vortex_array::arrays::Variant::scalar_at(array: &::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::VTable for vortex_array::arrays::Variant -pub type vortex_array::arrays::Variant::Array = vortex_array::arrays::variant::VariantArray +pub type vortex_array::arrays::Variant::ArrayData = vortex_array::arrays::variant::VariantData pub type vortex_array::arrays::Variant::Metadata = vortex_array::EmptyMetadata @@ -8216,25 +7732,25 @@ pub type vortex_array::arrays::Variant::OperationsVTable = vortex_array::arrays: pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::Variant -pub fn vortex_array::arrays::Variant::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: &Self::Array, other: &Self::Array, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: &Self::Array, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Variant::buffer(_array: &Self::Array, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Variant::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Variant::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Variant::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Variant::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Variant::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Variant::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Variant::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Variant::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Variant::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Variant::dtype(array: &Self::Array) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Variant::dtype(array: &Self::ArrayData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Variant::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -8242,13 +7758,13 @@ pub fn vortex_array::arrays::Variant::execute_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Variant::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Variant::len(array: &Self::Array) -> usize +pub fn vortex_array::arrays::Variant::len(array: &Self::ArrayData) -> usize -pub fn vortex_array::arrays::Variant::metadata(_array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Variant::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Variant::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Variant::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Variant::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Variant::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -8256,53 +7772,87 @@ pub fn vortex_array::arrays::Variant::reduce_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Variant::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Variant::stats(array: &Self::Array) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Variant::stats(array: &Self::ArrayData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Variant::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Variant::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Variant::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Variant -pub fn vortex_array::arrays::Variant::validity(array: &::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult + +pub struct vortex_array::arrays::VariantData + +impl vortex_array::arrays::variant::VariantData + +pub fn vortex_array::arrays::variant::VariantData::child(&self) -> &vortex_array::ArrayRef + +pub fn vortex_array::arrays::variant::VariantData::dtype(&self) -> &vortex_array::dtype::DType + +pub fn vortex_array::arrays::variant::VariantData::is_empty(&self) -> bool + +pub fn vortex_array::arrays::variant::VariantData::len(&self) -> usize + +pub fn vortex_array::arrays::variant::VariantData::new(child: vortex_array::ArrayRef) -> Self + +impl core::clone::Clone for vortex_array::arrays::variant::VariantData -pub struct vortex_array::arrays::VariantArray +pub fn vortex_array::arrays::variant::VariantData::clone(&self) -> vortex_array::arrays::variant::VariantData -impl vortex_array::arrays::variant::VariantArray +impl core::convert::From for vortex_array::ArrayRef -pub fn vortex_array::arrays::variant::VariantArray::child(&self) -> &vortex_array::ArrayRef +pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::variant::VariantData) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::variant::VariantArray::new(child: vortex_array::ArrayRef) -> Self +impl core::fmt::Debug for vortex_array::arrays::variant::VariantData -impl vortex_array::arrays::variant::VariantArray +pub fn vortex_array::arrays::variant::VariantData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -pub fn vortex_array::arrays::variant::VariantArray::to_array(&self) -> vortex_array::ArrayRef +impl vortex_array::IntoArray for vortex_array::arrays::variant::VariantData -impl core::clone::Clone for vortex_array::arrays::variant::VariantArray +pub fn vortex_array::arrays::variant::VariantData::into_array(self) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::variant::VariantArray::clone(&self) -> vortex_array::arrays::variant::VariantArray +pub type vortex_array::arrays::BoolArray = vortex_array::vtable::Array -impl core::convert::AsRef for vortex_array::arrays::variant::VariantArray +pub type vortex_array::arrays::ChunkedArray = vortex_array::vtable::Array -pub fn vortex_array::arrays::variant::VariantArray::as_ref(&self) -> &dyn vortex_array::DynArray +pub type vortex_array::arrays::ConstantArray = vortex_array::vtable::Array -impl core::convert::From for vortex_array::ArrayRef +pub type vortex_array::arrays::DecimalArray = vortex_array::vtable::Array -pub fn vortex_array::ArrayRef::from(value: vortex_array::arrays::variant::VariantArray) -> vortex_array::ArrayRef +pub type vortex_array::arrays::DictArray = vortex_array::vtable::Array -impl core::fmt::Debug for vortex_array::arrays::variant::VariantArray +pub type vortex_array::arrays::ExtensionArray = vortex_array::vtable::Array -pub fn vortex_array::arrays::variant::VariantArray::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub type vortex_array::arrays::FilterArray = vortex_array::vtable::Array -impl core::ops::deref::Deref for vortex_array::arrays::variant::VariantArray +pub type vortex_array::arrays::FixedSizeListArray = vortex_array::vtable::Array -pub type vortex_array::arrays::variant::VariantArray::Target = dyn vortex_array::DynArray +pub type vortex_array::arrays::ListArray = vortex_array::vtable::Array -pub fn vortex_array::arrays::variant::VariantArray::deref(&self) -> &Self::Target +pub type vortex_array::arrays::ListViewArray = vortex_array::vtable::Array -impl vortex_array::IntoArray for vortex_array::arrays::variant::VariantArray +pub type vortex_array::arrays::MaskedArray = vortex_array::vtable::Array -pub fn vortex_array::arrays::variant::VariantArray::into_array(self) -> vortex_array::ArrayRef +pub type vortex_array::arrays::NullArray = vortex_array::vtable::Array + +pub type vortex_array::arrays::PrimitiveArray = vortex_array::vtable::Array + +pub type vortex_array::arrays::ScalarFnArray = vortex_array::vtable::Array + +pub type vortex_array::arrays::SharedArray = vortex_array::vtable::Array + +pub type vortex_array::arrays::SliceArray = vortex_array::vtable::Array + +pub type vortex_array::arrays::StructArray = vortex_array::vtable::Array + +pub type vortex_array::arrays::TemporalArray = vortex_array::arrays::datetime::TemporalData + +pub type vortex_array::arrays::VarBinArray = vortex_array::vtable::Array + +pub type vortex_array::arrays::VarBinViewArray = vortex_array::vtable::Array + +pub type vortex_array::arrays::VariantArray = vortex_array::vtable::Array pub mod vortex_array::arrow @@ -14644,7 +14194,7 @@ pub fn vortex_array::kernel::ParentKernelAdapter::fmt(&self, f: &mut core: impl> vortex_array::kernel::DynParentKernel for vortex_array::kernel::ParentKernelAdapter -pub fn vortex_array::kernel::ParentKernelAdapter::execute_parent(&self, child: &::Array, parent: &vortex_array::ArrayRef, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::kernel::ParentKernelAdapter::execute_parent(&self, child: &vortex_array::vtable::Array, parent: &vortex_array::ArrayRef, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub fn vortex_array::kernel::ParentKernelAdapter::matches(&self, parent: &vortex_array::ArrayRef) -> bool @@ -14652,7 +14202,7 @@ pub struct vortex_array::kernel::ParentKernelSet vortex_array::kernel::ParentKernelSet -pub fn vortex_array::kernel::ParentKernelSet::execute(&self, child: &::Array, parent: &vortex_array::ArrayRef, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::kernel::ParentKernelSet::execute(&self, child: &vortex_array::vtable::Array, parent: &vortex_array::ArrayRef, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub const fn vortex_array::kernel::ParentKernelSet::lift>(kernel: &'static K) -> &'static dyn vortex_array::kernel::DynParentKernel @@ -14660,13 +14210,13 @@ pub const fn vortex_array::kernel::ParentKernelSet::new(kernels: &'static [&' pub trait vortex_array::kernel::DynParentKernel: core::marker::Send + core::marker::Sync -pub fn vortex_array::kernel::DynParentKernel::execute_parent(&self, child: &::Array, parent: &vortex_array::ArrayRef, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::kernel::DynParentKernel::execute_parent(&self, child: &vortex_array::vtable::Array, parent: &vortex_array::ArrayRef, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub fn vortex_array::kernel::DynParentKernel::matches(&self, parent: &vortex_array::ArrayRef) -> bool impl> vortex_array::kernel::DynParentKernel for vortex_array::kernel::ParentKernelAdapter -pub fn vortex_array::kernel::ParentKernelAdapter::execute_parent(&self, child: &::Array, parent: &vortex_array::ArrayRef, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::kernel::ParentKernelAdapter::execute_parent(&self, child: &vortex_array::vtable::Array, parent: &vortex_array::ArrayRef, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub fn vortex_array::kernel::ParentKernelAdapter::matches(&self, parent: &vortex_array::ArrayRef) -> bool @@ -14674,79 +14224,79 @@ pub trait vortex_array::kernel::ExecuteParentKernel::Array, parent: ::Match, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::kernel::ExecuteParentKernel::execute_parent(&self, array: &vortex_array::vtable::Array, parent: ::Match, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::kernel::ExecuteParentKernel for vortex_array::arrays::dict::TakeExecuteAdaptor where V: vortex_array::arrays::dict::TakeExecute pub type vortex_array::arrays::dict::TakeExecuteAdaptor::Parent = vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::TakeExecuteAdaptor::execute_parent(&self, array: &::Array, parent: ::Match, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::TakeExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: ::Match, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::kernel::ExecuteParentKernel for vortex_array::arrays::filter::FilterExecuteAdaptor where V: vortex_array::arrays::filter::FilterKernel pub type vortex_array::arrays::filter::FilterExecuteAdaptor::Parent = vortex_array::arrays::Filter -pub fn vortex_array::arrays::filter::FilterExecuteAdaptor::execute_parent(&self, array: &::Array, parent: ::Match, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::filter::FilterExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: ::Match, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::kernel::ExecuteParentKernel for vortex_array::arrays::slice::SliceExecuteAdaptor where V: vortex_array::arrays::slice::SliceKernel pub type vortex_array::arrays::slice::SliceExecuteAdaptor::Parent = vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::SliceExecuteAdaptor::execute_parent(&self, array: &::Array, parent: ::Match, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::SliceExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: ::Match, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn::fns::between::BetweenExecuteAdaptor where V: vortex_array::scalar_fn::fns::between::BetweenKernel pub type vortex_array::scalar_fn::fns::between::BetweenExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::between::BetweenExecuteAdaptor::execute_parent(&self, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::between::Between>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::between::BetweenExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::between::Between>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn::fns::binary::CompareExecuteAdaptor where V: vortex_array::scalar_fn::fns::binary::CompareKernel pub type vortex_array::scalar_fn::fns::binary::CompareExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::binary::CompareExecuteAdaptor::execute_parent(&self, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::binary::Binary>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::binary::CompareExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::binary::Binary>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn::fns::cast::CastExecuteAdaptor where V: vortex_array::scalar_fn::fns::cast::CastKernel pub type vortex_array::scalar_fn::fns::cast::CastExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::cast::CastExecuteAdaptor::execute_parent(&self, array: &::Array, parent: ::Match, _child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::cast::CastExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: ::Match, _child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn::fns::fill_null::FillNullExecuteAdaptor where V: vortex_array::scalar_fn::fns::fill_null::FillNullKernel pub type vortex_array::scalar_fn::fns::fill_null::FillNullExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::fill_null::FillNullExecuteAdaptor::execute_parent(&self, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::fill_null::FillNull>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::fill_null::FillNullExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::fill_null::FillNull>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn::fns::like::LikeExecuteAdaptor where V: vortex_array::scalar_fn::fns::like::LikeKernel pub type vortex_array::scalar_fn::fns::like::LikeExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::like::LikeExecuteAdaptor::execute_parent(&self, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::like::Like>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::like::LikeExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::like::Like>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn::fns::list_contains::ListContainsElementExecuteAdaptor where V: vortex_array::scalar_fn::fns::list_contains::ListContainsElementKernel pub type vortex_array::scalar_fn::fns::list_contains::ListContainsElementExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementExecuteAdaptor::execute_parent(&self, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::list_contains::ListContains>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::list_contains::ListContains>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn::fns::mask::MaskExecuteAdaptor where V: vortex_array::scalar_fn::fns::mask::MaskKernel pub type vortex_array::scalar_fn::fns::mask::MaskExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::mask::MaskExecuteAdaptor::execute_parent(&self, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::mask::Mask>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::mask::MaskExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::mask::Mask>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn::fns::not::NotExecuteAdaptor where V: vortex_array::scalar_fn::fns::not::NotKernel pub type vortex_array::scalar_fn::fns::not::NotExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::not::NotExecuteAdaptor::execute_parent(&self, array: &::Array, _parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::not::Not>, _child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::not::NotExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, _parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::not::Not>, _child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn::fns::zip::ZipExecuteAdaptor where V: vortex_array::scalar_fn::fns::zip::ZipKernel pub type vortex_array::scalar_fn::fns::zip::ZipExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::zip::ZipExecuteAdaptor::execute_parent(&self, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::zip::Zip>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::zip::ZipExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::zip::Zip>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub mod vortex_array::mask @@ -14792,7 +14342,7 @@ pub fn vortex_array::AnyColumnar::try_match<'a>(array: &'a dyn vortex_array::Dyn impl vortex_array::matcher::Matcher for vortex_array::arrays::scalar_fn::AnyScalarFn -pub type vortex_array::arrays::scalar_fn::AnyScalarFn::Match<'a> = &'a vortex_array::arrays::scalar_fn::ScalarFnArray +pub type vortex_array::arrays::scalar_fn::AnyScalarFn::Match<'a> = &'a vortex_array::vtable::Array pub fn vortex_array::arrays::scalar_fn::AnyScalarFn::matches(array: &dyn vortex_array::DynArray) -> bool @@ -14816,7 +14366,7 @@ pub fn vortex_array::arrays::scalar_fn::ExactScalarFn::try_match(array: &dyn impl vortex_array::matcher::Matcher for V -pub type V::Match<'a> = &'a ::Array +pub type V::Match<'a> = &'a vortex_array::vtable::Array pub fn V::matches(array: &dyn vortex_array::DynArray) -> bool @@ -14844,7 +14394,7 @@ impl::matches(&self, parent: &vortex_array::ArrayRef) -> bool -pub fn vortex_array::optimizer::rules::ParentReduceRuleAdapter::reduce_parent(&self, child: &::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::optimizer::rules::ParentReduceRuleAdapter::reduce_parent(&self, child: &vortex_array::vtable::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> impl> core::fmt::Debug for vortex_array::optimizer::rules::ParentReduceRuleAdapter @@ -14854,7 +14404,7 @@ pub struct vortex_array::optimizer::rules::ParentRuleSet vortex_array::optimizer::rules::ParentRuleSet -pub fn vortex_array::optimizer::rules::ParentRuleSet::evaluate(&self, child: &::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::optimizer::rules::ParentRuleSet::evaluate(&self, child: &vortex_array::vtable::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub const fn vortex_array::optimizer::rules::ParentRuleSet::lift>(rule: &'static R) -> &'static dyn vortex_array::optimizer::rules::DynArrayParentReduceRule @@ -14864,7 +14414,7 @@ pub struct vortex_array::optimizer::rules::ReduceRuleSet vortex_array::optimizer::rules::ReduceRuleSet -pub fn vortex_array::optimizer::rules::ReduceRuleSet::evaluate(&self, array: &::Array) -> vortex_error::VortexResult> +pub fn vortex_array::optimizer::rules::ReduceRuleSet::evaluate(&self, array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> pub const fn vortex_array::optimizer::rules::ReduceRuleSet::new(rules: &'static [&'static dyn vortex_array::optimizer::rules::ArrayReduceRule]) -> Self @@ -14872,7 +14422,7 @@ pub trait vortex_array::optimizer::rules::ArrayParentReduceRule::Array, parent: ::Match, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::optimizer::rules::ArrayParentReduceRule::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: ::Match, child_idx: usize) -> vortex_error::VortexResult> impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_array::arrays::bool::BoolMaskedValidityRule @@ -14884,95 +14434,95 @@ impl vortex_array::optimizer::rules::ArrayParentReduceRule vortex_error::VortexResult> +pub fn vortex_array::arrays::decimal::DecimalMaskedValidityRule::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: &vortex_array::arrays::MaskedArray, _child_idx: 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, array: &vortex_array::arrays::PrimitiveArray, parent: &vortex_array::arrays::MaskedArray, _child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::primitive::PrimitiveMaskedValidityRule::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: &vortex_array::arrays::MaskedArray, _child_idx: 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, array: &::Array, parent: &vortex_array::arrays::dict::DictArray, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::TakeReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: &vortex_array::arrays::dict::DictArray, child_idx: 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, array: &::Array, parent: &vortex_array::arrays::FilterArray, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::filter::FilterReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: &vortex_array::arrays::FilterArray, child_idx: 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, array: &::Array, parent: ::Match, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::slice::SliceReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: ::Match, child_idx: 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, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::between::Between>, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::between::BetweenReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::between::Between>, child_idx: 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, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::cast::Cast>, _child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::cast::CastReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::cast::Cast>, _child_idx: 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, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::fill_null::FillNull>, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::fill_null::FillNullReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::fill_null::FillNull>, child_idx: 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, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::like::Like>, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::like::LikeReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::like::Like>, child_idx: 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, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::list_contains::ListContains>, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::list_contains::ListContains>, child_idx: 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, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::mask::Mask>, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::mask::MaskReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::mask::Mask>, child_idx: 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, array: &::Array, _parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::not::Not>, _child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::not::NotReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, _parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::not::Not>, _child_idx: 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, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::zip::Zip>, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::zip::ZipReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::zip::Zip>, child_idx: 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, array: &::Array) -> vortex_error::VortexResult> +pub fn vortex_array::optimizer::rules::ArrayReduceRule::reduce(&self, array: &vortex_array::vtable::Array) -> 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, parent: &vortex_array::ArrayRef) -> bool -pub fn vortex_array::optimizer::rules::DynArrayParentReduceRule::reduce_parent(&self, array: &::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::optimizer::rules::DynArrayParentReduceRule::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: &vortex_array::ArrayRef, child_idx: 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, parent: &vortex_array::ArrayRef) -> bool -pub fn vortex_array::optimizer::rules::ParentReduceRuleAdapter::reduce_parent(&self, child: &::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::optimizer::rules::ParentReduceRuleAdapter::reduce_parent(&self, child: &vortex_array::vtable::Array, parent: &vortex_array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult> pub trait vortex_array::optimizer::ArrayOptimizer @@ -17116,7 +16666,7 @@ impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn pub type vortex_array::scalar_fn::fns::between::BetweenExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::between::BetweenExecuteAdaptor::execute_parent(&self, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::between::Between>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::between::BetweenExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::between::Between>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub struct vortex_array::scalar_fn::fns::between::BetweenOptions @@ -17166,27 +16716,27 @@ impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_arra 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, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::between::Between>, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::between::BetweenReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::between::Between>, child_idx: usize) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::between::BetweenKernel: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::between::BetweenKernel::between(array: &Self::Array, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::between::BetweenKernel::between(array: &vortex_array::vtable::Array, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::between::BetweenKernel for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::between(arr: &vortex_array::arrays::DecimalArray, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::between(arr: &vortex_array::vtable::Array, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::between::BetweenKernel for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::between(arr: &vortex_array::arrays::PrimitiveArray, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::between(arr: &vortex_array::vtable::Array, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::between::BetweenReduce: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::between::BetweenReduce::between(array: &Self::Array, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::between::BetweenReduce::between(array: &vortex_array::vtable::Array, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::between::BetweenReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::between(array: &vortex_array::arrays::ConstantArray, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::between(array: &vortex_array::vtable::Array, lower: &vortex_array::ArrayRef, upper: &vortex_array::ArrayRef, options: &vortex_array::scalar_fn::fns::between::BetweenOptions) -> vortex_error::VortexResult> pub mod vortex_array::scalar_fn::fns::binary @@ -17248,23 +16798,23 @@ impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn pub type vortex_array::scalar_fn::fns::binary::CompareExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::binary::CompareExecuteAdaptor::execute_parent(&self, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::binary::Binary>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::binary::CompareExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::binary::Binary>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::binary::CompareKernel: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::binary::CompareKernel::compare(lhs: &Self::Array, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::binary::CompareKernel::compare(lhs: &vortex_array::vtable::Array, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::binary::CompareKernel for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::compare(lhs: &vortex_array::arrays::ExtensionArray, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::compare(lhs: &vortex_array::vtable::Array, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::binary::CompareKernel for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::compare(lhs: &vortex_array::arrays::VarBinArray, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::compare(lhs: &vortex_array::vtable::Array, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::binary::CompareKernel for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::compare(lhs: &vortex_array::arrays::dict::DictArray, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::compare(lhs: &vortex_array::vtable::Array, rhs: &vortex_array::ArrayRef, operator: vortex_array::scalar_fn::fns::operators::CompareOperator, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub fn vortex_array::scalar_fn::fns::binary::and_kleene(lhs: &vortex_array::ArrayRef, rhs: &vortex_array::ArrayRef) -> vortex_error::VortexResult @@ -17416,7 +16966,7 @@ impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn pub type vortex_array::scalar_fn::fns::cast::CastExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::cast::CastExecuteAdaptor::execute_parent(&self, array: &::Array, parent: ::Match, _child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::cast::CastExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: ::Match, _child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub struct vortex_array::scalar_fn::fns::cast::CastReduceAdaptor(pub V) @@ -17432,27 +16982,27 @@ impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_arra 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, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::cast::Cast>, _child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::cast::CastReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::cast::Cast>, _child_idx: usize) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::cast::CastKernel: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::cast::CastKernel::cast(array: &Self::Array, dtype: &vortex_array::dtype::DType, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::cast::CastKernel::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastKernel for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::cast(array: &vortex_array::arrays::DecimalArray, dtype: &vortex_array::dtype::DType, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastKernel for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::cast(array: &vortex_array::arrays::PrimitiveArray, dtype: &vortex_array::dtype::DType, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastKernel for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::cast(array: &vortex_array::arrays::StructArray, dtype: &vortex_array::dtype::DType, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::cast::CastReduce: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::cast::CastReduce::cast(array: &Self::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::cast::CastReduce::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::Bool @@ -17460,43 +17010,43 @@ pub fn vortex_array::arrays::Bool::cast(array: &vortex_array::arrays::BoolArray, impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::cast(array: &vortex_array::arrays::ChunkedArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::cast(array: &vortex_array::arrays::ConstantArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::cast(array: &vortex_array::arrays::ExtensionArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::cast(array: &vortex_array::arrays::FixedSizeListArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::List -pub fn vortex_array::arrays::List::cast(array: &vortex_array::arrays::ListArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::cast(array: &vortex_array::arrays::ListViewArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::cast(array: &vortex_array::arrays::VarBinArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::cast(array: &vortex_array::arrays::VarBinViewArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::cast(array: &vortex_array::arrays::dict::DictArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::cast::CastReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::cast(array: &vortex_array::arrays::null::NullArray, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::cast(array: &vortex_array::vtable::Array, dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult> pub mod vortex_array::scalar_fn::fns::dynamic @@ -17640,7 +17190,7 @@ impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn pub type vortex_array::scalar_fn::fns::fill_null::FillNullExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::fill_null::FillNullExecuteAdaptor::execute_parent(&self, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::fill_null::FillNull>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::fill_null::FillNullExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::fill_null::FillNull>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub struct vortex_array::scalar_fn::fns::fill_null::FillNullReduceAdaptor(pub V) @@ -17656,11 +17206,11 @@ impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_arra 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, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::fill_null::FillNull>, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::fill_null::FillNullReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::fill_null::FillNull>, child_idx: usize) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::fill_null::FillNullKernel: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::fill_null::FillNullKernel::fill_null(array: &Self::Array, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::fill_null::FillNullKernel::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullKernel for vortex_array::arrays::Bool @@ -17668,27 +17218,27 @@ pub fn vortex_array::arrays::Bool::fill_null(array: &vortex_array::arrays::BoolA impl vortex_array::scalar_fn::fns::fill_null::FillNullKernel for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::fill_null(array: &vortex_array::arrays::DecimalArray, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullKernel for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::fill_null(array: &vortex_array::arrays::PrimitiveArray, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullKernel for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::fill_null(array: &vortex_array::arrays::dict::DictArray, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::fill_null::FillNullReduce: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::fill_null::FillNullReduce::fill_null(array: &Self::Array, fill_value: &vortex_array::scalar::Scalar) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::fill_null::FillNullReduce::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullReduce for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::fill_null(array: &vortex_array::arrays::ChunkedArray, fill_value: &vortex_array::scalar::Scalar) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::fill_null::FillNullReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::fill_null(array: &vortex_array::arrays::ConstantArray, fill_value: &vortex_array::scalar::Scalar) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::fill_null(array: &vortex_array::vtable::Array, fill_value: &vortex_array::scalar::Scalar) -> vortex_error::VortexResult> pub mod vortex_array::scalar_fn::fns::get_item @@ -17842,7 +17392,7 @@ impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn pub type vortex_array::scalar_fn::fns::like::LikeExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::like::LikeExecuteAdaptor::execute_parent(&self, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::like::Like>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::like::LikeExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::like::Like>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub struct vortex_array::scalar_fn::fns::like::LikeOptions @@ -17894,19 +17444,19 @@ impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_arra 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, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::like::Like>, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::like::LikeReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::like::Like>, child_idx: usize) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::like::LikeKernel: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::like::LikeKernel::like(array: &Self::Array, pattern: &vortex_array::ArrayRef, options: vortex_array::scalar_fn::fns::like::LikeOptions, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::like::LikeKernel::like(array: &vortex_array::vtable::Array, pattern: &vortex_array::ArrayRef, options: vortex_array::scalar_fn::fns::like::LikeOptions, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::like::LikeReduce: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::like::LikeReduce::like(array: &Self::Array, pattern: &vortex_array::ArrayRef, options: vortex_array::scalar_fn::fns::like::LikeOptions) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::like::LikeReduce::like(array: &vortex_array::vtable::Array, pattern: &vortex_array::ArrayRef, options: vortex_array::scalar_fn::fns::like::LikeOptions) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::like::LikeReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::like(array: &vortex_array::arrays::dict::DictArray, pattern: &vortex_array::ArrayRef, options: vortex_array::scalar_fn::fns::like::LikeOptions) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::like(array: &vortex_array::vtable::Array, pattern: &vortex_array::ArrayRef, options: vortex_array::scalar_fn::fns::like::LikeOptions) -> vortex_error::VortexResult> pub mod vortex_array::scalar_fn::fns::list_contains @@ -17968,7 +17518,7 @@ impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn pub type vortex_array::scalar_fn::fns::list_contains::ListContainsElementExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementExecuteAdaptor::execute_parent(&self, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::list_contains::ListContains>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::list_contains::ListContains>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub struct vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduceAdaptor(pub V) @@ -17984,15 +17534,15 @@ impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_arra 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, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::list_contains::ListContains>, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::list_contains::ListContains>, child_idx: usize) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::list_contains::ListContainsElementKernel: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementKernel::list_contains(list: &vortex_array::ArrayRef, element: &Self::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementKernel::list_contains(list: &vortex_array::ArrayRef, element: &vortex_array::vtable::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduce: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduce::list_contains(list: &vortex_array::ArrayRef, element: &Self::Array) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::list_contains::ListContainsElementReduce::list_contains(list: &vortex_array::ArrayRef, element: &vortex_array::vtable::Array) -> vortex_error::VortexResult> pub mod vortex_array::scalar_fn::fns::literal @@ -18100,7 +17650,7 @@ impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn pub type vortex_array::scalar_fn::fns::mask::MaskExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::mask::MaskExecuteAdaptor::execute_parent(&self, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::mask::Mask>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::mask::MaskExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::mask::Mask>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub struct vortex_array::scalar_fn::fns::mask::MaskReduceAdaptor(pub V) @@ -18116,19 +17666,19 @@ impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_arra 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, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::mask::Mask>, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::mask::MaskReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::mask::Mask>, child_idx: usize) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::mask::MaskKernel: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::mask::MaskKernel::mask(array: &Self::Array, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::mask::MaskKernel::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskKernel for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::mask(array: &vortex_array::arrays::ChunkedArray, mask: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::mask::MaskReduce: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::mask::MaskReduce::mask(array: &Self::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::mask::MaskReduce::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Bool @@ -18136,51 +17686,51 @@ pub fn vortex_array::arrays::Bool::mask(array: &vortex_array::arrays::BoolArray, impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::mask(array: &vortex_array::arrays::DecimalArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Decimal::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::mask(array: &vortex_array::arrays::ExtensionArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Extension::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::mask(array: &vortex_array::arrays::FixedSizeListArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::FixedSizeList::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::List -pub fn vortex_array::arrays::List::mask(array: &vortex_array::arrays::ListArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::List::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::mask(array: &vortex_array::arrays::ListViewArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::ListView::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::mask(array: &vortex_array::arrays::MaskedArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Masked::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::mask(array: &vortex_array::arrays::PrimitiveArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Primitive::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::mask(array: &vortex_array::arrays::StructArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::mask(array: &vortex_array::arrays::VarBinArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBin::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::mask(array: &vortex_array::arrays::VarBinViewArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::mask(array: &vortex_array::arrays::dict::DictArray, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::dict::Dict::mask(array: &vortex_array::vtable::Array, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::mask::MaskReduce for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::mask(array: &vortex_array::arrays::null::NullArray, _mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::null::Null::mask(array: &vortex_array::vtable::Array, _mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> pub mod vortex_array::scalar_fn::fns::merge @@ -18324,7 +17874,7 @@ impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn pub type vortex_array::scalar_fn::fns::not::NotExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::not::NotExecuteAdaptor::execute_parent(&self, array: &::Array, _parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::not::Not>, _child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::not::NotExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, _parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::not::Not>, _child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub struct vortex_array::scalar_fn::fns::not::NotReduceAdaptor(pub V) @@ -18340,19 +17890,19 @@ impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_arra 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, array: &::Array, _parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::not::Not>, _child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::not::NotReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, _parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::not::Not>, _child_idx: usize) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::not::NotKernel: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::not::NotKernel::invert(array: &Self::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::not::NotKernel::invert(array: &vortex_array::vtable::Array, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::not::NotReduce: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::not::NotReduce::invert(array: &Self::Array) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::not::NotReduce::invert(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::not::NotReduce for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::invert(array: &vortex_array::arrays::ConstantArray) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Constant::invert(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> pub mod vortex_array::scalar_fn::fns::operators @@ -18788,7 +18338,7 @@ impl vortex_array::kernel::ExecuteParentKernel for vortex_array::scalar_fn pub type vortex_array::scalar_fn::fns::zip::ZipExecuteAdaptor::Parent = vortex_array::arrays::scalar_fn::ExactScalarFn -pub fn vortex_array::scalar_fn::fns::zip::ZipExecuteAdaptor::execute_parent(&self, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::zip::Zip>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::zip::ZipExecuteAdaptor::execute_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::zip::Zip>, child_idx: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub struct vortex_array::scalar_fn::fns::zip::ZipReduceAdaptor(pub V) @@ -18804,27 +18354,27 @@ impl vortex_array::optimizer::rules::ArrayParentReduceRule for vortex_arra 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, array: &::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::zip::Zip>, child_idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::zip::ZipReduceAdaptor::reduce_parent(&self, array: &vortex_array::vtable::Array, parent: vortex_array::arrays::scalar_fn::ScalarFnArrayView<'_, vortex_array::scalar_fn::fns::zip::Zip>, child_idx: usize) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::zip::ZipKernel: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::zip::ZipKernel::zip(array: &Self::Array, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::zip::ZipKernel::zip(array: &vortex_array::vtable::Array, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::zip::ZipKernel for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::zip(if_true: &vortex_array::arrays::ChunkedArray, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Chunked::zip(if_true: &vortex_array::vtable::Array, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::zip::ZipKernel for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::zip(if_true: &vortex_array::arrays::StructArray, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::Struct::zip(if_true: &vortex_array::vtable::Array, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> impl vortex_array::scalar_fn::fns::zip::ZipKernel for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::zip(if_true: &vortex_array::arrays::VarBinViewArray, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> +pub fn vortex_array::arrays::VarBinView::zip(if_true: &vortex_array::vtable::Array, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult> pub trait vortex_array::scalar_fn::fns::zip::ZipReduce: vortex_array::vtable::VTable -pub fn vortex_array::scalar_fn::fns::zip::ZipReduce::zip(array: &Self::Array, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> +pub fn vortex_array::scalar_fn::fns::zip::ZipReduce::zip(array: &vortex_array::vtable::Array, if_false: &vortex_array::ArrayRef, mask: &vortex_array::ArrayRef) -> vortex_error::VortexResult> pub mod vortex_array::scalar_fn::session @@ -19080,42 +18630,6 @@ pub fn vortex_array::ArrayRef::node_dtype(&self) -> vortex_error::VortexResult core::option::Option<&vortex_array::scalar_fn::ScalarFnRef> -impl vortex_array::scalar_fn::ReduceNode for vortex_array::arrays::scalar_fn::ScalarFnArray - -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::as_any(&self) -> &dyn core::any::Any - -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::child(&self, idx: usize) -> vortex_array::scalar_fn::ReduceNodeRef - -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::child_count(&self) -> usize - -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::node_dtype(&self) -> vortex_error::VortexResult - -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::scalar_fn(&self) -> core::option::Option<&vortex_array::scalar_fn::ScalarFnRef> - -impl vortex_array::scalar_fn::ReduceNode for vortex_array::ArrayAdapter - -pub fn vortex_array::ArrayAdapter::as_any(&self) -> &dyn core::any::Any - -pub fn vortex_array::ArrayAdapter::child(&self, idx: usize) -> vortex_array::scalar_fn::ReduceNodeRef - -pub fn vortex_array::ArrayAdapter::child_count(&self) -> usize - -pub fn vortex_array::ArrayAdapter::node_dtype(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::scalar_fn(&self) -> core::option::Option<&vortex_array::scalar_fn::ScalarFnRef> - -impl vortex_array::scalar_fn::ReduceNode for vortex_array::vtable::Array - -pub fn vortex_array::vtable::Array::as_any(&self) -> &dyn core::any::Any - -pub fn vortex_array::vtable::Array::child(&self, idx: usize) -> vortex_array::scalar_fn::ReduceNodeRef - -pub fn vortex_array::vtable::Array::child_count(&self) -> usize - -pub fn vortex_array::vtable::Array::node_dtype(&self) -> vortex_error::VortexResult - -pub fn vortex_array::vtable::Array::scalar_fn(&self) -> core::option::Option<&vortex_array::scalar_fn::ScalarFnRef> - pub trait vortex_array::scalar_fn::ScalarFnPlugin: 'static + core::marker::Send + core::marker::Sync pub fn vortex_array::scalar_fn::ScalarFnPlugin::deserialize(&self, metadata: &[u8], session: &vortex_session::VortexSession) -> vortex_error::VortexResult @@ -20378,261 +19892,627 @@ pub fn vortex_array::stats::TypedStatsSetRef<'_, '_>::len(&self) -> usize pub const vortex_array::stats::PRUNING_STATS: &[vortex_array::expr::stats::Stat] -pub fn vortex_array::stats::as_stat_bitset_bytes(stats: &[vortex_array::expr::stats::Stat]) -> alloc::vec::Vec +pub fn vortex_array::stats::as_stat_bitset_bytes(stats: &[vortex_array::expr::stats::Stat]) -> alloc::vec::Vec + +pub fn vortex_array::stats::stats_from_bitset_bytes(bytes: &[u8]) -> alloc::vec::Vec + +pub mod vortex_array::stream + +pub struct vortex_array::stream::ArrayStreamAdapter + +impl vortex_array::stream::ArrayStreamAdapter where S: futures_core::stream::Stream> + +pub fn vortex_array::stream::ArrayStreamAdapter::new(dtype: vortex_array::dtype::DType, inner: S) -> Self + +impl<'__pin, S> core::marker::Unpin for vortex_array::stream::ArrayStreamAdapter where pin_project_lite::__private::PinnedFieldsOf<__Origin<'__pin, S>>: core::marker::Unpin + +impl futures_core::stream::Stream for vortex_array::stream::ArrayStreamAdapter where S: futures_core::stream::Stream> + +pub type vortex_array::stream::ArrayStreamAdapter::Item = core::result::Result, vortex_error::VortexError> + +pub fn vortex_array::stream::ArrayStreamAdapter::poll_next(self: core::pin::Pin<&mut Self>, cx: &mut core::task::wake::Context<'_>) -> core::task::poll::Poll> + +pub fn vortex_array::stream::ArrayStreamAdapter::size_hint(&self) -> (usize, core::option::Option) + +impl vortex_array::stream::ArrayStream for vortex_array::stream::ArrayStreamAdapter where S: futures_core::stream::Stream> + +pub fn vortex_array::stream::ArrayStreamAdapter::dtype(&self) -> &vortex_array::dtype::DType + +pub trait vortex_array::stream::ArrayStream: futures_core::stream::Stream> + +pub fn vortex_array::stream::ArrayStream::dtype(&self) -> &vortex_array::dtype::DType + +impl vortex_array::stream::ArrayStream for vortex_array::stream::SendableArrayStream + +pub fn vortex_array::stream::SendableArrayStream::dtype(&self) -> &vortex_array::dtype::DType + +impl vortex_array::stream::ArrayStream for vortex_array::stream::ArrayStreamAdapter where S: futures_core::stream::Stream> + +pub fn vortex_array::stream::ArrayStreamAdapter::dtype(&self) -> &vortex_array::dtype::DType + +pub trait vortex_array::stream::ArrayStreamExt: vortex_array::stream::ArrayStream + +pub fn vortex_array::stream::ArrayStreamExt::boxed(self) -> vortex_array::stream::SendableArrayStream where Self: core::marker::Sized + core::marker::Send + 'static + +pub fn vortex_array::stream::ArrayStreamExt::read_all(self) -> impl core::future::future::Future> where Self: core::marker::Sized + +impl vortex_array::stream::ArrayStreamExt for S + +pub fn S::boxed(self) -> vortex_array::stream::SendableArrayStream where Self: core::marker::Sized + core::marker::Send + 'static + +pub fn S::read_all(self) -> impl core::future::future::Future> where Self: core::marker::Sized + +pub type vortex_array::stream::SendableArrayStream = core::pin::Pin> + +pub mod vortex_array::validity + +pub enum vortex_array::validity::Validity + +pub vortex_array::validity::Validity::AllInvalid + +pub vortex_array::validity::Validity::AllValid + +pub vortex_array::validity::Validity::Array(vortex_array::ArrayRef) + +pub vortex_array::validity::Validity::NonNullable + +impl vortex_array::validity::Validity + +pub const vortex_array::validity::Validity::DTYPE: vortex_array::dtype::DType + +pub fn vortex_array::validity::Validity::and(self, rhs: vortex_array::validity::Validity) -> vortex_error::VortexResult + +pub fn vortex_array::validity::Validity::as_array(&self) -> core::option::Option<&vortex_array::ArrayRef> + +pub fn vortex_array::validity::Validity::cast_nullability(self, nullability: vortex_array::dtype::Nullability, len: usize) -> vortex_error::VortexResult + +pub fn vortex_array::validity::Validity::copy_from_array(array: &vortex_array::ArrayRef) -> vortex_error::VortexResult + +pub fn vortex_array::validity::Validity::execute_mask(&self, length: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult + +pub fn vortex_array::validity::Validity::filter(&self, mask: &vortex_mask::Mask) -> vortex_error::VortexResult + +pub fn vortex_array::validity::Validity::into_array(self) -> core::option::Option + +pub fn vortex_array::validity::Validity::into_non_nullable(self, len: usize) -> core::option::Option + +pub fn vortex_array::validity::Validity::into_nullable(self) -> vortex_array::validity::Validity + +pub fn vortex_array::validity::Validity::is_null(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::validity::Validity::is_valid(&self, index: usize) -> vortex_error::VortexResult + +pub fn vortex_array::validity::Validity::mask_eq(&self, other: &vortex_array::validity::Validity, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult + +pub fn vortex_array::validity::Validity::maybe_len(&self) -> core::option::Option + +pub fn vortex_array::validity::Validity::not(&self) -> vortex_error::VortexResult + +pub fn vortex_array::validity::Validity::nullability(&self) -> vortex_array::dtype::Nullability + +pub fn vortex_array::validity::Validity::patch(self, len: usize, indices_offset: usize, indices: &vortex_array::ArrayRef, patches: &vortex_array::validity::Validity, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult + +pub fn vortex_array::validity::Validity::slice(&self, range: core::ops::range::Range) -> vortex_error::VortexResult + +pub fn vortex_array::validity::Validity::take(&self, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult + +pub fn vortex_array::validity::Validity::to_array(&self, len: usize) -> vortex_array::ArrayRef + +pub fn vortex_array::validity::Validity::to_mask(&self, length: usize) -> vortex_mask::Mask + +pub fn vortex_array::validity::Validity::uncompressed_size(&self) -> usize + +pub fn vortex_array::validity::Validity::union_nullability(self, nullability: vortex_array::dtype::Nullability) -> Self + +impl vortex_array::validity::Validity + +pub fn vortex_array::validity::Validity::execute(self, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult + +impl vortex_array::validity::Validity + +pub fn vortex_array::validity::Validity::from_bit_buffer(buffer: vortex_buffer::bit::buf::BitBuffer, nullability: vortex_array::dtype::Nullability) -> Self + +pub fn vortex_array::validity::Validity::from_mask(mask: vortex_mask::Mask, nullability: vortex_array::dtype::Nullability) -> Self + +impl core::clone::Clone for vortex_array::validity::Validity + +pub fn vortex_array::validity::Validity::clone(&self) -> vortex_array::validity::Validity + +impl core::convert::From<&vortex_array::dtype::Nullability> for vortex_array::validity::Validity + +pub fn vortex_array::validity::Validity::from(value: &vortex_array::dtype::Nullability) -> Self + +impl core::convert::From for vortex_array::validity::Validity + +pub fn vortex_array::validity::Validity::from(value: vortex_array::dtype::Nullability) -> Self + +impl core::convert::From for vortex_array::validity::Validity + +pub fn vortex_array::validity::Validity::from(value: vortex_buffer::bit::buf::BitBuffer) -> Self + +impl core::fmt::Debug for vortex_array::validity::Validity + +pub fn vortex_array::validity::Validity::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result + +impl core::iter::traits::collect::FromIterator for vortex_array::validity::Validity + +pub fn vortex_array::validity::Validity::from_iter>(iter: T) -> Self + +impl core::iter::traits::collect::FromIterator for vortex_array::validity::Validity + +pub fn vortex_array::validity::Validity::from_iter>(iter: T) -> Self + +impl vortex_array::ArrayEq for vortex_array::validity::Validity + +pub fn vortex_array::validity::Validity::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool + +impl vortex_array::ArrayHash for vortex_array::validity::Validity + +pub fn vortex_array::validity::Validity::array_hash(&self, state: &mut H, precision: vortex_array::Precision) + +pub mod vortex_array::variants + +pub struct vortex_array::variants::BinaryTyped<'a>(_) + +pub struct vortex_array::variants::BoolTyped<'a>(_) + +impl vortex_array::variants::BoolTyped<'_> + +pub fn vortex_array::variants::BoolTyped<'_>::true_count(&self) -> vortex_error::VortexResult + +pub struct vortex_array::variants::DecimalTyped<'a>(_) + +pub struct vortex_array::variants::ExtensionTyped<'a>(_) + +impl vortex_array::variants::ExtensionTyped<'_> + +pub fn vortex_array::variants::ExtensionTyped<'_>::ext_dtype(&self) -> &vortex_array::dtype::extension::ExtDTypeRef + +pub struct vortex_array::variants::ListTyped<'a>(_) + +pub struct vortex_array::variants::NullTyped<'a>(_) + +pub struct vortex_array::variants::PrimitiveTyped<'a>(_) + +impl vortex_array::variants::PrimitiveTyped<'_> + +pub fn vortex_array::variants::PrimitiveTyped<'_>::ptype(&self) -> vortex_array::dtype::PType + +pub fn vortex_array::variants::PrimitiveTyped<'_>::value(&self, idx: usize) -> vortex_error::VortexResult> + +pub fn vortex_array::variants::PrimitiveTyped<'_>::value_unchecked(&self, idx: usize) -> vortex_error::VortexResult + +impl vortex_array::search_sorted::IndexOrd> for vortex_array::variants::PrimitiveTyped<'_> + +pub fn vortex_array::variants::PrimitiveTyped<'_>::index_cmp(&self, idx: usize, elem: &core::option::Option) -> vortex_error::VortexResult> + +pub fn vortex_array::variants::PrimitiveTyped<'_>::index_ge(&self, idx: usize, elem: &V) -> vortex_error::VortexResult + +pub fn vortex_array::variants::PrimitiveTyped<'_>::index_gt(&self, idx: usize, elem: &V) -> vortex_error::VortexResult + +pub fn vortex_array::variants::PrimitiveTyped<'_>::index_le(&self, idx: usize, elem: &V) -> vortex_error::VortexResult + +pub fn vortex_array::variants::PrimitiveTyped<'_>::index_len(&self) -> usize + +pub fn vortex_array::variants::PrimitiveTyped<'_>::index_lt(&self, idx: usize, elem: &V) -> vortex_error::VortexResult + +impl vortex_array::search_sorted::IndexOrd for vortex_array::variants::PrimitiveTyped<'_> + +pub fn vortex_array::variants::PrimitiveTyped<'_>::index_cmp(&self, idx: usize, elem: &vortex_array::scalar::PValue) -> vortex_error::VortexResult> + +pub fn vortex_array::variants::PrimitiveTyped<'_>::index_ge(&self, idx: usize, elem: &V) -> vortex_error::VortexResult + +pub fn vortex_array::variants::PrimitiveTyped<'_>::index_gt(&self, idx: usize, elem: &V) -> vortex_error::VortexResult + +pub fn vortex_array::variants::PrimitiveTyped<'_>::index_le(&self, idx: usize, elem: &V) -> vortex_error::VortexResult + +pub fn vortex_array::variants::PrimitiveTyped<'_>::index_len(&self) -> usize + +pub fn vortex_array::variants::PrimitiveTyped<'_>::index_lt(&self, idx: usize, elem: &V) -> vortex_error::VortexResult + +pub struct vortex_array::variants::StructTyped<'a>(_) + +impl vortex_array::variants::StructTyped<'_> + +pub fn vortex_array::variants::StructTyped<'_>::dtypes(&self) -> alloc::vec::Vec + +pub fn vortex_array::variants::StructTyped<'_>::names(&self) -> &vortex_array::dtype::FieldNames + +pub fn vortex_array::variants::StructTyped<'_>::nfields(&self) -> usize + +pub struct vortex_array::variants::Utf8Typed<'a>(_) + +pub mod vortex_array::vtable + +pub struct vortex_array::vtable::Array + +impl vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::from_indices>(length: usize, indices: I, validity: vortex_array::validity::Validity) -> Self + +pub fn vortex_array::vtable::Array::into_bit_buffer(self) -> vortex_buffer::bit::buf::BitBuffer + +pub fn vortex_array::vtable::Array::into_parts(self) -> vortex_array::arrays::bool::BoolArrayParts + +pub fn vortex_array::vtable::Array::new(bits: vortex_buffer::bit::buf::BitBuffer, validity: vortex_array::validity::Validity) -> Self + +pub fn vortex_array::vtable::Array::new_handle(handle: vortex_array::buffer::BufferHandle, offset: usize, len: usize, validity: vortex_array::validity::Validity) -> Self + +pub unsafe fn vortex_array::vtable::Array::new_unchecked(bits: vortex_buffer::bit::buf::BitBuffer, validity: vortex_array::validity::Validity) -> Self + +pub fn vortex_array::vtable::Array::try_new(bits: vortex_buffer::bit::buf::BitBuffer, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult + +pub fn vortex_array::vtable::Array::try_new_from_handle(bits: vortex_array::buffer::BufferHandle, offset: usize, len: usize, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult + +pub fn vortex_array::vtable::Array::validate(bits: &vortex_buffer::bit::buf::BitBuffer, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> + +impl vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::patch(self, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult + +impl vortex_array::vtable::Array + +pub unsafe fn vortex_array::vtable::Array::new_unchecked(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self + +pub fn vortex_array::vtable::Array::try_new(chunks: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> vortex_error::VortexResult + +impl vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::new(scalar: S, len: usize) -> Self where S: core::convert::Into + +impl vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::from_iter>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self + +pub fn vortex_array::vtable::Array::from_option_iter>>(iter: I, decimal_dtype: vortex_array::dtype::DecimalDType) -> Self + +pub fn vortex_array::vtable::Array::new(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self + +pub fn vortex_array::vtable::Array::new_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self + +pub unsafe fn vortex_array::vtable::Array::new_unchecked(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self + +pub unsafe fn vortex_array::vtable::Array::new_unchecked_handle(values: vortex_array::buffer::BufferHandle, values_type: vortex_array::dtype::DecimalType, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> Self + +pub fn vortex_array::vtable::Array::try_new(buffer: vortex_buffer::buffer::Buffer, decimal_dtype: vortex_array::dtype::DecimalDType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult + +impl vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> Self + +pub fn vortex_array::vtable::Array::try_new(ext_dtype: vortex_array::dtype::extension::ExtDTypeRef, storage_array: vortex_array::ArrayRef) -> vortex_error::VortexResult + +impl vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::new(array: vortex_array::ArrayRef, mask: vortex_mask::Mask) -> Self + +pub fn vortex_array::vtable::Array::try_new(array: vortex_array::ArrayRef, mask: vortex_mask::Mask) -> vortex_error::VortexResult + +impl vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self + +pub unsafe fn vortex_array::vtable::Array::new_unchecked(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> Self + +pub fn vortex_array::vtable::Array::try_new(elements: vortex_array::ArrayRef, list_size: u32, validity: vortex_array::validity::Validity, len: usize) -> vortex_error::VortexResult + +impl vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self + +pub unsafe fn vortex_array::vtable::Array::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self + +pub fn vortex_array::vtable::Array::try_new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult + +impl vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self + +pub unsafe fn vortex_array::vtable::Array::new_unchecked(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> Self + +pub fn vortex_array::vtable::Array::try_new(elements: vortex_array::ArrayRef, offsets: vortex_array::ArrayRef, sizes: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult + +pub unsafe fn vortex_array::vtable::Array::with_zero_copy_to_list(self, is_zctl: bool) -> Self + +impl vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::rebuild(&self, mode: vortex_array::arrays::listview::ListViewRebuildMode) -> vortex_error::VortexResult + +impl vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::try_new(child: vortex_array::ArrayRef, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult + +impl vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::as_slice(&self) -> &[T] + +pub fn vortex_array::vtable::Array::narrow(&self) -> vortex_error::VortexResult + +pub fn vortex_array::vtable::Array::reinterpret_cast(&self, ptype: vortex_array::dtype::PType) -> Self + +impl vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::empty(nullability: vortex_array::dtype::Nullability) -> Self + +pub fn vortex_array::vtable::Array::from_buffer_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self + +pub fn vortex_array::vtable::Array::from_byte_buffer(buffer: vortex_buffer::ByteBuffer, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self + +pub fn vortex_array::vtable::Array::from_values_byte_buffer(valid_elems_buffer: vortex_buffer::ByteBuffer, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity, n_rows: usize) -> Self + +pub fn vortex_array::vtable::Array::new(buffer: impl core::convert::Into>, validity: vortex_array::validity::Validity) -> Self + +pub unsafe fn vortex_array::vtable::Array::new_unchecked(buffer: vortex_buffer::buffer::Buffer, validity: vortex_array::validity::Validity) -> Self + +pub unsafe fn vortex_array::vtable::Array::new_unchecked_from_handle(handle: vortex_array::buffer::BufferHandle, ptype: vortex_array::dtype::PType, validity: vortex_array::validity::Validity) -> Self + +pub fn vortex_array::vtable::Array::try_new(buffer: vortex_buffer::buffer::Buffer, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult + +pub fn vortex_array::vtable::Array::validate(buffer: &vortex_buffer::buffer::Buffer, validity: &vortex_array::validity::Validity) -> vortex_error::VortexResult<()> + +impl vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::from_option_iter>>(iter: I) -> Self + +pub fn vortex_array::vtable::Array::into_buffer(self) -> vortex_buffer::buffer::Buffer + +pub fn vortex_array::vtable::Array::into_buffer_mut(self) -> vortex_buffer::buffer_mut::BufferMut + +pub fn vortex_array::vtable::Array::to_buffer(&self) -> vortex_buffer::buffer::Buffer -pub fn vortex_array::stats::stats_from_bitset_bytes(bytes: &[u8]) -> alloc::vec::Vec +pub fn vortex_array::vtable::Array::try_into_buffer_mut(self) -> core::result::Result, vortex_buffer::buffer::Buffer> -pub mod vortex_array::stream +impl vortex_array::vtable::Array -pub struct vortex_array::stream::ArrayStreamAdapter +pub fn vortex_array::vtable::Array::patch(self, patches: &vortex_array::patches::Patches, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult -impl vortex_array::stream::ArrayStreamAdapter where S: futures_core::stream::Stream> +impl vortex_array::vtable::Array -pub fn vortex_array::stream::ArrayStreamAdapter::new(dtype: vortex_array::dtype::DType, inner: S) -> Self +pub fn vortex_array::vtable::Array::top_value(&self) -> vortex_error::VortexResult> -impl<'__pin, S> core::marker::Unpin for vortex_array::stream::ArrayStreamAdapter where pin_project_lite::__private::PinnedFieldsOf<__Origin<'__pin, S>>: core::marker::Unpin +impl vortex_array::vtable::Array -impl futures_core::stream::Stream for vortex_array::stream::ArrayStreamAdapter where S: futures_core::stream::Stream> +pub fn vortex_array::vtable::Array::new(source: vortex_array::ArrayRef) -> Self -pub type vortex_array::stream::ArrayStreamAdapter::Item = core::result::Result, vortex_error::VortexError> +impl vortex_array::vtable::Array -pub fn vortex_array::stream::ArrayStreamAdapter::poll_next(self: core::pin::Pin<&mut Self>, cx: &mut core::task::wake::Context<'_>) -> core::task::poll::Poll> +pub fn vortex_array::vtable::Array::from_fields>(items: &[(N, vortex_array::ArrayRef)]) -> vortex_error::VortexResult -pub fn vortex_array::stream::ArrayStreamAdapter::size_hint(&self) -> (usize, core::option::Option) +pub fn vortex_array::vtable::Array::into_parts(self) -> vortex_array::arrays::struct_::StructArrayParts -impl vortex_array::stream::ArrayStream for vortex_array::stream::ArrayStreamAdapter where S: futures_core::stream::Stream> +pub fn vortex_array::vtable::Array::new(names: vortex_array::dtype::FieldNames, fields: impl core::convert::Into>, length: usize, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::stream::ArrayStreamAdapter::dtype(&self) -> &vortex_array::dtype::DType +pub fn vortex_array::vtable::Array::new_fieldless_with_len(len: usize) -> Self -pub trait vortex_array::stream::ArrayStream: futures_core::stream::Stream> +pub unsafe fn vortex_array::vtable::Array::new_unchecked(fields: impl core::convert::Into>, dtype: vortex_array::dtype::StructFields, length: usize, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::stream::ArrayStream::dtype(&self) -> &vortex_array::dtype::DType +pub fn vortex_array::vtable::Array::try_from_iter, A: vortex_array::IntoArray, T: core::iter::traits::collect::IntoIterator>(iter: T) -> vortex_error::VortexResult -impl vortex_array::stream::ArrayStream for vortex_array::stream::SendableArrayStream +pub fn vortex_array::vtable::Array::try_from_iter_with_validity, A: vortex_array::IntoArray, T: core::iter::traits::collect::IntoIterator>(iter: T, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub fn vortex_array::stream::SendableArrayStream::dtype(&self) -> &vortex_array::dtype::DType +pub fn vortex_array::vtable::Array::try_new(names: vortex_array::dtype::FieldNames, fields: impl core::convert::Into>, length: usize, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -impl vortex_array::stream::ArrayStream for vortex_array::stream::ArrayStreamAdapter where S: futures_core::stream::Stream> +pub fn vortex_array::vtable::Array::try_new_with_dtype(fields: impl core::convert::Into>, dtype: vortex_array::dtype::StructFields, length: usize, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub fn vortex_array::stream::ArrayStreamAdapter::dtype(&self) -> &vortex_array::dtype::DType +impl vortex_array::vtable::Array -pub trait vortex_array::stream::ArrayStreamExt: vortex_array::stream::ArrayStream +pub fn vortex_array::vtable::Array::into_record_batch_with_schema(self, schema: impl core::convert::AsRef) -> vortex_error::VortexResult -pub fn vortex_array::stream::ArrayStreamExt::boxed(self) -> vortex_array::stream::SendableArrayStream where Self: core::marker::Sized + core::marker::Send + 'static +impl vortex_array::vtable::Array -pub fn vortex_array::stream::ArrayStreamExt::read_all(self) -> impl core::future::future::Future> where Self: core::marker::Sized +pub fn vortex_array::vtable::Array::from_bytes(value: alloc::vec::Vec<&[u8]>) -> Self -impl vortex_array::stream::ArrayStreamExt for S +pub fn vortex_array::vtable::Array::from_iter, I: core::iter::traits::collect::IntoIterator>>(iter: I, dtype: vortex_array::dtype::DType) -> Self -pub fn S::boxed(self) -> vortex_array::stream::SendableArrayStream where Self: core::marker::Sized + core::marker::Send + 'static +pub fn vortex_array::vtable::Array::from_iter_nonnull, I: core::iter::traits::collect::IntoIterator>(iter: I, dtype: vortex_array::dtype::DType) -> Self -pub fn S::read_all(self) -> impl core::future::future::Future> where Self: core::marker::Sized +pub fn vortex_array::vtable::Array::from_nullable_bytes(value: alloc::vec::Vec>) -> Self -pub type vortex_array::stream::SendableArrayStream = core::pin::Pin> +pub fn vortex_array::vtable::Array::from_nullable_strs(value: alloc::vec::Vec>) -> Self -pub mod vortex_array::validity +pub fn vortex_array::vtable::Array::from_strs(value: alloc::vec::Vec<&str>) -> Self -pub enum vortex_array::validity::Validity +pub fn vortex_array::vtable::Array::from_vec>(vec: alloc::vec::Vec, dtype: vortex_array::dtype::DType) -> Self -pub vortex_array::validity::Validity::AllInvalid +impl vortex_array::vtable::Array -pub vortex_array::validity::Validity::AllValid +pub fn vortex_array::vtable::Array::new(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub vortex_array::validity::Validity::Array(vortex_array::ArrayRef) +pub unsafe fn vortex_array::vtable::Array::new_unchecked(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub vortex_array::validity::Validity::NonNullable +pub unsafe fn vortex_array::vtable::Array::new_unchecked_from_handle(offsets: vortex_array::ArrayRef, bytes: vortex_array::buffer::BufferHandle, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -impl vortex_array::validity::Validity +pub fn vortex_array::vtable::Array::try_new(offsets: vortex_array::ArrayRef, bytes: vortex_buffer::ByteBuffer, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub const vortex_array::validity::Validity::DTYPE: vortex_array::dtype::DType +impl vortex_array::vtable::Array -pub fn vortex_array::validity::Validity::and(self, rhs: vortex_array::validity::Validity) -> vortex_error::VortexResult +pub fn vortex_array::vtable::Array::compact_buffers(&self) -> vortex_error::VortexResult -pub fn vortex_array::validity::Validity::as_array(&self) -> core::option::Option<&vortex_array::ArrayRef> +pub fn vortex_array::vtable::Array::compact_with_threshold(&self, buffer_utilization_threshold: f64) -> vortex_error::VortexResult -pub fn vortex_array::validity::Validity::cast_nullability(self, nullability: vortex_array::dtype::Nullability, len: usize) -> vortex_error::VortexResult +impl vortex_array::vtable::Array -pub fn vortex_array::validity::Validity::copy_from_array(array: &vortex_array::ArrayRef) -> vortex_error::VortexResult +pub fn vortex_array::vtable::Array::from_iter, I: core::iter::traits::collect::IntoIterator>>(iter: I, dtype: vortex_array::dtype::DType) -> Self -pub fn vortex_array::validity::Validity::execute_mask(&self, length: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::vtable::Array::from_iter_bin, I: core::iter::traits::collect::IntoIterator>(iter: I) -> Self -pub fn vortex_array::validity::Validity::filter(&self, mask: &vortex_mask::Mask) -> vortex_error::VortexResult +pub fn vortex_array::vtable::Array::from_iter_nullable_bin, I: core::iter::traits::collect::IntoIterator>>(iter: I) -> Self -pub fn vortex_array::validity::Validity::into_array(self) -> core::option::Option +pub fn vortex_array::vtable::Array::from_iter_nullable_str, I: core::iter::traits::collect::IntoIterator>>(iter: I) -> Self -pub fn vortex_array::validity::Validity::into_non_nullable(self, len: usize) -> core::option::Option +pub fn vortex_array::vtable::Array::from_iter_str, I: core::iter::traits::collect::IntoIterator>(iter: I) -> Self -pub fn vortex_array::validity::Validity::into_nullable(self) -> vortex_array::validity::Validity +pub fn vortex_array::vtable::Array::new_handle(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::validity::Validity::is_null(&self, index: usize) -> vortex_error::VortexResult +pub unsafe fn vortex_array::vtable::Array::new_handle_unchecked(views: vortex_array::buffer::BufferHandle, buffers: alloc::sync::Arc<[vortex_array::buffer::BufferHandle]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::validity::Validity::is_valid(&self, index: usize) -> vortex_error::VortexResult +pub unsafe fn vortex_array::vtable::Array::new_unchecked(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> Self -pub fn vortex_array::validity::Validity::mask_eq(&self, other: &vortex_array::validity::Validity, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::vtable::Array::try_new(views: vortex_buffer::buffer::Buffer, buffers: alloc::sync::Arc<[vortex_buffer::ByteBuffer]>, dtype: vortex_array::dtype::DType, validity: vortex_array::validity::Validity) -> vortex_error::VortexResult -pub fn vortex_array::validity::Validity::maybe_len(&self) -> core::option::Option +impl vortex_array::vtable::Array -pub fn vortex_array::validity::Validity::not(&self) -> vortex_error::VortexResult +pub fn vortex_array::vtable::Array::new(child: vortex_array::ArrayRef) -> Self -pub fn vortex_array::validity::Validity::nullability(&self) -> vortex_array::dtype::Nullability +impl vortex_array::vtable::Array -pub fn vortex_array::validity::Validity::patch(self, len: usize, indices_offset: usize, indices: &vortex_array::ArrayRef, patches: &vortex_array::validity::Validity, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::vtable::Array::new(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self -pub fn vortex_array::validity::Validity::slice(&self, range: core::ops::range::Range) -> vortex_error::VortexResult +pub unsafe fn vortex_array::vtable::Array::new_unchecked(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> Self -pub fn vortex_array::validity::Validity::take(&self, indices: &vortex_array::ArrayRef) -> vortex_error::VortexResult +pub unsafe fn vortex_array::vtable::Array::set_all_values_referenced(self, all_values_referenced: bool) -> Self -pub fn vortex_array::validity::Validity::to_array(&self, len: usize) -> vortex_array::ArrayRef +pub fn vortex_array::vtable::Array::try_new(codes: vortex_array::ArrayRef, values: vortex_array::ArrayRef) -> vortex_error::VortexResult -pub fn vortex_array::validity::Validity::uncompressed_size(&self) -> usize +impl vortex_array::vtable::Array -pub fn vortex_array::validity::Validity::union_nullability(self, nullability: vortex_array::dtype::Nullability) -> Self +pub fn vortex_array::vtable::Array::new(len: usize) -> Self -impl vortex_array::validity::Validity +impl vortex_array::vtable::Array -pub fn vortex_array::validity::Validity::execute(self, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::vtable::Array::children(&self) -> &[vortex_array::ArrayRef] -impl vortex_array::validity::Validity +pub fn vortex_array::vtable::Array::scalar_fn(&self) -> &vortex_array::scalar_fn::ScalarFnRef -pub fn vortex_array::validity::Validity::from_bit_buffer(buffer: vortex_buffer::bit::buf::BitBuffer, nullability: vortex_array::dtype::Nullability) -> Self +pub fn vortex_array::vtable::Array::try_new(scalar_fn: vortex_array::scalar_fn::ScalarFnRef, children: alloc::vec::Vec, len: usize) -> vortex_error::VortexResult -pub fn vortex_array::validity::Validity::from_mask(mask: vortex_mask::Mask, nullability: vortex_array::dtype::Nullability) -> Self +impl vortex_array::vtable::Array -impl core::clone::Clone for vortex_array::validity::Validity +pub fn vortex_array::vtable::Array::new(child: vortex_array::ArrayRef, range: core::ops::range::Range) -> Self -pub fn vortex_array::validity::Validity::clone(&self) -> vortex_array::validity::Validity +pub fn vortex_array::vtable::Array::try_new(child: vortex_array::ArrayRef, range: core::ops::range::Range) -> vortex_error::VortexResult -impl core::convert::From<&vortex_array::dtype::Nullability> for vortex_array::validity::Validity +impl vortex_array::vtable::Array where ::ArrayData: vortex_array::vtable::ValidityHelper -pub fn vortex_array::validity::Validity::from(value: &vortex_array::dtype::Nullability) -> Self +pub fn vortex_array::vtable::Array::validity(&self) -> &vortex_array::validity::Validity -impl core::convert::From for vortex_array::validity::Validity +pub fn vortex_array::vtable::Array::validity_mask(&self) -> vortex_error::VortexResult -pub fn vortex_array::validity::Validity::from(value: vortex_array::dtype::Nullability) -> Self +impl vortex_array::vtable::Array -impl core::convert::From for vortex_array::validity::Validity +pub fn vortex_array::vtable::Array::all_invalid(&self) -> vortex_error::VortexResult -pub fn vortex_array::validity::Validity::from(value: vortex_buffer::bit::buf::BitBuffer) -> Self +pub fn vortex_array::vtable::Array::all_valid(&self) -> vortex_error::VortexResult -impl core::fmt::Debug for vortex_array::validity::Validity +pub fn vortex_array::vtable::Array::as_constant(&self) -> core::option::Option -pub fn vortex_array::validity::Validity::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +pub fn vortex_array::vtable::Array::filter(&self, mask: vortex_mask::Mask) -> vortex_error::VortexResult -impl core::iter::traits::collect::FromIterator for vortex_array::validity::Validity +pub fn vortex_array::vtable::Array::is_invalid(&self, index: usize) -> vortex_error::VortexResult -pub fn vortex_array::validity::Validity::from_iter>(iter: T) -> Self +pub fn vortex_array::vtable::Array::is_valid(&self, index: usize) -> vortex_error::VortexResult -impl core::iter::traits::collect::FromIterator for vortex_array::validity::Validity +pub fn vortex_array::vtable::Array::nbuffers(&self) -> usize -pub fn vortex_array::validity::Validity::from_iter>(iter: T) -> Self +pub fn vortex_array::vtable::Array::nbytes(&self) -> u64 -impl vortex_array::ArrayEq for vortex_array::validity::Validity +pub fn vortex_array::vtable::Array::scalar_at(&self, index: usize) -> vortex_error::VortexResult -pub fn vortex_array::validity::Validity::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool +pub fn vortex_array::vtable::Array::slice(&self, range: core::ops::range::Range) -> vortex_error::VortexResult -impl vortex_array::ArrayHash for vortex_array::validity::Validity +pub fn vortex_array::vtable::Array::take(&self, indices: vortex_array::ArrayRef) -> vortex_error::VortexResult -pub fn vortex_array::validity::Validity::array_hash(&self, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::vtable::Array::to_canonical(&self) -> vortex_error::VortexResult -pub mod vortex_array::variants +impl vortex_array::vtable::Array -pub struct vortex_array::variants::BinaryTyped<'a>(_) +pub fn vortex_array::vtable::Array::array_stats(&self) -> &vortex_array::stats::ArrayStats -pub struct vortex_array::variants::BoolTyped<'a>(_) +pub fn vortex_array::vtable::Array::data(&self) -> &::ArrayData -impl vortex_array::variants::BoolTyped<'_> +pub fn vortex_array::vtable::Array::dtype(&self) -> &vortex_array::dtype::DType -pub fn vortex_array::variants::BoolTyped<'_>::true_count(&self) -> vortex_error::VortexResult +pub fn vortex_array::vtable::Array::encoding_id(&self) -> vortex_array::vtable::ArrayId -pub struct vortex_array::variants::DecimalTyped<'a>(_) +pub unsafe fn vortex_array::vtable::Array::from_data_unchecked(vtable: V, dtype: vortex_array::dtype::DType, len: usize, data: ::ArrayData, stats: vortex_array::stats::ArrayStats) -> Self -pub struct vortex_array::variants::ExtensionTyped<'a>(_) +pub fn vortex_array::vtable::Array::into_data(self) -> ::ArrayData -impl vortex_array::variants::ExtensionTyped<'_> +pub fn vortex_array::vtable::Array::is_empty(&self) -> bool -pub fn vortex_array::variants::ExtensionTyped<'_>::ext_dtype(&self) -> &vortex_array::dtype::extension::ExtDTypeRef +pub fn vortex_array::vtable::Array::len(&self) -> usize -pub struct vortex_array::variants::ListTyped<'a>(_) +pub fn vortex_array::vtable::Array::statistics(&self) -> vortex_array::stats::StatsSetRef<'_> -pub struct vortex_array::variants::NullTyped<'a>(_) +pub fn vortex_array::vtable::Array::to_array_ref(&self) -> vortex_array::ArrayRef -pub struct vortex_array::variants::PrimitiveTyped<'a>(_) +pub fn vortex_array::vtable::Array::try_from_data(data: ::ArrayData) -> vortex_error::VortexResult -impl vortex_array::variants::PrimitiveTyped<'_> +pub fn vortex_array::vtable::Array::vtable(&self) -> &V -pub fn vortex_array::variants::PrimitiveTyped<'_>::ptype(&self) -> vortex_array::dtype::PType +impl core::convert::From> for vortex_array::vtable::Array -pub fn vortex_array::variants::PrimitiveTyped<'_>::value(&self, idx: usize) -> vortex_error::VortexResult> +pub fn vortex_array::vtable::Array::from(value: alloc::vec::Vec<&[u8]>) -> Self -pub fn vortex_array::variants::PrimitiveTyped<'_>::value_unchecked(&self, idx: usize) -> vortex_error::VortexResult +impl core::convert::From> for vortex_array::vtable::Array -impl vortex_array::search_sorted::IndexOrd> for vortex_array::variants::PrimitiveTyped<'_> +pub fn vortex_array::vtable::Array::from(value: alloc::vec::Vec<&str>) -> Self -pub fn vortex_array::variants::PrimitiveTyped<'_>::index_cmp(&self, idx: usize, elem: &core::option::Option) -> vortex_error::VortexResult> +impl core::convert::From> for vortex_array::vtable::Array -pub fn vortex_array::variants::PrimitiveTyped<'_>::index_ge(&self, idx: usize, elem: &V) -> vortex_error::VortexResult +pub fn vortex_array::vtable::Array::from(value: alloc::vec::Vec) -> Self -pub fn vortex_array::variants::PrimitiveTyped<'_>::index_gt(&self, idx: usize, elem: &V) -> vortex_error::VortexResult +impl core::convert::From>> for vortex_array::vtable::Array -pub fn vortex_array::variants::PrimitiveTyped<'_>::index_le(&self, idx: usize, elem: &V) -> vortex_error::VortexResult +pub fn vortex_array::vtable::Array::from(value: alloc::vec::Vec>) -> Self -pub fn vortex_array::variants::PrimitiveTyped<'_>::index_len(&self) -> usize +impl core::convert::From>> for vortex_array::vtable::Array -pub fn vortex_array::variants::PrimitiveTyped<'_>::index_lt(&self, idx: usize, elem: &V) -> vortex_error::VortexResult +pub fn vortex_array::vtable::Array::from(value: alloc::vec::Vec>) -> Self -impl vortex_array::search_sorted::IndexOrd for vortex_array::variants::PrimitiveTyped<'_> +impl core::convert::From>> for vortex_array::vtable::Array -pub fn vortex_array::variants::PrimitiveTyped<'_>::index_cmp(&self, idx: usize, elem: &vortex_array::scalar::PValue) -> vortex_error::VortexResult> +pub fn vortex_array::vtable::Array::from(value: alloc::vec::Vec>) -> Self -pub fn vortex_array::variants::PrimitiveTyped<'_>::index_ge(&self, idx: usize, elem: &V) -> vortex_error::VortexResult +impl core::convert::From>> for vortex_array::vtable::Array -pub fn vortex_array::variants::PrimitiveTyped<'_>::index_gt(&self, idx: usize, elem: &V) -> vortex_error::VortexResult +pub fn vortex_array::vtable::Array::from(value: alloc::vec::Vec>) -> Self -pub fn vortex_array::variants::PrimitiveTyped<'_>::index_le(&self, idx: usize, elem: &V) -> vortex_error::VortexResult +impl core::convert::From>>> for vortex_array::vtable::Array -pub fn vortex_array::variants::PrimitiveTyped<'_>::index_len(&self) -> usize +pub fn vortex_array::vtable::Array::from(value: alloc::vec::Vec>>) -> Self -pub fn vortex_array::variants::PrimitiveTyped<'_>::index_lt(&self, idx: usize, elem: &V) -> vortex_error::VortexResult +impl core::convert::TryFrom> for vortex_array::arrays::datetime::TemporalData -pub struct vortex_array::variants::StructTyped<'a>(_) +pub type vortex_array::arrays::datetime::TemporalData::Error = vortex_error::VortexError -impl vortex_array::variants::StructTyped<'_> +pub fn vortex_array::arrays::datetime::TemporalData::try_from(ext: vortex_array::arrays::ExtensionArray) -> core::result::Result -pub fn vortex_array::variants::StructTyped<'_>::dtypes(&self) -> alloc::vec::Vec +impl core::iter::traits::collect::FromIterator> for vortex_array::vtable::Array -pub fn vortex_array::variants::StructTyped<'_>::names(&self) -> &vortex_array::dtype::FieldNames +pub fn vortex_array::vtable::Array::from_iter>(iter: T) -> Self -pub fn vortex_array::variants::StructTyped<'_>::nfields(&self) -> usize +impl core::iter::traits::collect::FromIterator> for vortex_array::vtable::Array -pub struct vortex_array::variants::Utf8Typed<'a>(_) +pub fn vortex_array::vtable::Array::from_iter>>(iter: T) -> Self -pub mod vortex_array::vtable +impl core::iter::traits::collect::FromIterator> for vortex_array::vtable::Array -pub struct vortex_array::vtable::Array +pub fn vortex_array::vtable::Array::from_iter>>(iter: T) -> Self -impl vortex_array::vtable::Array +impl core::iter::traits::collect::FromIterator>> for vortex_array::vtable::Array -pub fn vortex_array::vtable::Array::array_stats(&self) -> &vortex_array::stats::ArrayStats +pub fn vortex_array::vtable::Array::from_iter>>>(iter: T) -> Self -pub fn vortex_array::vtable::Array::dtype(&self) -> &vortex_array::dtype::DType +impl core::iter::traits::collect::FromIterator>> for vortex_array::vtable::Array -pub fn vortex_array::vtable::Array::encoding_id(&self) -> vortex_array::vtable::ArrayId +pub fn vortex_array::vtable::Array::from_iter>>>(iter: T) -> Self -pub fn vortex_array::vtable::Array::inner(&self) -> &::Array +impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::vtable::Array -pub fn vortex_array::vtable::Array::into_inner(self) -> ::Array +pub fn vortex_array::vtable::Array::from_iter>>(iter: T) -> Self -pub fn vortex_array::vtable::Array::is_empty(&self) -> bool +impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::vtable::Array -pub fn vortex_array::vtable::Array::len(&self) -> usize +pub fn vortex_array::vtable::Array::from_iter>>(iter: T) -> Self -pub unsafe fn vortex_array::vtable::Array::new_unchecked(vtable: V, dtype: vortex_array::dtype::DType, len: usize, array: ::Array, stats: vortex_array::stats::ArrayStats) -> Self +impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::vtable::Array -pub fn vortex_array::vtable::Array::statistics(&self) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::vtable::Array::from_iter>>(iter: T) -> Self -pub fn vortex_array::vtable::Array::to_array_ref(&self) -> vortex_array::ArrayRef +impl<'a> core::iter::traits::collect::FromIterator> for vortex_array::vtable::Array -pub fn vortex_array::vtable::Array::typed_vtable(&self) -> &V +pub fn vortex_array::vtable::Array::from_iter>>(iter: T) -> Self impl core::clone::Clone for vortex_array::vtable::Array @@ -20648,9 +20528,13 @@ pub fn vortex_array::vtable::Array::fmt(&self, f: &mut core::fmt::Formatter<' impl core::ops::deref::Deref for vortex_array::vtable::Array -pub type vortex_array::vtable::Array::Target = ::Array +pub type vortex_array::vtable::Array::Target = ::ArrayData -pub fn vortex_array::vtable::Array::deref(&self) -> &::Array +pub fn vortex_array::vtable::Array::deref(&self) -> &::ArrayData + +impl core::ops::deref::DerefMut for vortex_array::vtable::Array + +pub fn vortex_array::vtable::Array::deref_mut(&mut self) -> &mut ::ArrayData impl vortex_array::ArrayEq for vortex_array::vtable::Array @@ -20742,51 +20626,39 @@ impl vortex_array::IntoArray for vortex_array:: pub fn vortex_array::vtable::Array::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::scalar_fn::ReduceNode for vortex_array::vtable::Array - -pub fn vortex_array::vtable::Array::as_any(&self) -> &dyn core::any::Any - -pub fn vortex_array::vtable::Array::child(&self, idx: usize) -> vortex_array::scalar_fn::ReduceNodeRef - -pub fn vortex_array::vtable::Array::child_count(&self) -> usize - -pub fn vortex_array::vtable::Array::node_dtype(&self) -> vortex_error::VortexResult - -pub fn vortex_array::vtable::Array::scalar_fn(&self) -> core::option::Option<&vortex_array::scalar_fn::ScalarFnRef> - pub struct vortex_array::vtable::NotSupported impl vortex_array::vtable::OperationsVTable for vortex_array::vtable::NotSupported -pub fn vortex_array::vtable::NotSupported::scalar_at(array: &::Array, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::vtable::NotSupported::scalar_at(array: &vortex_array::vtable::Array, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult pub struct vortex_array::vtable::ValidityVTableFromChild impl vortex_array::vtable::ValidityVTable for vortex_array::vtable::ValidityVTableFromChild where V: vortex_array::vtable::ValidityChild + vortex_array::vtable::VTable -pub fn vortex_array::vtable::ValidityVTableFromChild::validity(array: &::Array) -> vortex_error::VortexResult +pub fn vortex_array::vtable::ValidityVTableFromChild::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult pub struct vortex_array::vtable::ValidityVTableFromChildSliceHelper -impl vortex_array::vtable::ValidityVTable for vortex_array::vtable::ValidityVTableFromChildSliceHelper where ::Array: vortex_array::vtable::ValidityChildSliceHelper +impl vortex_array::vtable::ValidityVTable for vortex_array::vtable::ValidityVTableFromChildSliceHelper where ::ArrayData: vortex_array::vtable::ValidityChildSliceHelper -pub fn vortex_array::vtable::ValidityVTableFromChildSliceHelper::validity(array: &::Array) -> vortex_error::VortexResult +pub fn vortex_array::vtable::ValidityVTableFromChildSliceHelper::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult pub struct vortex_array::vtable::ValidityVTableFromValidityHelper -impl vortex_array::vtable::ValidityVTable for vortex_array::vtable::ValidityVTableFromValidityHelper where ::Array: vortex_array::vtable::ValidityHelper +impl vortex_array::vtable::ValidityVTable for vortex_array::vtable::ValidityVTableFromValidityHelper where ::ArrayData: vortex_array::vtable::ValidityHelper -pub fn vortex_array::vtable::ValidityVTableFromValidityHelper::validity(array: &::Array) -> vortex_error::VortexResult +pub fn vortex_array::vtable::ValidityVTableFromValidityHelper::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult pub struct vortex_array::vtable::ValidityVTableFromValiditySliceHelper -impl vortex_array::vtable::ValidityVTable for vortex_array::vtable::ValidityVTableFromValiditySliceHelper where ::Array: vortex_array::vtable::ValiditySliceHelper +impl vortex_array::vtable::ValidityVTable for vortex_array::vtable::ValidityVTableFromValiditySliceHelper where ::ArrayData: vortex_array::vtable::ValiditySliceHelper -pub fn vortex_array::vtable::ValidityVTableFromValiditySliceHelper::validity(array: &::Array) -> vortex_error::VortexResult +pub fn vortex_array::vtable::ValidityVTableFromValiditySliceHelper::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult pub trait vortex_array::vtable::ArrayVTable: 'static + core::clone::Clone + core::marker::Sized + core::marker::Send + core::marker::Sync + core::fmt::Debug -pub type vortex_array::vtable::ArrayVTable::Array: 'static + core::marker::Send + core::marker::Sync + core::clone::Clone + core::fmt::Debug + core::ops::deref::Deref + vortex_array::IntoArray +pub type vortex_array::vtable::ArrayVTable::ArrayData: 'static + core::marker::Send + core::marker::Sync + core::clone::Clone + core::fmt::Debug + vortex_array::IntoArray pub type vortex_array::vtable::ArrayVTable::Metadata: core::fmt::Debug @@ -20794,25 +20666,25 @@ pub type vortex_array::vtable::ArrayVTable::OperationsVTable: vortex_array::vtab pub type vortex_array::vtable::ArrayVTable::ValidityVTable: vortex_array::vtable::ValidityVTable -pub fn vortex_array::vtable::ArrayVTable::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::vtable::ArrayVTable::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::vtable::ArrayVTable::array_eq(array: &Self::Array, other: &Self::Array, precision: vortex_array::Precision) -> bool +pub fn vortex_array::vtable::ArrayVTable::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::vtable::ArrayVTable::array_hash(array: &Self::Array, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::vtable::ArrayVTable::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::vtable::ArrayVTable::buffer(array: &Self::Array, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::vtable::ArrayVTable::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::vtable::ArrayVTable::buffer_name(array: &Self::Array, idx: usize) -> core::option::Option +pub fn vortex_array::vtable::ArrayVTable::buffer_name(array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::vtable::ArrayVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::vtable::ArrayVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::vtable::ArrayVTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::vtable::ArrayVTable::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::vtable::ArrayVTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::vtable::ArrayVTable::child_name(array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::vtable::ArrayVTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::vtable::ArrayVTable::dtype(array: &Self::Array) -> &vortex_array::dtype::DType +pub fn vortex_array::vtable::ArrayVTable::dtype(array: &Self::ArrayData) -> &vortex_array::dtype::DType pub fn vortex_array::vtable::ArrayVTable::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20820,13 +20692,13 @@ pub fn vortex_array::vtable::ArrayVTable::execute_parent(array: &vortex_array::v pub fn vortex_array::vtable::ArrayVTable::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::vtable::ArrayVTable::len(array: &Self::Array) -> usize +pub fn vortex_array::vtable::ArrayVTable::len(array: &Self::ArrayData) -> usize -pub fn vortex_array::vtable::ArrayVTable::metadata(array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::vtable::ArrayVTable::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::vtable::ArrayVTable::nbuffers(array: &Self::Array) -> usize +pub fn vortex_array::vtable::ArrayVTable::nbuffers(array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::vtable::ArrayVTable::nchildren(array: &Self::Array) -> usize +pub fn vortex_array::vtable::ArrayVTable::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::vtable::ArrayVTable::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -20834,15 +20706,15 @@ pub fn vortex_array::vtable::ArrayVTable::reduce_parent(array: &vortex_array::vt pub fn vortex_array::vtable::ArrayVTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::vtable::ArrayVTable::stats(array: &Self::Array) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::vtable::ArrayVTable::stats(array: &Self::ArrayData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::vtable::ArrayVTable::vtable(array: &Self::Array) -> &Self +pub fn vortex_array::vtable::ArrayVTable::vtable(array: &Self::ArrayData) -> &Self -pub fn vortex_array::vtable::ArrayVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::vtable::ArrayVTable::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Bool -pub type vortex_array::arrays::Bool::Array = vortex_array::arrays::BoolArray +pub type vortex_array::arrays::Bool::ArrayData = vortex_array::arrays::BoolData pub type vortex_array::arrays::Bool::Metadata = vortex_array::ProstMetadata @@ -20850,25 +20722,25 @@ pub type vortex_array::arrays::Bool::OperationsVTable = vortex_array::arrays::Bo pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Bool::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Bool::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: &vortex_array::arrays::BoolArray, other: &vortex_array::arrays::BoolArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: &vortex_array::arrays::BoolArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Bool::buffer(array: &vortex_array::arrays::BoolArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Bool::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Bool::buffer_name(_array: &vortex_array::arrays::BoolArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Bool::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Bool::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Bool::child(array: &vortex_array::arrays::BoolArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Bool::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Bool::child_name(_array: &vortex_array::arrays::BoolArray, _idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Bool::child_name(_array: &vortex_array::vtable::Array, _idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Bool::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Bool::dtype(array: &vortex_array::arrays::BoolArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Bool::dtype(array: &vortex_array::arrays::BoolData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Bool::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20876,13 +20748,13 @@ pub fn vortex_array::arrays::Bool::execute_parent(array: &vortex_array::vtable:: pub fn vortex_array::arrays::Bool::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Bool::len(array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::Bool::len(array: &vortex_array::arrays::BoolData) -> usize -pub fn vortex_array::arrays::Bool::metadata(array: &vortex_array::arrays::BoolArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Bool::nbuffers(_array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::Bool::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Bool::nchildren(array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::Bool::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Bool::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -20890,15 +20762,15 @@ pub fn vortex_array::arrays::Bool::reduce_parent(array: &vortex_array::vtable::A pub fn vortex_array::arrays::Bool::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Bool::stats(array: &vortex_array::arrays::BoolArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Bool::stats(array: &vortex_array::arrays::BoolData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Bool::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Bool::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Bool::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Bool::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Chunked -pub type vortex_array::arrays::Chunked::Array = vortex_array::arrays::ChunkedArray +pub type vortex_array::arrays::Chunked::ArrayData = vortex_array::arrays::ChunkedData pub type vortex_array::arrays::Chunked::Metadata = vortex_array::EmptyMetadata @@ -20906,25 +20778,25 @@ pub type vortex_array::arrays::Chunked::OperationsVTable = vortex_array::arrays: pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::append_to_builder(array: &vortex_array::arrays::ChunkedArray, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: &vortex_array::arrays::ChunkedArray, other: &vortex_array::arrays::ChunkedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: &vortex_array::arrays::ChunkedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Chunked::buffer(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Chunked::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Chunked::buffer_name(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Chunked::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Chunked::build(dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::build(dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Chunked::child(array: &vortex_array::arrays::ChunkedArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Chunked::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Chunked::child_name(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Chunked::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Chunked::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Chunked::dtype(array: &vortex_array::arrays::ChunkedArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Chunked::dtype(array: &vortex_array::arrays::ChunkedData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Chunked::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20932,13 +20804,13 @@ pub fn vortex_array::arrays::Chunked::execute_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Chunked::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Chunked::len(array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::Chunked::len(array: &vortex_array::arrays::ChunkedData) -> usize -pub fn vortex_array::arrays::Chunked::metadata(_array: &vortex_array::arrays::ChunkedArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Chunked::nbuffers(_array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::Chunked::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Chunked::nchildren(array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::Chunked::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Chunked::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -20946,15 +20818,15 @@ pub fn vortex_array::arrays::Chunked::reduce_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Chunked::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Chunked::stats(array: &vortex_array::arrays::ChunkedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Chunked::stats(array: &vortex_array::arrays::ChunkedData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Chunked::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Chunked::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Chunked::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Constant -pub type vortex_array::arrays::Constant::Array = vortex_array::arrays::ConstantArray +pub type vortex_array::arrays::Constant::ArrayData = vortex_array::arrays::ConstantData pub type vortex_array::arrays::Constant::Metadata = vortex_array::scalar::Scalar @@ -20962,25 +20834,25 @@ pub type vortex_array::arrays::Constant::OperationsVTable = vortex_array::arrays pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::append_to_builder(array: &vortex_array::arrays::ConstantArray, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: &vortex_array::arrays::ConstantArray, other: &vortex_array::arrays::ConstantArray, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: &vortex_array::arrays::ConstantArray, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(array: &vortex_array::vtable::Array, state: &mut H, _precision: vortex_array::Precision) -pub fn vortex_array::arrays::Constant::buffer(array: &vortex_array::arrays::ConstantArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Constant::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Constant::buffer_name(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Constant::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Constant::build(_dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::build(_dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Constant::child(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Constant::child(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Constant::child_name(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Constant::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Constant::deserialize(_bytes: &[u8], dtype: &vortex_array::dtype::DType, _len: usize, buffers: &[vortex_array::buffer::BufferHandle], session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Constant::dtype(array: &vortex_array::arrays::ConstantArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Constant::dtype(array: &vortex_array::arrays::ConstantData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Constant::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -20988,13 +20860,13 @@ pub fn vortex_array::arrays::Constant::execute_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::Constant::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Constant::len(array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::Constant::len(array: &vortex_array::arrays::ConstantData) -> usize -pub fn vortex_array::arrays::Constant::metadata(array: &vortex_array::arrays::ConstantArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Constant::nbuffers(_array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::Constant::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Constant::nchildren(_array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::Constant::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Constant::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21002,15 +20874,15 @@ pub fn vortex_array::arrays::Constant::reduce_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Constant::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Constant::stats(array: &vortex_array::arrays::ConstantArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Constant::stats(array: &vortex_array::arrays::ConstantData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Constant::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Constant::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Constant::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::with_children(_array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Decimal -pub type vortex_array::arrays::Decimal::Array = vortex_array::arrays::DecimalArray +pub type vortex_array::arrays::Decimal::ArrayData = vortex_array::arrays::DecimalData pub type vortex_array::arrays::Decimal::Metadata = vortex_array::ProstMetadata @@ -21018,25 +20890,25 @@ pub type vortex_array::arrays::Decimal::OperationsVTable = vortex_array::arrays: pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Decimal::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Decimal::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: &vortex_array::arrays::DecimalArray, other: &vortex_array::arrays::DecimalArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: &vortex_array::arrays::DecimalArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Decimal::buffer(array: &vortex_array::arrays::DecimalArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Decimal::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Decimal::buffer_name(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Decimal::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Decimal::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Decimal::child(array: &vortex_array::arrays::DecimalArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Decimal::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Decimal::child_name(_array: &vortex_array::arrays::DecimalArray, _idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Decimal::child_name(_array: &vortex_array::vtable::Array, _idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Decimal::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Decimal::dtype(array: &vortex_array::arrays::DecimalArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Decimal::dtype(array: &vortex_array::arrays::DecimalData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Decimal::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21044,13 +20916,13 @@ pub fn vortex_array::arrays::Decimal::execute_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Decimal::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Decimal::len(array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::Decimal::len(array: &vortex_array::arrays::DecimalData) -> usize -pub fn vortex_array::arrays::Decimal::metadata(array: &vortex_array::arrays::DecimalArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Decimal::nbuffers(_array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::Decimal::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Decimal::nchildren(array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::Decimal::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Decimal::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21058,15 +20930,15 @@ pub fn vortex_array::arrays::Decimal::reduce_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Decimal::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Decimal::stats(array: &vortex_array::arrays::DecimalArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Decimal::stats(array: &vortex_array::arrays::DecimalData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Decimal::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Decimal::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Decimal::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Decimal::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Extension -pub type vortex_array::arrays::Extension::Array = vortex_array::arrays::ExtensionArray +pub type vortex_array::arrays::Extension::ArrayData = vortex_array::arrays::ExtensionData pub type vortex_array::arrays::Extension::Metadata = vortex_array::EmptyMetadata @@ -21074,25 +20946,25 @@ pub type vortex_array::arrays::Extension::OperationsVTable = vortex_array::array pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::vtable::ValidityVTableFromChild -pub fn vortex_array::arrays::Extension::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Extension::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: &vortex_array::arrays::ExtensionArray, other: &vortex_array::arrays::ExtensionArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: &vortex_array::arrays::ExtensionArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Extension::buffer(_array: &vortex_array::arrays::ExtensionArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Extension::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Extension::buffer_name(_array: &vortex_array::arrays::ExtensionArray, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Extension::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Extension::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Extension::child(array: &vortex_array::arrays::ExtensionArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Extension::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Extension::child_name(_array: &vortex_array::arrays::ExtensionArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Extension::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Extension::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Extension::dtype(array: &vortex_array::arrays::ExtensionArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Extension::dtype(array: &vortex_array::arrays::ExtensionData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Extension::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21100,13 +20972,13 @@ pub fn vortex_array::arrays::Extension::execute_parent(array: &vortex_array::vta pub fn vortex_array::arrays::Extension::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Extension::len(array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::Extension::len(array: &vortex_array::arrays::ExtensionData) -> usize -pub fn vortex_array::arrays::Extension::metadata(_array: &vortex_array::arrays::ExtensionArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Extension::nbuffers(_array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::Extension::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Extension::nchildren(_array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::Extension::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Extension::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21114,15 +20986,15 @@ pub fn vortex_array::arrays::Extension::reduce_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::Extension::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Extension::stats(array: &vortex_array::arrays::ExtensionArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Extension::stats(array: &vortex_array::arrays::ExtensionData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Extension::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Extension::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Extension::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Extension::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Filter -pub type vortex_array::arrays::Filter::Array = vortex_array::arrays::FilterArray +pub type vortex_array::arrays::Filter::ArrayData = vortex_array::arrays::FilterData pub type vortex_array::arrays::Filter::Metadata = vortex_array::arrays::filter::vtable::FilterMetadata @@ -21130,25 +21002,25 @@ pub type vortex_array::arrays::Filter::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Filter -pub fn vortex_array::arrays::Filter::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: &vortex_array::arrays::FilterArray, other: &vortex_array::arrays::FilterArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: &vortex_array::arrays::FilterArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Filter::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Filter::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Filter::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Filter::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Filter::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::filter::vtable::FilterMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::filter::vtable::FilterMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Filter::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Filter::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Filter::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Filter::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Filter::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Filter::dtype(array: &vortex_array::arrays::FilterArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Filter::dtype(array: &vortex_array::arrays::FilterData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Filter::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21156,13 +21028,13 @@ pub fn vortex_array::arrays::Filter::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Filter::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Filter::len(array: &vortex_array::arrays::FilterArray) -> usize +pub fn vortex_array::arrays::Filter::len(array: &vortex_array::arrays::FilterData) -> usize -pub fn vortex_array::arrays::Filter::metadata(array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Filter::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Filter::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Filter::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Filter::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Filter::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21170,15 +21042,15 @@ pub fn vortex_array::arrays::Filter::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Filter::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Filter::stats(array: &vortex_array::arrays::FilterArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Filter::stats(array: &vortex_array::arrays::FilterData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Filter::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Filter::vtable(_array: &vortex_array::arrays::FilterData) -> &Self -pub fn vortex_array::arrays::Filter::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::FixedSizeList -pub type vortex_array::arrays::FixedSizeList::Array = vortex_array::arrays::FixedSizeListArray +pub type vortex_array::arrays::FixedSizeList::ArrayData = vortex_array::arrays::FixedSizeListData pub type vortex_array::arrays::FixedSizeList::Metadata = vortex_array::EmptyMetadata @@ -21186,25 +21058,25 @@ pub type vortex_array::arrays::FixedSizeList::OperationsVTable = vortex_array::a pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: &vortex_array::arrays::FixedSizeListArray, other: &vortex_array::arrays::FixedSizeListArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: &vortex_array::arrays::FixedSizeListArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::FixedSizeList::buffer(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::FixedSizeList::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::FixedSizeList::buffer_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::FixedSizeList::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::FixedSizeList::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeList::child(array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FixedSizeList::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::FixedSizeList::child_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::FixedSizeList::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::FixedSizeList::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeList::dtype(array: &vortex_array::arrays::FixedSizeListArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::FixedSizeList::dtype(array: &vortex_array::arrays::FixedSizeListData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::FixedSizeList::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21212,13 +21084,13 @@ pub fn vortex_array::arrays::FixedSizeList::execute_parent(array: &vortex_array: pub fn vortex_array::arrays::FixedSizeList::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::FixedSizeList::len(array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeList::len(array: &vortex_array::arrays::FixedSizeListData) -> usize -pub fn vortex_array::arrays::FixedSizeList::metadata(_array: &vortex_array::arrays::FixedSizeListArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeList::nbuffers(_array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeList::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::FixedSizeList::nchildren(array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeList::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::FixedSizeList::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21226,15 +21098,15 @@ pub fn vortex_array::arrays::FixedSizeList::reduce_parent(array: &vortex_array:: pub fn vortex_array::arrays::FixedSizeList::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::FixedSizeList::stats(array: &vortex_array::arrays::FixedSizeListArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::FixedSizeList::stats(array: &vortex_array::arrays::FixedSizeListData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::FixedSizeList::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::FixedSizeList::vtable(_array: &vortex_array::arrays::FixedSizeListData) -> &Self -pub fn vortex_array::arrays::FixedSizeList::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeList::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::List -pub type vortex_array::arrays::List::Array = vortex_array::arrays::ListArray +pub type vortex_array::arrays::List::ArrayData = vortex_array::arrays::ListData pub type vortex_array::arrays::List::Metadata = vortex_array::ProstMetadata @@ -21242,25 +21114,25 @@ pub type vortex_array::arrays::List::OperationsVTable = vortex_array::arrays::Li pub type vortex_array::arrays::List::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::List::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: &vortex_array::arrays::ListArray, other: &vortex_array::arrays::ListArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: &vortex_array::arrays::ListArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::List::buffer(_array: &vortex_array::arrays::ListArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::List::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::List::buffer_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::List::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::List::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::List::child(array: &vortex_array::arrays::ListArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::List::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::List::child_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::List::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::List::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::List::dtype(array: &vortex_array::arrays::ListArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::List::dtype(array: &vortex_array::arrays::ListData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::List::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21268,13 +21140,13 @@ pub fn vortex_array::arrays::List::execute_parent(array: &vortex_array::vtable:: pub fn vortex_array::arrays::List::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::List::len(array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::List::len(array: &vortex_array::arrays::ListData) -> usize -pub fn vortex_array::arrays::List::metadata(array: &vortex_array::arrays::ListArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::List::nbuffers(_array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::List::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::List::nchildren(array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::List::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::List::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21282,15 +21154,15 @@ pub fn vortex_array::arrays::List::reduce_parent(array: &vortex_array::vtable::A pub fn vortex_array::arrays::List::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::List::stats(array: &vortex_array::arrays::ListArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::List::stats(array: &vortex_array::arrays::ListData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::List::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::List::vtable(_array: &vortex_array::arrays::ListData) -> &Self -pub fn vortex_array::arrays::List::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::ListView -pub type vortex_array::arrays::ListView::Array = vortex_array::arrays::ListViewArray +pub type vortex_array::arrays::ListView::ArrayData = vortex_array::arrays::ListViewData pub type vortex_array::arrays::ListView::Metadata = vortex_array::ProstMetadata @@ -21298,25 +21170,25 @@ pub type vortex_array::arrays::ListView::OperationsVTable = vortex_array::arrays pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::ListView::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: &vortex_array::arrays::ListViewArray, other: &vortex_array::arrays::ListViewArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: &vortex_array::arrays::ListViewArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::ListView::buffer(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::ListView::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::ListView::buffer_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::ListView::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::ListView::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListView::child(array: &vortex_array::arrays::ListViewArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListView::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::ListView::child_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::ListView::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::ListView::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListView::dtype(array: &vortex_array::arrays::ListViewArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::ListView::dtype(array: &vortex_array::arrays::ListViewData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::ListView::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21324,13 +21196,13 @@ pub fn vortex_array::arrays::ListView::execute_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::ListView::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::ListView::len(array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListView::len(array: &vortex_array::arrays::ListViewData) -> usize -pub fn vortex_array::arrays::ListView::metadata(array: &vortex_array::arrays::ListViewArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListView::nbuffers(_array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListView::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::ListView::nchildren(array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListView::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::ListView::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21338,15 +21210,15 @@ pub fn vortex_array::arrays::ListView::reduce_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::ListView::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ListView::stats(array: &vortex_array::arrays::ListViewArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ListView::stats(array: &vortex_array::arrays::ListViewData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::ListView::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::ListView::vtable(_array: &vortex_array::arrays::ListViewData) -> &Self -pub fn vortex_array::arrays::ListView::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Masked -pub type vortex_array::arrays::Masked::Array = vortex_array::arrays::MaskedArray +pub type vortex_array::arrays::Masked::ArrayData = vortex_array::arrays::MaskedData pub type vortex_array::arrays::Masked::Metadata = vortex_array::EmptyMetadata @@ -21354,25 +21226,25 @@ pub type vortex_array::arrays::Masked::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Masked::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: &vortex_array::arrays::MaskedArray, other: &vortex_array::arrays::MaskedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: &vortex_array::arrays::MaskedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Masked::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Masked::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Masked::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Masked::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Masked::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Masked::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Masked::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Masked::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Masked::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Masked::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Masked::dtype(array: &vortex_array::arrays::MaskedArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Masked::dtype(array: &vortex_array::arrays::MaskedData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Masked::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21380,13 +21252,13 @@ pub fn vortex_array::arrays::Masked::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Masked::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Masked::len(array: &vortex_array::arrays::MaskedArray) -> usize +pub fn vortex_array::arrays::Masked::len(array: &vortex_array::arrays::MaskedData) -> usize -pub fn vortex_array::arrays::Masked::metadata(_array: &vortex_array::arrays::MaskedArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Masked::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Masked::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Masked::nchildren(array: &Self::Array) -> usize +pub fn vortex_array::arrays::Masked::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Masked::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21394,15 +21266,15 @@ pub fn vortex_array::arrays::Masked::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Masked::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Masked::stats(array: &vortex_array::arrays::MaskedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Masked::stats(array: &vortex_array::arrays::MaskedData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Masked::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Masked::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Masked::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Primitive -pub type vortex_array::arrays::Primitive::Array = vortex_array::arrays::PrimitiveArray +pub type vortex_array::arrays::Primitive::ArrayData = vortex_array::arrays::PrimitiveData pub type vortex_array::arrays::Primitive::Metadata = vortex_array::EmptyMetadata @@ -21410,25 +21282,25 @@ pub type vortex_array::arrays::Primitive::OperationsVTable = vortex_array::array pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Primitive::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Primitive::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: &vortex_array::arrays::PrimitiveArray, other: &vortex_array::arrays::PrimitiveArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: &vortex_array::arrays::PrimitiveArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Primitive::buffer(array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Primitive::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Primitive::buffer_name(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Primitive::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Primitive::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Primitive::child(array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Primitive::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Primitive::child_name(_array: &vortex_array::arrays::PrimitiveArray, _idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Primitive::child_name(_array: &vortex_array::vtable::Array, _idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Primitive::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Primitive::dtype(array: &vortex_array::arrays::PrimitiveArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Primitive::dtype(array: &vortex_array::arrays::PrimitiveData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Primitive::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21436,13 +21308,13 @@ pub fn vortex_array::arrays::Primitive::execute_parent(array: &vortex_array::vta pub fn vortex_array::arrays::Primitive::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Primitive::len(array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::Primitive::len(array: &vortex_array::arrays::PrimitiveData) -> usize -pub fn vortex_array::arrays::Primitive::metadata(_array: &vortex_array::arrays::PrimitiveArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Primitive::nbuffers(_array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::Primitive::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Primitive::nchildren(array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::Primitive::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Primitive::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21450,15 +21322,15 @@ pub fn vortex_array::arrays::Primitive::reduce_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::Primitive::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Primitive::stats(array: &vortex_array::arrays::PrimitiveArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Primitive::stats(array: &vortex_array::arrays::PrimitiveData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Primitive::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Primitive::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Primitive::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Primitive::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Shared -pub type vortex_array::arrays::Shared::Array = vortex_array::arrays::SharedArray +pub type vortex_array::arrays::Shared::ArrayData = vortex_array::arrays::SharedData pub type vortex_array::arrays::Shared::Metadata = vortex_array::EmptyMetadata @@ -21466,25 +21338,25 @@ pub type vortex_array::arrays::Shared::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Shared -pub fn vortex_array::arrays::Shared::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: &vortex_array::arrays::SharedArray, other: &vortex_array::arrays::SharedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: &vortex_array::arrays::SharedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Shared::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Shared::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Shared::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Shared::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Shared::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Shared::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Shared::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Shared::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Shared::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Shared::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Shared::dtype(array: &vortex_array::arrays::SharedArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Shared::dtype(array: &vortex_array::arrays::SharedData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Shared::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21492,13 +21364,13 @@ pub fn vortex_array::arrays::Shared::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Shared::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Shared::len(array: &vortex_array::arrays::SharedArray) -> usize +pub fn vortex_array::arrays::Shared::len(array: &vortex_array::arrays::SharedData) -> usize -pub fn vortex_array::arrays::Shared::metadata(_array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Shared::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Shared::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Shared::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Shared::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Shared::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21506,15 +21378,15 @@ pub fn vortex_array::arrays::Shared::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Shared::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Shared::stats(array: &vortex_array::arrays::SharedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Shared::stats(array: &vortex_array::arrays::SharedData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Shared::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Shared::vtable(_array: &vortex_array::arrays::SharedData) -> &Self -pub fn vortex_array::arrays::Shared::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Struct -pub type vortex_array::arrays::Struct::Array = vortex_array::arrays::StructArray +pub type vortex_array::arrays::Struct::ArrayData = vortex_array::arrays::StructData pub type vortex_array::arrays::Struct::Metadata = vortex_array::EmptyMetadata @@ -21522,25 +21394,25 @@ pub type vortex_array::arrays::Struct::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Struct::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Struct::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: &vortex_array::arrays::StructArray, other: &vortex_array::arrays::StructArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: &vortex_array::arrays::StructArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Struct::buffer(_array: &vortex_array::arrays::StructArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Struct::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Struct::buffer_name(_array: &vortex_array::arrays::StructArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Struct::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Struct::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Struct::child(array: &vortex_array::arrays::StructArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Struct::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Struct::child_name(array: &vortex_array::arrays::StructArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Struct::child_name(array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Struct::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Struct::dtype(array: &vortex_array::arrays::StructArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Struct::dtype(array: &vortex_array::arrays::StructData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Struct::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21548,13 +21420,13 @@ pub fn vortex_array::arrays::Struct::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Struct::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Struct::len(array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::Struct::len(array: &vortex_array::arrays::StructData) -> usize -pub fn vortex_array::arrays::Struct::metadata(_array: &vortex_array::arrays::StructArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Struct::nbuffers(_array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::Struct::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Struct::nchildren(array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::Struct::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Struct::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21562,15 +21434,15 @@ pub fn vortex_array::arrays::Struct::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Struct::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Struct::stats(array: &vortex_array::arrays::StructArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Struct::stats(array: &vortex_array::arrays::StructData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Struct::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Struct::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Struct::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Struct::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::VarBin -pub type vortex_array::arrays::VarBin::Array = vortex_array::arrays::VarBinArray +pub type vortex_array::arrays::VarBin::ArrayData = vortex_array::arrays::VarBinData pub type vortex_array::arrays::VarBin::Metadata = vortex_array::ProstMetadata @@ -21578,25 +21450,25 @@ pub type vortex_array::arrays::VarBin::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::VarBin::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: &vortex_array::arrays::VarBinArray, other: &vortex_array::arrays::VarBinArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: &vortex_array::arrays::VarBinArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::VarBin::buffer(array: &vortex_array::arrays::VarBinArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::VarBin::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::VarBin::buffer_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::VarBin::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::VarBin::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBin::child(array: &vortex_array::arrays::VarBinArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBin::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBin::child_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::VarBin::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::VarBin::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBin::dtype(array: &vortex_array::arrays::VarBinArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::VarBin::dtype(array: &vortex_array::arrays::VarBinData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::VarBin::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21604,13 +21476,13 @@ pub fn vortex_array::arrays::VarBin::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::VarBin::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::VarBin::len(array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBin::len(array: &vortex_array::arrays::VarBinData) -> usize -pub fn vortex_array::arrays::VarBin::metadata(array: &vortex_array::arrays::VarBinArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBin::nbuffers(_array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBin::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::VarBin::nchildren(array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBin::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::VarBin::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21618,15 +21490,15 @@ pub fn vortex_array::arrays::VarBin::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::VarBin::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::VarBin::stats(array: &vortex_array::arrays::VarBinArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::VarBin::stats(array: &vortex_array::arrays::VarBinData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::VarBin::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::VarBin::vtable(_array: &vortex_array::arrays::VarBinData) -> &Self -pub fn vortex_array::arrays::VarBin::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::VarBinView -pub type vortex_array::arrays::VarBinView::Array = vortex_array::arrays::VarBinViewArray +pub type vortex_array::arrays::VarBinView::ArrayData = vortex_array::arrays::VarBinViewData pub type vortex_array::arrays::VarBinView::Metadata = vortex_array::EmptyMetadata @@ -21634,25 +21506,25 @@ pub type vortex_array::arrays::VarBinView::OperationsVTable = vortex_array::arra pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::VarBinView::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinView::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: &vortex_array::arrays::VarBinViewArray, other: &vortex_array::arrays::VarBinViewArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: &vortex_array::arrays::VarBinViewArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::VarBinView::buffer(array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::VarBinView::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::VarBinView::buffer_name(array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::VarBinView::buffer_name(array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::VarBinView::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinView::child(array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinView::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBinView::child_name(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::VarBinView::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::VarBinView::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinView::dtype(array: &vortex_array::arrays::VarBinViewArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::VarBinView::dtype(array: &vortex_array::arrays::VarBinViewData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::VarBinView::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21660,13 +21532,13 @@ pub fn vortex_array::arrays::VarBinView::execute_parent(array: &vortex_array::vt pub fn vortex_array::arrays::VarBinView::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::VarBinView::len(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinView::len(array: &vortex_array::arrays::VarBinViewData) -> usize -pub fn vortex_array::arrays::VarBinView::metadata(_array: &vortex_array::arrays::VarBinViewArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinView::nbuffers(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinView::nbuffers(array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::VarBinView::nchildren(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinView::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::VarBinView::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21674,15 +21546,15 @@ pub fn vortex_array::arrays::VarBinView::reduce_parent(array: &vortex_array::vta pub fn vortex_array::arrays::VarBinView::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::VarBinView::stats(array: &vortex_array::arrays::VarBinViewArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::VarBinView::stats(array: &vortex_array::arrays::VarBinViewData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::VarBinView::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::VarBinView::vtable(_array: &vortex_array::arrays::VarBinViewData) -> &Self -pub fn vortex_array::arrays::VarBinView::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinView::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Variant -pub type vortex_array::arrays::Variant::Array = vortex_array::arrays::variant::VariantArray +pub type vortex_array::arrays::Variant::ArrayData = vortex_array::arrays::variant::VariantData pub type vortex_array::arrays::Variant::Metadata = vortex_array::EmptyMetadata @@ -21690,25 +21562,25 @@ pub type vortex_array::arrays::Variant::OperationsVTable = vortex_array::arrays: pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::Variant -pub fn vortex_array::arrays::Variant::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: &Self::Array, other: &Self::Array, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: &Self::Array, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Variant::buffer(_array: &Self::Array, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Variant::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Variant::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Variant::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Variant::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Variant::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Variant::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Variant::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Variant::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Variant::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Variant::dtype(array: &Self::Array) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Variant::dtype(array: &Self::ArrayData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Variant::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21716,13 +21588,13 @@ pub fn vortex_array::arrays::Variant::execute_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Variant::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Variant::len(array: &Self::Array) -> usize +pub fn vortex_array::arrays::Variant::len(array: &Self::ArrayData) -> usize -pub fn vortex_array::arrays::Variant::metadata(_array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Variant::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Variant::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Variant::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Variant::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Variant::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21730,15 +21602,15 @@ pub fn vortex_array::arrays::Variant::reduce_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Variant::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Variant::stats(array: &Self::Array) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Variant::stats(array: &Self::ArrayData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Variant::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Variant::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Variant::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::dict::Dict -pub type vortex_array::arrays::dict::Dict::Array = vortex_array::arrays::dict::DictArray +pub type vortex_array::arrays::dict::Dict::ArrayData = vortex_array::arrays::dict::DictData pub type vortex_array::arrays::dict::Dict::Metadata = vortex_array::ProstMetadata @@ -21746,25 +21618,25 @@ pub type vortex_array::arrays::dict::Dict::OperationsVTable = vortex_array::arra pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::arrays::dict::DictArray, other: &vortex_array::arrays::dict::DictArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::arrays::dict::DictArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::dict::Dict::buffer(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::dict::Dict::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: &vortex_array::arrays::dict::DictArray, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::dict::Dict::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::child(array: &vortex_array::arrays::dict::DictArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::dict::Dict::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::dict::Dict::child_name(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::dict::Dict::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::dict::Dict::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::dtype(array: &vortex_array::arrays::dict::DictArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::dict::Dict::dtype(array: &vortex_array::arrays::dict::DictData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::dict::Dict::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21772,13 +21644,13 @@ pub fn vortex_array::arrays::dict::Dict::execute_parent(array: &vortex_array::vt pub fn vortex_array::arrays::dict::Dict::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::dict::Dict::len(array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::len(array: &vortex_array::arrays::dict::DictData) -> usize -pub fn vortex_array::arrays::dict::Dict::metadata(array: &vortex_array::arrays::dict::DictArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::nbuffers(_array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::dict::Dict::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::dict::Dict::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21786,15 +21658,15 @@ pub fn vortex_array::arrays::dict::Dict::reduce_parent(array: &vortex_array::vta pub fn vortex_array::arrays::dict::Dict::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::dict::Dict::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::dict::Dict::stats(array: &vortex_array::arrays::dict::DictData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::dict::Dict::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::dict::Dict::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::dict::Dict::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::null::Null -pub type vortex_array::arrays::null::Null::Array = vortex_array::arrays::null::NullArray +pub type vortex_array::arrays::null::Null::ArrayData = vortex_array::arrays::null::NullData pub type vortex_array::arrays::null::Null::Metadata = vortex_array::EmptyMetadata @@ -21802,25 +21674,25 @@ pub type vortex_array::arrays::null::Null::OperationsVTable = vortex_array::arra pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(array: &vortex_array::arrays::null::NullArray, other: &vortex_array::arrays::null::NullArray, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(array: &vortex_array::arrays::null::NullArray, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(array: &vortex_array::vtable::Array, state: &mut H, _precision: vortex_array::Precision) -pub fn vortex_array::arrays::null::Null::buffer(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::null::Null::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::null::Null::buffer_name(_array: &vortex_array::arrays::null::NullArray, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::null::Null::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::null::Null::build(_dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::build(_dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::null::Null::child(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::null::Null::child(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::null::Null::child_name(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::null::Null::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::null::Null::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::null::Null::dtype(_array: &vortex_array::arrays::null::NullArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::null::Null::dtype(_array: &vortex_array::arrays::null::NullData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::null::Null::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21828,13 +21700,13 @@ pub fn vortex_array::arrays::null::Null::execute_parent(array: &vortex_array::vt pub fn vortex_array::arrays::null::Null::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::null::Null::len(array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::Null::len(array: &vortex_array::arrays::null::NullData) -> usize -pub fn vortex_array::arrays::null::Null::metadata(_array: &vortex_array::arrays::null::NullArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::null::Null::nbuffers(_array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::Null::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::null::Null::nchildren(_array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::Null::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::null::Null::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21842,15 +21714,15 @@ pub fn vortex_array::arrays::null::Null::reduce_parent(array: &vortex_array::vta pub fn vortex_array::arrays::null::Null::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::null::Null::stats(array: &vortex_array::arrays::null::NullArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::null::Null::stats(array: &vortex_array::arrays::null::NullData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::null::Null::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::null::Null::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::null::Null::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::with_children(_array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::scalar_fn::ScalarFnVTable -pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::Array = vortex_array::arrays::scalar_fn::ScalarFnArray +pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ArrayData = vortex_array::arrays::ScalarFnData pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::Metadata = vortex_array::arrays::scalar_fn::metadata::ScalarFnMetadata @@ -21858,25 +21730,25 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::OperationsVTable = vor pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vortex_array::arrays::scalar_fn::ScalarFnVTable -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, other: &vortex_array::arrays::scalar_fn::ScalarFnArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer_name(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::scalar_fn::metadata::ScalarFnMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::scalar_fn::metadata::ScalarFnMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child_name(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child_name(array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::dtype(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::dtype(array: &vortex_array::arrays::ScalarFnData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21884,13 +21756,13 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::execute_parent(array: &v pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::len(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::len(array: &vortex_array::arrays::ScalarFnData) -> usize -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::metadata(array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nbuffers(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nchildren(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21898,15 +21770,15 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce_parent(array: &vo pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::ScalarFnData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::vtable(array: &Self::Array) -> &Self +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::vtable(array: &vortex_array::arrays::ScalarFnData) -> &Self -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::slice::Slice -pub type vortex_array::arrays::slice::Slice::Array = vortex_array::arrays::slice::SliceArray +pub type vortex_array::arrays::slice::Slice::ArrayData = vortex_array::arrays::SliceData pub type vortex_array::arrays::slice::Slice::Metadata = vortex_array::arrays::slice::SliceMetadata @@ -21914,25 +21786,25 @@ pub type vortex_array::arrays::slice::Slice::OperationsVTable = vortex_array::ar pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: &vortex_array::arrays::slice::SliceArray, other: &vortex_array::arrays::slice::SliceArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: &vortex_array::arrays::slice::SliceArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::slice::Slice::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::slice::Slice::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::slice::Slice::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::slice::Slice::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::slice::Slice::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::slice::SliceMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::slice::SliceMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::slice::Slice::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::slice::Slice::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::slice::Slice::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::slice::Slice::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::slice::Slice::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::slice::Slice::dtype(array: &vortex_array::arrays::slice::SliceArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::slice::Slice::dtype(array: &vortex_array::arrays::SliceData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::slice::Slice::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -21940,13 +21812,13 @@ pub fn vortex_array::arrays::slice::Slice::execute_parent(array: &vortex_array:: pub fn vortex_array::arrays::slice::Slice::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::slice::Slice::len(array: &vortex_array::arrays::slice::SliceArray) -> usize +pub fn vortex_array::arrays::slice::Slice::len(array: &vortex_array::arrays::SliceData) -> usize -pub fn vortex_array::arrays::slice::Slice::metadata(array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::slice::Slice::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::slice::Slice::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::slice::Slice::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::slice::Slice::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::slice::Slice::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -21954,11 +21826,11 @@ pub fn vortex_array::arrays::slice::Slice::reduce_parent(array: &vortex_array::v pub fn vortex_array::arrays::slice::Slice::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::slice::Slice::stats(array: &vortex_array::arrays::slice::SliceArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::slice::Slice::stats(array: &vortex_array::arrays::SliceData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::slice::Slice::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::slice::Slice::vtable(_array: &vortex_array::arrays::SliceData) -> &Self -pub fn vortex_array::arrays::slice::Slice::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> pub trait vortex_array::vtable::DynVTable: 'static + core::marker::Send + core::marker::Sync + core::fmt::Debug @@ -21994,95 +21866,95 @@ pub fn V::with_children(&self, array: &vortex_array::ArrayRef, children: alloc:: pub trait vortex_array::vtable::OperationsVTable -pub fn vortex_array::vtable::OperationsVTable::scalar_at(array: &::Array, index: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::vtable::OperationsVTable::scalar_at(array: &vortex_array::vtable::Array, index: usize, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Bool -pub fn vortex_array::arrays::Bool::scalar_at(array: &vortex_array::arrays::BoolArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::scalar_at(array: &vortex_array::arrays::ChunkedArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::scalar_at(array: &vortex_array::arrays::ConstantArray, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::scalar_at(array: &vortex_array::vtable::Array, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Decimal -pub fn vortex_array::arrays::Decimal::scalar_at(array: &vortex_array::arrays::DecimalArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::scalar_at(array: &vortex_array::arrays::ExtensionArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Filter -pub fn vortex_array::arrays::Filter::scalar_at(array: &vortex_array::arrays::FilterArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::FixedSizeList -pub fn vortex_array::arrays::FixedSizeList::scalar_at(array: &vortex_array::arrays::FixedSizeListArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::List -pub fn vortex_array::arrays::List::scalar_at(array: &vortex_array::arrays::ListArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::ListView -pub fn vortex_array::arrays::ListView::scalar_at(array: &vortex_array::arrays::ListViewArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Masked -pub fn vortex_array::arrays::Masked::scalar_at(array: &vortex_array::arrays::MaskedArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Primitive -pub fn vortex_array::arrays::Primitive::scalar_at(array: &vortex_array::arrays::PrimitiveArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Shared -pub fn vortex_array::arrays::Shared::scalar_at(array: &vortex_array::arrays::SharedArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Struct -pub fn vortex_array::arrays::Struct::scalar_at(array: &vortex_array::arrays::StructArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::VarBin -pub fn vortex_array::arrays::VarBin::scalar_at(array: &vortex_array::arrays::VarBinArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::VarBinView -pub fn vortex_array::arrays::VarBinView::scalar_at(array: &vortex_array::arrays::VarBinViewArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::Variant -pub fn vortex_array::arrays::Variant::scalar_at(array: &::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::scalar_at(array: &vortex_array::arrays::dict::DictArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::scalar_at(_array: &vortex_array::arrays::null::NullArray, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::scalar_at(_array: &vortex_array::vtable::Array, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::scalar_fn::ScalarFnVTable -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::scalar_at(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::Slice::scalar_at(array: &vortex_array::arrays::slice::SliceArray, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::scalar_at(array: &vortex_array::vtable::Array, index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult impl vortex_array::vtable::OperationsVTable for vortex_array::vtable::NotSupported -pub fn vortex_array::vtable::NotSupported::scalar_at(array: &::Array, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult +pub fn vortex_array::vtable::NotSupported::scalar_at(array: &vortex_array::vtable::Array, _index: usize, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult pub trait vortex_array::vtable::VTable: 'static + core::clone::Clone + core::marker::Sized + core::marker::Send + core::marker::Sync + core::fmt::Debug -pub type vortex_array::vtable::VTable::Array: 'static + core::marker::Send + core::marker::Sync + core::clone::Clone + core::fmt::Debug + core::ops::deref::Deref + vortex_array::IntoArray +pub type vortex_array::vtable::VTable::ArrayData: 'static + core::marker::Send + core::marker::Sync + core::clone::Clone + core::fmt::Debug + vortex_array::IntoArray pub type vortex_array::vtable::VTable::Metadata: core::fmt::Debug @@ -22090,25 +21962,25 @@ pub type vortex_array::vtable::VTable::OperationsVTable: vortex_array::vtable::O pub type vortex_array::vtable::VTable::ValidityVTable: vortex_array::vtable::ValidityVTable -pub fn vortex_array::vtable::VTable::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::vtable::VTable::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::vtable::VTable::array_eq(array: &Self::Array, other: &Self::Array, precision: vortex_array::Precision) -> bool +pub fn vortex_array::vtable::VTable::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::vtable::VTable::array_hash(array: &Self::Array, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::vtable::VTable::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::vtable::VTable::buffer(array: &Self::Array, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::vtable::VTable::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::vtable::VTable::buffer_name(array: &Self::Array, idx: usize) -> core::option::Option +pub fn vortex_array::vtable::VTable::buffer_name(array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::vtable::VTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::vtable::VTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::vtable::VTable::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::vtable::VTable::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::vtable::VTable::child_name(array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::vtable::VTable::child_name(array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::vtable::VTable::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::vtable::VTable::dtype(array: &Self::Array) -> &vortex_array::dtype::DType +pub fn vortex_array::vtable::VTable::dtype(array: &Self::ArrayData) -> &vortex_array::dtype::DType pub fn vortex_array::vtable::VTable::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22116,13 +21988,13 @@ pub fn vortex_array::vtable::VTable::execute_parent(array: &vortex_array::vtable pub fn vortex_array::vtable::VTable::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::vtable::VTable::len(array: &Self::Array) -> usize +pub fn vortex_array::vtable::VTable::len(array: &Self::ArrayData) -> usize -pub fn vortex_array::vtable::VTable::metadata(array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::vtable::VTable::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::vtable::VTable::nbuffers(array: &Self::Array) -> usize +pub fn vortex_array::vtable::VTable::nbuffers(array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::vtable::VTable::nchildren(array: &Self::Array) -> usize +pub fn vortex_array::vtable::VTable::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::vtable::VTable::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22130,15 +22002,15 @@ pub fn vortex_array::vtable::VTable::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::vtable::VTable::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::vtable::VTable::stats(array: &Self::Array) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::vtable::VTable::stats(array: &Self::ArrayData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::vtable::VTable::vtable(array: &Self::Array) -> &Self +pub fn vortex_array::vtable::VTable::vtable(array: &Self::ArrayData) -> &Self -pub fn vortex_array::vtable::VTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::vtable::VTable::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Bool -pub type vortex_array::arrays::Bool::Array = vortex_array::arrays::BoolArray +pub type vortex_array::arrays::Bool::ArrayData = vortex_array::arrays::BoolData pub type vortex_array::arrays::Bool::Metadata = vortex_array::ProstMetadata @@ -22146,25 +22018,25 @@ pub type vortex_array::arrays::Bool::OperationsVTable = vortex_array::arrays::Bo pub type vortex_array::arrays::Bool::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Bool::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Bool::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Bool::array_eq(array: &vortex_array::arrays::BoolArray, other: &vortex_array::arrays::BoolArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Bool::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Bool::array_hash(array: &vortex_array::arrays::BoolArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Bool::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Bool::buffer(array: &vortex_array::arrays::BoolArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Bool::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Bool::buffer_name(_array: &vortex_array::arrays::BoolArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Bool::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Bool::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Bool::child(array: &vortex_array::arrays::BoolArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Bool::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Bool::child_name(_array: &vortex_array::arrays::BoolArray, _idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Bool::child_name(_array: &vortex_array::vtable::Array, _idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Bool::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Bool::dtype(array: &vortex_array::arrays::BoolArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Bool::dtype(array: &vortex_array::arrays::BoolData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Bool::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22172,13 +22044,13 @@ pub fn vortex_array::arrays::Bool::execute_parent(array: &vortex_array::vtable:: pub fn vortex_array::arrays::Bool::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Bool::len(array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::Bool::len(array: &vortex_array::arrays::BoolData) -> usize -pub fn vortex_array::arrays::Bool::metadata(array: &vortex_array::arrays::BoolArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Bool::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Bool::nbuffers(_array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::Bool::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Bool::nchildren(array: &vortex_array::arrays::BoolArray) -> usize +pub fn vortex_array::arrays::Bool::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Bool::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22186,15 +22058,15 @@ pub fn vortex_array::arrays::Bool::reduce_parent(array: &vortex_array::vtable::A pub fn vortex_array::arrays::Bool::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Bool::stats(array: &vortex_array::arrays::BoolArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Bool::stats(array: &vortex_array::arrays::BoolData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Bool::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Bool::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Bool::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Bool::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Chunked -pub type vortex_array::arrays::Chunked::Array = vortex_array::arrays::ChunkedArray +pub type vortex_array::arrays::Chunked::ArrayData = vortex_array::arrays::ChunkedData pub type vortex_array::arrays::Chunked::Metadata = vortex_array::EmptyMetadata @@ -22202,25 +22074,25 @@ pub type vortex_array::arrays::Chunked::OperationsVTable = vortex_array::arrays: pub type vortex_array::arrays::Chunked::ValidityVTable = vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::append_to_builder(array: &vortex_array::arrays::ChunkedArray, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Chunked::array_eq(array: &vortex_array::arrays::ChunkedArray, other: &vortex_array::arrays::ChunkedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Chunked::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Chunked::array_hash(array: &vortex_array::arrays::ChunkedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Chunked::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Chunked::buffer(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Chunked::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Chunked::buffer_name(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Chunked::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Chunked::build(dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::build(dtype: &vortex_array::dtype::DType, _len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Chunked::child(array: &vortex_array::arrays::ChunkedArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Chunked::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Chunked::child_name(_array: &vortex_array::arrays::ChunkedArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Chunked::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Chunked::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Chunked::dtype(array: &vortex_array::arrays::ChunkedArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Chunked::dtype(array: &vortex_array::arrays::ChunkedData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Chunked::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22228,13 +22100,13 @@ pub fn vortex_array::arrays::Chunked::execute_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Chunked::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Chunked::len(array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::Chunked::len(array: &vortex_array::arrays::ChunkedData) -> usize -pub fn vortex_array::arrays::Chunked::metadata(_array: &vortex_array::arrays::ChunkedArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Chunked::nbuffers(_array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::Chunked::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Chunked::nchildren(array: &vortex_array::arrays::ChunkedArray) -> usize +pub fn vortex_array::arrays::Chunked::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Chunked::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22242,15 +22114,15 @@ pub fn vortex_array::arrays::Chunked::reduce_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Chunked::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Chunked::stats(array: &vortex_array::arrays::ChunkedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Chunked::stats(array: &vortex_array::arrays::ChunkedData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Chunked::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Chunked::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Chunked::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Chunked::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Constant -pub type vortex_array::arrays::Constant::Array = vortex_array::arrays::ConstantArray +pub type vortex_array::arrays::Constant::ArrayData = vortex_array::arrays::ConstantData pub type vortex_array::arrays::Constant::Metadata = vortex_array::scalar::Scalar @@ -22258,25 +22130,25 @@ pub type vortex_array::arrays::Constant::OperationsVTable = vortex_array::arrays pub type vortex_array::arrays::Constant::ValidityVTable = vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::append_to_builder(array: &vortex_array::arrays::ConstantArray, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Constant::array_eq(array: &vortex_array::arrays::ConstantArray, other: &vortex_array::arrays::ConstantArray, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Constant::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Constant::array_hash(array: &vortex_array::arrays::ConstantArray, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::Constant::array_hash(array: &vortex_array::vtable::Array, state: &mut H, _precision: vortex_array::Precision) -pub fn vortex_array::arrays::Constant::buffer(array: &vortex_array::arrays::ConstantArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Constant::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Constant::buffer_name(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Constant::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Constant::build(_dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::build(_dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Constant::child(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Constant::child(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Constant::child_name(_array: &vortex_array::arrays::ConstantArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Constant::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Constant::deserialize(_bytes: &[u8], dtype: &vortex_array::dtype::DType, _len: usize, buffers: &[vortex_array::buffer::BufferHandle], session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Constant::dtype(array: &vortex_array::arrays::ConstantArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Constant::dtype(array: &vortex_array::arrays::ConstantData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Constant::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22284,13 +22156,13 @@ pub fn vortex_array::arrays::Constant::execute_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::Constant::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Constant::len(array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::Constant::len(array: &vortex_array::arrays::ConstantData) -> usize -pub fn vortex_array::arrays::Constant::metadata(array: &vortex_array::arrays::ConstantArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Constant::nbuffers(_array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::Constant::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Constant::nchildren(_array: &vortex_array::arrays::ConstantArray) -> usize +pub fn vortex_array::arrays::Constant::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Constant::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22298,15 +22170,15 @@ pub fn vortex_array::arrays::Constant::reduce_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Constant::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Constant::stats(array: &vortex_array::arrays::ConstantArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Constant::stats(array: &vortex_array::arrays::ConstantData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Constant::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Constant::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Constant::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Constant::with_children(_array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Decimal -pub type vortex_array::arrays::Decimal::Array = vortex_array::arrays::DecimalArray +pub type vortex_array::arrays::Decimal::ArrayData = vortex_array::arrays::DecimalData pub type vortex_array::arrays::Decimal::Metadata = vortex_array::ProstMetadata @@ -22314,25 +22186,25 @@ pub type vortex_array::arrays::Decimal::OperationsVTable = vortex_array::arrays: pub type vortex_array::arrays::Decimal::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Decimal::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Decimal::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Decimal::array_eq(array: &vortex_array::arrays::DecimalArray, other: &vortex_array::arrays::DecimalArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Decimal::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Decimal::array_hash(array: &vortex_array::arrays::DecimalArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Decimal::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Decimal::buffer(array: &vortex_array::arrays::DecimalArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Decimal::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Decimal::buffer_name(_array: &vortex_array::arrays::DecimalArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Decimal::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Decimal::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Decimal::child(array: &vortex_array::arrays::DecimalArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Decimal::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Decimal::child_name(_array: &vortex_array::arrays::DecimalArray, _idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Decimal::child_name(_array: &vortex_array::vtable::Array, _idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Decimal::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Decimal::dtype(array: &vortex_array::arrays::DecimalArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Decimal::dtype(array: &vortex_array::arrays::DecimalData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Decimal::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22340,13 +22212,13 @@ pub fn vortex_array::arrays::Decimal::execute_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Decimal::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Decimal::len(array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::Decimal::len(array: &vortex_array::arrays::DecimalData) -> usize -pub fn vortex_array::arrays::Decimal::metadata(array: &vortex_array::arrays::DecimalArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Decimal::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Decimal::nbuffers(_array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::Decimal::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Decimal::nchildren(array: &vortex_array::arrays::DecimalArray) -> usize +pub fn vortex_array::arrays::Decimal::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Decimal::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22354,15 +22226,15 @@ pub fn vortex_array::arrays::Decimal::reduce_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Decimal::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Decimal::stats(array: &vortex_array::arrays::DecimalArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Decimal::stats(array: &vortex_array::arrays::DecimalData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Decimal::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Decimal::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Decimal::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Decimal::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Extension -pub type vortex_array::arrays::Extension::Array = vortex_array::arrays::ExtensionArray +pub type vortex_array::arrays::Extension::ArrayData = vortex_array::arrays::ExtensionData pub type vortex_array::arrays::Extension::Metadata = vortex_array::EmptyMetadata @@ -22370,25 +22242,25 @@ pub type vortex_array::arrays::Extension::OperationsVTable = vortex_array::array pub type vortex_array::arrays::Extension::ValidityVTable = vortex_array::vtable::ValidityVTableFromChild -pub fn vortex_array::arrays::Extension::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Extension::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Extension::array_eq(array: &vortex_array::arrays::ExtensionArray, other: &vortex_array::arrays::ExtensionArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Extension::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Extension::array_hash(array: &vortex_array::arrays::ExtensionArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Extension::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Extension::buffer(_array: &vortex_array::arrays::ExtensionArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Extension::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Extension::buffer_name(_array: &vortex_array::arrays::ExtensionArray, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Extension::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Extension::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Extension::child(array: &vortex_array::arrays::ExtensionArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Extension::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Extension::child_name(_array: &vortex_array::arrays::ExtensionArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Extension::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Extension::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Extension::dtype(array: &vortex_array::arrays::ExtensionArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Extension::dtype(array: &vortex_array::arrays::ExtensionData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Extension::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22396,13 +22268,13 @@ pub fn vortex_array::arrays::Extension::execute_parent(array: &vortex_array::vta pub fn vortex_array::arrays::Extension::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Extension::len(array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::Extension::len(array: &vortex_array::arrays::ExtensionData) -> usize -pub fn vortex_array::arrays::Extension::metadata(_array: &vortex_array::arrays::ExtensionArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Extension::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Extension::nbuffers(_array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::Extension::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Extension::nchildren(_array: &vortex_array::arrays::ExtensionArray) -> usize +pub fn vortex_array::arrays::Extension::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Extension::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22410,15 +22282,15 @@ pub fn vortex_array::arrays::Extension::reduce_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::Extension::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Extension::stats(array: &vortex_array::arrays::ExtensionArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Extension::stats(array: &vortex_array::arrays::ExtensionData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Extension::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Extension::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Extension::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Extension::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Filter -pub type vortex_array::arrays::Filter::Array = vortex_array::arrays::FilterArray +pub type vortex_array::arrays::Filter::ArrayData = vortex_array::arrays::FilterData pub type vortex_array::arrays::Filter::Metadata = vortex_array::arrays::filter::vtable::FilterMetadata @@ -22426,25 +22298,25 @@ pub type vortex_array::arrays::Filter::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Filter::ValidityVTable = vortex_array::arrays::Filter -pub fn vortex_array::arrays::Filter::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Filter::array_eq(array: &vortex_array::arrays::FilterArray, other: &vortex_array::arrays::FilterArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Filter::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Filter::array_hash(array: &vortex_array::arrays::FilterArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Filter::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Filter::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Filter::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Filter::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Filter::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Filter::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::filter::vtable::FilterMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::filter::vtable::FilterMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Filter::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Filter::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Filter::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Filter::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Filter::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Filter::dtype(array: &vortex_array::arrays::FilterArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Filter::dtype(array: &vortex_array::arrays::FilterData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Filter::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22452,13 +22324,13 @@ pub fn vortex_array::arrays::Filter::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Filter::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Filter::len(array: &vortex_array::arrays::FilterArray) -> usize +pub fn vortex_array::arrays::Filter::len(array: &vortex_array::arrays::FilterData) -> usize -pub fn vortex_array::arrays::Filter::metadata(array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Filter::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Filter::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Filter::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Filter::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Filter::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22466,15 +22338,15 @@ pub fn vortex_array::arrays::Filter::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Filter::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Filter::stats(array: &vortex_array::arrays::FilterArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Filter::stats(array: &vortex_array::arrays::FilterData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Filter::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Filter::vtable(_array: &vortex_array::arrays::FilterData) -> &Self -pub fn vortex_array::arrays::Filter::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Filter::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::FixedSizeList -pub type vortex_array::arrays::FixedSizeList::Array = vortex_array::arrays::FixedSizeListArray +pub type vortex_array::arrays::FixedSizeList::ArrayData = vortex_array::arrays::FixedSizeListData pub type vortex_array::arrays::FixedSizeList::Metadata = vortex_array::EmptyMetadata @@ -22482,25 +22354,25 @@ pub type vortex_array::arrays::FixedSizeList::OperationsVTable = vortex_array::a pub type vortex_array::arrays::FixedSizeList::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeList::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::FixedSizeList::array_eq(array: &vortex_array::arrays::FixedSizeListArray, other: &vortex_array::arrays::FixedSizeListArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::FixedSizeList::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::FixedSizeList::array_hash(array: &vortex_array::arrays::FixedSizeListArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::FixedSizeList::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::FixedSizeList::buffer(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::FixedSizeList::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::FixedSizeList::buffer_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::FixedSizeList::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::FixedSizeList::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeList::child(array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FixedSizeList::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::FixedSizeList::child_name(_array: &vortex_array::arrays::FixedSizeListArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::FixedSizeList::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::FixedSizeList::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeList::dtype(array: &vortex_array::arrays::FixedSizeListArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::FixedSizeList::dtype(array: &vortex_array::arrays::FixedSizeListData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::FixedSizeList::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22508,13 +22380,13 @@ pub fn vortex_array::arrays::FixedSizeList::execute_parent(array: &vortex_array: pub fn vortex_array::arrays::FixedSizeList::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::FixedSizeList::len(array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeList::len(array: &vortex_array::arrays::FixedSizeListData) -> usize -pub fn vortex_array::arrays::FixedSizeList::metadata(_array: &vortex_array::arrays::FixedSizeListArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::FixedSizeList::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::FixedSizeList::nbuffers(_array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeList::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::FixedSizeList::nchildren(array: &vortex_array::arrays::FixedSizeListArray) -> usize +pub fn vortex_array::arrays::FixedSizeList::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::FixedSizeList::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22522,15 +22394,15 @@ pub fn vortex_array::arrays::FixedSizeList::reduce_parent(array: &vortex_array:: pub fn vortex_array::arrays::FixedSizeList::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::FixedSizeList::stats(array: &vortex_array::arrays::FixedSizeListArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::FixedSizeList::stats(array: &vortex_array::arrays::FixedSizeListData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::FixedSizeList::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::FixedSizeList::vtable(_array: &vortex_array::arrays::FixedSizeListData) -> &Self -pub fn vortex_array::arrays::FixedSizeList::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::FixedSizeList::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::List -pub type vortex_array::arrays::List::Array = vortex_array::arrays::ListArray +pub type vortex_array::arrays::List::ArrayData = vortex_array::arrays::ListData pub type vortex_array::arrays::List::Metadata = vortex_array::ProstMetadata @@ -22538,25 +22410,25 @@ pub type vortex_array::arrays::List::OperationsVTable = vortex_array::arrays::Li pub type vortex_array::arrays::List::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::List::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::List::array_eq(array: &vortex_array::arrays::ListArray, other: &vortex_array::arrays::ListArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::List::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::List::array_hash(array: &vortex_array::arrays::ListArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::List::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::List::buffer(_array: &vortex_array::arrays::ListArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::List::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::List::buffer_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::List::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::List::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::List::child(array: &vortex_array::arrays::ListArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::List::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::List::child_name(_array: &vortex_array::arrays::ListArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::List::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::List::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::List::dtype(array: &vortex_array::arrays::ListArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::List::dtype(array: &vortex_array::arrays::ListData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::List::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22564,13 +22436,13 @@ pub fn vortex_array::arrays::List::execute_parent(array: &vortex_array::vtable:: pub fn vortex_array::arrays::List::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::List::len(array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::List::len(array: &vortex_array::arrays::ListData) -> usize -pub fn vortex_array::arrays::List::metadata(array: &vortex_array::arrays::ListArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::List::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::List::nbuffers(_array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::List::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::List::nchildren(array: &vortex_array::arrays::ListArray) -> usize +pub fn vortex_array::arrays::List::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::List::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22578,15 +22450,15 @@ pub fn vortex_array::arrays::List::reduce_parent(array: &vortex_array::vtable::A pub fn vortex_array::arrays::List::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::List::stats(array: &vortex_array::arrays::ListArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::List::stats(array: &vortex_array::arrays::ListData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::List::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::List::vtable(_array: &vortex_array::arrays::ListData) -> &Self -pub fn vortex_array::arrays::List::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::List::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::ListView -pub type vortex_array::arrays::ListView::Array = vortex_array::arrays::ListViewArray +pub type vortex_array::arrays::ListView::ArrayData = vortex_array::arrays::ListViewData pub type vortex_array::arrays::ListView::Metadata = vortex_array::ProstMetadata @@ -22594,25 +22466,25 @@ pub type vortex_array::arrays::ListView::OperationsVTable = vortex_array::arrays pub type vortex_array::arrays::ListView::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::ListView::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::ListView::array_eq(array: &vortex_array::arrays::ListViewArray, other: &vortex_array::arrays::ListViewArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::ListView::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::ListView::array_hash(array: &vortex_array::arrays::ListViewArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::ListView::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::ListView::buffer(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::ListView::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::ListView::buffer_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::ListView::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::ListView::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListView::child(array: &vortex_array::arrays::ListViewArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListView::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::ListView::child_name(_array: &vortex_array::arrays::ListViewArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::ListView::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::ListView::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListView::dtype(array: &vortex_array::arrays::ListViewArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::ListView::dtype(array: &vortex_array::arrays::ListViewData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::ListView::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22620,13 +22492,13 @@ pub fn vortex_array::arrays::ListView::execute_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::ListView::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::ListView::len(array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListView::len(array: &vortex_array::arrays::ListViewData) -> usize -pub fn vortex_array::arrays::ListView::metadata(array: &vortex_array::arrays::ListViewArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::ListView::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::ListView::nbuffers(_array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListView::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::ListView::nchildren(array: &vortex_array::arrays::ListViewArray) -> usize +pub fn vortex_array::arrays::ListView::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::ListView::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22634,15 +22506,15 @@ pub fn vortex_array::arrays::ListView::reduce_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::ListView::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::ListView::stats(array: &vortex_array::arrays::ListViewArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::ListView::stats(array: &vortex_array::arrays::ListViewData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::ListView::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::ListView::vtable(_array: &vortex_array::arrays::ListViewData) -> &Self -pub fn vortex_array::arrays::ListView::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::ListView::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Masked -pub type vortex_array::arrays::Masked::Array = vortex_array::arrays::MaskedArray +pub type vortex_array::arrays::Masked::ArrayData = vortex_array::arrays::MaskedData pub type vortex_array::arrays::Masked::Metadata = vortex_array::EmptyMetadata @@ -22650,25 +22522,25 @@ pub type vortex_array::arrays::Masked::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Masked::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Masked::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Masked::array_eq(array: &vortex_array::arrays::MaskedArray, other: &vortex_array::arrays::MaskedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Masked::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Masked::array_hash(array: &vortex_array::arrays::MaskedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Masked::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Masked::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Masked::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Masked::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Masked::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Masked::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Masked::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Masked::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Masked::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Masked::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Masked::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Masked::dtype(array: &vortex_array::arrays::MaskedArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Masked::dtype(array: &vortex_array::arrays::MaskedData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Masked::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22676,13 +22548,13 @@ pub fn vortex_array::arrays::Masked::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Masked::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Masked::len(array: &vortex_array::arrays::MaskedArray) -> usize +pub fn vortex_array::arrays::Masked::len(array: &vortex_array::arrays::MaskedData) -> usize -pub fn vortex_array::arrays::Masked::metadata(_array: &vortex_array::arrays::MaskedArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Masked::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Masked::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Masked::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Masked::nchildren(array: &Self::Array) -> usize +pub fn vortex_array::arrays::Masked::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Masked::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22690,15 +22562,15 @@ pub fn vortex_array::arrays::Masked::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Masked::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Masked::stats(array: &vortex_array::arrays::MaskedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Masked::stats(array: &vortex_array::arrays::MaskedData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Masked::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Masked::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Masked::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Masked::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Primitive -pub type vortex_array::arrays::Primitive::Array = vortex_array::arrays::PrimitiveArray +pub type vortex_array::arrays::Primitive::ArrayData = vortex_array::arrays::PrimitiveData pub type vortex_array::arrays::Primitive::Metadata = vortex_array::EmptyMetadata @@ -22706,25 +22578,25 @@ pub type vortex_array::arrays::Primitive::OperationsVTable = vortex_array::array pub type vortex_array::arrays::Primitive::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Primitive::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Primitive::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Primitive::array_eq(array: &vortex_array::arrays::PrimitiveArray, other: &vortex_array::arrays::PrimitiveArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Primitive::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Primitive::array_hash(array: &vortex_array::arrays::PrimitiveArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Primitive::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Primitive::buffer(array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Primitive::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Primitive::buffer_name(_array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Primitive::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Primitive::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Primitive::child(array: &vortex_array::arrays::PrimitiveArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Primitive::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Primitive::child_name(_array: &vortex_array::arrays::PrimitiveArray, _idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Primitive::child_name(_array: &vortex_array::vtable::Array, _idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Primitive::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Primitive::dtype(array: &vortex_array::arrays::PrimitiveArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Primitive::dtype(array: &vortex_array::arrays::PrimitiveData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Primitive::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22732,13 +22604,13 @@ pub fn vortex_array::arrays::Primitive::execute_parent(array: &vortex_array::vta pub fn vortex_array::arrays::Primitive::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Primitive::len(array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::Primitive::len(array: &vortex_array::arrays::PrimitiveData) -> usize -pub fn vortex_array::arrays::Primitive::metadata(_array: &vortex_array::arrays::PrimitiveArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Primitive::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Primitive::nbuffers(_array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::Primitive::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Primitive::nchildren(array: &vortex_array::arrays::PrimitiveArray) -> usize +pub fn vortex_array::arrays::Primitive::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Primitive::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22746,15 +22618,15 @@ pub fn vortex_array::arrays::Primitive::reduce_parent(array: &vortex_array::vtab pub fn vortex_array::arrays::Primitive::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Primitive::stats(array: &vortex_array::arrays::PrimitiveArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Primitive::stats(array: &vortex_array::arrays::PrimitiveData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Primitive::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Primitive::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Primitive::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Primitive::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Shared -pub type vortex_array::arrays::Shared::Array = vortex_array::arrays::SharedArray +pub type vortex_array::arrays::Shared::ArrayData = vortex_array::arrays::SharedData pub type vortex_array::arrays::Shared::Metadata = vortex_array::EmptyMetadata @@ -22762,25 +22634,25 @@ pub type vortex_array::arrays::Shared::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Shared::ValidityVTable = vortex_array::arrays::Shared -pub fn vortex_array::arrays::Shared::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Shared::array_eq(array: &vortex_array::arrays::SharedArray, other: &vortex_array::arrays::SharedArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Shared::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Shared::array_hash(array: &vortex_array::arrays::SharedArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Shared::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Shared::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Shared::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Shared::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Shared::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Shared::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Shared::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Shared::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Shared::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Shared::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Shared::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Shared::dtype(array: &vortex_array::arrays::SharedArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Shared::dtype(array: &vortex_array::arrays::SharedData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Shared::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22788,13 +22660,13 @@ pub fn vortex_array::arrays::Shared::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Shared::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Shared::len(array: &vortex_array::arrays::SharedArray) -> usize +pub fn vortex_array::arrays::Shared::len(array: &vortex_array::arrays::SharedData) -> usize -pub fn vortex_array::arrays::Shared::metadata(_array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Shared::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Shared::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Shared::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Shared::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Shared::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22802,15 +22674,15 @@ pub fn vortex_array::arrays::Shared::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Shared::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Shared::stats(array: &vortex_array::arrays::SharedArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Shared::stats(array: &vortex_array::arrays::SharedData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Shared::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Shared::vtable(_array: &vortex_array::arrays::SharedData) -> &Self -pub fn vortex_array::arrays::Shared::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Shared::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Struct -pub type vortex_array::arrays::Struct::Array = vortex_array::arrays::StructArray +pub type vortex_array::arrays::Struct::ArrayData = vortex_array::arrays::StructData pub type vortex_array::arrays::Struct::Metadata = vortex_array::EmptyMetadata @@ -22818,25 +22690,25 @@ pub type vortex_array::arrays::Struct::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::Struct::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::Struct::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Struct::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Struct::array_eq(array: &vortex_array::arrays::StructArray, other: &vortex_array::arrays::StructArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Struct::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Struct::array_hash(array: &vortex_array::arrays::StructArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Struct::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Struct::buffer(_array: &vortex_array::arrays::StructArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Struct::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Struct::buffer_name(_array: &vortex_array::arrays::StructArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Struct::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Struct::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Struct::child(array: &vortex_array::arrays::StructArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Struct::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Struct::child_name(array: &vortex_array::arrays::StructArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Struct::child_name(array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Struct::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Struct::dtype(array: &vortex_array::arrays::StructArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Struct::dtype(array: &vortex_array::arrays::StructData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Struct::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22844,13 +22716,13 @@ pub fn vortex_array::arrays::Struct::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Struct::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Struct::len(array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::Struct::len(array: &vortex_array::arrays::StructData) -> usize -pub fn vortex_array::arrays::Struct::metadata(_array: &vortex_array::arrays::StructArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Struct::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Struct::nbuffers(_array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::Struct::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Struct::nchildren(array: &vortex_array::arrays::StructArray) -> usize +pub fn vortex_array::arrays::Struct::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Struct::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22858,15 +22730,15 @@ pub fn vortex_array::arrays::Struct::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::Struct::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Struct::stats(array: &vortex_array::arrays::StructArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Struct::stats(array: &vortex_array::arrays::StructData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Struct::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Struct::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Struct::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Struct::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::VarBin -pub type vortex_array::arrays::VarBin::Array = vortex_array::arrays::VarBinArray +pub type vortex_array::arrays::VarBin::ArrayData = vortex_array::arrays::VarBinData pub type vortex_array::arrays::VarBin::Metadata = vortex_array::ProstMetadata @@ -22874,25 +22746,25 @@ pub type vortex_array::arrays::VarBin::OperationsVTable = vortex_array::arrays:: pub type vortex_array::arrays::VarBin::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::VarBin::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBin::array_eq(array: &vortex_array::arrays::VarBinArray, other: &vortex_array::arrays::VarBinArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBin::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBin::array_hash(array: &vortex_array::arrays::VarBinArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBin::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::VarBin::buffer(array: &vortex_array::arrays::VarBinArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::VarBin::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::VarBin::buffer_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::VarBin::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::VarBin::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBin::child(array: &vortex_array::arrays::VarBinArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBin::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBin::child_name(_array: &vortex_array::arrays::VarBinArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::VarBin::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::VarBin::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBin::dtype(array: &vortex_array::arrays::VarBinArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::VarBin::dtype(array: &vortex_array::arrays::VarBinData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::VarBin::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22900,13 +22772,13 @@ pub fn vortex_array::arrays::VarBin::execute_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::VarBin::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::VarBin::len(array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBin::len(array: &vortex_array::arrays::VarBinData) -> usize -pub fn vortex_array::arrays::VarBin::metadata(array: &vortex_array::arrays::VarBinArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBin::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBin::nbuffers(_array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBin::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::VarBin::nchildren(array: &vortex_array::arrays::VarBinArray) -> usize +pub fn vortex_array::arrays::VarBin::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::VarBin::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22914,15 +22786,15 @@ pub fn vortex_array::arrays::VarBin::reduce_parent(array: &vortex_array::vtable: pub fn vortex_array::arrays::VarBin::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::VarBin::stats(array: &vortex_array::arrays::VarBinArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::VarBin::stats(array: &vortex_array::arrays::VarBinData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::VarBin::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::VarBin::vtable(_array: &vortex_array::arrays::VarBinData) -> &Self -pub fn vortex_array::arrays::VarBin::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBin::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::VarBinView -pub type vortex_array::arrays::VarBinView::Array = vortex_array::arrays::VarBinViewArray +pub type vortex_array::arrays::VarBinView::ArrayData = vortex_array::arrays::VarBinViewData pub type vortex_array::arrays::VarBinView::Metadata = vortex_array::EmptyMetadata @@ -22930,25 +22802,25 @@ pub type vortex_array::arrays::VarBinView::OperationsVTable = vortex_array::arra pub type vortex_array::arrays::VarBinView::ValidityVTable = vortex_array::vtable::ValidityVTableFromValidityHelper -pub fn vortex_array::arrays::VarBinView::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinView::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::VarBinView::array_eq(array: &vortex_array::arrays::VarBinViewArray, other: &vortex_array::arrays::VarBinViewArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::VarBinView::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::VarBinView::array_hash(array: &vortex_array::arrays::VarBinViewArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::VarBinView::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::VarBinView::buffer(array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::VarBinView::buffer(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::VarBinView::buffer_name(array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::VarBinView::buffer_name(array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::VarBinView::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinView::child(array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinView::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::VarBinView::child_name(_array: &vortex_array::arrays::VarBinViewArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::VarBinView::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::VarBinView::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinView::dtype(array: &vortex_array::arrays::VarBinViewArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::VarBinView::dtype(array: &vortex_array::arrays::VarBinViewData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::VarBinView::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -22956,13 +22828,13 @@ pub fn vortex_array::arrays::VarBinView::execute_parent(array: &vortex_array::vt pub fn vortex_array::arrays::VarBinView::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::VarBinView::len(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinView::len(array: &vortex_array::arrays::VarBinViewData) -> usize -pub fn vortex_array::arrays::VarBinView::metadata(_array: &vortex_array::arrays::VarBinViewArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::VarBinView::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::VarBinView::nbuffers(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinView::nbuffers(array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::VarBinView::nchildren(array: &vortex_array::arrays::VarBinViewArray) -> usize +pub fn vortex_array::arrays::VarBinView::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::VarBinView::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -22970,15 +22842,15 @@ pub fn vortex_array::arrays::VarBinView::reduce_parent(array: &vortex_array::vta pub fn vortex_array::arrays::VarBinView::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::VarBinView::stats(array: &vortex_array::arrays::VarBinViewArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::VarBinView::stats(array: &vortex_array::arrays::VarBinViewData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::VarBinView::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::VarBinView::vtable(_array: &vortex_array::arrays::VarBinViewData) -> &Self -pub fn vortex_array::arrays::VarBinView::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::VarBinView::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::Variant -pub type vortex_array::arrays::Variant::Array = vortex_array::arrays::variant::VariantArray +pub type vortex_array::arrays::Variant::ArrayData = vortex_array::arrays::variant::VariantData pub type vortex_array::arrays::Variant::Metadata = vortex_array::EmptyMetadata @@ -22986,25 +22858,25 @@ pub type vortex_array::arrays::Variant::OperationsVTable = vortex_array::arrays: pub type vortex_array::arrays::Variant::ValidityVTable = vortex_array::arrays::Variant -pub fn vortex_array::arrays::Variant::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::Variant::array_eq(array: &Self::Array, other: &Self::Array, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::Variant::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::Variant::array_hash(array: &Self::Array, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::Variant::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::Variant::buffer(_array: &Self::Array, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::Variant::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::Variant::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::Variant::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::Variant::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::build(dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Variant::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::Variant::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::Variant::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::Variant::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::Variant::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Variant::dtype(array: &Self::Array) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::Variant::dtype(array: &Self::ArrayData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::Variant::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23012,13 +22884,13 @@ pub fn vortex_array::arrays::Variant::execute_parent(array: &vortex_array::vtabl pub fn vortex_array::arrays::Variant::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::Variant::len(array: &Self::Array) -> usize +pub fn vortex_array::arrays::Variant::len(array: &Self::ArrayData) -> usize -pub fn vortex_array::arrays::Variant::metadata(_array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::Variant::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Variant::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::Variant::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::Variant::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::Variant::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -23026,15 +22898,15 @@ pub fn vortex_array::arrays::Variant::reduce_parent(array: &vortex_array::vtable pub fn vortex_array::arrays::Variant::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::Variant::stats(array: &Self::Array) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::Variant::stats(array: &Self::ArrayData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::Variant::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::Variant::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::Variant::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::Variant::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::dict::Dict -pub type vortex_array::arrays::dict::Dict::Array = vortex_array::arrays::dict::DictArray +pub type vortex_array::arrays::dict::Dict::ArrayData = vortex_array::arrays::dict::DictData pub type vortex_array::arrays::dict::Dict::Metadata = vortex_array::ProstMetadata @@ -23042,25 +22914,25 @@ pub type vortex_array::arrays::dict::Dict::OperationsVTable = vortex_array::arra pub type vortex_array::arrays::dict::Dict::ValidityVTable = vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::arrays::dict::DictArray, other: &vortex_array::arrays::dict::DictArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::dict::Dict::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::arrays::dict::DictArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::dict::Dict::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::dict::Dict::buffer(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::dict::Dict::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: &vortex_array::arrays::dict::DictArray, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::dict::Dict::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::dict::Dict::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::child(array: &vortex_array::arrays::dict::DictArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::dict::Dict::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::dict::Dict::child_name(_array: &vortex_array::arrays::dict::DictArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::dict::Dict::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::dict::Dict::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::dtype(array: &vortex_array::arrays::dict::DictArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::dict::Dict::dtype(array: &vortex_array::arrays::dict::DictData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::dict::Dict::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23068,13 +22940,13 @@ pub fn vortex_array::arrays::dict::Dict::execute_parent(array: &vortex_array::vt pub fn vortex_array::arrays::dict::Dict::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::dict::Dict::len(array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::len(array: &vortex_array::arrays::dict::DictData) -> usize -pub fn vortex_array::arrays::dict::Dict::metadata(array: &vortex_array::arrays::dict::DictArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::dict::Dict::nbuffers(_array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::dict::Dict::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize +pub fn vortex_array::arrays::dict::Dict::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::dict::Dict::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -23082,15 +22954,15 @@ pub fn vortex_array::arrays::dict::Dict::reduce_parent(array: &vortex_array::vta pub fn vortex_array::arrays::dict::Dict::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::dict::Dict::stats(array: &vortex_array::arrays::dict::DictArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::dict::Dict::stats(array: &vortex_array::arrays::dict::DictData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::dict::Dict::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::dict::Dict::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::dict::Dict::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::dict::Dict::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::null::Null -pub type vortex_array::arrays::null::Null::Array = vortex_array::arrays::null::NullArray +pub type vortex_array::arrays::null::Null::ArrayData = vortex_array::arrays::null::NullData pub type vortex_array::arrays::null::Null::Metadata = vortex_array::EmptyMetadata @@ -23098,25 +22970,25 @@ pub type vortex_array::arrays::null::Null::OperationsVTable = vortex_array::arra pub type vortex_array::arrays::null::Null::ValidityVTable = vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::null::Null::array_eq(array: &vortex_array::arrays::null::NullArray, other: &vortex_array::arrays::null::NullArray, _precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::null::Null::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, _precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::null::Null::array_hash(array: &vortex_array::arrays::null::NullArray, state: &mut H, _precision: vortex_array::Precision) +pub fn vortex_array::arrays::null::Null::array_hash(array: &vortex_array::vtable::Array, state: &mut H, _precision: vortex_array::Precision) -pub fn vortex_array::arrays::null::Null::buffer(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::null::Null::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::null::Null::buffer_name(_array: &vortex_array::arrays::null::NullArray, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::null::Null::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::null::Null::build(_dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::build(_dtype: &vortex_array::dtype::DType, len: usize, _metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], _children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::null::Null::child(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::null::Null::child(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::null::Null::child_name(_array: &vortex_array::arrays::null::NullArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::null::Null::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::null::Null::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::null::Null::dtype(_array: &vortex_array::arrays::null::NullArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::null::Null::dtype(_array: &vortex_array::arrays::null::NullData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::null::Null::execute(array: alloc::sync::Arc>, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23124,13 +22996,13 @@ pub fn vortex_array::arrays::null::Null::execute_parent(array: &vortex_array::vt pub fn vortex_array::arrays::null::Null::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::null::Null::len(array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::Null::len(array: &vortex_array::arrays::null::NullData) -> usize -pub fn vortex_array::arrays::null::Null::metadata(_array: &vortex_array::arrays::null::NullArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::metadata(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::null::Null::nbuffers(_array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::Null::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::null::Null::nchildren(_array: &vortex_array::arrays::null::NullArray) -> usize +pub fn vortex_array::arrays::null::Null::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::null::Null::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -23138,15 +23010,15 @@ pub fn vortex_array::arrays::null::Null::reduce_parent(array: &vortex_array::vta pub fn vortex_array::arrays::null::Null::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::null::Null::stats(array: &vortex_array::arrays::null::NullArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::null::Null::stats(array: &vortex_array::arrays::null::NullData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::null::Null::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::null::Null::vtable(_array: &Self::ArrayData) -> &Self -pub fn vortex_array::arrays::null::Null::with_children(_array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::null::Null::with_children(_array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::scalar_fn::ScalarFnVTable -pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::Array = vortex_array::arrays::scalar_fn::ScalarFnArray +pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ArrayData = vortex_array::arrays::ScalarFnData pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::Metadata = vortex_array::arrays::scalar_fn::metadata::ScalarFnMetadata @@ -23154,25 +23026,25 @@ pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::OperationsVTable = vor pub type vortex_array::arrays::scalar_fn::ScalarFnVTable::ValidityVTable = vortex_array::arrays::scalar_fn::ScalarFnVTable -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, other: &vortex_array::arrays::scalar_fn::ScalarFnArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer(_array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer_name(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> core::option::Option +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::buffer_name(_array: &vortex_array::vtable::Array, idx: usize) -> core::option::Option -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::scalar_fn::metadata::ScalarFnMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::scalar_fn::metadata::ScalarFnMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child_name(array: &vortex_array::arrays::scalar_fn::ScalarFnArray, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::child_name(array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::dtype(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::dtype(array: &vortex_array::arrays::ScalarFnData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23180,13 +23052,13 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::execute_parent(array: &v pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::len(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::len(array: &vortex_array::arrays::ScalarFnData) -> usize -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::metadata(array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nbuffers(_array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nchildren(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> usize +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::nchildren(array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -23194,15 +23066,15 @@ pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::reduce_parent(array: &vo pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::stats(array: &vortex_array::arrays::ScalarFnData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::vtable(array: &Self::Array) -> &Self +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::vtable(array: &vortex_array::arrays::ScalarFnData) -> &Self -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> impl vortex_array::vtable::VTable for vortex_array::arrays::slice::Slice -pub type vortex_array::arrays::slice::Slice::Array = vortex_array::arrays::slice::SliceArray +pub type vortex_array::arrays::slice::Slice::ArrayData = vortex_array::arrays::SliceData pub type vortex_array::arrays::slice::Slice::Metadata = vortex_array::arrays::slice::SliceMetadata @@ -23210,25 +23082,25 @@ pub type vortex_array::arrays::slice::Slice::OperationsVTable = vortex_array::ar pub type vortex_array::arrays::slice::Slice::ValidityVTable = vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: &Self::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::append_to_builder(array: &vortex_array::vtable::Array, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> -pub fn vortex_array::arrays::slice::Slice::array_eq(array: &vortex_array::arrays::slice::SliceArray, other: &vortex_array::arrays::slice::SliceArray, precision: vortex_array::Precision) -> bool +pub fn vortex_array::arrays::slice::Slice::array_eq(array: &vortex_array::vtable::Array, other: &vortex_array::vtable::Array, precision: vortex_array::Precision) -> bool -pub fn vortex_array::arrays::slice::Slice::array_hash(array: &vortex_array::arrays::slice::SliceArray, state: &mut H, precision: vortex_array::Precision) +pub fn vortex_array::arrays::slice::Slice::array_hash(array: &vortex_array::vtable::Array, state: &mut H, precision: vortex_array::Precision) -pub fn vortex_array::arrays::slice::Slice::buffer(_array: &Self::Array, _idx: usize) -> vortex_array::buffer::BufferHandle +pub fn vortex_array::arrays::slice::Slice::buffer(_array: &vortex_array::vtable::Array, _idx: usize) -> vortex_array::buffer::BufferHandle -pub fn vortex_array::arrays::slice::Slice::buffer_name(_array: &Self::Array, _idx: usize) -> core::option::Option +pub fn vortex_array::arrays::slice::Slice::buffer_name(_array: &vortex_array::vtable::Array, _idx: usize) -> core::option::Option -pub fn vortex_array::arrays::slice::Slice::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::slice::SliceMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &vortex_array::arrays::slice::SliceMetadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult -pub fn vortex_array::arrays::slice::Slice::child(array: &Self::Array, idx: usize) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::slice::Slice::child(array: &vortex_array::vtable::Array, idx: usize) -> vortex_array::ArrayRef -pub fn vortex_array::arrays::slice::Slice::child_name(_array: &Self::Array, idx: usize) -> alloc::string::String +pub fn vortex_array::arrays::slice::Slice::child_name(_array: &vortex_array::vtable::Array, idx: usize) -> alloc::string::String pub fn vortex_array::arrays::slice::Slice::deserialize(_bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult -pub fn vortex_array::arrays::slice::Slice::dtype(array: &vortex_array::arrays::slice::SliceArray) -> &vortex_array::dtype::DType +pub fn vortex_array::arrays::slice::Slice::dtype(array: &vortex_array::arrays::SliceData) -> &vortex_array::dtype::DType pub fn vortex_array::arrays::slice::Slice::execute(array: alloc::sync::Arc>, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult @@ -23236,13 +23108,13 @@ pub fn vortex_array::arrays::slice::Slice::execute_parent(array: &vortex_array:: pub fn vortex_array::arrays::slice::Slice::id(&self) -> vortex_array::vtable::ArrayId -pub fn vortex_array::arrays::slice::Slice::len(array: &vortex_array::arrays::slice::SliceArray) -> usize +pub fn vortex_array::arrays::slice::Slice::len(array: &vortex_array::arrays::SliceData) -> usize -pub fn vortex_array::arrays::slice::Slice::metadata(array: &Self::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::metadata(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -pub fn vortex_array::arrays::slice::Slice::nbuffers(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::slice::Slice::nbuffers(_array: &vortex_array::vtable::Array) -> usize -pub fn vortex_array::arrays::slice::Slice::nchildren(_array: &Self::Array) -> usize +pub fn vortex_array::arrays::slice::Slice::nchildren(_array: &vortex_array::vtable::Array) -> usize pub fn vortex_array::arrays::slice::Slice::reduce(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult> @@ -23250,19 +23122,19 @@ pub fn vortex_array::arrays::slice::Slice::reduce_parent(array: &vortex_array::v pub fn vortex_array::arrays::slice::Slice::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult>> -pub fn vortex_array::arrays::slice::Slice::stats(array: &vortex_array::arrays::slice::SliceArray) -> vortex_array::stats::StatsSetRef<'_> +pub fn vortex_array::arrays::slice::Slice::stats(array: &vortex_array::arrays::SliceData) -> &vortex_array::stats::ArrayStats -pub fn vortex_array::arrays::slice::Slice::vtable(_array: &Self::Array) -> &Self +pub fn vortex_array::arrays::slice::Slice::vtable(_array: &vortex_array::arrays::SliceData) -> &Self -pub fn vortex_array::arrays::slice::Slice::with_children(array: &mut Self::Array, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> +pub fn vortex_array::arrays::slice::Slice::with_children(array: &mut Self::ArrayData, children: alloc::vec::Vec) -> vortex_error::VortexResult<()> pub trait vortex_array::vtable::ValidityChild -pub fn vortex_array::vtable::ValidityChild::validity_child(array: &::Array) -> &vortex_array::ArrayRef +pub fn vortex_array::vtable::ValidityChild::validity_child(array: &::ArrayData) -> &vortex_array::ArrayRef impl vortex_array::vtable::ValidityChild for vortex_array::arrays::Extension -pub fn vortex_array::arrays::Extension::validity_child(array: &vortex_array::arrays::ExtensionArray) -> &vortex_array::ArrayRef +pub fn vortex_array::arrays::Extension::validity_child(array: &vortex_array::arrays::ExtensionData) -> &vortex_array::ArrayRef pub trait vortex_array::vtable::ValidityChildSliceHelper @@ -23274,45 +23146,45 @@ pub trait vortex_array::vtable::ValidityHelper pub fn vortex_array::vtable::ValidityHelper::validity(&self) -> &vortex_array::validity::Validity -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::BoolArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::BoolData -pub fn vortex_array::arrays::BoolArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::BoolData::validity(&self) -> &vortex_array::validity::Validity -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::DecimalArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::DecimalData -pub fn vortex_array::arrays::DecimalArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::DecimalData::validity(&self) -> &vortex_array::validity::Validity -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::FixedSizeListArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::FixedSizeListData -pub fn vortex_array::arrays::FixedSizeListArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::FixedSizeListData::validity(&self) -> &vortex_array::validity::Validity -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::ListArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::ListData -pub fn vortex_array::arrays::ListArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::ListData::validity(&self) -> &vortex_array::validity::Validity -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::ListViewArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::ListViewData -pub fn vortex_array::arrays::ListViewArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::ListViewData::validity(&self) -> &vortex_array::validity::Validity -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::MaskedArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::MaskedData -pub fn vortex_array::arrays::MaskedArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::MaskedData::validity(&self) -> &vortex_array::validity::Validity -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::PrimitiveArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::PrimitiveData -pub fn vortex_array::arrays::PrimitiveArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::PrimitiveData::validity(&self) -> &vortex_array::validity::Validity -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::StructArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::StructData -pub fn vortex_array::arrays::StructArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::StructData::validity(&self) -> &vortex_array::validity::Validity -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::VarBinArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::VarBinArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::VarBinData::validity(&self) -> &vortex_array::validity::Validity -impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::VarBinViewArray +impl vortex_array::vtable::ValidityHelper for vortex_array::arrays::VarBinViewData -pub fn vortex_array::arrays::VarBinViewArray::validity(&self) -> &vortex_array::validity::Validity +pub fn vortex_array::arrays::VarBinViewData::validity(&self) -> &vortex_array::validity::Validity pub trait vortex_array::vtable::ValiditySliceHelper @@ -23322,59 +23194,59 @@ pub fn vortex_array::vtable::ValiditySliceHelper::unsliced_validity_and_slice(&s pub trait vortex_array::vtable::ValidityVTable -pub fn vortex_array::vtable::ValidityVTable::validity(array: &::Array) -> vortex_error::VortexResult +pub fn vortex_array::vtable::ValidityVTable::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Chunked -pub fn vortex_array::arrays::Chunked::validity(array: &vortex_array::arrays::ChunkedArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Chunked::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Constant -pub fn vortex_array::arrays::Constant::validity(array: &vortex_array::arrays::ConstantArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Constant::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Filter -pub fn vortex_array::arrays::Filter::validity(array: &vortex_array::arrays::FilterArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Filter::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Shared -pub fn vortex_array::arrays::Shared::validity(array: &vortex_array::arrays::SharedArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Shared::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::Variant -pub fn vortex_array::arrays::Variant::validity(array: &::Array) -> vortex_error::VortexResult +pub fn vortex_array::arrays::Variant::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::dict::Dict -pub fn vortex_array::arrays::dict::Dict::validity(array: &vortex_array::arrays::dict::DictArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::dict::Dict::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::null::Null -pub fn vortex_array::arrays::null::Null::validity(_array: &vortex_array::arrays::null::NullArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::null::Null::validity(_array: &vortex_array::vtable::Array) -> vortex_error::VortexResult impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::scalar_fn::ScalarFnVTable -pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validity(array: &vortex_array::arrays::scalar_fn::ScalarFnArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::scalar_fn::ScalarFnVTable::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult impl vortex_array::vtable::ValidityVTable for vortex_array::arrays::slice::Slice -pub fn vortex_array::arrays::slice::Slice::validity(array: &vortex_array::arrays::slice::SliceArray) -> vortex_error::VortexResult +pub fn vortex_array::arrays::slice::Slice::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -impl vortex_array::vtable::ValidityVTable for vortex_array::vtable::ValidityVTableFromChildSliceHelper where ::Array: vortex_array::vtable::ValidityChildSliceHelper +impl vortex_array::vtable::ValidityVTable for vortex_array::vtable::ValidityVTableFromChildSliceHelper where ::ArrayData: vortex_array::vtable::ValidityChildSliceHelper -pub fn vortex_array::vtable::ValidityVTableFromChildSliceHelper::validity(array: &::Array) -> vortex_error::VortexResult +pub fn vortex_array::vtable::ValidityVTableFromChildSliceHelper::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -impl vortex_array::vtable::ValidityVTable for vortex_array::vtable::ValidityVTableFromValidityHelper where ::Array: vortex_array::vtable::ValidityHelper +impl vortex_array::vtable::ValidityVTable for vortex_array::vtable::ValidityVTableFromValidityHelper where ::ArrayData: vortex_array::vtable::ValidityHelper -pub fn vortex_array::vtable::ValidityVTableFromValidityHelper::validity(array: &::Array) -> vortex_error::VortexResult +pub fn vortex_array::vtable::ValidityVTableFromValidityHelper::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult -impl vortex_array::vtable::ValidityVTable for vortex_array::vtable::ValidityVTableFromValiditySliceHelper where ::Array: vortex_array::vtable::ValiditySliceHelper +impl vortex_array::vtable::ValidityVTable for vortex_array::vtable::ValidityVTableFromValiditySliceHelper where ::ArrayData: vortex_array::vtable::ValiditySliceHelper -pub fn vortex_array::vtable::ValidityVTableFromValiditySliceHelper::validity(array: &::Array) -> vortex_error::VortexResult +pub fn vortex_array::vtable::ValidityVTableFromValiditySliceHelper::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult impl vortex_array::vtable::ValidityVTable for vortex_array::vtable::ValidityVTableFromChild where V: vortex_array::vtable::ValidityChild + vortex_array::vtable::VTable -pub fn vortex_array::vtable::ValidityVTableFromChild::validity(array: &::Array) -> vortex_error::VortexResult +pub fn vortex_array::vtable::ValidityVTableFromChild::validity(array: &vortex_array::vtable::Array) -> vortex_error::VortexResult pub fn vortex_array::vtable::patches_child(patches: &vortex_array::patches::Patches, idx: usize) -> vortex_array::ArrayRef @@ -23438,7 +23310,7 @@ pub vortex_array::Canonical::Struct(vortex_array::arrays::StructArray) pub vortex_array::Canonical::VarBinView(vortex_array::arrays::VarBinViewArray) -pub vortex_array::Canonical::Variant(vortex_array::arrays::variant::VariantArray) +pub vortex_array::Canonical::Variant(vortex_array::arrays::VariantArray) impl vortex_array::Canonical @@ -23492,13 +23364,13 @@ pub fn vortex_array::Canonical::is_empty(&self) -> bool pub fn vortex_array::Canonical::len(&self) -> usize -impl core::clone::Clone for vortex_array::Canonical +impl vortex_array::Canonical -pub fn vortex_array::Canonical::clone(&self) -> vortex_array::Canonical +pub fn vortex_array::Canonical::to_array_ref(&self) -> vortex_array::ArrayRef -impl core::convert::AsRef for vortex_array::Canonical +impl core::clone::Clone for vortex_array::Canonical -pub fn vortex_array::Canonical::as_ref(&self) -> &(dyn vortex_array::DynArray + 'static) +pub fn vortex_array::Canonical::clone(&self) -> vortex_array::Canonical impl core::convert::From for vortex_array::ArrayRef @@ -23540,11 +23412,11 @@ pub vortex_array::CanonicalView::Struct(&'a vortex_array::arrays::StructArray) pub vortex_array::CanonicalView::VarBinView(&'a vortex_array::arrays::VarBinViewArray) -pub vortex_array::CanonicalView::Variant(&'a vortex_array::arrays::variant::VariantArray) +pub vortex_array::CanonicalView::Variant(&'a vortex_array::arrays::VariantArray) -impl core::convert::AsRef for vortex_array::CanonicalView<'_> +impl vortex_array::CanonicalView<'_> -pub fn vortex_array::CanonicalView<'_>::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::CanonicalView<'_>::to_array_ref(&self) -> vortex_array::ArrayRef impl core::convert::From> for vortex_array::Canonical @@ -23588,9 +23460,9 @@ pub vortex_array::ColumnarView::Canonical(vortex_array::CanonicalView<'a>) pub vortex_array::ColumnarView::Constant(&'a vortex_array::arrays::ConstantArray) -impl<'a> core::convert::AsRef for vortex_array::ColumnarView<'a> +impl vortex_array::ColumnarView<'_> -pub fn vortex_array::ColumnarView<'a>::as_ref(&self) -> &dyn vortex_array::DynArray +pub fn vortex_array::ColumnarView<'_>::to_array_ref(&self) -> vortex_array::ArrayRef pub enum vortex_array::ExecutionStep @@ -23638,116 +23510,6 @@ pub fn vortex_array::AnyColumnar::matches(array: &dyn vortex_array::DynArray) -> pub fn vortex_array::AnyColumnar::try_match<'a>(array: &'a dyn vortex_array::DynArray) -> core::option::Option -#[repr(transparent)] pub struct vortex_array::ArrayAdapter(_) - -impl vortex_array::ArrayAdapter - -pub fn vortex_array::ArrayAdapter::as_inner(&self) -> &::Array - -pub fn vortex_array::ArrayAdapter::into_inner(self) -> ::Array - -impl core::fmt::Debug for vortex_array::ArrayAdapter - -pub fn vortex_array::ArrayAdapter::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result - -impl vortex_array::ArrayEq for vortex_array::ArrayAdapter - -pub fn vortex_array::ArrayAdapter::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool - -impl vortex_array::ArrayHash for vortex_array::ArrayAdapter - -pub fn vortex_array::ArrayAdapter::array_hash(&self, state: &mut H, precision: vortex_array::Precision) - -impl vortex_array::ArrayVisitor for vortex_array::ArrayAdapter - -pub fn vortex_array::ArrayAdapter::buffer_handles(&self) -> alloc::vec::Vec - -pub fn vortex_array::ArrayAdapter::buffer_names(&self) -> alloc::vec::Vec - -pub fn vortex_array::ArrayAdapter::buffers(&self) -> alloc::vec::Vec - -pub fn vortex_array::ArrayAdapter::children(&self) -> alloc::vec::Vec - -pub fn vortex_array::ArrayAdapter::children_names(&self) -> alloc::vec::Vec - -pub fn vortex_array::ArrayAdapter::is_host(&self) -> bool - -pub fn vortex_array::ArrayAdapter::metadata(&self) -> vortex_error::VortexResult>> - -pub fn vortex_array::ArrayAdapter::metadata_fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result - -pub fn vortex_array::ArrayAdapter::named_buffers(&self) -> alloc::vec::Vec<(alloc::string::String, vortex_array::buffer::BufferHandle)> - -pub fn vortex_array::ArrayAdapter::named_children(&self) -> alloc::vec::Vec<(alloc::string::String, vortex_array::ArrayRef)> - -pub fn vortex_array::ArrayAdapter::nbuffers(&self) -> usize - -pub fn vortex_array::ArrayAdapter::nchildren(&self) -> usize - -pub fn vortex_array::ArrayAdapter::nth_child(&self, idx: usize) -> core::option::Option - -impl vortex_array::DynArray for vortex_array::ArrayAdapter - -pub fn vortex_array::ArrayAdapter::all_invalid(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::all_valid(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::append_to_builder(&self, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> - -pub fn vortex_array::ArrayAdapter::as_any(&self) -> &dyn core::any::Any - -pub fn vortex_array::ArrayAdapter::as_any_arc(self: alloc::sync::Arc) -> alloc::sync::Arc<(dyn core::any::Any + core::marker::Send + core::marker::Sync)> - -pub fn vortex_array::ArrayAdapter::dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::ArrayAdapter::encoding_id(&self) -> vortex_array::vtable::ArrayId - -pub fn vortex_array::ArrayAdapter::filter(&self, mask: vortex_mask::Mask) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::invalid_count(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::is_empty(&self) -> bool - -pub fn vortex_array::ArrayAdapter::is_invalid(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::is_valid(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::len(&self) -> usize - -pub fn vortex_array::ArrayAdapter::scalar_at(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::slice(&self, range: core::ops::range::Range) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::statistics(&self) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::ArrayAdapter::take(&self, indices: vortex_array::ArrayRef) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::to_array(&self) -> vortex_array::ArrayRef - -pub fn vortex_array::ArrayAdapter::to_canonical(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::valid_count(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::validity(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::validity_mask(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::vtable(&self) -> &dyn vortex_array::vtable::DynVTable - -pub fn vortex_array::ArrayAdapter::with_children(&self, children: alloc::vec::Vec) -> vortex_error::VortexResult - -impl vortex_array::scalar_fn::ReduceNode for vortex_array::ArrayAdapter - -pub fn vortex_array::ArrayAdapter::as_any(&self) -> &dyn core::any::Any - -pub fn vortex_array::ArrayAdapter::child(&self, idx: usize) -> vortex_array::scalar_fn::ReduceNodeRef - -pub fn vortex_array::ArrayAdapter::child_count(&self) -> usize - -pub fn vortex_array::ArrayAdapter::node_dtype(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::scalar_fn(&self) -> core::option::Option<&vortex_array::scalar_fn::ScalarFnRef> - pub struct vortex_array::CanonicalValidity(pub vortex_array::Canonical) impl vortex_array::Executable for vortex_array::CanonicalValidity @@ -23920,10 +23682,6 @@ impl vortex_array::ArrayEq for core::option::Option pub fn core::option::Option::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool -impl vortex_array::ArrayEq for vortex_array::ArrayAdapter - -pub fn vortex_array::ArrayAdapter::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool - impl vortex_array::ArrayEq for vortex_array::vtable::Array pub fn vortex_array::vtable::Array::array_eq(&self, other: &Self, precision: vortex_array::Precision) -> bool @@ -23968,10 +23726,6 @@ impl vortex_array::ArrayHash for core::option::Optio pub fn core::option::Option::array_hash(&self, state: &mut H, precision: vortex_array::Precision) -impl vortex_array::ArrayHash for vortex_array::ArrayAdapter - -pub fn vortex_array::ArrayAdapter::array_hash(&self, state: &mut H, precision: vortex_array::Precision) - impl vortex_array::ArrayHash for vortex_array::vtable::Array pub fn vortex_array::vtable::Array::array_hash(&self, state: &mut H, precision: vortex_array::Precision) @@ -24032,34 +23786,6 @@ pub fn alloc::sync::Arc::nchildren(&self) -> usize pub fn alloc::sync::Arc::nth_child(&self, idx: usize) -> core::option::Option -impl vortex_array::ArrayVisitor for vortex_array::ArrayAdapter - -pub fn vortex_array::ArrayAdapter::buffer_handles(&self) -> alloc::vec::Vec - -pub fn vortex_array::ArrayAdapter::buffer_names(&self) -> alloc::vec::Vec - -pub fn vortex_array::ArrayAdapter::buffers(&self) -> alloc::vec::Vec - -pub fn vortex_array::ArrayAdapter::children(&self) -> alloc::vec::Vec - -pub fn vortex_array::ArrayAdapter::children_names(&self) -> alloc::vec::Vec - -pub fn vortex_array::ArrayAdapter::is_host(&self) -> bool - -pub fn vortex_array::ArrayAdapter::metadata(&self) -> vortex_error::VortexResult>> - -pub fn vortex_array::ArrayAdapter::metadata_fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result - -pub fn vortex_array::ArrayAdapter::named_buffers(&self) -> alloc::vec::Vec<(alloc::string::String, vortex_array::buffer::BufferHandle)> - -pub fn vortex_array::ArrayAdapter::named_children(&self) -> alloc::vec::Vec<(alloc::string::String, vortex_array::ArrayRef)> - -pub fn vortex_array::ArrayAdapter::nbuffers(&self) -> usize - -pub fn vortex_array::ArrayAdapter::nchildren(&self) -> usize - -pub fn vortex_array::ArrayAdapter::nth_child(&self, idx: usize) -> core::option::Option - impl vortex_array::ArrayVisitor for vortex_array::vtable::Array pub fn vortex_array::vtable::Array::buffer_handles(&self) -> alloc::vec::Vec @@ -24124,7 +23850,7 @@ pub type vortex_array::ProstMetadata::Output = M pub fn vortex_array::ProstMetadata::deserialize(metadata: &[u8]) -> vortex_error::VortexResult -pub trait vortex_array::DynArray: 'static + vortex_array::array::private::Sealed + core::marker::Send + core::marker::Sync + core::fmt::Debug + vortex_array::DynArrayEq + vortex_array::DynArrayHash + vortex_array::ArrayVisitor + vortex_array::scalar_fn::ReduceNode +pub trait vortex_array::DynArray: 'static + vortex_array::array::private::Sealed + core::marker::Send + core::marker::Sync + core::fmt::Debug + vortex_array::DynArrayEq + vortex_array::DynArrayHash + vortex_array::ArrayVisitor pub fn vortex_array::DynArray::all_invalid(&self) -> vortex_error::VortexResult @@ -24224,56 +23950,6 @@ pub fn alloc::sync::Arc::vtable(&self) -> &dyn vorte pub fn alloc::sync::Arc::with_children(&self, children: alloc::vec::Vec) -> vortex_error::VortexResult -impl vortex_array::DynArray for vortex_array::ArrayAdapter - -pub fn vortex_array::ArrayAdapter::all_invalid(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::all_valid(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::append_to_builder(&self, builder: &mut dyn vortex_array::builders::ArrayBuilder, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()> - -pub fn vortex_array::ArrayAdapter::as_any(&self) -> &dyn core::any::Any - -pub fn vortex_array::ArrayAdapter::as_any_arc(self: alloc::sync::Arc) -> alloc::sync::Arc<(dyn core::any::Any + core::marker::Send + core::marker::Sync)> - -pub fn vortex_array::ArrayAdapter::dtype(&self) -> &vortex_array::dtype::DType - -pub fn vortex_array::ArrayAdapter::encoding_id(&self) -> vortex_array::vtable::ArrayId - -pub fn vortex_array::ArrayAdapter::filter(&self, mask: vortex_mask::Mask) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::invalid_count(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::is_empty(&self) -> bool - -pub fn vortex_array::ArrayAdapter::is_invalid(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::is_valid(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::len(&self) -> usize - -pub fn vortex_array::ArrayAdapter::scalar_at(&self, index: usize) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::slice(&self, range: core::ops::range::Range) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::statistics(&self) -> vortex_array::stats::StatsSetRef<'_> - -pub fn vortex_array::ArrayAdapter::take(&self, indices: vortex_array::ArrayRef) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::to_array(&self) -> vortex_array::ArrayRef - -pub fn vortex_array::ArrayAdapter::to_canonical(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::valid_count(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::validity(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::validity_mask(&self) -> vortex_error::VortexResult - -pub fn vortex_array::ArrayAdapter::vtable(&self) -> &dyn vortex_array::vtable::DynVTable - -pub fn vortex_array::ArrayAdapter::with_children(&self, children: alloc::vec::Vec) -> vortex_error::VortexResult - impl vortex_array::DynArray for vortex_array::vtable::Array pub fn vortex_array::vtable::Array::all_invalid(&self) -> vortex_error::VortexResult @@ -24440,89 +24116,89 @@ impl vortex_array::IntoArray for vortex_array::Columnar pub fn vortex_array::Columnar::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::BoolArray +impl vortex_array::IntoArray for vortex_array::arrays::BoolData -pub fn vortex_array::arrays::BoolArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::BoolData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::ChunkedArray +impl vortex_array::IntoArray for vortex_array::arrays::ChunkedData -pub fn vortex_array::arrays::ChunkedArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ChunkedData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::ConstantArray +impl vortex_array::IntoArray for vortex_array::arrays::ConstantData -pub fn vortex_array::arrays::ConstantArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ConstantData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::DecimalArray +impl vortex_array::IntoArray for vortex_array::arrays::DecimalData -pub fn vortex_array::arrays::DecimalArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::DecimalData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::ExtensionArray +impl vortex_array::IntoArray for vortex_array::arrays::ExtensionData -pub fn vortex_array::arrays::ExtensionArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ExtensionData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::FilterArray +impl vortex_array::IntoArray for vortex_array::arrays::FilterData -pub fn vortex_array::arrays::FilterArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FilterData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::FixedSizeListArray +impl vortex_array::IntoArray for vortex_array::arrays::FixedSizeListData -pub fn vortex_array::arrays::FixedSizeListArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::FixedSizeListData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::ListArray +impl vortex_array::IntoArray for vortex_array::arrays::ListData -pub fn vortex_array::arrays::ListArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::ListViewArray +impl vortex_array::IntoArray for vortex_array::arrays::ListViewData -pub fn vortex_array::arrays::ListViewArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ListViewData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::MaskedArray +impl vortex_array::IntoArray for vortex_array::arrays::MaskedData -pub fn vortex_array::arrays::MaskedArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::MaskedData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::PrimitiveArray +impl vortex_array::IntoArray for vortex_array::arrays::PrimitiveData -pub fn vortex_array::arrays::PrimitiveArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::PrimitiveData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::SharedArray +impl vortex_array::IntoArray for vortex_array::arrays::ScalarFnData -pub fn vortex_array::arrays::SharedArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::ScalarFnData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::StructArray +impl vortex_array::IntoArray for vortex_array::arrays::SharedData -pub fn vortex_array::arrays::StructArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::SharedData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::VarBinArray +impl vortex_array::IntoArray for vortex_array::arrays::SliceData -pub fn vortex_array::arrays::VarBinArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::SliceData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::VarBinViewArray +impl vortex_array::IntoArray for vortex_array::arrays::StructData -pub fn vortex_array::arrays::VarBinViewArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::StructData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::datetime::TemporalArray +impl vortex_array::IntoArray for vortex_array::arrays::VarBinData -pub fn vortex_array::arrays::datetime::TemporalArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::dict::DictArray +impl vortex_array::IntoArray for vortex_array::arrays::VarBinViewData -pub fn vortex_array::arrays::dict::DictArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::VarBinViewData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::null::NullArray +impl vortex_array::IntoArray for vortex_array::arrays::datetime::TemporalData -pub fn vortex_array::arrays::null::NullArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::datetime::TemporalData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::scalar_fn::ScalarFnArray +impl vortex_array::IntoArray for vortex_array::arrays::dict::DictData -pub fn vortex_array::arrays::scalar_fn::ScalarFnArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::dict::DictData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::slice::SliceArray +impl vortex_array::IntoArray for vortex_array::arrays::null::NullData -pub fn vortex_array::arrays::slice::SliceArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::null::NullData::into_array(self) -> vortex_array::ArrayRef -impl vortex_array::IntoArray for vortex_array::arrays::variant::VariantArray +impl vortex_array::IntoArray for vortex_array::arrays::variant::VariantData -pub fn vortex_array::arrays::variant::VariantArray::into_array(self) -> vortex_array::ArrayRef +pub fn vortex_array::arrays::variant::VariantData::into_array(self) -> vortex_array::ArrayRef impl vortex_array::IntoArray for vortex_buffer::bit::buf::BitBuffer @@ -24598,23 +24274,23 @@ pub fn vortex_array::ToCanonical::to_varbinview(&self) -> vortex_array::arrays:: impl vortex_array::ToCanonical for A -pub fn A::to_bool(&self) -> vortex_array::arrays::BoolArray +pub fn A::to_bool(&self) -> vortex_array::vtable::Array -pub fn A::to_decimal(&self) -> vortex_array::arrays::DecimalArray +pub fn A::to_decimal(&self) -> vortex_array::vtable::Array -pub fn A::to_extension(&self) -> vortex_array::arrays::ExtensionArray +pub fn A::to_extension(&self) -> vortex_array::vtable::Array -pub fn A::to_fixed_size_list(&self) -> vortex_array::arrays::FixedSizeListArray +pub fn A::to_fixed_size_list(&self) -> vortex_array::vtable::Array -pub fn A::to_listview(&self) -> vortex_array::arrays::ListViewArray +pub fn A::to_listview(&self) -> vortex_array::vtable::Array -pub fn A::to_null(&self) -> vortex_array::arrays::null::NullArray +pub fn A::to_null(&self) -> vortex_array::vtable::Array -pub fn A::to_primitive(&self) -> vortex_array::arrays::PrimitiveArray +pub fn A::to_primitive(&self) -> vortex_array::vtable::Array -pub fn A::to_struct(&self) -> vortex_array::arrays::StructArray +pub fn A::to_struct(&self) -> vortex_array::vtable::Array -pub fn A::to_varbinview(&self) -> vortex_array::arrays::VarBinViewArray +pub fn A::to_varbinview(&self) -> vortex_array::vtable::Array pub trait vortex_array::VortexSessionExecute diff --git a/vortex-array/src/aggregate_fn/accumulator_grouped.rs b/vortex-array/src/aggregate_fn/accumulator_grouped.rs index a4d9c38b60e..a84db76a8b9 100644 --- a/vortex-array/src/aggregate_fn/accumulator_grouped.rs +++ b/vortex-array/src/aggregate_fn/accumulator_grouped.rs @@ -33,7 +33,6 @@ use crate::dtype::DType; use crate::dtype::IntegerPType; use crate::executor::MAX_ITERATIONS; use crate::match_each_integer_ptype; -use crate::vtable::ValidityHelper; /// Reference-counted type-erased grouped accumulator. pub type GroupedAccumulatorRef = Box; diff --git a/vortex-array/src/aliases/mod.rs b/vortex-array/src/aliases/mod.rs index de68213a51f..d001e0402e2 100644 --- a/vortex-array/src/aliases/mod.rs +++ b/vortex-array/src/aliases/mod.rs @@ -11,3 +11,8 @@ pub mod paste { // Re-export of [`inventory`](https://docs.rs/inventory/latest/inventory/). pub use inventory; + +pub mod vortex_error { + //! Re-export of [`vortex_error`](https://docs.rs/vortex-error/latest/vortex_error/). + pub use vortex_error::VortexExpect; +} diff --git a/vortex-array/src/array/mod.rs b/vortex-array/src/array/mod.rs index 9e870d120ba..053abc2e0cb 100644 --- a/vortex-array/src/array/mod.rs +++ b/vortex-array/src/array/mod.rs @@ -38,7 +38,6 @@ use crate::arrays::DictArray; use crate::arrays::FilterArray; use crate::arrays::Null; use crate::arrays::Primitive; -use crate::arrays::ScalarFnVTable; use crate::arrays::SliceArray; use crate::arrays::VarBin; use crate::arrays::VarBinView; @@ -53,9 +52,6 @@ use crate::hash; use crate::matcher::Matcher; use crate::optimizer::ArrayOptimizer; use crate::scalar::Scalar; -use crate::scalar_fn::ReduceNode; -use crate::scalar_fn::ReduceNodeRef; -use crate::scalar_fn::ScalarFnRef; use crate::stats::StatsSetRef; use crate::validity::Validity; use crate::vtable::Array; @@ -67,15 +63,7 @@ use crate::vtable::ValidityVTable; /// The public API trait for all Vortex arrays. pub trait DynArray: - 'static - + private::Sealed - + Send - + Sync - + Debug - + DynArrayEq - + DynArrayHash - + ArrayVisitor - + ReduceNode + 'static + private::Sealed + Send + Sync + Debug + DynArrayEq + DynArrayHash + ArrayVisitor { /// Returns the array as a reference to a generic [`Any`] trait object. fn as_any(&self) -> &dyn Any; @@ -307,8 +295,8 @@ impl dyn DynArray + '_ { M::try_match(self) } - /// Returns the array downcast to the given `V::Array` as an owned object. - pub fn try_into(self: Arc) -> Result> { + /// Returns the array downcast to the given `Array` as an owned object. + pub fn try_into(self: Arc) -> Result, Arc> { if !self.is::() { return Err(self); } @@ -318,11 +306,16 @@ impl dyn DynArray + '_ { .map_err(|_| vortex_err!("failed to downcast")) .vortex_expect("Failed to downcast"); Ok(match Arc::try_unwrap(typed) { - Ok(array) => array.into_inner(), - Err(arc) => arc.deref().inner().clone(), + Ok(array) => array, + Err(arc) => arc.deref().clone(), }) } + /// Returns a reference to the typed `Array` if this array matches the given vtable type. + pub fn as_typed(&self) -> Option<&Array> { + DynArray::as_any(self).downcast_ref::>() + } + pub fn as_constant(&self) -> Option { self.as_opt::().map(|a| a.scalar().clone()) } @@ -383,7 +376,6 @@ mod private { pub trait Sealed {} impl Sealed for Array {} - impl Sealed for ArrayAdapter {} impl Sealed for Arc {} } @@ -417,11 +409,11 @@ impl DynArray for Array { } fn vtable(&self) -> &dyn DynVTable { - self.typed_vtable() + self.vtable() } fn encoding_id(&self) -> ArrayId { - self.typed_vtable().id() + self.vtable().id() } fn slice(&self, range: Range) -> VortexResult { @@ -492,7 +484,7 @@ impl DynArray for Array { return Ok(Scalar::null(self.dtype.clone())); } let scalar = >::scalar_at( - &self.array, + self, index, &mut LEGACY_SESSION.create_execution_ctx(), )?; @@ -566,13 +558,13 @@ impl DynArray for Array { fn validity(&self) -> VortexResult { if self.dtype.is_nullable() { - let validity = >::validity(&self.array)?; + let validity = >::validity(self)?; if let Validity::Array(array) = &validity { vortex_ensure!(array.len() == self.len, "Validity array length mismatch"); vortex_ensure!( matches!(array.dtype(), DType::Bool(Nullability::NonNullable)), "Validity array is not non-nullable boolean: {}", - self.typed_vtable().id(), + self.vtable().id(), ); } Ok(validity) @@ -608,13 +600,13 @@ impl DynArray for Array { } let len = builder.len(); - V::append_to_builder(&self.array, builder, ctx)?; + V::append_to_builder(self, builder, ctx)?; assert_eq!( len + self.len, builder.len(), "Builder length mismatch after writing array for encoding {}", - self.typed_vtable().id(), + self.vtable().id(), ); Ok(()) } @@ -624,12 +616,12 @@ impl DynArray for Array { } fn with_children(&self, children: Vec) -> VortexResult { - let mut inner = self.array.clone(); + let mut inner = self.data.clone(); V::with_children(&mut inner, children)?; // SAFETY: with_children preserves dtype and len. Ok(unsafe { - Array::new_unchecked( - self.typed_vtable().clone(), + Array::from_data_unchecked( + self.vtable().clone(), self.dtype.clone(), self.len, inner, @@ -642,483 +634,74 @@ impl DynArray for Array { impl ArrayHash for Array { fn array_hash(&self, state: &mut H, precision: hash::Precision) { - self.typed_vtable().id().hash(state); - V::array_hash(&self.array, state, precision); + self.vtable().id().hash(state); + V::array_hash(self, state, precision); } } impl ArrayEq for Array { fn array_eq(&self, other: &Self, precision: hash::Precision) -> bool { - V::array_eq(&self.array, &other.array, precision) + V::array_eq(self, other, precision) } } impl ArrayVisitor for Array { fn children(&self) -> Vec { - (0..V::nchildren(&self.array)) - .map(|i| V::child(&self.array, i)) - .collect() - } - - fn nchildren(&self) -> usize { - V::nchildren(&self.array) - } - - fn nth_child(&self, idx: usize) -> Option { - (idx < V::nchildren(&self.array)).then(|| V::child(&self.array, idx)) - } - - fn children_names(&self) -> Vec { - (0..V::nchildren(&self.array)) - .map(|i| V::child_name(&self.array, i)) - .collect() - } - - fn named_children(&self) -> Vec<(String, ArrayRef)> { - (0..V::nchildren(&self.array)) - .map(|i| (V::child_name(&self.array, i), V::child(&self.array, i))) - .collect() - } - - fn buffers(&self) -> Vec { - (0..V::nbuffers(&self.array)) - .map(|i| V::buffer(&self.array, i).to_host_sync()) - .collect() - } - - fn buffer_handles(&self) -> Vec { - (0..V::nbuffers(&self.array)) - .map(|i| V::buffer(&self.array, i)) - .collect() - } - - fn buffer_names(&self) -> Vec { - (0..V::nbuffers(&self.array)) - .filter_map(|i| V::buffer_name(&self.array, i)) - .collect() - } - - fn named_buffers(&self) -> Vec<(String, BufferHandle)> { - (0..V::nbuffers(&self.array)) - .filter_map(|i| { - V::buffer_name(&self.array, i).map(|name| (name, V::buffer(&self.array, i))) - }) - .collect() - } - - fn nbuffers(&self) -> usize { - V::nbuffers(&self.array) - } - - fn metadata(&self) -> VortexResult>> { - V::serialize(V::metadata(&self.array)?) - } - - fn metadata_fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match V::metadata(&self.array) { - Err(e) => write!(f, ""), - Ok(metadata) => Debug::fmt(&metadata, f), - } - } - - fn is_host(&self) -> bool { - for array in self.depth_first_traversal() { - if !array.buffer_handles().iter().all(BufferHandle::is_on_host) { - return false; - } - } - true - } -} - -impl ReduceNode for Array { - fn as_any(&self) -> &dyn Any { - self - } - - fn node_dtype(&self) -> VortexResult { - Ok(self.dtype.clone()) - } - - fn scalar_fn(&self) -> Option<&ScalarFnRef> { - // Access as_opt via inner's Deref to dyn DynArray. - (*self.array) - .as_opt::() - .map(|a| a.scalar_fn()) - } - - fn child(&self, idx: usize) -> ReduceNodeRef { - ArrayVisitor::nth_child(self, idx) - .unwrap_or_else(|| vortex_panic!("Child index out of bounds: {}", idx)) - } - - fn child_count(&self) -> usize { - ArrayVisitor::nchildren(self) - } -} - -// ============================================================================= -// Legacy path: ArrayAdapter -// ============================================================================= - -/// Adapter struct used to lift the [`VTable`] trait into an object-safe [`DynArray`] -/// implementation. -/// -/// Since this is a unit struct with `repr(transparent)`, we are able to turn un-adapted array -/// structs into [`dyn Array`] using some cheeky casting inside [`std::ops::Deref`] and -/// [`AsRef`]. See the `vtable!` macro for more details. -#[repr(transparent)] -pub struct ArrayAdapter(V::Array); - -impl ArrayAdapter { - /// Provide a reference to the underlying array held within the adapter. - pub fn as_inner(&self) -> &V::Array { - &self.0 - } - - /// Consume the adapter and return the underlying array. - pub fn into_inner(self) -> V::Array { - self.0 - } -} - -impl Debug for ArrayAdapter { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - self.0.fmt(f) - } -} - -impl ReduceNode for ArrayAdapter { - fn as_any(&self) -> &dyn Any { - self - } - - fn node_dtype(&self) -> VortexResult { - Ok(V::dtype(&self.0).clone()) - } - - fn scalar_fn(&self) -> Option<&ScalarFnRef> { - self.0.as_opt::().map(|a| a.scalar_fn()) - } - - fn child(&self, idx: usize) -> ReduceNodeRef { - self.nth_child(idx) - .unwrap_or_else(|| vortex_panic!("Child index out of bounds: {}", idx)) - } - - fn child_count(&self) -> usize { - self.nchildren() - } -} - -impl DynArray for ArrayAdapter { - fn as_any(&self) -> &dyn Any { - self - } - - fn as_any_arc(self: Arc) -> Arc { - self - } - - fn to_array(&self) -> ArrayRef { - self.0.clone().into_array() - } - - fn len(&self) -> usize { - V::len(&self.0) - } - - fn dtype(&self) -> &DType { - V::dtype(&self.0) - } - - fn vtable(&self) -> &dyn DynVTable { - V::vtable(self.as_inner()) - } - - fn encoding_id(&self) -> ArrayId { - V::vtable(&self.0).id() - } - - fn slice(&self, range: Range) -> VortexResult { - let start = range.start; - let stop = range.end; - - if start == 0 && stop == self.len() { - return Ok(self.to_array()); - } - - vortex_ensure!( - start <= self.len(), - "OutOfBounds: start {start} > length {}", - self.len() - ); - vortex_ensure!( - stop <= self.len(), - "OutOfBounds: stop {stop} > length {}", - self.len() - ); - - vortex_ensure!(start <= stop, "start ({start}) must be <= stop ({stop})"); - - if start == stop { - return Ok(Canonical::empty(self.dtype()).into_array()); - } - - let sliced = SliceArray::try_new(self.to_array(), range)? - .into_array() - .optimize()?; - - // Propagate some stats from the original array to the sliced array. - if !sliced.is::() { - self.statistics().with_iter(|iter| { - sliced.statistics().inherit(iter.filter(|(stat, value)| { - matches!( - stat, - Stat::IsConstant | Stat::IsSorted | Stat::IsStrictSorted - ) && value.as_ref().as_exact().is_some_and(|v| { - Scalar::try_new(DType::Bool(Nullability::NonNullable), Some(v.clone())) - .vortex_expect("A stat that was expected to be a boolean stat was not") - .as_bool() - .value() - .unwrap_or_default() - }) - })); - }); - } - - Ok(sliced) - } - - fn filter(&self, mask: Mask) -> VortexResult { - FilterArray::try_new(self.to_array(), mask)? - .into_array() - .optimize() - } - - fn take(&self, indices: ArrayRef) -> VortexResult { - DictArray::try_new(indices, self.to_array())? - .into_array() - .optimize() - } - - fn scalar_at(&self, index: usize) -> VortexResult { - vortex_ensure!(index < self.len(), OutOfBounds: index, 0, self.len()); - if self.is_invalid(index)? { - return Ok(Scalar::null(self.dtype().clone())); - } - let mut ctx = LEGACY_SESSION.create_execution_ctx(); - let scalar = - >::scalar_at(&self.0, index, &mut ctx)?; - vortex_ensure!(self.dtype() == scalar.dtype(), "Scalar dtype mismatch"); - Ok(scalar) - } - - fn is_valid(&self, index: usize) -> VortexResult { - vortex_ensure!(index < self.len(), OutOfBounds: index, 0, self.len()); - match self.validity()? { - Validity::NonNullable | Validity::AllValid => Ok(true), - Validity::AllInvalid => Ok(false), - Validity::Array(a) => a - .scalar_at(index)? - .as_bool() - .value() - .ok_or_else(|| vortex_err!("validity value at index {} is null", index)), - } - } - - fn is_invalid(&self, index: usize) -> VortexResult { - Ok(!self.is_valid(index)?) - } - - fn all_valid(&self) -> VortexResult { - match self.validity()? { - Validity::NonNullable | Validity::AllValid => Ok(true), - Validity::AllInvalid => Ok(false), - Validity::Array(a) => Ok(a.statistics().compute_min::().unwrap_or(false)), - } - } - - fn all_invalid(&self) -> VortexResult { - match self.validity()? { - Validity::NonNullable | Validity::AllValid => Ok(false), - Validity::AllInvalid => Ok(true), - Validity::Array(a) => Ok(!a.statistics().compute_max::().unwrap_or(true)), - } - } - - // TODO(ngates): deprecate this function since it requires compute. - fn valid_count(&self) -> VortexResult { - if let Some(Precision::Exact(invalid_count)) = - self.statistics().get_as::(Stat::NullCount) - { - return Ok(self.len() - invalid_count); - } - - let count = match self.validity()? { - Validity::NonNullable | Validity::AllValid => self.len(), - Validity::AllInvalid => 0, - Validity::Array(a) => { - let mut ctx = LEGACY_SESSION.create_execution_ctx(); - let array_sum = sum(&a, &mut ctx)?; - array_sum - .as_primitive() - .as_::() - .ok_or_else(|| vortex_err!("sum of validity array is null"))? - } - }; - vortex_ensure!(count <= self.len(), "Valid count exceeds array length"); - - self.statistics() - .set(Stat::NullCount, Precision::exact(self.len() - count)); - - Ok(count) - } - - fn invalid_count(&self) -> VortexResult { - Ok(self.len() - self.valid_count()?) - } - - fn validity(&self) -> VortexResult { - if self.dtype().is_nullable() { - let validity = >::validity(&self.0)?; - if let Validity::Array(array) = &validity { - vortex_ensure!(array.len() == self.len(), "Validity array length mismatch"); - vortex_ensure!( - matches!(array.dtype(), DType::Bool(Nullability::NonNullable)), - "Validity array is not non-nullable boolean: {}", - self.encoding_id(), - ); - } - Ok(validity) - } else { - Ok(Validity::NonNullable) - } - } - - fn validity_mask(&self) -> VortexResult { - match self.validity()? { - Validity::NonNullable | Validity::AllValid => Ok(Mask::new_true(self.len())), - Validity::AllInvalid => Ok(Mask::new_false(self.len())), - Validity::Array(a) => Ok(a.to_bool().to_mask()), - } - } - - fn to_canonical(&self) -> VortexResult { - self.to_array() - .execute(&mut LEGACY_SESSION.create_execution_ctx()) - } - - fn append_to_builder( - &self, - builder: &mut dyn ArrayBuilder, - ctx: &mut ExecutionCtx, - ) -> VortexResult<()> { - if builder.dtype() != self.dtype() { - vortex_panic!( - "Builder dtype mismatch: expected {}, got {}", - self.dtype(), - builder.dtype(), - ); - } - let len = builder.len(); - - V::append_to_builder(&self.0, builder, ctx)?; - - assert_eq!( - len + self.len(), - builder.len(), - "Builder length mismatch after writing array for encoding {}", - self.encoding_id(), - ); - Ok(()) - } - - fn statistics(&self) -> StatsSetRef<'_> { - V::stats(&self.0) - } - - fn with_children(&self, children: Vec) -> VortexResult { - let mut this = self.0.clone(); - V::with_children(&mut this, children)?; - Ok(this.into_array()) - } -} - -impl ArrayHash for ArrayAdapter { - fn array_hash(&self, state: &mut H, precision: hash::Precision) { - self.0.encoding_id().hash(state); - V::array_hash(&self.0, state, precision); - } -} - -impl ArrayEq for ArrayAdapter { - fn array_eq(&self, other: &Self, precision: hash::Precision) -> bool { - V::array_eq(&self.0, &other.0, precision) - } -} - -impl ArrayVisitor for ArrayAdapter { - fn children(&self) -> Vec { - (0..V::nchildren(&self.0)) - .map(|i| V::child(&self.0, i)) - .collect() + (0..V::nchildren(self)).map(|i| V::child(self, i)).collect() } fn nchildren(&self) -> usize { - V::nchildren(&self.0) + V::nchildren(self) } fn nth_child(&self, idx: usize) -> Option { - (idx < V::nchildren(&self.0)).then(|| V::child(&self.0, idx)) + (idx < V::nchildren(self)).then(|| V::child(self, idx)) } fn children_names(&self) -> Vec { - (0..V::nchildren(&self.0)) - .map(|i| V::child_name(&self.0, i)) + (0..V::nchildren(self)) + .map(|i| V::child_name(self, i)) .collect() } fn named_children(&self) -> Vec<(String, ArrayRef)> { - (0..V::nchildren(&self.0)) - .map(|i| (V::child_name(&self.0, i), V::child(&self.0, i))) + (0..V::nchildren(self)) + .map(|i| (V::child_name(self, i), V::child(self, i))) .collect() } fn buffers(&self) -> Vec { - (0..V::nbuffers(&self.0)) - .map(|i| V::buffer(&self.0, i).to_host_sync()) + (0..V::nbuffers(self)) + .map(|i| V::buffer(self, i).to_host_sync()) .collect() } fn buffer_handles(&self) -> Vec { - (0..V::nbuffers(&self.0)) - .map(|i| V::buffer(&self.0, i)) - .collect() + (0..V::nbuffers(self)).map(|i| V::buffer(self, i)).collect() } fn buffer_names(&self) -> Vec { - (0..V::nbuffers(&self.0)) - .filter_map(|i| V::buffer_name(&self.0, i)) + (0..V::nbuffers(self)) + .filter_map(|i| V::buffer_name(self, i)) .collect() } fn named_buffers(&self) -> Vec<(String, BufferHandle)> { - (0..V::nbuffers(&self.0)) - .filter_map(|i| V::buffer_name(&self.0, i).map(|name| (name, V::buffer(&self.0, i)))) + (0..V::nbuffers(self)) + .filter_map(|i| V::buffer_name(self, i).map(|name| (name, V::buffer(self, i)))) .collect() } fn nbuffers(&self) -> usize { - V::nbuffers(&self.0) + V::nbuffers(self) } fn metadata(&self) -> VortexResult>> { - V::serialize(V::metadata(&self.0)?) + V::serialize(V::metadata(self)?) } fn metadata_fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - match V::metadata(&self.0) { + match V::metadata(self) { Err(e) => write!(f, ""), Ok(metadata) => Debug::fmt(&metadata, f), } @@ -1130,30 +713,18 @@ impl ArrayVisitor for ArrayAdapter { return false; } } - true } } -/// Implement a matcher for a specific VTable type. -/// -/// During the migration, this tries both `Array` (new path) and `ArrayAdapter` -/// (legacy path). Returns `&V::Array` for backward compatibility. impl Matcher for V { - type Match<'a> = &'a V::Array; + type Match<'a> = &'a Array; fn matches(array: &dyn DynArray) -> bool { - DynArray::as_any(array).is::>() || DynArray::as_any(array).is::>() + DynArray::as_any(array).is::>() } fn try_match<'a>(array: &'a dyn DynArray) -> Option> { - // Try new Array first. - if let Some(typed) = DynArray::as_any(array).downcast_ref::>() { - return Some(typed.inner()); - } - // Fall back to legacy ArrayAdapter. - DynArray::as_any(array) - .downcast_ref::>() - .map(|adapter| adapter.as_inner()) + DynArray::as_any(array).downcast_ref::>() } } diff --git a/vortex-array/src/arrays/assertions.rs b/vortex-array/src/arrays/assertions.rs index ef409f2af23..c152dab1a93 100644 --- a/vortex-array/src/arrays/assertions.rs +++ b/vortex-array/src/arrays/assertions.rs @@ -21,9 +21,15 @@ pub fn format_indices>(indices: I) -> impl Display /// ``` #[macro_export] macro_rules! assert_nth_scalar { - ($arr:expr, $n:expr, $expected:expr) => { - assert_eq!($arr.scalar_at($n).unwrap(), $expected.try_into().unwrap()); - }; + ($arr:expr, $n:expr, $expected:expr) => {{ + use $crate::DynArray as _; + use $crate::IntoArray as _; + let arr_ref: $crate::ArrayRef = $crate::IntoArray::into_array($arr.clone()); + assert_eq!( + arr_ref.scalar_at($n).unwrap(), + $expected.try_into().unwrap() + ); + }}; } /// Asserts that the scalar at position `$n` in array `$arr` is null. @@ -36,21 +42,25 @@ macro_rules! assert_nth_scalar { /// ``` #[macro_export] macro_rules! assert_nth_scalar_is_null { - ($arr:expr, $n:expr) => { + ($arr:expr, $n:expr) => {{ + use $crate::DynArray as _; + let arr_ref: $crate::ArrayRef = $crate::IntoArray::into_array($arr.clone()); assert!( - $arr.scalar_at($n).unwrap().is_null(), + arr_ref.scalar_at($n).unwrap().is_null(), "expected scalar at index {} to be null, but was {:?}", $n, - $arr.scalar_at($n).unwrap() + arr_ref.scalar_at($n).unwrap() ); - }; + }}; } #[macro_export] macro_rules! assert_arrays_eq { ($left:expr, $right:expr) => {{ - let left = $left.clone(); - let right = $right.clone(); + + use $crate::DynArray as _; + let left: $crate::ArrayRef = $crate::IntoArray::into_array($left.clone()); + let right: $crate::ArrayRef = $crate::IntoArray::into_array($right.clone()); if left.dtype() != right.dtype() { panic!( "assertion left == right failed: arrays differ in type: {} != {}.\n left: {}\n right: {}", diff --git a/vortex-array/src/arrays/bool/array.rs b/vortex-array/src/arrays/bool/array.rs index 3999f8fa86e..6b51512c759 100644 --- a/vortex-array/src/arrays/bool/array.rs +++ b/vortex-array/src/arrays/bool/array.rs @@ -11,13 +11,15 @@ use vortex_mask::Mask; use crate::ArrayRef; use crate::IntoArray; -use crate::arrays::bool; +use crate::arrays::Bool; +use crate::arrays::BoolArray; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::stats::ArrayStats; use crate::validity::Validity; +use crate::vtable::Array; -/// A boolean array that stores true/false values in a compact bit-packed format. +/// Inner data for a boolean array that stores true/false values in a compact bit-packed format. /// /// This mirrors the Apache Arrow Boolean array encoding, where each boolean value /// is stored as a single bit rather than a full byte. @@ -50,7 +52,7 @@ use crate::validity::Validity; /// # } /// ``` #[derive(Clone, Debug)] -pub struct BoolArray { +pub struct BoolData { pub(super) dtype: DType, pub(super) bits: BufferHandle, pub(super) offset: usize, @@ -66,7 +68,85 @@ pub struct BoolArrayParts { pub validity: Validity, } -impl BoolArray { +/// Field accessors and non-consuming methods on the inner bool data. +impl BoolData { + /// Returns the length of this array. + pub fn len(&self) -> usize { + self.len + } + + /// Returns the [`DType`] of this array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns `true` if this array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Returns the [`Validity`] of this array. + #[allow(clippy::same_name_method)] + pub fn validity(&self) -> &Validity { + &self.validity + } + + /// Returns the validity as a [`Mask`]. + pub fn validity_mask(&self) -> Mask { + self.validity.to_mask(self.len()) + } + + /// Returns the underlying [`BitBuffer`] of the array. + pub fn to_bit_buffer(&self) -> BitBuffer { + let buffer = self.bits.as_host().clone(); + BitBuffer::new_with_offset(buffer, self.len, self.offset) + } + + /// Returns the underlying [`BitBuffer`] of the array + pub fn into_bit_buffer(self) -> BitBuffer { + let buffer = self.bits.unwrap_host(); + BitBuffer::new_with_offset(buffer, self.len, self.offset) + } + + /// Splits into owned parts + #[inline] + pub fn into_parts(self) -> BoolArrayParts { + BoolArrayParts { + bits: self.bits, + offset: self.offset, + len: self.len, + validity: self.validity, + } + } + + pub fn to_mask(&self) -> Mask { + self.maybe_to_mask() + .vortex_expect("failed to check validity") + .vortex_expect("cannot convert nullable boolean array to mask") + } + + pub fn maybe_to_mask(&self) -> VortexResult> { + let all_valid = match &self.validity { + Validity::NonNullable | Validity::AllValid => true, + Validity::AllInvalid => false, + Validity::Array(a) => a.statistics().compute_min::().unwrap_or(false), + }; + Ok(all_valid.then(|| Mask::from_buffer(self.to_bit_buffer()))) + } + + pub fn to_mask_fill_null_false(&self) -> Mask { + let validity_mask = self.validity_mask(); + let buffer = match validity_mask { + Mask::AllTrue(_) => self.to_bit_buffer(), + Mask::AllFalse(_) => return Mask::new_false(self.len()), + Mask::Values(validity) => validity.bit_buffer() & self.to_bit_buffer(), + }; + Mask::from_buffer(buffer) + } +} + +/// Constructors and consuming methods for `BoolArray` (`Array`). +impl Array { /// Constructs a new `BoolArray`. /// /// # Panics @@ -88,13 +168,68 @@ impl BoolArray { /// Constructs a new `BoolArray`. /// - /// See [`BoolArray::new_unchecked`] for more information. - /// /// # Errors /// - /// Returns an error if the provided components do not satisfy the invariants documented in - /// [`BoolArray::new_unchecked`]. + /// Returns an error if the provided components do not satisfy the invariants. pub fn try_new(bits: BitBuffer, validity: Validity) -> VortexResult { + Array::try_from_data(BoolData::try_new(bits, validity)?) + } + + /// Build a new bool array from a `BufferHandle`, returning an error if the offset is + /// too large or the buffer is not large enough to hold the values. + pub fn try_new_from_handle( + bits: BufferHandle, + offset: usize, + len: usize, + validity: Validity, + ) -> VortexResult { + Array::try_from_data(BoolData::try_new_from_handle(bits, offset, len, validity)?) + } + + /// Creates a new [`BoolArray`] without validation. + /// + /// # Safety + /// + /// The caller must ensure that the validity length is equal to the bit buffer length. + pub unsafe fn new_unchecked(bits: BitBuffer, validity: Validity) -> Self { + // SAFETY: caller guarantees validity length equals bit buffer length. + Array::try_from_data(unsafe { BoolData::new_unchecked(bits, validity) }) + .vortex_expect("BoolData is always valid") + } + + /// Validates the components that would be used to create a [`BoolArray`]. + pub fn validate(bits: &BitBuffer, validity: &Validity) -> VortexResult<()> { + BoolData::validate(bits, validity) + } + + /// Create a new BoolArray from a set of indices and a length. + /// + /// All indices must be less than the length. + pub fn from_indices>( + length: usize, + indices: I, + validity: Validity, + ) -> Self { + let mut buffer = BitBufferMut::new_unset(length); + indices.into_iter().for_each(|idx| buffer.set(idx)); + Self::new(buffer.freeze(), validity) + } + + /// Returns the underlying [`BitBuffer`] of the array, consuming self. + pub fn into_bit_buffer(self) -> BitBuffer { + self.into_data().into_bit_buffer() + } + + /// Splits into owned parts, consuming self. + #[inline] + pub fn into_parts(self) -> BoolArrayParts { + self.into_data().into_parts() + } +} + +/// Internal constructors on BoolData (used by Array constructors and VTable::build). +impl BoolData { + pub(super) fn try_new(bits: BitBuffer, validity: Validity) -> VortexResult { let bits = bits.shrink_offset(); Self::validate(&bits, &validity)?; @@ -110,13 +245,7 @@ impl BoolArray { }) } - /// Build a new bool array from a `BufferHandle`, returning an error if the offset is - /// too large or the buffer is not large enough to hold the values. - /// - /// # Error - /// - /// Error if the inputs fail validation. See also `try_new`. - pub fn try_new_from_handle( + pub(super) fn try_new_from_handle( bits: BufferHandle, offset: usize, len: usize, @@ -147,14 +276,9 @@ impl BoolArray { }) } - /// Creates a new [`BoolArray`] without validation from these components: - /// - /// # Safety - /// - /// The caller must ensure that the validity length is equal to the bit buffer length. - pub unsafe fn new_unchecked(bits: BitBuffer, validity: Validity) -> Self { + pub(super) unsafe fn new_unchecked(bits: BitBuffer, validity: Validity) -> Self { if cfg!(debug_assertions) { - Self::new(bits, validity) + Self::try_new(bits, validity).vortex_expect("Failed to create BoolData") } else { let (offset, len, buffer) = bits.into_inner(); @@ -169,17 +293,13 @@ impl BoolArray { } } - /// Validates the components that would be used to create a [`BoolArray`]. - /// - /// This function checks all the invariants required by [`BoolArray::new_unchecked`]. - pub fn validate(bits: &BitBuffer, validity: &Validity) -> VortexResult<()> { + pub(super) fn validate(bits: &BitBuffer, validity: &Validity) -> VortexResult<()> { vortex_ensure!( bits.offset() < 8, "BitBuffer offset must be <8, got {}", bits.offset() ); - // Validate validity if let Some(validity_len) = validity.maybe_len() { vortex_ensure!( validity_len == bits.len(), @@ -190,88 +310,17 @@ impl BoolArray { Ok(()) } - - /// Splits into owned parts - #[inline] - pub fn into_parts(self) -> BoolArrayParts { - BoolArrayParts { - bits: self.bits, - offset: self.offset, - len: self.len, - validity: self.validity, - } - } - - /// Create a new BoolArray from a set of indices and a length. - /// - /// All indices must be less than the length. - pub fn from_indices>( - length: usize, - indices: I, - validity: Validity, - ) -> Self { - let mut buffer = BitBufferMut::new_unset(length); - indices.into_iter().for_each(|idx| buffer.set(idx)); - Self::new(buffer.freeze(), validity) - } - - /// Returns the underlying [`BitBuffer`] of the array. - pub fn to_bit_buffer(&self) -> BitBuffer { - let buffer = self.bits.as_host().clone(); - - BitBuffer::new_with_offset(buffer, self.len, self.offset) - } - - /// Returns the underlying [`BitBuffer`] of the array - pub fn into_bit_buffer(self) -> BitBuffer { - let buffer = self.bits.unwrap_host(); - - BitBuffer::new_with_offset(buffer, self.len, self.offset) - } - - pub fn to_mask(&self) -> Mask { - self.maybe_to_mask() - .vortex_expect("failed to check validity") - .vortex_expect("cannot convert nullable boolean array to mask") - } - - pub fn maybe_to_mask(&self) -> VortexResult> { - Ok(self - .all_valid()? - .then(|| Mask::from_buffer(self.to_bit_buffer()))) - } - - pub fn to_mask_fill_null_false(&self) -> Mask { - if let Some(constant) = self.as_constant() { - let bool_constant = constant.as_bool(); - if bool_constant.value().unwrap_or(false) { - return Mask::new_true(self.len()); - } else { - return Mask::new_false(self.len()); - } - } - // Extract a boolean buffer, treating null values to false - let buffer = match self - .validity_mask() - .unwrap_or_else(|_| Mask::new_true(self.len())) - { - Mask::AllTrue(_) => self.to_bit_buffer(), - Mask::AllFalse(_) => return Mask::new_false(self.len()), - Mask::Values(validity) => validity.bit_buffer() & self.to_bit_buffer(), - }; - Mask::from_buffer(buffer) - } } impl From for BoolArray { fn from(value: BitBuffer) -> Self { - Self::new(value, Validity::NonNullable) + BoolArray::new(value, Validity::NonNullable) } } impl FromIterator for BoolArray { fn from_iter>(iter: T) -> Self { - Self::from(BitBuffer::from_iter(iter)) + BoolArray::from(BitBuffer::from_iter(iter)) } } @@ -279,7 +328,7 @@ impl FromIterator> for BoolArray { fn from_iter>>(iter: I) -> Self { let (buffer, nulls) = BooleanArray::from_iter(iter).into_parts(); - Self::new( + BoolArray::new( BitBuffer::from(buffer), nulls .map(|n| Validity::from(BitBuffer::from(n.into_inner()))) @@ -309,7 +358,6 @@ mod tests { use vortex_buffer::BitBufferMut; use vortex_buffer::buffer; - use crate::DynArray; use crate::IntoArray; use crate::LEGACY_SESSION; use crate::VortexSessionExecute; @@ -318,7 +366,6 @@ mod tests { use crate::assert_arrays_eq; use crate::patches::Patches; use crate::validity::Validity; - use crate::vtable::ValidityHelper; #[test] fn bool_array() { diff --git a/vortex-array/src/arrays/bool/compute/cast.rs b/vortex-array/src/arrays/bool/compute/cast.rs index 105625f3258..6c8bc12fbd6 100644 --- a/vortex-array/src/arrays/bool/compute/cast.rs +++ b/vortex-array/src/arrays/bool/compute/cast.rs @@ -9,7 +9,6 @@ use crate::arrays::Bool; use crate::arrays::BoolArray; use crate::dtype::DType; use crate::scalar_fn::fns::cast::CastReduce; -use crate::vtable::ValidityHelper; impl CastReduce for Bool { fn cast(array: &BoolArray, dtype: &DType) -> VortexResult> { diff --git a/vortex-array/src/arrays/bool/compute/fill_null.rs b/vortex-array/src/arrays/bool/compute/fill_null.rs index b209cb5aa5d..d3ea9231e51 100644 --- a/vortex-array/src/arrays/bool/compute/fill_null.rs +++ b/vortex-array/src/arrays/bool/compute/fill_null.rs @@ -12,7 +12,6 @@ use crate::arrays::BoolArray; use crate::scalar::Scalar; use crate::scalar_fn::fns::fill_null::FillNullKernel; use crate::validity::Validity; -use crate::vtable::ValidityHelper; impl FillNullKernel for Bool { fn fill_null( diff --git a/vortex-array/src/arrays/bool/compute/filter.rs b/vortex-array/src/arrays/bool/compute/filter.rs index cf0f90f66ca..82962013ec7 100644 --- a/vortex-array/src/arrays/bool/compute/filter.rs +++ b/vortex-array/src/arrays/bool/compute/filter.rs @@ -14,7 +14,6 @@ use crate::IntoArray; use crate::arrays::Bool; use crate::arrays::BoolArray; use crate::arrays::filter::FilterReduce; -use crate::vtable::ValidityHelper; /// If the filter density is above 80%, we use slices to filter the array instead of indices. const FILTER_SLICES_DENSITY_THRESHOLD: f64 = 0.8; diff --git a/vortex-array/src/arrays/bool/compute/mask.rs b/vortex-array/src/arrays/bool/compute/mask.rs index 4ca590094f4..c938a33035c 100644 --- a/vortex-array/src/arrays/bool/compute/mask.rs +++ b/vortex-array/src/arrays/bool/compute/mask.rs @@ -9,7 +9,6 @@ use crate::arrays::Bool; use crate::arrays::BoolArray; use crate::scalar_fn::fns::mask::MaskReduce; use crate::validity::Validity; -use crate::vtable::ValidityHelper; impl MaskReduce for Bool { fn mask(array: &BoolArray, mask: &ArrayRef) -> VortexResult> { diff --git a/vortex-array/src/arrays/bool/compute/rules.rs b/vortex-array/src/arrays/bool/compute/rules.rs index c4ed7496229..1e8ab5cfeb8 100644 --- a/vortex-array/src/arrays/bool/compute/rules.rs +++ b/vortex-array/src/arrays/bool/compute/rules.rs @@ -15,7 +15,6 @@ use crate::optimizer::rules::ArrayParentReduceRule; use crate::optimizer::rules::ParentRuleSet; use crate::scalar_fn::fns::cast::CastReduceAdaptor; use crate::scalar_fn::fns::mask::MaskReduceAdaptor; -use crate::vtable::ValidityHelper; pub(crate) const RULES: ParentRuleSet = ParentRuleSet::new(&[ ParentRuleSet::lift(&BoolMaskedValidityRule), diff --git a/vortex-array/src/arrays/bool/compute/slice.rs b/vortex-array/src/arrays/bool/compute/slice.rs index 31045004c93..7285062eede 100644 --- a/vortex-array/src/arrays/bool/compute/slice.rs +++ b/vortex-array/src/arrays/bool/compute/slice.rs @@ -10,10 +10,9 @@ use crate::IntoArray; use crate::arrays::Bool; use crate::arrays::BoolArray; use crate::arrays::slice::SliceReduce; -use crate::vtable::ValidityHelper; impl SliceReduce for Bool { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &BoolArray, range: Range) -> VortexResult> { Ok(Some( BoolArray::new( array.to_bit_buffer().slice(range.clone()), diff --git a/vortex-array/src/arrays/bool/compute/take.rs b/vortex-array/src/arrays/bool/compute/take.rs index be4a25a9ad4..e419d62532b 100644 --- a/vortex-array/src/arrays/bool/compute/take.rs +++ b/vortex-array/src/arrays/bool/compute/take.rs @@ -20,7 +20,6 @@ use crate::builtins::ArrayBuiltins; use crate::executor::ExecutionCtx; use crate::match_each_integer_ptype; use crate::scalar::Scalar; -use crate::vtable::ValidityHelper; impl TakeExecute for Bool { fn take( @@ -83,7 +82,6 @@ mod test { use rstest::rstest; use vortex_buffer::buffer; - use crate::DynArray; use crate::IntoArray as _; use crate::ToCanonical; use crate::arrays::BoolArray; diff --git a/vortex-array/src/arrays/bool/mod.rs b/vortex-array/src/arrays/bool/mod.rs index 9b95ddc5d3c..9378983286f 100644 --- a/vortex-array/src/arrays/bool/mod.rs +++ b/vortex-array/src/arrays/bool/mod.rs @@ -4,14 +4,15 @@ mod array; mod patch; -pub use array::BoolArray; pub use array::BoolArrayParts; +pub use array::BoolData; pub(crate) mod compute; mod vtable; pub use compute::rules::BoolMaskedValidityRule; pub use vtable::Bool; +pub use vtable::BoolArray; #[cfg(feature = "_test-harness")] mod test_harness; diff --git a/vortex-array/src/arrays/bool/patch.rs b/vortex-array/src/arrays/bool/patch.rs index 3e787bb278e..f8b6be4a4c7 100644 --- a/vortex-array/src/arrays/bool/patch.rs +++ b/vortex-array/src/arrays/bool/patch.rs @@ -10,7 +10,6 @@ use crate::arrays::BoolArray; use crate::arrays::PrimitiveArray; use crate::match_each_unsigned_integer_ptype; use crate::patches::Patches; -use crate::vtable::ValidityHelper; impl BoolArray { pub fn patch(self, patches: &Patches, ctx: &mut ExecutionCtx) -> VortexResult { @@ -50,13 +49,14 @@ impl BoolArray { mod tests { use vortex_buffer::BitBuffer; + use crate::IntoArray; use crate::arrays::BoolArray; use crate::assert_arrays_eq; #[test] fn patch_sliced_bools() { let arr = BoolArray::from(BitBuffer::new_set(12)); - let sliced = arr.slice(4..12).unwrap(); + let sliced = arr.into_array().slice(4..12).unwrap(); let expected = BoolArray::from_iter([true; 8]); assert_arrays_eq!(sliced, expected); } @@ -64,7 +64,7 @@ mod tests { #[test] fn patch_sliced_bools_offset() { let arr = BoolArray::from(BitBuffer::new_set(15)); - let sliced = arr.slice(4..15).unwrap(); + let sliced = arr.into_array().slice(4..15).unwrap(); let expected = BoolArray::from_iter([true; 11]); assert_arrays_eq!(sliced, expected); } diff --git a/vortex-array/src/arrays/bool/test_harness.rs b/vortex-array/src/arrays/bool/test_harness.rs index 286c0f98110..4adc53b89ac 100644 --- a/vortex-array/src/arrays/bool/test_harness.rs +++ b/vortex-array/src/arrays/bool/test_harness.rs @@ -9,7 +9,7 @@ use crate::arrays::BoolArray; impl BoolArray { pub fn opt_bool_vec(&self) -> Vec> { self.validity_mask() - .vortex_expect("Failed to get validity mask") + .vortex_expect("validity_mask") .to_bit_buffer() .iter() .zip(self.to_bit_buffer().iter()) @@ -19,7 +19,7 @@ impl BoolArray { pub fn bool_vec(&self) -> Vec { self.validity_mask() - .vortex_expect("Failed to get validity mask") + .vortex_expect("validity_mask") .to_bit_buffer() .iter() .zip(self.to_bit_buffer().iter()) diff --git a/vortex-array/src/arrays/bool/vtable/mod.rs b/vortex-array/src/arrays/bool/vtable/mod.rs index 761cd58de24..97b8304bc12 100644 --- a/vortex-array/src/arrays/bool/vtable/mod.rs +++ b/vortex-array/src/arrays/bool/vtable/mod.rs @@ -17,7 +17,7 @@ use crate::ExecutionCtx; use crate::ExecutionResult; use crate::ProstMetadata; use crate::SerializeMetadata; -use crate::arrays::BoolArray; +use crate::arrays::bool::BoolData; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::serde::ArrayChildren; @@ -39,10 +39,10 @@ use crate::Precision; use crate::arrays::bool::compute::rules::RULES; use crate::hash::ArrayEq; use crate::hash::ArrayHash; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::vtable::ArrayId; -vtable!(Bool); +vtable!(Bool, Bool, BoolData); #[derive(prost::Message)] pub struct BoolMetadata { @@ -52,13 +52,13 @@ pub struct BoolMetadata { } impl VTable for Bool { - type Array = BoolArray; + type ArrayData = BoolData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValidityHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Bool } @@ -66,25 +66,25 @@ impl VTable for Bool { Self::ID } - fn len(array: &BoolArray) -> usize { + fn len(array: &BoolData) -> usize { array.len } - fn dtype(array: &BoolArray) -> &DType { + fn dtype(array: &BoolData) -> &DType { &array.dtype } - fn stats(array: &BoolArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &BoolData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &BoolArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.to_bit_buffer().array_hash(state, precision); array.validity.array_hash(state, precision); } - fn array_eq(array: &BoolArray, other: &BoolArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { if array.dtype != other.dtype { return false; } @@ -94,29 +94,29 @@ impl VTable for Bool { && array.validity.array_eq(&other.validity, precision) } - fn nbuffers(_array: &BoolArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 1 } - fn buffer(array: &BoolArray, idx: usize) -> BufferHandle { + fn buffer(array: &Array, idx: usize) -> BufferHandle { match idx { 0 => array.bits.clone(), _ => vortex_panic!("BoolArray buffer index {idx} out of bounds"), } } - fn buffer_name(_array: &BoolArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { match idx { 0 => Some("bits".to_string()), _ => None, } } - fn nchildren(array: &BoolArray) -> usize { + fn nchildren(array: &Array) -> usize { validity_nchildren(&array.validity) } - fn child(array: &BoolArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => validity_to_child(&array.validity, array.len()) .vortex_expect("BoolArray child index out of bounds"), @@ -124,11 +124,11 @@ impl VTable for Bool { } } - fn child_name(_array: &BoolArray, _idx: usize) -> String { + fn child_name(_array: &Array, _idx: usize) -> String { "validity".to_string() } - fn metadata(array: &BoolArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { assert!(array.offset < 8, "Offset must be <8, got {}", array.offset); Ok(ProstMetadata(BoolMetadata { offset: u32::try_from(array.offset).vortex_expect("checked"), @@ -156,7 +156,7 @@ impl VTable for Bool { metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { if buffers.len() != 1 { vortex_bail!("Expected 1 buffer, got {}", buffers.len()); } @@ -172,10 +172,10 @@ impl VTable for Bool { let buffer = buffers[0].clone(); - BoolArray::try_new_from_handle(buffer, metadata.offset as usize, len, validity) + BoolData::try_new_from_handle(buffer, metadata.offset as usize, len, validity) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() <= 1, "BoolArray can have at most 1 child (validity), got {}", diff --git a/vortex-array/src/arrays/bool/vtable/operations.rs b/vortex-array/src/arrays/bool/vtable/operations.rs index 7688d90bab5..8afb0a3fd5d 100644 --- a/vortex-array/src/arrays/bool/vtable/operations.rs +++ b/vortex-array/src/arrays/bool/vtable/operations.rs @@ -5,12 +5,16 @@ use vortex_error::VortexResult; use crate::ExecutionCtx; use crate::arrays::Bool; -use crate::arrays::bool::vtable::BoolArray; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for Bool { - fn scalar_at(array: &BoolArray, index: usize, _ctx: &mut ExecutionCtx) -> VortexResult { + fn scalar_at( + array: &Array, + index: usize, + _ctx: &mut ExecutionCtx, + ) -> VortexResult { Ok(Scalar::bool( array.to_bit_buffer().value(index), array.dtype().nullability(), @@ -22,14 +26,15 @@ impl OperationsVTable for Bool { mod tests { use std::iter; - use super::*; + use crate::IntoArray; use crate::ToCanonical; + use crate::arrays::BoolArray; use crate::assert_arrays_eq; #[test] fn test_slice_hundred_elements() { let arr = BoolArray::from_iter(iter::repeat_n(Some(true), 100)); - let sliced_arr = arr.slice(8..16).unwrap().to_bool(); + let sliced_arr = arr.into_array().slice(8..16).unwrap().to_bool(); assert_eq!(sliced_arr.len(), 8); assert_eq!(sliced_arr.to_bit_buffer().len(), 8); assert_eq!(sliced_arr.to_bit_buffer().offset(), 0); @@ -38,7 +43,7 @@ mod tests { #[test] fn test_slice() { let arr = BoolArray::from_iter([Some(true), Some(true), None, Some(false), None]); - let sliced_arr = arr.slice(1..4).unwrap().to_bool(); + let sliced_arr = arr.into_array().slice(1..4).unwrap().to_bool(); assert_arrays_eq!( sliced_arr, diff --git a/vortex-array/src/arrays/bool/vtable/validity.rs b/vortex-array/src/arrays/bool/vtable/validity.rs index f923e5f6910..774d975b819 100644 --- a/vortex-array/src/arrays/bool/vtable/validity.rs +++ b/vortex-array/src/arrays/bool/vtable/validity.rs @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use crate::arrays::bool::vtable::BoolArray; +use crate::arrays::bool::BoolData; use crate::validity::Validity; use crate::vtable::ValidityHelper; -impl ValidityHelper for BoolArray { +impl ValidityHelper for BoolData { fn validity(&self) -> &Validity { &self.validity } diff --git a/vortex-array/src/arrays/chunked/array.rs b/vortex-array/src/arrays/chunked/array.rs index 98b1c76dd5e..6e8fe790927 100644 --- a/vortex-array/src/arrays/chunked/array.rs +++ b/vortex-array/src/arrays/chunked/array.rs @@ -17,7 +17,8 @@ use vortex_error::vortex_bail; use crate::ArrayRef; use crate::DynArray; use crate::IntoArray; -use crate::arrays::PrimitiveArray; +use crate::arrays::Chunked; +use crate::arrays::PrimitiveData; use crate::dtype::DType; use crate::iter::ArrayIterator; use crate::iter::ArrayIteratorAdapter; @@ -27,25 +28,26 @@ use crate::stats::ArrayStats; use crate::stream::ArrayStream; use crate::stream::ArrayStreamAdapter; use crate::validity::Validity; +use crate::vtable::Array; #[derive(Clone, Debug)] -pub struct ChunkedArray { +pub struct ChunkedData { pub(super) dtype: DType, pub(super) len: usize, - pub(super) chunk_offsets: PrimitiveArray, + pub(super) chunk_offsets: PrimitiveData, pub(super) chunks: Vec, pub(super) stats_set: ArrayStats, } -impl ChunkedArray { +impl ChunkedData { /// Constructs a new `ChunkedArray`. /// - /// See [`ChunkedArray::new_unchecked`] for more information. + /// See `ChunkedArray::new_unchecked` for more information. /// /// # Errors /// /// Returns an error if the provided components do not satisfy the invariants documented in - /// [`ChunkedArray::new_unchecked`]. + /// `ChunkedArray::new_unchecked`. pub fn try_new(chunks: Vec, dtype: DType) -> VortexResult { Self::validate(&chunks, &dtype)?; @@ -53,7 +55,7 @@ impl ChunkedArray { unsafe { Ok(Self::new_unchecked(chunks, dtype)) } } - /// Creates a new [`ChunkedArray`] without validation from these components: + /// Creates a new `ChunkedArray` without validation from these components: /// /// * `chunks` is a vector of arrays to be concatenated logically. /// * `dtype` is the common data type of all chunks. @@ -78,7 +80,7 @@ impl ChunkedArray { unsafe { chunk_offsets_buf.push_unchecked(curr_offset) } } - let chunk_offsets = PrimitiveArray::new(chunk_offsets_buf.freeze(), Validity::NonNullable); + let chunk_offsets = PrimitiveData::new(chunk_offsets_buf.freeze(), Validity::NonNullable); Self { dtype, @@ -91,9 +93,9 @@ impl ChunkedArray { } } - /// Validates the components that would be used to create a [`ChunkedArray`]. + /// Validates the components that would be used to create a `ChunkedArray`. /// - /// This function checks all the invariants required by [`ChunkedArray::new_unchecked`]. + /// This function checks all the invariants required by `ChunkedArray::new_unchecked`. pub fn validate(chunks: &[ArrayRef], dtype: &DType) -> VortexResult<()> { for chunk in chunks { if chunk.dtype() != dtype { @@ -104,6 +106,21 @@ impl ChunkedArray { Ok(()) } + /// Returns the length of this array. + pub fn len(&self) -> usize { + self.len + } + + /// Returns the [`DType`] of this array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns `true` if this array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + #[inline] pub fn chunk(&self, idx: usize) -> &ArrayRef { assert!(idx < self.nchunks(), "chunk index {idx} out of bounds"); @@ -173,11 +190,10 @@ impl ChunkedArray { new_chunks.push( // SAFETY: chunks_to_combine contains valid chunks of the same dtype as self. // All chunks are guaranteed to be valid arrays matching self.dtype(). - unsafe { - ChunkedArray::new_unchecked(chunks_to_combine, self.dtype().clone()) - .to_canonical()? - .into_array() - }, + unsafe { ChunkedData::new_unchecked(chunks_to_combine, self.dtype().clone()) } + .into_array() + .to_canonical()? + .into_array(), ); new_chunk_n_bytes = 0; @@ -195,13 +211,14 @@ impl ChunkedArray { } if !chunks_to_combine.is_empty() { - new_chunks.push(unsafe { + new_chunks.push( // SAFETY: chunks_to_combine contains valid chunks of the same dtype as self. // All chunks are guaranteed to be valid arrays matching self.dtype(). - ChunkedArray::new_unchecked(chunks_to_combine, self.dtype().clone()) - .to_canonical()? + unsafe { ChunkedData::new_unchecked(chunks_to_combine, self.dtype().clone()) } .into_array() - }); + .to_canonical()? + .into_array(), + ); } // SAFETY: new_chunks contains valid arrays of the same dtype as self. @@ -210,14 +227,32 @@ impl ChunkedArray { } } -impl FromIterator for ChunkedArray { +impl Array { + /// Constructs a new `ChunkedArray`. + pub fn try_new(chunks: Vec, dtype: DType) -> VortexResult { + Array::try_from_data(ChunkedData::try_new(chunks, dtype)?) + } + + /// Creates a new `ChunkedArray` without validation. + /// + /// # Safety + /// + /// See [`ChunkedData::new_unchecked`]. + pub unsafe fn new_unchecked(chunks: Vec, dtype: DType) -> Self { + Array::try_from_data(unsafe { ChunkedData::new_unchecked(chunks, dtype) }) + .vortex_expect("ChunkedData is always valid") + } +} + +impl FromIterator for Array { fn from_iter>(iter: T) -> Self { let chunks: Vec = iter.into_iter().collect(); let dtype = chunks .first() .map(|c| c.dtype().clone()) .vortex_expect("Cannot infer DType from an empty iterator"); - Self::try_new(chunks, dtype).vortex_expect("Failed to create chunked array from iterator") + Array::::try_new(chunks, dtype) + .vortex_expect("Failed to create chunked array from iterator") } } @@ -317,7 +352,7 @@ mod test { // Should be all_valid since all non-empty chunks are all_valid assert!(chunked.all_valid().unwrap()); - assert!(!chunked.all_invalid().unwrap()); + assert!(!chunked.into_array().all_invalid().unwrap()); Ok(()) } @@ -337,7 +372,7 @@ mod test { // Should be all_invalid since all non-empty chunks are all_invalid assert!(!chunked.all_valid().unwrap()); - assert!(chunked.all_invalid().unwrap()); + assert!(chunked.into_array().all_invalid().unwrap()); Ok(()) } @@ -357,7 +392,7 @@ mod test { // Should be neither all_valid nor all_invalid assert!(!chunked.all_valid().unwrap()); - assert!(!chunked.all_invalid().unwrap()); + assert!(!chunked.into_array().all_invalid().unwrap()); Ok(()) } diff --git a/vortex-array/src/arrays/chunked/compute/cast.rs b/vortex-array/src/arrays/chunked/compute/cast.rs index a74927199fa..f60fbac9ec2 100644 --- a/vortex-array/src/arrays/chunked/compute/cast.rs +++ b/vortex-array/src/arrays/chunked/compute/cast.rs @@ -10,9 +10,10 @@ use crate::arrays::ChunkedArray; use crate::builtins::ArrayBuiltins; use crate::dtype::DType; use crate::scalar_fn::fns::cast::CastReduce; +use crate::vtable::Array; impl CastReduce for Chunked { - fn cast(array: &ChunkedArray, dtype: &DType) -> VortexResult> { + fn cast(array: &Array, dtype: &DType) -> VortexResult> { let mut cast_chunks = Vec::new(); for chunk in array.chunks() { cast_chunks.push(chunk.cast(dtype.clone())?); diff --git a/vortex-array/src/arrays/chunked/compute/fill_null.rs b/vortex-array/src/arrays/chunked/compute/fill_null.rs index 46aa17622ac..26a28e43e84 100644 --- a/vortex-array/src/arrays/chunked/compute/fill_null.rs +++ b/vortex-array/src/arrays/chunked/compute/fill_null.rs @@ -10,9 +10,10 @@ use crate::arrays::ChunkedArray; use crate::builtins::ArrayBuiltins; use crate::scalar::Scalar; use crate::scalar_fn::fns::fill_null::FillNullReduce; +use crate::vtable::Array; impl FillNullReduce for Chunked { - fn fill_null(array: &ChunkedArray, fill_value: &Scalar) -> VortexResult> { + fn fill_null(array: &Array, fill_value: &Scalar) -> VortexResult> { let new_chunks = array .chunks() .iter() diff --git a/vortex-array/src/arrays/chunked/compute/filter.rs b/vortex-array/src/arrays/chunked/compute/filter.rs index 4d2ff8149cb..1d176411a24 100644 --- a/vortex-array/src/arrays/chunked/compute/filter.rs +++ b/vortex-array/src/arrays/chunked/compute/filter.rs @@ -18,13 +18,14 @@ use crate::arrays::filter::FilterKernel; use crate::search_sorted::SearchSorted; use crate::search_sorted::SearchSortedSide; use crate::validity::Validity; +use crate::vtable::Array; // This is modeled after the constant with the equivalent name in arrow-rs. pub(crate) const FILTER_SLICES_SELECTIVITY_THRESHOLD: f64 = 0.8; impl FilterKernel for Chunked { fn filter( - array: &ChunkedArray, + array: &Array, mask: &Mask, _ctx: &mut ExecutionCtx, ) -> VortexResult> { @@ -62,7 +63,7 @@ pub(crate) enum ChunkFilter { /// Filter the chunks using slice ranges. fn filter_slices( - array: &ChunkedArray, + array: &Array, slices: impl Iterator, ) -> VortexResult> { let mut result = Vec::with_capacity(array.nchunks()); @@ -87,7 +88,7 @@ fn filter_slices( } pub(crate) fn chunk_filters( - array: &ChunkedArray, + array: &Array, slices: impl Iterator, ) -> VortexResult> { let chunk_offsets = array.chunk_offsets(); @@ -146,7 +147,7 @@ pub(crate) fn chunk_filters( /// Filter the chunks using indices. fn filter_indices( - array: &ChunkedArray, + array: &Array, indices: impl Iterator, ) -> VortexResult> { let mut result = Vec::with_capacity(array.nchunks()); diff --git a/vortex-array/src/arrays/chunked/compute/mask.rs b/vortex-array/src/arrays/chunked/compute/mask.rs index 441f9a5ce3e..95e54e067c6 100644 --- a/vortex-array/src/arrays/chunked/compute/mask.rs +++ b/vortex-array/src/arrays/chunked/compute/mask.rs @@ -12,10 +12,11 @@ use crate::arrays::scalar_fn::ScalarFnArrayExt; use crate::scalar_fn::EmptyOptions; use crate::scalar_fn::fns::mask::Mask as MaskExpr; use crate::scalar_fn::fns::mask::MaskKernel; +use crate::vtable::Array; impl MaskKernel for Chunked { fn mask( - array: &ChunkedArray, + array: &Array, mask: &ArrayRef, _ctx: &mut ExecutionCtx, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/chunked/compute/rules.rs b/vortex-array/src/arrays/chunked/compute/rules.rs index 808b50c7d94..f488bd7e8a7 100644 --- a/vortex-array/src/arrays/chunked/compute/rules.rs +++ b/vortex-array/src/arrays/chunked/compute/rules.rs @@ -17,6 +17,7 @@ use crate::optimizer::rules::ArrayParentReduceRule; use crate::optimizer::rules::ParentRuleSet; use crate::scalar_fn::fns::cast::CastReduceAdaptor; use crate::scalar_fn::fns::fill_null::FillNullReduceAdaptor; +use crate::vtable::Array; pub(crate) const PARENT_RULES: ParentRuleSet = ParentRuleSet::new(&[ ParentRuleSet::lift(&CastReduceAdaptor(Chunked)), @@ -33,7 +34,7 @@ impl ArrayParentReduceRule for ChunkedUnaryScalarFnPushDownRule { fn reduce_parent( &self, - array: &ChunkedArray, + array: &Array, parent: &ScalarFnArray, _child_idx: usize, ) -> VortexResult> { @@ -69,7 +70,7 @@ impl ArrayParentReduceRule for ChunkedConstantScalarFnPushDownRule { fn reduce_parent( &self, - array: &ChunkedArray, + array: &Array, parent: &ScalarFnArray, child_idx: usize, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/chunked/compute/slice.rs b/vortex-array/src/arrays/chunked/compute/slice.rs index d582387b372..dcaac9b2e48 100644 --- a/vortex-array/src/arrays/chunked/compute/slice.rs +++ b/vortex-array/src/arrays/chunked/compute/slice.rs @@ -12,10 +12,11 @@ use crate::IntoArray; use crate::arrays::Chunked; use crate::arrays::ChunkedArray; use crate::arrays::slice::SliceKernel; +use crate::vtable::Array; impl SliceKernel for Chunked { fn slice( - array: &Self::Array, + array: &Array, range: Range, _ctx: &mut ExecutionCtx, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/chunked/compute/take.rs b/vortex-array/src/arrays/chunked/compute/take.rs index ac29808fc6a..6af90f70d12 100644 --- a/vortex-array/src/arrays/chunked/compute/take.rs +++ b/vortex-array/src/arrays/chunked/compute/take.rs @@ -18,11 +18,12 @@ use crate::dtype::DType; use crate::dtype::PType; use crate::executor::ExecutionCtx; use crate::validity::Validity; +use crate::vtable::Array; // TODO(joe): this is pretty unoptimized but better than before. We want canonical using a builder // we also want to return a chunked array ideally. fn take_chunked( - array: &ChunkedArray, + array: &Array, indices: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -95,13 +96,14 @@ fn take_chunked( // 4. Single take to restore original order and expand duplicates. // Carry the original index validity so null indices produce null outputs. - let take_validity = Validity::from_mask(indices_mask, indices.dtype().nullability()); + let take_validity = + Validity::from_mask(indices.validity_mask()?, indices.dtype().nullability()); flat.take(PrimitiveArray::new(final_take.freeze(), take_validity).into_array()) } impl TakeExecute for Chunked { fn take( - array: &ChunkedArray, + array: &Array, indices: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/chunked/compute/zip.rs b/vortex-array/src/arrays/chunked/compute/zip.rs index bcb9fbe58d6..72fa236461e 100644 --- a/vortex-array/src/arrays/chunked/compute/zip.rs +++ b/vortex-array/src/arrays/chunked/compute/zip.rs @@ -10,13 +10,14 @@ use crate::arrays::Chunked; use crate::arrays::ChunkedArray; use crate::builtins::ArrayBuiltins; use crate::scalar_fn::fns::zip::ZipKernel; +use crate::vtable::Array; // Push down the zip call to the chunks. Without this rule // the default implementation canonicalises the chunked array // then zips once. impl ZipKernel for Chunked { fn zip( - if_true: &ChunkedArray, + if_true: &Array, if_false: &ArrayRef, mask: &ArrayRef, _ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/arrays/chunked/mod.rs b/vortex-array/src/arrays/chunked/mod.rs index b9a24da320e..e48c3488ecc 100644 --- a/vortex-array/src/arrays/chunked/mod.rs +++ b/vortex-array/src/arrays/chunked/mod.rs @@ -2,7 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::ChunkedArray; +pub use array::ChunkedData; +pub use vtable::ChunkedArray; pub(crate) mod compute; mod paired_chunks; diff --git a/vortex-array/src/arrays/chunked/vtable/canonical.rs b/vortex-array/src/arrays/chunked/vtable/canonical.rs index d165dc0be6e..45715924b0d 100644 --- a/vortex-array/src/arrays/chunked/vtable/canonical.rs +++ b/vortex-array/src/arrays/chunked/vtable/canonical.rs @@ -52,7 +52,10 @@ pub(super) fn _canonicalize( )?), _ => { let mut builder = builder_with_capacity(array.dtype(), array.len()); - array.append_to_builder(builder.as_mut(), ctx)?; + array + .clone() + .into_array() + .append_to_builder(builder.as_mut(), ctx)?; builder.finish_into_canonical() } }) diff --git a/vortex-array/src/arrays/chunked/vtable/mod.rs b/vortex-array/src/arrays/chunked/vtable/mod.rs index f5f8ff81eb3..6722c628d24 100644 --- a/vortex-array/src/arrays/chunked/vtable/mod.rs +++ b/vortex-array/src/arrays/chunked/vtable/mod.rs @@ -20,8 +20,8 @@ use crate::ExecutionResult; use crate::IntoArray; use crate::Precision; use crate::ToCanonical; -use crate::arrays::ChunkedArray; -use crate::arrays::PrimitiveArray; +use crate::arrays::ChunkedData; +use crate::arrays::PrimitiveData; use crate::arrays::chunked::compute::kernel::PARENT_KERNELS; use crate::arrays::chunked::compute::rules::PARENT_RULES; use crate::arrays::chunked::vtable::canonical::_canonicalize; @@ -33,7 +33,7 @@ use crate::dtype::PType; use crate::hash::ArrayEq; use crate::hash::ArrayHash; use crate::serde::ArrayChildren; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::validity::Validity; use crate::vtable; use crate::vtable::Array; @@ -42,7 +42,7 @@ use crate::vtable::VTable; mod canonical; mod operations; mod validity; -vtable!(Chunked); +vtable!(Chunked, Chunked, ChunkedData); #[derive(Clone, Debug)] pub struct Chunked; @@ -52,12 +52,12 @@ impl Chunked { } impl VTable for Chunked { - type Array = ChunkedArray; + type ArrayData = ChunkedData; type Metadata = EmptyMetadata; type OperationsVTable = Self; type ValidityVTable = Self; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Chunked } @@ -65,34 +65,39 @@ impl VTable for Chunked { Self::ID } - fn len(array: &ChunkedArray) -> usize { + fn len(array: &ChunkedData) -> usize { array.len } - fn dtype(array: &ChunkedArray) -> &DType { + fn dtype(array: &ChunkedData) -> &DType { &array.dtype } - fn stats(array: &ChunkedArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &ChunkedData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &ChunkedArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.len.hash(state); - array.chunk_offsets.as_ref().array_hash(state, precision); + array + .chunk_offsets + .clone() + .into_array() + .array_hash(state, precision); for chunk in &array.chunks { chunk.array_hash(state, precision); } } - fn array_eq(array: &ChunkedArray, other: &ChunkedArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.len == other.len && array .chunk_offsets - .as_ref() - .array_eq(other.chunk_offsets.as_ref(), precision) + .clone() + .into_array() + .array_eq(&other.chunk_offsets.clone().into_array(), precision) && array.chunks.len() == other.chunks.len() && array .chunks @@ -101,37 +106,37 @@ impl VTable for Chunked { .all(|(a, b)| a.array_eq(b, precision)) } - fn nbuffers(_array: &ChunkedArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &ChunkedArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("ChunkedArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &ChunkedArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { vortex_panic!("ChunkedArray buffer_name index {idx} out of bounds") } - fn nchildren(array: &ChunkedArray) -> usize { + fn nchildren(array: &Array) -> usize { 1 + array.chunks().len() } - fn child(array: &ChunkedArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.chunk_offsets.clone().into_array(), n => array.chunks()[n - 1].clone(), } } - fn child_name(_array: &ChunkedArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "chunk_offsets".to_string(), n => format!("chunks[{}]", n - 1), } } - fn metadata(_array: &ChunkedArray) -> VortexResult { + fn metadata(_array: &Array) -> VortexResult { Ok(EmptyMetadata) } @@ -155,7 +160,7 @@ impl VTable for Chunked { _metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { if children.is_empty() { vortex_bail!("Chunked array needs at least one child"); } @@ -186,7 +191,7 @@ impl VTable for Chunked { }) .try_collect()?; - let chunk_offsets = PrimitiveArray::new(chunk_offsets_buf.clone(), Validity::NonNullable); + let chunk_offsets = PrimitiveData::new(chunk_offsets_buf.clone(), Validity::NonNullable); let total_len = chunk_offsets_buf .last() @@ -195,7 +200,7 @@ impl VTable for Chunked { .map_err(|_| vortex_err!("total length {} exceeds usize range", total_len))?; // Construct directly using the struct fields to avoid recomputing chunk_offsets - Ok(ChunkedArray { + Ok(ChunkedData { dtype: dtype.clone(), len, chunk_offsets, @@ -204,7 +209,7 @@ impl VTable for Chunked { }) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { // Children: chunk_offsets, then chunks... vortex_ensure!( !children.is_empty(), @@ -223,7 +228,7 @@ impl VTable for Chunked { ); let chunks = children.into_iter().skip(1).collect(); - array.chunk_offsets = PrimitiveArray::new(chunk_offsets_buf.clone(), Validity::NonNullable); + array.chunk_offsets = PrimitiveData::new(chunk_offsets_buf.clone(), Validity::NonNullable); array.chunks = chunks; let total_len = chunk_offsets_buf @@ -236,7 +241,7 @@ impl VTable for Chunked { } fn append_to_builder( - array: &ChunkedArray, + array: &Array, builder: &mut dyn ArrayBuilder, ctx: &mut ExecutionCtx, ) -> VortexResult<()> { diff --git a/vortex-array/src/arrays/chunked/vtable/operations.rs b/vortex-array/src/arrays/chunked/vtable/operations.rs index d5362013790..7e43bfdde78 100644 --- a/vortex-array/src/arrays/chunked/vtable/operations.rs +++ b/vortex-array/src/arrays/chunked/vtable/operations.rs @@ -6,13 +6,13 @@ use vortex_error::VortexResult; use crate::DynArray; use crate::ExecutionCtx; use crate::arrays::Chunked; -use crate::arrays::chunked::vtable::ChunkedArray; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for Chunked { fn scalar_at( - array: &ChunkedArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { diff --git a/vortex-array/src/arrays/chunked/vtable/validity.rs b/vortex-array/src/arrays/chunked/vtable/validity.rs index 04a9cf73956..9a61d5e51ae 100644 --- a/vortex-array/src/arrays/chunked/vtable/validity.rs +++ b/vortex-array/src/arrays/chunked/vtable/validity.rs @@ -7,14 +7,15 @@ use vortex_error::VortexResult; use crate::DynArray; use crate::IntoArray; use crate::arrays::Chunked; -use crate::arrays::chunked::vtable::ChunkedArray; +use crate::arrays::ChunkedData; use crate::dtype::DType; use crate::dtype::Nullability; use crate::validity::Validity; +use crate::vtable::Array; use crate::vtable::ValidityVTable; impl ValidityVTable for Chunked { - fn validity(array: &ChunkedArray) -> VortexResult { + fn validity(array: &Array) -> VortexResult { let validities: Vec = array.chunks().iter().map(|c| c.validity()).try_collect()?; @@ -39,7 +40,7 @@ impl ValidityVTable for Chunked { Ok(Validity::Array( unsafe { - ChunkedArray::new_unchecked( + ChunkedData::new_unchecked( validities .into_iter() .zip(array.chunks()) diff --git a/vortex-array/src/arrays/constant/array.rs b/vortex-array/src/arrays/constant/array.rs index e8bcb7d88c6..189d9046985 100644 --- a/vortex-array/src/arrays/constant/array.rs +++ b/vortex-array/src/arrays/constant/array.rs @@ -1,17 +1,22 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use vortex_error::VortexExpect; + +use crate::arrays::Constant; +use crate::dtype::DType; use crate::scalar::Scalar; use crate::stats::ArrayStats; +use crate::vtable::Array; #[derive(Clone, Debug)] -pub struct ConstantArray { +pub struct ConstantData { pub(super) scalar: Scalar, pub(super) len: usize, pub(super) stats_set: ArrayStats, } -impl ConstantArray { +impl ConstantData { pub fn new(scalar: S, len: usize) -> Self where S: Into, @@ -24,6 +29,21 @@ impl ConstantArray { } } + /// Returns the length of this array. + pub fn len(&self) -> usize { + self.len + } + + /// Returns the [`DType`] of this array. + pub fn dtype(&self) -> &DType { + self.scalar.dtype() + } + + /// Returns `true` if this array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + /// Returns the [`Scalar`] value of this constant array. pub fn scalar(&self) -> &Scalar { &self.scalar @@ -33,3 +53,13 @@ impl ConstantArray { self.scalar } } + +impl Array { + pub fn new(scalar: S, len: usize) -> Self + where + S: Into, + { + Array::try_from_data(ConstantData::new(scalar, len)) + .vortex_expect("ConstantData is always valid") + } +} diff --git a/vortex-array/src/arrays/constant/compute/between.rs b/vortex-array/src/arrays/constant/compute/between.rs index a90254dab10..54571a1b177 100644 --- a/vortex-array/src/arrays/constant/compute/between.rs +++ b/vortex-array/src/arrays/constant/compute/between.rs @@ -10,17 +10,17 @@ use crate::arrays::ConstantArray; use crate::scalar::Scalar; use crate::scalar_fn::fns::between::BetweenOptions; use crate::scalar_fn::fns::between::BetweenReduce; +use crate::vtable::Array; impl BetweenReduce for Constant { fn between( - array: &ConstantArray, + array: &Array, lower: &ArrayRef, upper: &ArrayRef, options: &BetweenOptions, ) -> VortexResult> { // Can reduce if everything is constant - if let Some(((constant, lower), upper)) = array - .as_constant() + if let Some(((constant, lower), upper)) = Some(array.scalar().clone()) .zip(lower.as_constant()) .zip(upper.as_constant()) { diff --git a/vortex-array/src/arrays/constant/compute/cast.rs b/vortex-array/src/arrays/constant/compute/cast.rs index ad44492c618..6795b74a1c2 100644 --- a/vortex-array/src/arrays/constant/compute/cast.rs +++ b/vortex-array/src/arrays/constant/compute/cast.rs @@ -9,9 +9,10 @@ use crate::arrays::Constant; use crate::arrays::ConstantArray; use crate::dtype::DType; use crate::scalar_fn::fns::cast::CastReduce; +use crate::vtable::Array; impl CastReduce for Constant { - fn cast(array: &ConstantArray, dtype: &DType) -> VortexResult> { + fn cast(array: &Array, dtype: &DType) -> VortexResult> { match array.scalar().cast(dtype) { Ok(scalar) => Ok(Some(ConstantArray::new(scalar, array.len()).into_array())), Err(_e) => Ok(None), diff --git a/vortex-array/src/arrays/constant/compute/fill_null.rs b/vortex-array/src/arrays/constant/compute/fill_null.rs index 9854e184f0b..167f9047e7a 100644 --- a/vortex-array/src/arrays/constant/compute/fill_null.rs +++ b/vortex-array/src/arrays/constant/compute/fill_null.rs @@ -5,13 +5,13 @@ use vortex_error::VortexResult; use crate::ArrayRef; use crate::arrays::Constant; -use crate::arrays::ConstantArray; use crate::scalar::Scalar; use crate::scalar_fn::fns::fill_null::FillNullReduce; use crate::scalar_fn::fns::fill_null::fill_null_constant; +use crate::vtable::Array; impl FillNullReduce for Constant { - fn fill_null(array: &ConstantArray, fill_value: &Scalar) -> VortexResult> { + fn fill_null(array: &Array, fill_value: &Scalar) -> VortexResult> { fill_null_constant(array, fill_value).map(Some) } } diff --git a/vortex-array/src/arrays/constant/compute/filter.rs b/vortex-array/src/arrays/constant/compute/filter.rs index 40f181fb2a0..475813520f5 100644 --- a/vortex-array/src/arrays/constant/compute/filter.rs +++ b/vortex-array/src/arrays/constant/compute/filter.rs @@ -9,9 +9,10 @@ use crate::IntoArray; use crate::arrays::Constant; use crate::arrays::ConstantArray; use crate::arrays::filter::FilterReduce; +use crate::vtable::Array; impl FilterReduce for Constant { - fn filter(array: &ConstantArray, mask: &Mask) -> VortexResult> { + fn filter(array: &Array, mask: &Mask) -> VortexResult> { Ok(Some( ConstantArray::new(array.scalar().clone(), mask.true_count()).into_array(), )) diff --git a/vortex-array/src/arrays/constant/compute/not.rs b/vortex-array/src/arrays/constant/compute/not.rs index 4f3e9cc0355..ad4398415bf 100644 --- a/vortex-array/src/arrays/constant/compute/not.rs +++ b/vortex-array/src/arrays/constant/compute/not.rs @@ -9,9 +9,10 @@ use crate::arrays::Constant; use crate::arrays::ConstantArray; use crate::scalar::Scalar; use crate::scalar_fn::fns::not::NotReduce; +use crate::vtable::Array; impl NotReduce for Constant { - fn invert(array: &ConstantArray) -> VortexResult> { + fn invert(array: &Array) -> VortexResult> { let value = match array.scalar().as_bool().value() { Some(b) => Scalar::bool(!b, array.dtype().nullability()), None => Scalar::null(array.dtype().clone()), diff --git a/vortex-array/src/arrays/constant/compute/rules.rs b/vortex-array/src/arrays/constant/compute/rules.rs index 9e4bfb59fa2..b695b424171 100644 --- a/vortex-array/src/arrays/constant/compute/rules.rs +++ b/vortex-array/src/arrays/constant/compute/rules.rs @@ -18,6 +18,7 @@ use crate::scalar_fn::fns::between::BetweenReduceAdaptor; use crate::scalar_fn::fns::cast::CastReduceAdaptor; use crate::scalar_fn::fns::fill_null::FillNullReduceAdaptor; use crate::scalar_fn::fns::not::NotReduceAdaptor; +use crate::vtable::Array; pub(crate) const PARENT_RULES: ParentRuleSet = ParentRuleSet::new(&[ ParentRuleSet::lift(&BetweenReduceAdaptor(Constant)), @@ -38,7 +39,7 @@ impl ArrayParentReduceRule for ConstantFilterRule { fn reduce_parent( &self, - child: &ConstantArray, + child: &Array, parent: &FilterArray, _child_idx: usize, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/constant/compute/slice.rs b/vortex-array/src/arrays/constant/compute/slice.rs index 9c5ddac1784..3a65533e7e4 100644 --- a/vortex-array/src/arrays/constant/compute/slice.rs +++ b/vortex-array/src/arrays/constant/compute/slice.rs @@ -10,9 +10,10 @@ use crate::IntoArray; use crate::arrays::Constant; use crate::arrays::ConstantArray; use crate::arrays::slice::SliceReduce; +use crate::vtable::Array; impl SliceReduce for Constant { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { Ok(Some( ConstantArray::new(array.scalar.clone(), range.len()).into_array(), )) diff --git a/vortex-array/src/arrays/constant/compute/take.rs b/vortex-array/src/arrays/constant/compute/take.rs index 535e7bcbc10..8fc5efce398 100644 --- a/vortex-array/src/arrays/constant/compute/take.rs +++ b/vortex-array/src/arrays/constant/compute/take.rs @@ -15,9 +15,10 @@ use crate::arrays::dict::TakeReduceAdaptor; use crate::optimizer::rules::ParentRuleSet; use crate::scalar::Scalar; use crate::validity::Validity; +use crate::vtable::Array; impl TakeReduce for Constant { - fn take(array: &ConstantArray, indices: &ArrayRef) -> VortexResult> { + fn take(array: &Array, indices: &ArrayRef) -> VortexResult> { let result = match indices.validity_mask()?.bit_buffer() { AllOr::All => { let scalar = Scalar::try_new( diff --git a/vortex-array/src/arrays/constant/mod.rs b/vortex-array/src/arrays/constant/mod.rs index f8361bae704..36df554d4c3 100644 --- a/vortex-array/src/arrays/constant/mod.rs +++ b/vortex-array/src/arrays/constant/mod.rs @@ -7,7 +7,8 @@ mod arbitrary; pub use arbitrary::ArbitraryConstantArray; mod array; -pub use array::ConstantArray; +pub use array::ConstantData; +pub use vtable::ConstantArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/constant/vtable/canonical.rs b/vortex-array/src/arrays/constant/vtable/canonical.rs index 1b17c76054b..20268519d0c 100644 --- a/vortex-array/src/arrays/constant/vtable/canonical.rs +++ b/vortex-array/src/arrays/constant/vtable/canonical.rs @@ -335,7 +335,6 @@ mod tests { use crate::expr::stats::StatsProvider; use crate::scalar::Scalar; use crate::validity::Validity; - use crate::vtable::ValidityHelper; #[test] fn test_canonicalize_null() { @@ -362,12 +361,13 @@ mod tests { .compute_all(&all::().collect_vec()) .unwrap(); let canonical = const_array.to_canonical()?; - let canonical_stats = canonical.as_ref().statistics(); + let canonical_arr = canonical.to_array_ref(); + let canonical_stats = canonical_arr.statistics(); - let stats_ref = stats.as_typed_ref(canonical.as_ref().dtype()); + let stats_ref = stats.as_typed_ref(canonical.dtype()); for stat in all::() { - if stat.dtype(canonical.as_ref().dtype()).is_none() { + if stat.dtype(canonical.dtype()).is_none() { continue; } assert_eq!( diff --git a/vortex-array/src/arrays/constant/vtable/mod.rs b/vortex-array/src/arrays/constant/vtable/mod.rs index 674d97a346d..201424b780c 100644 --- a/vortex-array/src/arrays/constant/vtable/mod.rs +++ b/vortex-array/src/arrays/constant/vtable/mod.rs @@ -17,7 +17,7 @@ use crate::ExecutionCtx; use crate::ExecutionResult; use crate::IntoArray; use crate::Precision; -use crate::arrays::ConstantArray; +use crate::arrays::ConstantData; use crate::arrays::constant::compute::rules::PARENT_RULES; use crate::arrays::constant::vtable::canonical::constant_canonicalize; use crate::buffer::BufferHandle; @@ -35,7 +35,7 @@ use crate::scalar::DecimalValue; use crate::scalar::Scalar; use crate::scalar::ScalarValue; use crate::serde::ArrayChildren; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::vtable; use crate::vtable::Array; use crate::vtable::ArrayId; @@ -44,7 +44,7 @@ pub(crate) mod canonical; mod operations; mod validity; -vtable!(Constant); +vtable!(Constant, Constant, ConstantData); #[derive(Clone, Debug)] pub struct Constant; @@ -54,13 +54,13 @@ impl Constant { } impl VTable for Constant { - type Array = ConstantArray; + type ArrayData = ConstantData; type Metadata = Scalar; type OperationsVTable = Self; type ValidityVTable = Self; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Constant } @@ -68,36 +68,32 @@ impl VTable for Constant { Self::ID } - fn len(array: &ConstantArray) -> usize { + fn len(array: &ConstantData) -> usize { array.len } - fn dtype(array: &ConstantArray) -> &DType { + fn dtype(array: &ConstantData) -> &DType { array.scalar.dtype() } - fn stats(array: &ConstantArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &ConstantData) -> &ArrayStats { + &array.stats_set } - fn array_hash( - array: &ConstantArray, - state: &mut H, - _precision: Precision, - ) { + fn array_hash(array: &Array, state: &mut H, _precision: Precision) { array.scalar.hash(state); array.len.hash(state); } - fn array_eq(array: &ConstantArray, other: &ConstantArray, _precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, _precision: Precision) -> bool { array.scalar == other.scalar && array.len == other.len } - fn nbuffers(_array: &ConstantArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 1 } - fn buffer(array: &ConstantArray, idx: usize) -> BufferHandle { + fn buffer(array: &Array, idx: usize) -> BufferHandle { match idx { 0 => BufferHandle::new_host( ScalarValue::to_proto_bytes::(array.scalar.value()).freeze(), @@ -106,26 +102,26 @@ impl VTable for Constant { } } - fn buffer_name(_array: &ConstantArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { match idx { 0 => Some("scalar".to_string()), _ => None, } } - fn nchildren(_array: &ConstantArray) -> usize { + fn nchildren(_array: &Array) -> usize { 0 } - fn child(_array: &ConstantArray, idx: usize) -> ArrayRef { + fn child(_array: &Array, idx: usize) -> ArrayRef { vortex_panic!("ConstantArray child index {idx} out of bounds") } - fn child_name(_array: &ConstantArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { vortex_panic!("ConstantArray child_name index {idx} out of bounds") } - fn metadata(array: &ConstantArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(array.scalar().clone()) } @@ -163,11 +159,11 @@ impl VTable for Constant { metadata: &Self::Metadata, _buffers: &[BufferHandle], _children: &dyn ArrayChildren, - ) -> VortexResult { - Ok(ConstantArray::new(metadata.clone(), len)) + ) -> VortexResult { + Ok(ConstantData::new(metadata.clone(), len)) } - fn with_children(_array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(_array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.is_empty(), "ConstantArray has no children, got {}", @@ -191,7 +187,7 @@ impl VTable for Constant { } fn append_to_builder( - array: &ConstantArray, + array: &Array, builder: &mut dyn ArrayBuilder, ctx: &mut ExecutionCtx, ) -> VortexResult<()> { diff --git a/vortex-array/src/arrays/constant/vtable/operations.rs b/vortex-array/src/arrays/constant/vtable/operations.rs index 7e0c1c939a4..0b6c76eabdb 100644 --- a/vortex-array/src/arrays/constant/vtable/operations.rs +++ b/vortex-array/src/arrays/constant/vtable/operations.rs @@ -5,13 +5,13 @@ use vortex_error::VortexResult; use crate::ExecutionCtx; use crate::arrays::Constant; -use crate::arrays::constant::vtable::ConstantArray; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for Constant { fn scalar_at( - array: &ConstantArray, + array: &Array, _index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { diff --git a/vortex-array/src/arrays/constant/vtable/validity.rs b/vortex-array/src/arrays/constant/vtable/validity.rs index 709be371625..8c223d05af3 100644 --- a/vortex-array/src/arrays/constant/vtable/validity.rs +++ b/vortex-array/src/arrays/constant/vtable/validity.rs @@ -4,12 +4,12 @@ use vortex_error::VortexResult; use crate::arrays::Constant; -use crate::arrays::constant::vtable::ConstantArray; use crate::validity::Validity; +use crate::vtable::Array; use crate::vtable::ValidityVTable; impl ValidityVTable for Constant { - fn validity(array: &ConstantArray) -> VortexResult { + fn validity(array: &Array) -> VortexResult { debug_assert!(array.dtype().is_nullable()); Ok(if array.scalar().is_null() { Validity::AllInvalid diff --git a/vortex-array/src/arrays/datetime/mod.rs b/vortex-array/src/arrays/datetime/mod.rs index eb0524c4ce4..de4857a97a8 100644 --- a/vortex-array/src/arrays/datetime/mod.rs +++ b/vortex-array/src/arrays/datetime/mod.rs @@ -31,23 +31,26 @@ use crate::extension::datetime::Timestamp; /// /// ## Arrow compatibility /// -/// TemporalArray can be created from Arrow arrays containing the following datatypes: +/// TemporalData can be created from Arrow arrays containing the following datatypes: /// * `Time32` /// * `Time64` /// * `Timestamp` /// * `Date32` /// * `Date64` /// -/// Anything that can be constructed and held in a `TemporalArray` can also be zero-copy converted +/// Anything that can be constructed and held in a `TemporalData` can also be zero-copy converted /// back to the relevant Arrow datatype. #[derive(Clone, Debug)] -pub struct TemporalArray { +pub struct TemporalData { /// The underlying Vortex extension array holding all the numeric values. ext: ExtensionArray, } -impl TemporalArray { - /// Create a new `TemporalArray` holding either i32 day offsets, or i64 millisecond offsets +/// Type alias for backward compatibility. +pub type TemporalArray = TemporalData; + +impl TemporalData { + /// Create a new `TemporalData` holding either i32 day offsets, or i64 millisecond offsets /// that are evenly divisible by the number of 86,400,000. /// /// This is equivalent to the data described by either of the `Date32` or `Date64` data types @@ -69,7 +72,7 @@ impl TemporalArray { } } - /// Create a new `TemporalArray` holding one of the following values: + /// Create a new `TemporalData` holding one of the following values: /// /// * `i32` values representing seconds since midnight /// * `i32` values representing milliseconds since midnight @@ -97,7 +100,7 @@ impl TemporalArray { } } - /// Create a new `TemporalArray` holding Arrow spec compliant Timestamp data, with an + /// Create a new `TemporalData` holding Arrow spec compliant Timestamp data, with an /// optional timezone. /// /// # Panics @@ -119,7 +122,7 @@ impl TemporalArray { } } -impl TemporalArray { +impl TemporalData { /// Access the underlying temporal values in the underlying ExtensionArray storage. /// /// These values are to be interpreted based on the time unit and optional time-zone stored @@ -145,30 +148,29 @@ impl TemporalArray { pub fn dtype(&self) -> &DType { self.ext.dtype() } -} -impl AsRef for TemporalArray { - fn as_ref(&self) -> &dyn DynArray { - self.ext.as_ref() + /// Convert to an [`ArrayRef`]. + pub fn to_array_ref(&self) -> ArrayRef { + self.ext.clone().into_array() } } -impl From for ArrayRef { - fn from(value: TemporalArray) -> Self { +impl From for ArrayRef { + fn from(value: TemporalData) -> Self { value.ext.into_array() } } -impl IntoArray for TemporalArray { +impl IntoArray for TemporalData { fn into_array(self) -> ArrayRef { self.into() } } -impl TryFrom for TemporalArray { +impl TryFrom for TemporalData { type Error = VortexError; - /// Try to specialize a generic Vortex array as a TemporalArray. + /// Try to specialize a generic Vortex array as a TemporalData. /// /// # Errors /// @@ -191,19 +193,19 @@ impl TryFrom for TemporalArray { } // Conversions to/from ExtensionArray -impl From<&TemporalArray> for ExtensionArray { - fn from(value: &TemporalArray) -> Self { +impl From<&TemporalData> for ExtensionArray { + fn from(value: &TemporalData) -> Self { value.ext.clone() } } -impl From for ExtensionArray { - fn from(value: TemporalArray) -> Self { +impl From for ExtensionArray { + fn from(value: TemporalData) -> Self { value.ext } } -impl TryFrom for TemporalArray { +impl TryFrom for TemporalData { type Error = VortexError; fn try_from(ext: ExtensionArray) -> Result { diff --git a/vortex-array/src/arrays/datetime/test.rs b/vortex-array/src/arrays/datetime/test.rs index b77da6b622a..ea0609ffe09 100644 --- a/vortex-array/src/arrays/datetime/test.rs +++ b/vortex-array/src/arrays/datetime/test.rs @@ -10,7 +10,7 @@ use crate::Precision; use crate::ToCanonical; use crate::array::DynArray; use crate::arrays::PrimitiveArray; -use crate::arrays::TemporalArray; +use crate::arrays::TemporalData; use crate::assert_arrays_eq; use crate::expr::gt; use crate::expr::lit; @@ -22,12 +22,10 @@ use crate::extension::datetime::TimestampOptions; use crate::hash::ArrayEq; use crate::scalar::Scalar; use crate::validity::Validity; -use crate::vtable::ValidityHelper; - macro_rules! test_temporal_roundtrip { ($prim:ty, $constructor:expr, $unit:expr) => {{ let array = buffer![100 as $prim].into_array(); - let temporal: TemporalArray = $constructor(array, $unit); + let temporal: TemporalData = $constructor(array, $unit); assert_arrays_eq!( temporal.temporal_values(), @@ -60,25 +58,25 @@ macro_rules! test_fail_case { test_success_case!( test_roundtrip_time32_second, i32, - TemporalArray::new_time, + TemporalData::new_time, TimeUnit::Seconds ); test_success_case!( test_roundtrip_time32_millisecond, i32, - TemporalArray::new_time, + TemporalData::new_time, TimeUnit::Milliseconds ); test_fail_case!( test_fail_time32_micro, i32, - TemporalArray::new_time, + TemporalData::new_time, TimeUnit::Microseconds ); test_fail_case!( test_fail_time32_nano, i32, - TemporalArray::new_time, + TemporalData::new_time, TimeUnit::Nanoseconds ); @@ -86,31 +84,31 @@ test_fail_case!( test_success_case!( test_roundtrip_time64_us, i64, - TemporalArray::new_time, + TemporalData::new_time, TimeUnit::Microseconds ); test_success_case!( test_roundtrip_time64_ns, i64, - TemporalArray::new_time, + TemporalData::new_time, TimeUnit::Nanoseconds ); test_fail_case!( test_fail_time64_ms, i64, - TemporalArray::new_time, + TemporalData::new_time, TimeUnit::Milliseconds ); test_fail_case!( test_fail_time64_s, i64, - TemporalArray::new_time, + TemporalData::new_time, TimeUnit::Seconds ); test_fail_case!( test_fail_time64_i32, i32, - TemporalArray::new_time, + TemporalData::new_time, TimeUnit::Nanoseconds ); @@ -118,13 +116,13 @@ test_fail_case!( test_success_case!( test_roundtrip_date32, i32, - TemporalArray::new_date, + TemporalData::new_date, TimeUnit::Days ); test_fail_case!( test_fail_date32, i64, - TemporalArray::new_date, + TemporalData::new_date, TimeUnit::Days ); @@ -132,13 +130,13 @@ test_fail_case!( test_success_case!( test_roundtrip_date64, i64, - TemporalArray::new_date, + TemporalData::new_date, TimeUnit::Milliseconds ); test_fail_case!( test_fail_date64, i32, - TemporalArray::new_date, + TemporalData::new_date, TimeUnit::Milliseconds ); @@ -155,8 +153,7 @@ fn test_timestamp() { TimeUnit::Nanoseconds, ] { for tz in [Some("UTC".into()), None] { - let temporal_array = - TemporalArray::new_timestamp(ts_array.to_array(), unit, tz.clone()); + let temporal_array = TemporalData::new_timestamp(ts_array.to_array(), unit, tz.clone()); assert_arrays_eq!( temporal_array.temporal_values(), @@ -176,7 +173,7 @@ fn test_timestamp_fails_i32() { let ts = buffer![100i32].into_array(); let ts_array = ts.into_array(); - TemporalArray::new_timestamp(ts_array, TimeUnit::Seconds, None); + TemporalData::new_timestamp(ts_array, TimeUnit::Seconds, None); } #[rstest] @@ -195,7 +192,7 @@ fn test_validity_preservation(#[case] validity: Validity) { ) .into_array(); let temporal_array = - TemporalArray::new_timestamp(milliseconds, TimeUnit::Milliseconds, Some("UTC".into())); + TemporalData::new_timestamp(milliseconds, TimeUnit::Milliseconds, Some("UTC".into())); assert!( temporal_array @@ -211,7 +208,7 @@ fn test222() -> VortexResult<()> { // Write file with MILLISECONDS timestamps let ts_array = PrimitiveArray::from_iter(vec![1704067200000i64, 1704153600000, 1704240000000]) .into_array(); - let temporal = TemporalArray::new_timestamp(ts_array, TimeUnit::Milliseconds, None); + let temporal = TemporalData::new_timestamp(ts_array, TimeUnit::Milliseconds, None); // Read with SECONDS filter scalar let filter_expr = gt( @@ -225,7 +222,7 @@ fn test222() -> VortexResult<()> { )), ); - let _result = temporal.as_ref().apply(&filter_expr); + let _result = temporal.to_array_ref().apply(&filter_expr); // let err = result.is_err().unwrap(); // println!("Expected error: {}", err); diff --git a/vortex-array/src/arrays/decimal/array.rs b/vortex-array/src/arrays/decimal/array.rs index 9f1be7e487a..3d13ea11a5e 100644 --- a/vortex-array/src/arrays/decimal/array.rs +++ b/vortex-array/src/arrays/decimal/array.rs @@ -10,9 +10,12 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_panic; +use vortex_mask::Mask; use crate::ExecutionCtx; use crate::IntoArray; +use crate::arrays::Decimal; +use crate::arrays::DecimalArray; use crate::arrays::PrimitiveArray; use crate::buffer::BufferHandle; use crate::dtype::BigCast; @@ -26,7 +29,7 @@ use crate::match_each_integer_ptype; use crate::patches::Patches; use crate::stats::ArrayStats; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; /// A decimal array that stores fixed-precision decimal numbers with configurable scale. /// @@ -86,7 +89,7 @@ use crate::vtable::ValidityHelper; /// assert_eq!(array.len(), 3); /// ``` #[derive(Clone, Debug)] -pub struct DecimalArray { +pub struct DecimalData { pub(super) dtype: DType, pub(super) values: BufferHandle, pub(super) values_type: DecimalType, @@ -101,7 +104,7 @@ pub struct DecimalArrayParts { pub validity: Validity, } -impl DecimalArray { +impl DecimalData { /// Creates a new [`DecimalArray`] using a host-native buffer. /// /// # Panics @@ -278,6 +281,32 @@ impl DecimalArray { } } + /// Returns the length of this array. + pub fn len(&self) -> usize { + self.values.len() / self.values_type.byte_width() + } + + /// Returns the [`DType`] of this array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns `true` if this array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Returns the [`Validity`] of this array. + #[allow(clippy::same_name_method)] + pub fn validity(&self) -> &Validity { + &self.validity + } + + /// Returns the validity as a [`Mask`]. + pub fn validity_mask(&self) -> Mask { + self.validity.to_mask(self.len()) + } + pub fn into_parts(self) -> DecimalArrayParts { let decimal_dtype = self.dtype.into_decimal_opt().vortex_expect("cannot fail"); @@ -405,6 +434,96 @@ impl DecimalArray { } } +impl Array { + /// Creates a new [`DecimalArray`] using a host-native buffer. + pub fn new( + buffer: Buffer, + decimal_dtype: DecimalDType, + validity: Validity, + ) -> Self { + Array::try_from_data(DecimalData::new(buffer, decimal_dtype, validity)) + .vortex_expect("DecimalData is always valid") + } + + /// Creates a new [`DecimalArray`] without validation. + /// + /// # Safety + /// + /// See [`DecimalData::new_unchecked`]. + pub unsafe fn new_unchecked( + buffer: Buffer, + decimal_dtype: DecimalDType, + validity: Validity, + ) -> Self { + Array::try_from_data(unsafe { DecimalData::new_unchecked(buffer, decimal_dtype, validity) }) + .vortex_expect("DecimalData is always valid") + } + + /// Creates a new [`DecimalArray`] from a host-native buffer with validation. + pub fn try_new( + buffer: Buffer, + decimal_dtype: DecimalDType, + validity: Validity, + ) -> VortexResult { + Array::try_from_data(DecimalData::try_new(buffer, decimal_dtype, validity)?) + } + + /// Creates a new [`DecimalArray`] from an iterator of values. + #[expect( + clippy::same_name_method, + reason = "intentionally named from_iter like Iterator::from_iter" + )] + pub fn from_iter>( + iter: I, + decimal_dtype: DecimalDType, + ) -> Self { + Array::try_from_data(DecimalData::from_iter(iter, decimal_dtype)) + .vortex_expect("DecimalData is always valid") + } + + /// Creates a new [`DecimalArray`] from an iterator of optional values. + pub fn from_option_iter>>( + iter: I, + decimal_dtype: DecimalDType, + ) -> Self { + Array::try_from_data(DecimalData::from_option_iter(iter, decimal_dtype)) + .vortex_expect("DecimalData is always valid") + } + + /// Creates a new [`DecimalArray`] from a [`BufferHandle`]. + pub fn new_handle( + values: BufferHandle, + values_type: DecimalType, + decimal_dtype: DecimalDType, + validity: Validity, + ) -> Self { + Array::try_from_data(DecimalData::new_handle( + values, + values_type, + decimal_dtype, + validity, + )) + .vortex_expect("DecimalData is always valid") + } + + /// Creates a new [`DecimalArray`] without validation from a [`BufferHandle`]. + /// + /// # Safety + /// + /// See [`DecimalData::new_unchecked_handle`]. + pub unsafe fn new_unchecked_handle( + values: BufferHandle, + values_type: DecimalType, + decimal_dtype: DecimalDType, + validity: Validity, + ) -> Self { + Array::try_from_data(unsafe { + DecimalData::new_unchecked_handle(values, values_type, decimal_dtype, validity) + }) + .vortex_expect("DecimalData is always valid") + } +} + fn patch_typed( mut buffer: BufferMut, decimal_dtype: DecimalDType, @@ -412,7 +531,7 @@ fn patch_typed( patch_indices_offset: usize, patch_values: Buffer, patched_validity: Validity, -) -> DecimalArray +) -> DecimalData where I: IntegerPType, PatchDVT: NativeDecimalType, @@ -432,5 +551,5 @@ where ); } - DecimalArray::new(buffer.freeze(), decimal_dtype, patched_validity) + DecimalData::new(buffer.freeze(), decimal_dtype, patched_validity) } diff --git a/vortex-array/src/arrays/decimal/compute/between.rs b/vortex-array/src/arrays/decimal/compute/between.rs index d504cbb8822..3571716e78b 100644 --- a/vortex-array/src/arrays/decimal/compute/between.rs +++ b/vortex-array/src/arrays/decimal/compute/between.rs @@ -10,7 +10,6 @@ use crate::ExecutionCtx; use crate::IntoArray; use crate::arrays::BoolArray; use crate::arrays::Decimal; -use crate::arrays::DecimalArray; use crate::dtype::NativeDecimalType; use crate::dtype::Nullability; use crate::match_each_decimal_value_type; @@ -18,11 +17,11 @@ use crate::scalar::Scalar; use crate::scalar_fn::fns::between::BetweenKernel; use crate::scalar_fn::fns::between::BetweenOptions; use crate::scalar_fn::fns::between::StrictComparison; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl BetweenKernel for Decimal { fn between( - arr: &DecimalArray, + arr: &Array, lower: &ArrayRef, upper: &ArrayRef, options: &BetweenOptions, @@ -46,7 +45,7 @@ impl BetweenKernel for Decimal { } fn between_unpack( - arr: &DecimalArray, + arr: &Array, lower: Scalar, upper: Scalar, nullability: Nullability, @@ -94,7 +93,7 @@ fn between_unpack( } fn between_impl( - arr: &DecimalArray, + arr: &Array, lower: T, upper: T, nullability: Nullability, diff --git a/vortex-array/src/arrays/decimal/compute/cast.rs b/vortex-array/src/arrays/decimal/compute/cast.rs index cea97ac91ae..5b36a872ac2 100644 --- a/vortex-array/src/arrays/decimal/compute/cast.rs +++ b/vortex-array/src/arrays/decimal/compute/cast.rs @@ -17,11 +17,11 @@ use crate::dtype::DecimalType; use crate::dtype::NativeDecimalType; use crate::match_each_decimal_value_type; use crate::scalar_fn::fns::cast::CastKernel; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl CastKernel for Decimal { fn cast( - array: &DecimalArray, + array: &Array, dtype: &DType, _ctx: &mut ExecutionCtx, ) -> VortexResult> { @@ -100,7 +100,7 @@ impl CastKernel for Decimal { /// Returns an error if `to_values_type` is narrower than the array's current values type. /// Only upcasting (widening) is supported. pub fn upcast_decimal_values( - array: &DecimalArray, + array: &Array, to_values_type: DecimalType, ) -> VortexResult { let from_values_type = array.values_type(); @@ -156,7 +156,6 @@ mod tests { use crate::dtype::DecimalType; use crate::dtype::Nullability; use crate::validity::Validity; - use crate::vtable::ValidityHelper; #[test] fn cast_decimal_to_nullable() { diff --git a/vortex-array/src/arrays/decimal/compute/fill_null.rs b/vortex-array/src/arrays/decimal/compute/fill_null.rs index 1ef920ac74f..743a16ef20d 100644 --- a/vortex-array/src/arrays/decimal/compute/fill_null.rs +++ b/vortex-array/src/arrays/decimal/compute/fill_null.rs @@ -21,11 +21,11 @@ use crate::scalar::DecimalValue; use crate::scalar::Scalar; use crate::scalar_fn::fns::fill_null::FillNullKernel; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl FillNullKernel for Decimal { fn fill_null( - array: &DecimalArray, + array: &Array, fill_value: &Scalar, ctx: &mut ExecutionCtx, ) -> VortexResult> { @@ -57,7 +57,7 @@ impl FillNullKernel for Decimal { } fn fill_invalid_positions( - array: &DecimalArray, + array: &Array, is_invalid: &BitBuffer, decimal_value: &DecimalValue, result_validity: Validity, @@ -75,7 +75,7 @@ fn fill_invalid_positions( } fn fill_buffer( - array: &DecimalArray, + array: &Array, is_invalid: &BitBuffer, fill_val: T, result_validity: Validity, diff --git a/vortex-array/src/arrays/decimal/compute/mask.rs b/vortex-array/src/arrays/decimal/compute/mask.rs index d6d2c65368e..c9b1ae36214 100644 --- a/vortex-array/src/arrays/decimal/compute/mask.rs +++ b/vortex-array/src/arrays/decimal/compute/mask.rs @@ -10,10 +10,10 @@ use crate::arrays::DecimalArray; use crate::match_each_decimal_value_type; use crate::scalar_fn::fns::mask::MaskReduce; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl MaskReduce for Decimal { - fn mask(array: &DecimalArray, mask: &ArrayRef) -> VortexResult> { + fn mask(array: &Array, mask: &ArrayRef) -> VortexResult> { Ok(Some(match_each_decimal_value_type!( array.values_type(), |D| { diff --git a/vortex-array/src/arrays/decimal/compute/rules.rs b/vortex-array/src/arrays/decimal/compute/rules.rs index a7d7dab51e0..60e88e3003f 100644 --- a/vortex-array/src/arrays/decimal/compute/rules.rs +++ b/vortex-array/src/arrays/decimal/compute/rules.rs @@ -17,7 +17,7 @@ use crate::match_each_decimal_value_type; use crate::optimizer::rules::ArrayParentReduceRule; use crate::optimizer::rules::ParentRuleSet; use crate::scalar_fn::fns::mask::MaskReduceAdaptor; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; pub(crate) static RULES: ParentRuleSet = ParentRuleSet::new(&[ ParentRuleSet::lift(&DecimalMaskedValidityRule), @@ -37,7 +37,7 @@ impl ArrayParentReduceRule for DecimalMaskedValidityRule { fn reduce_parent( &self, - array: &DecimalArray, + array: &Array, parent: &MaskedArray, _child_idx: usize, ) -> VortexResult> { @@ -61,7 +61,7 @@ impl ArrayParentReduceRule for DecimalMaskedValidityRule { } impl SliceReduce for Decimal { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { let result = match_each_decimal_value_type!(array.values_type(), |D| { let sliced = array.buffer::().slice(range.clone()); let validity = array.validity().clone().slice(range)?; diff --git a/vortex-array/src/arrays/decimal/compute/take.rs b/vortex-array/src/arrays/decimal/compute/take.rs index fb6b0470e00..0d57946604f 100644 --- a/vortex-array/src/arrays/decimal/compute/take.rs +++ b/vortex-array/src/arrays/decimal/compute/take.rs @@ -15,11 +15,11 @@ use crate::dtype::NativeDecimalType; use crate::executor::ExecutionCtx; use crate::match_each_decimal_value_type; use crate::match_each_integer_ptype; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl TakeExecute for Decimal { fn take( - array: &DecimalArray, + array: &Array, indices: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/decimal/mod.rs b/vortex-array/src/arrays/decimal/mod.rs index d58ce9f13ab..137331a492f 100644 --- a/vortex-array/src/arrays/decimal/mod.rs +++ b/vortex-array/src/arrays/decimal/mod.rs @@ -2,8 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::DecimalArray; pub use array::DecimalArrayParts; +pub use array::DecimalData; +pub use vtable::DecimalArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/decimal/utils.rs b/vortex-array/src/arrays/decimal/utils.rs index 40dd7d9cff6..8cb0f8dd22a 100644 --- a/vortex-array/src/arrays/decimal/utils.rs +++ b/vortex-array/src/arrays/decimal/utils.rs @@ -8,7 +8,6 @@ use vortex_error::VortexExpect; use crate::arrays::DecimalArray; use crate::dtype::DecimalType; use crate::dtype::i256; -use crate::vtable::ValidityHelper; macro_rules! try_downcast { ($array:expr, from: $src:ty, to: $($dst:ty),*) => {{ diff --git a/vortex-array/src/arrays/decimal/vtable/mod.rs b/vortex-array/src/arrays/decimal/vtable/mod.rs index 8ccba2fd417..b9ac4cc22ab 100644 --- a/vortex-array/src/arrays/decimal/vtable/mod.rs +++ b/vortex-array/src/arrays/decimal/vtable/mod.rs @@ -18,7 +18,7 @@ use crate::ExecutionCtx; use crate::ExecutionResult; use crate::ProstMetadata; use crate::SerializeMetadata; -use crate::arrays::DecimalArray; +use crate::arrays::DecimalData; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::dtype::DecimalType; @@ -42,9 +42,9 @@ use crate::Precision; use crate::arrays::decimal::compute::rules::RULES; use crate::hash::ArrayEq; use crate::hash::ArrayHash; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::vtable::ArrayId; -vtable!(Decimal); +vtable!(Decimal, Decimal, DecimalData); // The type of the values can be determined by looking at the type info...right? #[derive(prost::Message)] @@ -54,13 +54,13 @@ pub struct DecimalMetadata { } impl VTable for Decimal { - type Array = DecimalArray; + type ArrayData = DecimalData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValidityHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Decimal } @@ -68,7 +68,7 @@ impl VTable for Decimal { Self::ID } - fn len(array: &DecimalArray) -> usize { + fn len(array: &DecimalData) -> usize { let divisor = match array.values_type { DecimalType::I8 => 1, DecimalType::I16 => 2, @@ -80,51 +80,51 @@ impl VTable for Decimal { array.values.len() / divisor } - fn dtype(array: &DecimalArray) -> &DType { + fn dtype(array: &DecimalData) -> &DType { &array.dtype } - fn stats(array: &DecimalArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &DecimalData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &DecimalArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.values.array_hash(state, precision); std::mem::discriminant(&array.values_type).hash(state); array.validity.array_hash(state, precision); } - fn array_eq(array: &DecimalArray, other: &DecimalArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.values.array_eq(&other.values, precision) && array.values_type == other.values_type && array.validity.array_eq(&other.validity, precision) } - fn nbuffers(_array: &DecimalArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 1 } - fn buffer(array: &DecimalArray, idx: usize) -> BufferHandle { + fn buffer(array: &Array, idx: usize) -> BufferHandle { match idx { 0 => array.values.clone(), _ => vortex_panic!("DecimalArray buffer index {idx} out of bounds"), } } - fn buffer_name(_array: &DecimalArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { match idx { 0 => Some("values".to_string()), _ => None, } } - fn nchildren(array: &DecimalArray) -> usize { + fn nchildren(array: &Array) -> usize { validity_nchildren(&array.validity) } - fn child(array: &DecimalArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => validity_to_child(&array.validity, array.len()) .vortex_expect("DecimalArray child index out of bounds"), @@ -132,11 +132,11 @@ impl VTable for Decimal { } } - fn child_name(_array: &DecimalArray, _idx: usize) -> String { + fn child_name(_array: &Array, _idx: usize) -> String { "validity".to_string() } - fn metadata(array: &DecimalArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(DecimalMetadata { values_type: array.values_type() as i32, })) @@ -163,7 +163,7 @@ impl VTable for Decimal { metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { if buffers.len() != 1 { vortex_bail!("Expected 1 buffer, got {}", buffers.len()); } @@ -189,11 +189,11 @@ impl VTable for Decimal { "DecimalArray buffer not aligned for values type {:?}", D::DECIMAL_TYPE ); - DecimalArray::try_new_handle(values, metadata.values_type(), *decimal_dtype, validity) + DecimalData::try_new_handle(values, metadata.values_type(), *decimal_dtype, validity) }) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() <= 1, "DecimalArray expects 0 or 1 child (validity), got {}", diff --git a/vortex-array/src/arrays/decimal/vtable/operations.rs b/vortex-array/src/arrays/decimal/vtable/operations.rs index a64be6bd393..4bfa375f225 100644 --- a/vortex-array/src/arrays/decimal/vtable/operations.rs +++ b/vortex-array/src/arrays/decimal/vtable/operations.rs @@ -5,15 +5,15 @@ use vortex_error::VortexResult; use crate::ExecutionCtx; use crate::arrays::Decimal; -use crate::arrays::decimal::vtable::DecimalArray; use crate::match_each_decimal_value_type; use crate::scalar::DecimalValue; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for Decimal { fn scalar_at( - array: &DecimalArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { diff --git a/vortex-array/src/arrays/decimal/vtable/validity.rs b/vortex-array/src/arrays/decimal/vtable/validity.rs index 96956ac6aa8..b269a2deea8 100644 --- a/vortex-array/src/arrays/decimal/vtable/validity.rs +++ b/vortex-array/src/arrays/decimal/vtable/validity.rs @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use crate::arrays::decimal::vtable::DecimalArray; +use crate::arrays::DecimalData; use crate::validity::Validity; use crate::vtable::ValidityHelper; -impl ValidityHelper for DecimalArray { +impl ValidityHelper for DecimalData { fn validity(&self) -> &Validity { &self.validity } diff --git a/vortex-array/src/arrays/dict/array.rs b/vortex-array/src/arrays/dict/array.rs index ac9bd1edb2e..1ba47a12a99 100644 --- a/vortex-array/src/arrays/dict/array.rs +++ b/vortex-array/src/arrays/dict/array.rs @@ -10,10 +10,12 @@ use vortex_mask::AllOr; use crate::ArrayRef; use crate::ToCanonical; +use crate::arrays::Dict; use crate::dtype::DType; use crate::dtype::PType; use crate::match_each_integer_ptype; use crate::stats::ArrayStats; +use crate::vtable::Array; #[derive(Clone, prost::Message)] pub struct DictMetadata { @@ -32,7 +34,7 @@ pub struct DictMetadata { } #[derive(Debug, Clone)] -pub struct DictArray { +pub struct DictData { pub(super) codes: ArrayRef, pub(super) values: ArrayRef, pub(super) stats_set: ArrayStats, @@ -51,12 +53,12 @@ pub struct DictArrayParts { pub dtype: DType, } -impl DictArray { +impl DictData { /// Build a new `DictArray` without validating the codes or values. /// /// # Safety /// This should be called only when you can guarantee the invariants checked - /// by the safe [`DictArray::try_new`] constructor are valid, for example when + /// by the safe `DictArray::try_new` constructor are valid, for example when /// you are filtering or slicing an existing valid `DictArray`. pub unsafe fn new_unchecked(codes: ArrayRef, values: ArrayRef) -> Self { let dtype = values @@ -96,7 +98,7 @@ impl DictArray { /// Build a new `DictArray` from its components, `codes` and `values`. /// /// This constructor will panic if `codes` or `values` do not pass validation for building - /// a new `DictArray`. See [`DictArray::try_new`] for a description of the error conditions. + /// a new `DictArray`. See `DictArray::try_new` for a description of the error conditions. pub fn new(codes: ArrayRef, values: ArrayRef) -> Self { Self::try_new(codes, values).vortex_expect("DictArray new") } @@ -120,6 +122,21 @@ impl DictArray { Ok(unsafe { Self::new_unchecked(codes, values) }) } + /// Returns the length of this array. + pub fn len(&self) -> usize { + self.codes.len() + } + + /// Returns the [`DType`] of this array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns `true` if this array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + pub fn into_parts(self) -> DictArrayParts { DictArrayParts { codes: self.codes, @@ -169,17 +186,44 @@ impl DictArray { Ok(()) } +} - /// Compute a mask indicating which values in the dictionary are referenced by at least one code. +impl Array { + /// Build a new `DictArray` from its components, `codes` and `values`. + pub fn new(codes: ArrayRef, values: ArrayRef) -> Self { + Array::try_from_data(DictData::new(codes, values)).vortex_expect("DictData is always valid") + } + + /// Build a new `DictArray` from its components, `codes` and `values`. + pub fn try_new(codes: ArrayRef, values: ArrayRef) -> VortexResult { + Array::try_from_data(DictData::try_new(codes, values)?) + } + + /// Build a new `DictArray` without validating the codes or values. /// - /// When `referenced = true`, returns a `BitBuffer` where set bits (true) correspond to - /// referenced values, and unset bits (false) correspond to unreferenced values. + /// # Safety + /// + /// See [`DictData::new_unchecked`]. + pub unsafe fn new_unchecked(codes: ArrayRef, values: ArrayRef) -> Self { + Array::try_from_data(unsafe { DictData::new_unchecked(codes, values) }) + .vortex_expect("DictData is always valid") + } + + /// Set whether all values in the dictionary are referenced by at least one code. /// - /// When `referenced = false` (default for unreferenced values), returns the inverse: - /// set bits (true) correspond to unreferenced values, and unset bits (false) correspond - /// to referenced values. + /// # Safety /// - /// This is useful for operations like min/max that need to ignore unreferenced values. + /// See [`DictData::set_all_values_referenced`]. + pub unsafe fn set_all_values_referenced(self, all_values_referenced: bool) -> Self { + Array::try_from_data(unsafe { + self.into_data() + .set_all_values_referenced(all_values_referenced) + }) + .vortex_expect("data is always valid") + } +} + +impl DictData { pub fn compute_referenced_values_mask(&self, referenced: bool) -> VortexResult { let codes_validity = self.codes().validity_mask()?; let codes_primitive = self.codes().to_primitive(); diff --git a/vortex-array/src/arrays/dict/compute/cast.rs b/vortex-array/src/arrays/dict/compute/cast.rs index 22457e875b2..6bcf51546c0 100644 --- a/vortex-array/src/arrays/dict/compute/cast.rs +++ b/vortex-array/src/arrays/dict/compute/cast.rs @@ -11,9 +11,10 @@ use crate::IntoArray; use crate::builtins::ArrayBuiltins; use crate::dtype::DType; use crate::scalar_fn::fns::cast::CastReduce; +use crate::vtable::Array; impl CastReduce for Dict { - fn cast(array: &DictArray, dtype: &DType) -> VortexResult> { + fn cast(array: &Array, dtype: &DType) -> VortexResult> { // Can have un-reference null values making the cast of values fail without a possible mask. // TODO(joe): optimize this, could look at accessible values and fill_null not those? if !dtype.is_nullable() diff --git a/vortex-array/src/arrays/dict/compute/compare.rs b/vortex-array/src/arrays/dict/compute/compare.rs index 3dadc7d98e6..c3be3a8223a 100644 --- a/vortex-array/src/arrays/dict/compute/compare.rs +++ b/vortex-array/src/arrays/dict/compute/compare.rs @@ -15,10 +15,11 @@ use crate::builtins::ArrayBuiltins; use crate::scalar_fn::fns::binary::CompareKernel; use crate::scalar_fn::fns::operators::CompareOperator; use crate::scalar_fn::fns::operators::Operator; +use crate::vtable::Array; impl CompareKernel for Dict { fn compare( - lhs: &DictArray, + lhs: &Array, rhs: &ArrayRef, operator: CompareOperator, ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/arrays/dict/compute/fill_null.rs b/vortex-array/src/arrays/dict/compute/fill_null.rs index cb5d9d528a6..80650eece1d 100644 --- a/vortex-array/src/arrays/dict/compute/fill_null.rs +++ b/vortex-array/src/arrays/dict/compute/fill_null.rs @@ -18,10 +18,11 @@ use crate::scalar::Scalar; use crate::scalar::ScalarValue; use crate::scalar_fn::fns::fill_null::FillNullKernel; use crate::scalar_fn::fns::operators::Operator; +use crate::vtable::Array; impl FillNullKernel for Dict { fn fill_null( - array: &DictArray, + array: &Array, fill_value: &Scalar, ctx: &mut ExecutionCtx, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/dict/compute/like.rs b/vortex-array/src/arrays/dict/compute/like.rs index fc2cb3681f5..65295dd8ab0 100644 --- a/vortex-array/src/arrays/dict/compute/like.rs +++ b/vortex-array/src/arrays/dict/compute/like.rs @@ -14,10 +14,11 @@ use crate::optimizer::ArrayOptimizer; use crate::scalar_fn::fns::like::Like; use crate::scalar_fn::fns::like::LikeOptions; use crate::scalar_fn::fns::like::LikeReduce; +use crate::vtable::Array; impl LikeReduce for Dict { fn like( - array: &DictArray, + array: &Array, pattern: &ArrayRef, options: LikeOptions, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/dict/compute/mask.rs b/vortex-array/src/arrays/dict/compute/mask.rs index 6986a8c343a..4f0e9d04344 100644 --- a/vortex-array/src/arrays/dict/compute/mask.rs +++ b/vortex-array/src/arrays/dict/compute/mask.rs @@ -11,9 +11,10 @@ use crate::arrays::scalar_fn::ScalarFnArrayExt; use crate::scalar_fn::EmptyOptions; use crate::scalar_fn::fns::mask::Mask as MaskExpr; use crate::scalar_fn::fns::mask::MaskReduce; +use crate::vtable::Array; impl MaskReduce for Dict { - fn mask(array: &DictArray, mask: &ArrayRef) -> VortexResult> { + fn mask(array: &Array, mask: &ArrayRef) -> VortexResult> { let masked_codes = MaskExpr.try_new_array( array.codes().len(), EmptyOptions, diff --git a/vortex-array/src/arrays/dict/compute/mod.rs b/vortex-array/src/arrays/dict/compute/mod.rs index 0aa1586d29f..4e939022a5b 100644 --- a/vortex-array/src/arrays/dict/compute/mod.rs +++ b/vortex-array/src/arrays/dict/compute/mod.rs @@ -23,10 +23,11 @@ use crate::DynArray; use crate::ExecutionCtx; use crate::IntoArray; use crate::arrays::filter::FilterReduce; +use crate::vtable::Array; impl TakeExecute for Dict { fn take( - array: &DictArray, + array: &Array, indices: &ArrayRef, _ctx: &mut ExecutionCtx, ) -> VortexResult> { @@ -40,7 +41,7 @@ impl TakeExecute for Dict { } impl FilterReduce for Dict { - fn filter(array: &DictArray, mask: &Mask) -> VortexResult> { + fn filter(array: &Array, mask: &Mask) -> VortexResult> { let codes = array.codes().filter(mask.clone())?; // SAFETY: filtering codes doesn't change invariants diff --git a/vortex-array/src/arrays/dict/compute/rules.rs b/vortex-array/src/arrays/dict/compute/rules.rs index 30f8b4d6c61..3d8fee79d84 100644 --- a/vortex-array/src/arrays/dict/compute/rules.rs +++ b/vortex-array/src/arrays/dict/compute/rules.rs @@ -25,6 +25,7 @@ use crate::scalar_fn::fns::cast::CastReduceAdaptor; use crate::scalar_fn::fns::like::LikeReduceAdaptor; use crate::scalar_fn::fns::mask::MaskReduceAdaptor; use crate::scalar_fn::fns::pack::Pack; +use crate::vtable::Array; pub(crate) const PARENT_RULES: ParentRuleSet = ParentRuleSet::new(&[ ParentRuleSet::lift(&FilterReduceAdaptor(Dict)), @@ -45,7 +46,7 @@ impl ArrayParentReduceRule for DictionaryScalarFnValuesPushDownRule { fn reduce_parent( &self, - array: &DictArray, + array: &Array, parent: &ScalarFnArray, child_idx: usize, ) -> VortexResult> { @@ -77,7 +78,7 @@ impl ArrayParentReduceRule for DictionaryScalarFnValuesPushDownRule { tracing::trace!( "Not pushing down fallible scalar function {} over dictionary with sparse codes {}", parent.scalar_fn(), - array.encoding_id(), + Dict::ID, ); return Ok(None); } @@ -100,7 +101,7 @@ impl ArrayParentReduceRule for DictionaryScalarFnValuesPushDownRule { tracing::trace!( "Not pushing down null-sensitive scalar function {} over dictionary with null codes {}", parent.scalar_fn(), - array.encoding_id(), + Dict::ID, ); return Ok(None); } @@ -146,7 +147,7 @@ impl ArrayParentReduceRule for DictionaryScalarFnCodesPullUpRule { fn reduce_parent( &self, - array: &DictArray, + array: &Array, parent: &ScalarFnArray, child_idx: usize, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/dict/compute/slice.rs b/vortex-array/src/arrays/dict/compute/slice.rs index dd01c585a67..1c2f544a155 100644 --- a/vortex-array/src/arrays/dict/compute/slice.rs +++ b/vortex-array/src/arrays/dict/compute/slice.rs @@ -13,9 +13,10 @@ use crate::arrays::Dict; use crate::arrays::DictArray; use crate::arrays::slice::SliceReduce; use crate::scalar::Scalar; +use crate::vtable::Array; impl SliceReduce for Dict { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { let sliced_code = array.codes().slice(range)?; // TODO(joe): if the range is size 1 replace with a constant array if let Some(code) = sliced_code.as_opt::() { @@ -48,7 +49,6 @@ mod tests { use vortex_buffer::buffer; use vortex_error::VortexResult; - use crate::DynArray; use crate::IntoArray; use crate::arrays::DictArray; use crate::arrays::PrimitiveArray; diff --git a/vortex-array/src/arrays/dict/take.rs b/vortex-array/src/arrays/dict/take.rs index e3323323ae6..01abb3dabb2 100644 --- a/vortex-array/src/arrays/dict/take.rs +++ b/vortex-array/src/arrays/dict/take.rs @@ -20,6 +20,7 @@ use crate::matcher::Matcher; use crate::optimizer::rules::ArrayParentReduceRule; use crate::scalar::Scalar; use crate::stats::StatsSet; +use crate::vtable::Array; use crate::vtable::VTable; pub trait TakeReduce: VTable { @@ -32,7 +33,7 @@ pub trait TakeReduce: VTable { /// # Preconditions /// /// The indices are guaranteed to be non-empty. - fn take(array: &Self::Array, indices: &ArrayRef) -> VortexResult>; + fn take(array: &Array, indices: &ArrayRef) -> VortexResult>; } pub trait TakeExecute: VTable { @@ -45,7 +46,7 @@ pub trait TakeExecute: VTable { /// /// The indices are guaranteed to be non-empty. fn take( - array: &Self::Array, + array: &Array, indices: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult>; @@ -55,20 +56,19 @@ pub trait TakeExecute: VTable { /// /// Returns `Some(result)` if the precondition short-circuits the take operation, /// or `None` if the take should proceed normally. -fn precondition(array: &V::Array, indices: &ArrayRef) -> Option { +fn precondition(array: &Array, indices: &ArrayRef) -> Option { // Fast-path for empty indices. if indices.is_empty() { - let result_dtype = array - .dtype() + let result_dtype = V::dtype(array) .clone() .union_nullability(indices.dtype().nullability()); return Some(Canonical::empty(&result_dtype).into_array()); } // Fast-path for empty arrays: all indices must be null, return all-invalid result. - if array.is_empty() { + if V::len(array) == 0 { return Some( - ConstantArray::new(Scalar::null(array.dtype().as_nullable()), indices.len()) + ConstantArray::new(Scalar::null(V::dtype(array).as_nullable()), indices.len()) .into_array(), ); } @@ -87,7 +87,7 @@ where fn reduce_parent( &self, - array: &V::Array, + array: &Array, parent: &DictArray, child_idx: usize, ) -> VortexResult> { @@ -100,7 +100,7 @@ where } let result = ::take(array, parent.codes())?; if let Some(ref taken) = result { - propagate_take_stats(&array.to_array(), taken, parent.codes())?; + propagate_take_stats(&array.clone().into_array(), taken, parent.codes())?; } Ok(result) } @@ -117,7 +117,7 @@ where fn execute_parent( &self, - array: &V::Array, + array: &Array, parent: ::Match<'_>, child_idx: usize, ctx: &mut ExecutionCtx, @@ -131,7 +131,7 @@ where } let result = ::take(array, parent.codes(), ctx)?; if let Some(ref taken) = result { - propagate_take_stats(&array.to_array(), taken, parent.codes())?; + propagate_take_stats(&array.clone().into_array(), taken, parent.codes())?; } Ok(result) } diff --git a/vortex-array/src/arrays/dict/tests.rs b/vortex-array/src/arrays/dict/tests.rs index a404e9ef06d..bc69998b0de 100644 --- a/vortex-array/src/arrays/dict/tests.rs +++ b/vortex-array/src/arrays/dict/tests.rs @@ -4,7 +4,6 @@ use vortex_buffer::buffer; use super::DictArray; -use crate::DynArray; use crate::IntoArray; use crate::arrays::BoolArray; use crate::arrays::ListArray; diff --git a/vortex-array/src/arrays/dict/vtable/mod.rs b/vortex-array/src/arrays/dict/vtable/mod.rs index 8c14f841481..0e0822026f7 100644 --- a/vortex-array/src/arrays/dict/vtable/mod.rs +++ b/vortex-array/src/arrays/dict/vtable/mod.rs @@ -13,8 +13,8 @@ use vortex_error::vortex_err; use vortex_error::vortex_panic; use vortex_session::VortexSession; -use super::DictArray; use super::DictArrayParts; +use super::DictData; use super::DictMetadata; use super::take_canonical; use crate::AnyCanonical; @@ -26,7 +26,7 @@ use crate::IntoArray; use crate::Precision; use crate::ProstMetadata; use crate::SerializeMetadata; -use crate::arrays::ConstantArray; +use crate::arrays::ConstantData; use crate::arrays::Primitive; use crate::arrays::dict::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; @@ -40,7 +40,7 @@ use crate::hash::ArrayHash; use crate::require_child; use crate::scalar::Scalar; use crate::serde::ArrayChildren; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::vtable; use crate::vtable::Array; use crate::vtable::ArrayId; @@ -49,7 +49,7 @@ mod kernel; mod operations; mod validity; -vtable!(Dict); +vtable!(Dict, Dict, DictData); #[derive(Clone, Debug)] pub struct Dict; @@ -59,13 +59,13 @@ impl Dict { } impl VTable for Dict { - type Array = DictArray; + type ArrayData = DictData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = Self; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Dict } @@ -73,47 +73,47 @@ impl VTable for Dict { Self::ID } - fn len(array: &DictArray) -> usize { + fn len(array: &DictData) -> usize { array.codes.len() } - fn dtype(array: &DictArray) -> &DType { + fn dtype(array: &DictData) -> &DType { &array.dtype } - fn stats(array: &DictArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &DictData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &DictArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.codes.array_hash(state, precision); array.values.array_hash(state, precision); } - fn array_eq(array: &DictArray, other: &DictArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.codes.array_eq(&other.codes, precision) && array.values.array_eq(&other.values, precision) } - fn nbuffers(_array: &DictArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &DictArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("DictArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &DictArray, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(_array: &DictArray) -> usize { + fn nchildren(_array: &Array) -> usize { 2 } - fn child(array: &DictArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.codes().clone(), 1 => array.values().clone(), @@ -121,7 +121,7 @@ impl VTable for Dict { } } - fn child_name(_array: &DictArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "codes".to_string(), 1 => "values".to_string(), @@ -129,7 +129,7 @@ impl VTable for Dict { } } - fn metadata(array: &DictArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(DictMetadata { codes_ptype: PType::try_from(array.codes().dtype())? as i32, values_len: u32::try_from(array.values().len()).map_err(|_| { @@ -164,7 +164,7 @@ impl VTable for Dict { metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { if children.len() != 2 { vortex_bail!( "Expected 2 children for dict encoding, found {}", @@ -184,11 +184,11 @@ impl VTable for Dict { // SAFETY: We've validated the metadata and children. Ok(unsafe { - DictArray::new_unchecked(codes, values).set_all_values_referenced(all_values_referenced) + DictData::new_unchecked(codes, values).set_all_values_referenced(all_values_referenced) }) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 2, "DictArray expects exactly 2 children (codes, values), got {}", @@ -217,7 +217,7 @@ impl VTable for Dict { // is correct. if array.codes().all_invalid()? { return Ok(ExecutionResult::done( - ConstantArray::new(Scalar::null(array.dtype().as_nullable()), array.codes.len()) + ConstantData::new(Scalar::null(array.dtype().as_nullable()), array.codes.len()) .into_array(), )); } @@ -225,7 +225,7 @@ impl VTable for Dict { let array = require_child!(array, array.values(), 1 => AnyCanonical); let DictArrayParts { codes, values, .. } = - Arc::unwrap_or_clone(array).into_inner().into_parts(); + Arc::unwrap_or_clone(array).into_data().into_parts(); let codes = codes .try_into::() diff --git a/vortex-array/src/arrays/dict/vtable/operations.rs b/vortex-array/src/arrays/dict/vtable/operations.rs index 9fe33e8b9a3..792f439bafc 100644 --- a/vortex-array/src/arrays/dict/vtable/operations.rs +++ b/vortex-array/src/arrays/dict/vtable/operations.rs @@ -7,12 +7,16 @@ use vortex_error::VortexResult; use super::Dict; use crate::DynArray; use crate::ExecutionCtx; -use crate::arrays::DictArray; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for Dict { - fn scalar_at(array: &DictArray, index: usize, _ctx: &mut ExecutionCtx) -> VortexResult { + fn scalar_at( + array: &Array, + index: usize, + _ctx: &mut ExecutionCtx, + ) -> VortexResult { let Some(dict_index) = array .codes() .scalar_at(index)? diff --git a/vortex-array/src/arrays/dict/vtable/validity.rs b/vortex-array/src/arrays/dict/vtable/validity.rs index 95204c0d5b5..bd83fab1a6c 100644 --- a/vortex-array/src/arrays/dict/vtable/validity.rs +++ b/vortex-array/src/arrays/dict/vtable/validity.rs @@ -6,15 +6,16 @@ use vortex_error::VortexResult; use super::Dict; use crate::DynArray; use crate::IntoArray; -use crate::arrays::DictArray; +use crate::arrays::DictData; use crate::builtins::ArrayBuiltins; use crate::dtype::Nullability; use crate::scalar::Scalar; use crate::validity::Validity; +use crate::vtable::Array; use crate::vtable::ValidityVTable; impl ValidityVTable for Dict { - fn validity(array: &DictArray) -> VortexResult { + fn validity(array: &Array) -> VortexResult { Ok( match (array.codes().validity()?, array.values().validity()?) { ( @@ -32,13 +33,13 @@ impl ValidityVTable for Dict { // We know codes are all valid, so the cast is free. let codes = array.codes().cast(array.codes().dtype().as_nonnullable())?; Validity::Array( - unsafe { DictArray::new_unchecked(codes, values_validity) }.into_array(), + unsafe { DictData::new_unchecked(codes, values_validity) }.into_array(), ) } (Validity::Array(_codes_validity), Validity::Array(values_validity)) => { // Create a mask representing "is the value at codes[i] valid?" let values_valid_mask = - unsafe { DictArray::new_unchecked(array.codes().clone(), values_validity) } + unsafe { DictData::new_unchecked(array.codes().clone(), values_validity) } .into_array(); let values_valid_mask = values_valid_mask .fill_null(Scalar::bool(false, Nullability::NonNullable))?; diff --git a/vortex-array/src/arrays/extension/array.rs b/vortex-array/src/arrays/extension/array.rs index 799646817a9..93af835b41e 100644 --- a/vortex-array/src/arrays/extension/array.rs +++ b/vortex-array/src/arrays/extension/array.rs @@ -5,9 +5,11 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::ArrayRef; +use crate::arrays::Extension; use crate::dtype::DType; use crate::dtype::extension::ExtDTypeRef; use crate::stats::ArrayStats; +use crate::vtable::Array; /// An extension array that wraps another array with additional type information. /// @@ -48,7 +50,7 @@ use crate::stats::ArrayStats; /// - Slicing preserves the extension type /// - Scalar access wraps storage scalars with extension metadata #[derive(Clone, Debug)] -pub struct ExtensionArray { +pub struct ExtensionData { /// The storage dtype. This **must** be a [`Extension::DType`] variant. pub(super) dtype: DType, @@ -59,7 +61,7 @@ pub struct ExtensionArray { pub(super) stats_set: ArrayStats, } -impl ExtensionArray { +impl ExtensionData { /// Constructs a new `ExtensionArray`. /// /// # Panics @@ -113,6 +115,21 @@ impl ExtensionArray { } } + /// Returns the length of this array. + pub fn len(&self) -> usize { + self.storage_array.len() + } + + /// Returns the [`DType`] of this array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns `true` if this array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + /// The extension dtype of this array. pub fn ext_dtype(&self) -> &ExtDTypeRef { let DType::Extension(ext) = &self.dtype else { @@ -126,3 +143,20 @@ impl ExtensionArray { &self.storage_array } } + +impl Array { + /// Constructs a new `ExtensionArray`. + /// + /// # Panics + /// + /// Panics if the storage array is not compatible with the extension dtype. + pub fn new(ext_dtype: ExtDTypeRef, storage_array: ArrayRef) -> Self { + Array::try_from_data(ExtensionData::new(ext_dtype, storage_array)) + .vortex_expect("ExtensionData is always valid") + } + + /// Tries to construct a new `ExtensionArray`. + pub fn try_new(ext_dtype: ExtDTypeRef, storage_array: ArrayRef) -> VortexResult { + Array::try_from_data(ExtensionData::try_new(ext_dtype, storage_array)?) + } +} diff --git a/vortex-array/src/arrays/extension/compute/cast.rs b/vortex-array/src/arrays/extension/compute/cast.rs index 1b02b479438..fd840dee23a 100644 --- a/vortex-array/src/arrays/extension/compute/cast.rs +++ b/vortex-array/src/arrays/extension/compute/cast.rs @@ -8,9 +8,13 @@ use crate::arrays::ExtensionArray; use crate::builtins::ArrayBuiltins; use crate::dtype::DType; use crate::scalar_fn::fns::cast::CastReduce; +use crate::vtable::Array; impl CastReduce for Extension { - fn cast(array: &ExtensionArray, dtype: &DType) -> vortex_error::VortexResult> { + fn cast( + array: &Array, + dtype: &DType, + ) -> vortex_error::VortexResult> { if !array.dtype().eq_ignore_nullability(dtype) { return Ok(None); } diff --git a/vortex-array/src/arrays/extension/compute/compare.rs b/vortex-array/src/arrays/extension/compute/compare.rs index 2e097b4f60a..5f3fa872d4f 100644 --- a/vortex-array/src/arrays/extension/compute/compare.rs +++ b/vortex-array/src/arrays/extension/compute/compare.rs @@ -9,15 +9,15 @@ use crate::ExecutionCtx; use crate::IntoArray; use crate::arrays::ConstantArray; use crate::arrays::Extension; -use crate::arrays::ExtensionArray; use crate::builtins::ArrayBuiltins; use crate::scalar_fn::fns::binary::CompareKernel; use crate::scalar_fn::fns::operators::CompareOperator; use crate::scalar_fn::fns::operators::Operator; +use crate::vtable::Array; impl CompareKernel for Extension { fn compare( - lhs: &ExtensionArray, + lhs: &Array, rhs: &ArrayRef, operator: CompareOperator, _ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/arrays/extension/compute/filter.rs b/vortex-array/src/arrays/extension/compute/filter.rs index 3dd03a8a4a0..d7fc0031e2b 100644 --- a/vortex-array/src/arrays/extension/compute/filter.rs +++ b/vortex-array/src/arrays/extension/compute/filter.rs @@ -9,9 +9,10 @@ use crate::IntoArray; use crate::arrays::Extension; use crate::arrays::ExtensionArray; use crate::arrays::filter::FilterReduce; +use crate::vtable::Array; impl FilterReduce for Extension { - fn filter(array: &ExtensionArray, mask: &Mask) -> VortexResult> { + fn filter(array: &Array, mask: &Mask) -> VortexResult> { Ok(Some( ExtensionArray::new( array.ext_dtype().clone(), diff --git a/vortex-array/src/arrays/extension/compute/mask.rs b/vortex-array/src/arrays/extension/compute/mask.rs index af7770ee0ca..d36664fbf25 100644 --- a/vortex-array/src/arrays/extension/compute/mask.rs +++ b/vortex-array/src/arrays/extension/compute/mask.rs @@ -11,9 +11,10 @@ use crate::arrays::scalar_fn::ScalarFnArrayExt; use crate::scalar_fn::EmptyOptions; use crate::scalar_fn::fns::mask::Mask as MaskExpr; use crate::scalar_fn::fns::mask::MaskReduce; +use crate::vtable::Array; impl MaskReduce for Extension { - fn mask(array: &ExtensionArray, mask: &ArrayRef) -> VortexResult> { + fn mask(array: &Array, mask: &ArrayRef) -> VortexResult> { let masked_storage = MaskExpr.try_new_array( array.storage_array().len(), EmptyOptions, diff --git a/vortex-array/src/arrays/extension/compute/rules.rs b/vortex-array/src/arrays/extension/compute/rules.rs index 0703af6414a..138171275c4 100644 --- a/vortex-array/src/arrays/extension/compute/rules.rs +++ b/vortex-array/src/arrays/extension/compute/rules.rs @@ -15,6 +15,7 @@ use crate::optimizer::rules::ArrayParentReduceRule; use crate::optimizer::rules::ParentRuleSet; use crate::scalar_fn::fns::cast::CastReduceAdaptor; use crate::scalar_fn::fns::mask::MaskReduceAdaptor; +use crate::vtable::Array; pub(crate) const PARENT_RULES: ParentRuleSet = ParentRuleSet::new(&[ ParentRuleSet::lift(&ExtensionFilterPushDownRule), @@ -33,7 +34,7 @@ impl ArrayParentReduceRule for ExtensionFilterPushDownRule { fn reduce_parent( &self, - child: &ExtensionArray, + child: &Array, parent: &FilterArray, child_idx: usize, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/extension/compute/slice.rs b/vortex-array/src/arrays/extension/compute/slice.rs index 96d00e332bd..6f6da765c6a 100644 --- a/vortex-array/src/arrays/extension/compute/slice.rs +++ b/vortex-array/src/arrays/extension/compute/slice.rs @@ -10,9 +10,10 @@ use crate::IntoArray; use crate::arrays::Extension; use crate::arrays::ExtensionArray; use crate::arrays::slice::SliceReduce; +use crate::vtable::Array; impl SliceReduce for Extension { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { Ok(Some( ExtensionArray::new( array.ext_dtype().clone(), diff --git a/vortex-array/src/arrays/extension/compute/take.rs b/vortex-array/src/arrays/extension/compute/take.rs index bf8b24c6fe4..f5998eaa451 100644 --- a/vortex-array/src/arrays/extension/compute/take.rs +++ b/vortex-array/src/arrays/extension/compute/take.rs @@ -10,10 +10,11 @@ use crate::IntoArray; use crate::arrays::Extension; use crate::arrays::ExtensionArray; use crate::arrays::dict::TakeExecute; +use crate::vtable::Array; impl TakeExecute for Extension { fn take( - array: &ExtensionArray, + array: &Array, indices: &ArrayRef, _ctx: &mut ExecutionCtx, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/extension/mod.rs b/vortex-array/src/arrays/extension/mod.rs index 703871bf311..3e4502cc522 100644 --- a/vortex-array/src/arrays/extension/mod.rs +++ b/vortex-array/src/arrays/extension/mod.rs @@ -2,7 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::ExtensionArray; +pub use array::ExtensionData; +pub use vtable::ExtensionArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/extension/vtable/mod.rs b/vortex-array/src/arrays/extension/vtable/mod.rs index 9f870c17bda..59125d33560 100644 --- a/vortex-array/src/arrays/extension/vtable/mod.rs +++ b/vortex-array/src/arrays/extension/vtable/mod.rs @@ -21,30 +21,30 @@ use crate::EmptyMetadata; use crate::ExecutionCtx; use crate::ExecutionResult; use crate::Precision; -use crate::arrays::ExtensionArray; +use crate::arrays::ExtensionData; use crate::arrays::extension::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::hash::ArrayEq; use crate::hash::ArrayHash; use crate::serde::ArrayChildren; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::vtable; use crate::vtable::Array; use crate::vtable::ArrayId; use crate::vtable::VTable; use crate::vtable::ValidityVTableFromChild; -vtable!(Extension); +vtable!(Extension, Extension, ExtensionData); impl VTable for Extension { - type Array = ExtensionArray; + type ArrayData = ExtensionData; type Metadata = EmptyMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromChild; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Extension } @@ -52,65 +52,61 @@ impl VTable for Extension { Self::ID } - fn len(array: &ExtensionArray) -> usize { + fn len(array: &ExtensionData) -> usize { array.storage_array.len() } - fn dtype(array: &ExtensionArray) -> &DType { + fn dtype(array: &ExtensionData) -> &DType { &array.dtype } - fn stats(array: &ExtensionArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &ExtensionData) -> &ArrayStats { + &array.stats_set } - fn array_hash( - array: &ExtensionArray, - state: &mut H, - precision: Precision, - ) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.storage_array.array_hash(state, precision); } - fn array_eq(array: &ExtensionArray, other: &ExtensionArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array .storage_array .array_eq(&other.storage_array, precision) } - fn nbuffers(_array: &ExtensionArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &ExtensionArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("ExtensionArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &ExtensionArray, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(_array: &ExtensionArray) -> usize { + fn nchildren(_array: &Array) -> usize { 1 } - fn child(array: &ExtensionArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.storage_array.clone(), _ => vortex_panic!("ExtensionArray child index {idx} out of bounds"), } } - fn child_name(_array: &ExtensionArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "storage".to_string(), _ => vortex_panic!("ExtensionArray child_name index {idx} out of bounds"), } } - fn metadata(_array: &ExtensionArray) -> VortexResult { + fn metadata(_array: &Array) -> VortexResult { Ok(EmptyMetadata) } @@ -134,7 +130,7 @@ impl VTable for Extension { _metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let DType::Extension(ext_dtype) = dtype else { vortex_bail!("Not an extension DType"); }; @@ -142,10 +138,10 @@ impl VTable for Extension { vortex_bail!("Expected 1 child, got {}", children.len()); } let storage = children.get(0, ext_dtype.storage_dtype(), len)?; - Ok(ExtensionArray::new(ext_dtype.clone(), storage)) + Ok(ExtensionData::new(ext_dtype.clone(), storage)) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 1, "ExtensionArray expects exactly 1 child (storage), got {}", diff --git a/vortex-array/src/arrays/extension/vtable/operations.rs b/vortex-array/src/arrays/extension/vtable/operations.rs index eb5dd056633..3f201350c41 100644 --- a/vortex-array/src/arrays/extension/vtable/operations.rs +++ b/vortex-array/src/arrays/extension/vtable/operations.rs @@ -3,16 +3,15 @@ use vortex_error::VortexResult; -use crate::DynArray; use crate::ExecutionCtx; use crate::arrays::Extension; -use crate::arrays::ExtensionArray; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for Extension { fn scalar_at( - array: &ExtensionArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { diff --git a/vortex-array/src/arrays/extension/vtable/validity.rs b/vortex-array/src/arrays/extension/vtable/validity.rs index 7bdd96f2f78..aa0705561ef 100644 --- a/vortex-array/src/arrays/extension/vtable/validity.rs +++ b/vortex-array/src/arrays/extension/vtable/validity.rs @@ -3,11 +3,11 @@ use crate::ArrayRef; use crate::arrays::Extension; -use crate::arrays::ExtensionArray; +use crate::arrays::ExtensionData; use crate::vtable::ValidityChild; impl ValidityChild for Extension { - fn validity_child(array: &ExtensionArray) -> &ArrayRef { + fn validity_child(array: &ExtensionData) -> &ArrayRef { &array.storage_array } } diff --git a/vortex-array/src/arrays/filter/array.rs b/vortex-array/src/arrays/filter/array.rs index 40857487a65..fc143805758 100644 --- a/vortex-array/src/arrays/filter/array.rs +++ b/vortex-array/src/arrays/filter/array.rs @@ -7,7 +7,10 @@ use vortex_error::vortex_ensure_eq; use vortex_mask::Mask; use crate::ArrayRef; +use crate::arrays::Filter; +use crate::dtype::DType; use crate::stats::ArrayStats; +use crate::vtable::Array; /// Decomposed parts of the filter array. pub struct FilterArrayParts { @@ -23,7 +26,7 @@ pub struct FilterArrayParts { /// /// The resulting array contains only the elements where the mask is true. #[derive(Clone, Debug)] -pub struct FilterArray { +pub struct FilterData { /// The source array being filtered. pub(super) child: ArrayRef, @@ -34,7 +37,7 @@ pub struct FilterArray { pub(super) stats: ArrayStats, } -impl FilterArray { +impl FilterData { pub fn new(array: ArrayRef, mask: Mask) -> Self { Self::try_new(array, mask).vortex_expect("FilterArray construction failed") } @@ -55,6 +58,21 @@ impl FilterArray { }) } + /// Returns the length of this array (number of elements after filtering). + pub fn len(&self) -> usize { + self.mask.true_count() + } + + /// Returns the [`DType`] of this array. + pub fn dtype(&self) -> &DType { + self.child.dtype() + } + + /// Returns `true` if this array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + /// The child array being filtered. pub fn child(&self) -> &ArrayRef { &self.child @@ -64,7 +82,22 @@ impl FilterArray { pub fn filter_mask(&self) -> &Mask { &self.mask } +} + +impl Array { + /// Creates a new `FilterArray`. + pub fn new(array: ArrayRef, mask: Mask) -> Self { + Array::try_from_data(FilterData::new(array, mask)) + .vortex_expect("FilterData is always valid") + } + + /// Constructs a new `FilterArray`. + pub fn try_new(array: ArrayRef, mask: Mask) -> VortexResult { + Array::try_from_data(FilterData::try_new(array, mask)?) + } +} +impl FilterData { /// Consume the array and return its individual components. pub fn into_parts(self) -> FilterArrayParts { FilterArrayParts { diff --git a/vortex-array/src/arrays/filter/execute/bool.rs b/vortex-array/src/arrays/filter/execute/bool.rs index 834a11b2cee..1929d75c3e0 100644 --- a/vortex-array/src/arrays/filter/execute/bool.rs +++ b/vortex-array/src/arrays/filter/execute/bool.rs @@ -3,7 +3,6 @@ use std::sync::Arc; -use vortex_error::VortexExpect; use vortex_mask::MaskValues; use crate::arrays::BoolArray; @@ -11,7 +10,7 @@ use crate::arrays::filter::execute::bitbuffer; use crate::arrays::filter::execute::filter_validity; pub fn filter_bool(array: &BoolArray, mask: &Arc) -> BoolArray { - let validity = array.validity().vortex_expect("missing BoolArray validity"); + let validity = array.validity().clone(); let filtered_validity = filter_validity(validity, mask); let bit_buffer = array.to_bit_buffer(); diff --git a/vortex-array/src/arrays/filter/execute/decimal.rs b/vortex-array/src/arrays/filter/execute/decimal.rs index b3f1b755792..5a290ab5604 100644 --- a/vortex-array/src/arrays/filter/execute/decimal.rs +++ b/vortex-array/src/arrays/filter/execute/decimal.rs @@ -9,7 +9,6 @@ use crate::arrays::DecimalArray; use crate::arrays::filter::execute::buffer; use crate::arrays::filter::execute::filter_validity; use crate::match_each_decimal_value_type; -use crate::vtable::ValidityHelper; pub fn filter_decimal(array: &DecimalArray, mask: &Arc) -> DecimalArray { let filtered_validity = filter_validity(array.validity().clone(), mask); diff --git a/vortex-array/src/arrays/filter/execute/fixed_size_list.rs b/vortex-array/src/arrays/filter/execute/fixed_size_list.rs index 5b65ffee011..0c5aef7d62e 100644 --- a/vortex-array/src/arrays/filter/execute/fixed_size_list.rs +++ b/vortex-array/src/arrays/filter/execute/fixed_size_list.rs @@ -10,7 +10,6 @@ use vortex_mask::MaskValues; use crate::arrays::FixedSizeListArray; use crate::arrays::filter::execute::filter_validity; -use crate::vtable::ValidityHelper; /// Density threshold for choosing between indices and slices representation when expanding masks. /// diff --git a/vortex-array/src/arrays/filter/execute/listview.rs b/vortex-array/src/arrays/filter/execute/listview.rs index 9d0434d0bd7..b622e6d3328 100644 --- a/vortex-array/src/arrays/filter/execute/listview.rs +++ b/vortex-array/src/arrays/filter/execute/listview.rs @@ -10,7 +10,6 @@ use crate::arrays::ListViewArray; use crate::arrays::filter::execute::filter_validity; use crate::arrays::filter::execute::values_to_mask; use crate::arrays::listview::ListViewRebuildMode; -use crate::vtable::ValidityHelper; // TODO(connor)[ListView]: Make use of this threshold after we start migrating operators. /// The threshold for triggering a rebuild of the [`ListViewArray`]. diff --git a/vortex-array/src/arrays/filter/execute/mod.rs b/vortex-array/src/arrays/filter/execute/mod.rs index 0dbffad14b5..4eabaa90119 100644 --- a/vortex-array/src/arrays/filter/execute/mod.rs +++ b/vortex-array/src/arrays/filter/execute/mod.rs @@ -15,6 +15,7 @@ use vortex_mask::MaskValues; use crate::ArrayRef; use crate::Canonical; +use crate::DynArray; use crate::ExecutionCtx; use crate::IntoArray; use crate::arrays::ConstantArray; diff --git a/vortex-array/src/arrays/filter/execute/primitive.rs b/vortex-array/src/arrays/filter/execute/primitive.rs index 7a88afdc942..071b54eea56 100644 --- a/vortex-array/src/arrays/filter/execute/primitive.rs +++ b/vortex-array/src/arrays/filter/execute/primitive.rs @@ -3,7 +3,6 @@ use std::sync::Arc; -use vortex_error::VortexExpect; use vortex_mask::MaskValues; use crate::arrays::PrimitiveArray; @@ -12,9 +11,7 @@ use crate::arrays::filter::execute::filter_validity; use crate::match_each_native_ptype; pub fn filter_primitive(array: &PrimitiveArray, mask: &Arc) -> PrimitiveArray { - let validity = array - .validity() - .vortex_expect("missing PrimitiveArray validity"); + let validity = array.validity().clone(); let filtered_validity = filter_validity(validity, mask); match_each_native_ptype!(array.ptype(), |T| { diff --git a/vortex-array/src/arrays/filter/execute/struct_.rs b/vortex-array/src/arrays/filter/execute/struct_.rs index 1cdc4b17c64..583f871f3fc 100644 --- a/vortex-array/src/arrays/filter/execute/struct_.rs +++ b/vortex-array/src/arrays/filter/execute/struct_.rs @@ -10,7 +10,6 @@ use crate::ArrayRef; use crate::arrays::StructArray; use crate::arrays::filter::execute::filter_validity; use crate::arrays::filter::execute::values_to_mask; -use crate::vtable::ValidityHelper; pub fn filter_struct(array: &StructArray, mask: &Arc) -> StructArray { let filtered_validity = filter_validity(array.validity().clone(), mask); diff --git a/vortex-array/src/arrays/filter/kernel.rs b/vortex-array/src/arrays/filter/kernel.rs index 6b50ab98559..88f8a5cdd40 100644 --- a/vortex-array/src/arrays/filter/kernel.rs +++ b/vortex-array/src/arrays/filter/kernel.rs @@ -20,6 +20,7 @@ use crate::arrays::FilterArray; use crate::kernel::ExecuteParentKernel; use crate::matcher::Matcher; use crate::optimizer::rules::ArrayParentReduceRule; +use crate::vtable::Array; use crate::vtable::VTable; pub trait FilterReduce: VTable { @@ -35,7 +36,7 @@ pub trait FilterReduce: VTable { /// /// Additionally, the mask is guaranteed to be a `Mask::Values` variant (i.e., neither /// `Mask::AllTrue` nor `Mask::AllFalse`). - fn filter(array: &Self::Array, mask: &Mask) -> VortexResult>; + fn filter(array: &Array, mask: &Mask) -> VortexResult>; } pub trait FilterKernel: VTable { @@ -51,7 +52,7 @@ pub trait FilterKernel: VTable { /// Additionally, the mask is guaranteed to be a `Mask::Values` variant (i.e., neither /// `Mask::AllTrue` nor `Mask::AllFalse`). fn filter( - array: &Self::Array, + array: &Array, mask: &Mask, ctx: &mut ExecutionCtx, ) -> VortexResult>; @@ -61,17 +62,17 @@ pub trait FilterKernel: VTable { /// /// Returns `Some(result)` if the precondition short-circuits the filter operation, /// or `None` if the filter should proceed normally. -fn precondition(array: &V::Array, mask: &Mask) -> Option { +fn precondition(array: &Array, mask: &Mask) -> Option { let true_count = mask.true_count(); // Fast-path for empty mask (all false). if true_count == 0 { - return Some(Canonical::empty(array.dtype()).into_array()); + return Some(Canonical::empty(V::dtype(array)).into_array()); } // Fast-path for full mask (all true). if true_count == mask.len() { - return Some(array.to_array()); + return Some(array.clone().into_array()); } None @@ -89,7 +90,7 @@ where fn reduce_parent( &self, - array: &V::Array, + array: &Array, parent: &FilterArray, child_idx: usize, ) -> VortexResult> { @@ -113,7 +114,7 @@ where fn execute_parent( &self, - array: &V::Array, + array: &Array, parent: ::Match<'_>, child_idx: usize, ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/arrays/filter/mod.rs b/vortex-array/src/arrays/filter/mod.rs index 33729d44f73..d10cae11e41 100644 --- a/vortex-array/src/arrays/filter/mod.rs +++ b/vortex-array/src/arrays/filter/mod.rs @@ -2,8 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::FilterArray; pub use array::FilterArrayParts; +pub use array::FilterData; +pub use vtable::FilterArray; mod execute; diff --git a/vortex-array/src/arrays/filter/rules.rs b/vortex-array/src/arrays/filter/rules.rs index f5683e86126..a88a158990a 100644 --- a/vortex-array/src/arrays/filter/rules.rs +++ b/vortex-array/src/arrays/filter/rules.rs @@ -17,6 +17,7 @@ use crate::optimizer::rules::ArrayParentReduceRule; use crate::optimizer::rules::ArrayReduceRule; use crate::optimizer::rules::ParentRuleSet; use crate::optimizer::rules::ReduceRuleSet; +use crate::vtable::Array; pub(super) const PARENT_RULES: ParentRuleSet = ParentRuleSet::new(&[ParentRuleSet::lift(&FilterFilterRule)]); @@ -34,7 +35,7 @@ impl ArrayParentReduceRule for FilterFilterRule { fn reduce_parent( &self, - child: &FilterArray, + child: &Array, parent: &FilterArray, _child_idx: usize, ) -> VortexResult> { @@ -49,7 +50,7 @@ impl ArrayParentReduceRule for FilterFilterRule { struct TrivialFilterRule; impl ArrayReduceRule for TrivialFilterRule { - fn reduce(&self, array: &FilterArray) -> VortexResult> { + fn reduce(&self, array: &Array) -> VortexResult> { match array.filter_mask() { Mask::AllTrue(_) => Ok(Some(array.child.clone())), Mask::AllFalse(_) => Ok(Some(Canonical::empty(array.dtype()).into_array())), @@ -63,7 +64,7 @@ impl ArrayReduceRule for TrivialFilterRule { struct FilterStructRule; impl ArrayReduceRule for FilterStructRule { - fn reduce(&self, array: &FilterArray) -> VortexResult> { + fn reduce(&self, array: &Array) -> VortexResult> { let mask = array.filter_mask(); let Some(struct_array) = array.child().as_opt::() else { return Ok(None); diff --git a/vortex-array/src/arrays/filter/vtable.rs b/vortex-array/src/arrays/filter/vtable.rs index 80ec8ded692..e3a8b114990 100644 --- a/vortex-array/src/arrays/filter/vtable.rs +++ b/vortex-array/src/arrays/filter/vtable.rs @@ -20,7 +20,7 @@ use crate::ArrayRef; use crate::DynArray; use crate::IntoArray; use crate::Precision; -use crate::arrays::filter::array::FilterArray; +use crate::arrays::filter::array::FilterData; use crate::arrays::filter::execute::execute_filter; use crate::arrays::filter::execute::execute_filter_fast_paths; use crate::arrays::filter::rules::PARENT_RULES; @@ -31,7 +31,7 @@ use crate::executor::ExecutionCtx; use crate::executor::ExecutionResult; use crate::scalar::Scalar; use crate::serde::ArrayChildren; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::validity::Validity; use crate::vtable; use crate::vtable::Array; @@ -40,7 +40,7 @@ use crate::vtable::OperationsVTable; use crate::vtable::VTable; use crate::vtable::ValidityVTable; -vtable!(Filter); +vtable!(Filter, Filter, FilterData); #[derive(Clone, Debug)] pub struct Filter; @@ -50,11 +50,11 @@ impl Filter { } impl VTable for Filter { - type Array = FilterArray; + type ArrayData = FilterData; type Metadata = FilterMetadata; type OperationsVTable = Self; type ValidityVTable = Self; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &FilterData) -> &Self { &Filter } @@ -62,58 +62,58 @@ impl VTable for Filter { Self::ID } - fn len(array: &FilterArray) -> usize { + fn len(array: &FilterData) -> usize { array.mask.true_count() } - fn dtype(array: &FilterArray) -> &DType { + fn dtype(array: &FilterData) -> &DType { array.child.dtype() } - fn stats(array: &FilterArray) -> StatsSetRef<'_> { - array.stats.to_ref(array.as_ref()) + fn stats(array: &FilterData) -> &ArrayStats { + &array.stats } - fn array_hash(array: &FilterArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.child.array_hash(state, precision); array.mask.array_hash(state, precision); } - fn array_eq(array: &FilterArray, other: &FilterArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.child.array_eq(&other.child, precision) && array.mask.array_eq(&other.mask, precision) } - fn nbuffers(_array: &Self::Array) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &Self::Array, _idx: usize) -> BufferHandle { + fn buffer(_array: &Array, _idx: usize) -> BufferHandle { vortex_panic!("FilterArray has no buffers") } - fn buffer_name(_array: &Self::Array, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(_array: &Self::Array) -> usize { + fn nchildren(_array: &Array) -> usize { 1 } - fn child(array: &Self::Array, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.child.clone(), _ => vortex_panic!("FilterArray child index {idx} out of bounds"), } } - fn child_name(_array: &Self::Array, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "child".to_string(), _ => vortex_panic!("FilterArray child_name index {idx} out of bounds"), } } - fn metadata(array: &Self::Array) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(FilterMetadata(array.mask.clone())) } @@ -138,17 +138,17 @@ impl VTable for Filter { metadata: &FilterMetadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { assert_eq!(len, metadata.0.true_count()); let child = children.get(0, dtype, metadata.0.len())?; - Ok(FilterArray { + Ok(FilterData { child, mask: metadata.0.clone(), stats: Default::default(), }) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 1, "FilterArray expects exactly 1 child, got {}", @@ -190,7 +190,7 @@ impl VTable for Filter { } impl OperationsVTable for Filter { fn scalar_at( - array: &FilterArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -200,7 +200,7 @@ impl OperationsVTable for Filter { } impl ValidityVTable for Filter { - fn validity(array: &FilterArray) -> VortexResult { + fn validity(array: &Array) -> VortexResult { array.child.validity()?.filter(&array.mask) } } diff --git a/vortex-array/src/arrays/fixed_size_list/array.rs b/vortex-array/src/arrays/fixed_size_list/array.rs index 12a9e044c11..64c4efb031b 100644 --- a/vortex-array/src/arrays/fixed_size_list/array.rs +++ b/vortex-array/src/arrays/fixed_size_list/array.rs @@ -9,9 +9,11 @@ use vortex_error::vortex_ensure; use crate::ArrayRef; use crate::DynArray; +use crate::arrays::FixedSizeList; use crate::dtype::DType; use crate::stats::ArrayStats; use crate::validity::Validity; +use crate::vtable::Array; /// The canonical encoding for fixed-size list arrays. /// @@ -61,7 +63,7 @@ use crate::validity::Validity; /// # } /// ``` #[derive(Clone, Debug)] -pub struct FixedSizeListArray { +pub struct FixedSizeListData { /// The [`DType`] of the fixed-size list. /// /// This type **must** be the variant [`DType::FixedSizeList`]. @@ -99,13 +101,13 @@ pub struct FixedSizeListArray { pub(super) stats_set: ArrayStats, } -impl FixedSizeListArray { - /// Creates a new [`FixedSizeListArray`]. +impl FixedSizeListData { + /// Creates a new `FixedSizeListArray`. /// /// # Panics /// /// Panics if the provided components do not satisfy the invariants documented - /// in [`FixedSizeListArray::new_unchecked`]. + /// in `FixedSizeListArray::new_unchecked`. pub fn new(elements: ArrayRef, list_size: u32, validity: Validity, len: usize) -> Self { Self::try_new(elements, list_size, validity, len) .vortex_expect("FixedSizeListArray construction failed") @@ -113,12 +115,12 @@ impl FixedSizeListArray { /// Constructs a new `FixedSizeListArray`. /// - /// See [`FixedSizeListArray::new_unchecked`] for more information. + /// See `FixedSizeListArray::new_unchecked` for more information. /// /// # Errors /// /// Returns an error if the provided components do not satisfy the invariants documented - /// in [`FixedSizeListArray::new_unchecked`]. + /// in `FixedSizeListArray::new_unchecked`. pub fn try_new( elements: ArrayRef, list_size: u32, @@ -131,7 +133,7 @@ impl FixedSizeListArray { Ok(unsafe { Self::new_unchecked(elements, list_size, validity, len) }) } - /// Creates a new [`FixedSizeListArray`] without validation from these components: + /// Creates a new `FixedSizeListArray` without validation from these components: /// /// * `elements` is the data array where each fixed-size list is a slice. /// * `list_size` is the fixed number of elements in each list. @@ -173,9 +175,9 @@ impl FixedSizeListArray { (self.elements, self.validity, self.dtype) } - /// Validates the components that would be used to create a [`FixedSizeListArray`]. + /// Validates the components that would be used to create a `FixedSizeListArray`. /// - /// This function checks all the invariants required by [`FixedSizeListArray::new_unchecked`]. + /// This function checks all the invariants required by `FixedSizeListArray::new_unchecked`. pub fn validate( elements: &ArrayRef, len: usize, @@ -209,6 +211,32 @@ impl FixedSizeListArray { Ok(()) } + /// Returns the dtype of the array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns the length of the array. + pub fn len(&self) -> usize { + self.len + } + + /// Returns `true` if the array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Returns the validity of the array. + #[allow(clippy::same_name_method)] + pub fn validity(&self) -> &Validity { + &self.validity + } + + /// Returns the validity as a [`Mask`](vortex_mask::Mask). + pub fn validity_mask(&self) -> vortex_mask::Mask { + self.validity.to_mask(self.len()) + } + /// Returns the elements array. pub fn elements(&self) -> &ArrayRef { &self.elements @@ -218,12 +246,46 @@ impl FixedSizeListArray { pub const fn list_size(&self) -> u32 { self.list_size } +} + +impl Array { + /// Creates a new `FixedSizeListArray`. + pub fn new(elements: ArrayRef, list_size: u32, validity: Validity, len: usize) -> Self { + Array::try_from_data(FixedSizeListData::new(elements, list_size, validity, len)) + .vortex_expect("FixedSizeListData is always valid") + } + + /// Constructs a new `FixedSizeListArray`. + pub fn try_new( + elements: ArrayRef, + list_size: u32, + validity: Validity, + len: usize, + ) -> VortexResult { + Array::try_from_data(FixedSizeListData::try_new( + elements, list_size, validity, len, + )?) + } - /// Returns the elements of the fixed-size list scalar at the given index of the list array. + /// Creates a new `FixedSizeListArray` without validation. /// - /// # Errors + /// # Safety /// - /// Returns an error if the index is out of bounds or the slice operation fails. + /// See [`FixedSizeListData::new_unchecked`]. + pub unsafe fn new_unchecked( + elements: ArrayRef, + list_size: u32, + validity: Validity, + len: usize, + ) -> Self { + Array::try_from_data(unsafe { + FixedSizeListData::new_unchecked(elements, list_size, validity, len) + }) + .vortex_expect("FixedSizeListData is always valid") + } +} + +impl FixedSizeListData { pub fn fixed_size_list_elements_at(&self, index: usize) -> VortexResult { debug_assert!( index < self.len, diff --git a/vortex-array/src/arrays/fixed_size_list/compute/cast.rs b/vortex-array/src/arrays/fixed_size_list/compute/cast.rs index f990047dde2..d89d9685550 100644 --- a/vortex-array/src/arrays/fixed_size_list/compute/cast.rs +++ b/vortex-array/src/arrays/fixed_size_list/compute/cast.rs @@ -10,14 +10,14 @@ use crate::arrays::FixedSizeListArray; use crate::builtins::ArrayBuiltins; use crate::dtype::DType; use crate::scalar_fn::fns::cast::CastReduce; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; /// Cast implementation for [`FixedSizeListArray`]. /// /// Recursively casts the inner elements array to the target element type while preserving the list /// structure. impl CastReduce for FixedSizeList { - fn cast(array: &FixedSizeListArray, dtype: &DType) -> VortexResult> { + fn cast(array: &Array, dtype: &DType) -> VortexResult> { let Some(target_element_type) = dtype.as_fixed_size_list_element_opt() else { return Ok(None); }; diff --git a/vortex-array/src/arrays/fixed_size_list/compute/mask.rs b/vortex-array/src/arrays/fixed_size_list/compute/mask.rs index d189f5570be..72357f1d191 100644 --- a/vortex-array/src/arrays/fixed_size_list/compute/mask.rs +++ b/vortex-array/src/arrays/fixed_size_list/compute/mask.rs @@ -9,10 +9,10 @@ use crate::arrays::FixedSizeList; use crate::arrays::FixedSizeListArray; use crate::scalar_fn::fns::mask::MaskReduce; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl MaskReduce for FixedSizeList { - fn mask(array: &FixedSizeListArray, mask: &ArrayRef) -> VortexResult> { + fn mask(array: &Array, mask: &ArrayRef) -> VortexResult> { // SAFETY: masking the validity does not affect the invariants Ok(Some( unsafe { diff --git a/vortex-array/src/arrays/fixed_size_list/compute/slice.rs b/vortex-array/src/arrays/fixed_size_list/compute/slice.rs index 9db5d8a7c08..9b9b6f809c2 100644 --- a/vortex-array/src/arrays/fixed_size_list/compute/slice.rs +++ b/vortex-array/src/arrays/fixed_size_list/compute/slice.rs @@ -10,10 +10,10 @@ use crate::IntoArray; use crate::arrays::FixedSizeList; use crate::arrays::FixedSizeListArray; use crate::arrays::slice::SliceReduce; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl SliceReduce for FixedSizeList { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { let new_len = range.len(); let list_size = array.list_size() as usize; diff --git a/vortex-array/src/arrays/fixed_size_list/compute/take.rs b/vortex-array/src/arrays/fixed_size_list/compute/take.rs index f69ef5840e1..72af7042975 100644 --- a/vortex-array/src/arrays/fixed_size_list/compute/take.rs +++ b/vortex-array/src/arrays/fixed_size_list/compute/take.rs @@ -12,13 +12,14 @@ use crate::DynArray; use crate::IntoArray; use crate::arrays::FixedSizeList; use crate::arrays::FixedSizeListArray; +use crate::arrays::Primitive; use crate::arrays::PrimitiveArray; use crate::arrays::dict::TakeExecute; use crate::dtype::IntegerPType; use crate::executor::ExecutionCtx; use crate::match_each_integer_ptype; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; /// Take implementation for [`FixedSizeListArray`]. /// @@ -27,7 +28,7 @@ use crate::vtable::ValidityHelper; /// into element indices and push them down to the child elements array. impl TakeExecute for FixedSizeList { fn take( - array: &FixedSizeListArray, + array: &Array, indices: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult> { @@ -40,7 +41,7 @@ impl TakeExecute for FixedSizeList { /// Dispatches to the appropriate take implementation based on list size and nullability. fn take_with_indices( - array: &FixedSizeListArray, + array: &Array, indices: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -83,8 +84,8 @@ fn take_with_indices( /// Takes from an array when both the array and indices are non-nullable. fn take_non_nullable_fsl( - array: &FixedSizeListArray, - indices_array: &PrimitiveArray, + array: &Array, + indices_array: &Array, ) -> VortexResult { let list_size = array.list_size() as usize; let indices: &[I] = indices_array.as_slice::(); @@ -132,8 +133,8 @@ fn take_non_nullable_fsl( /// Takes from an array when either the array or indices are nullable. fn take_nullable_fsl( - array: &FixedSizeListArray, - indices_array: &PrimitiveArray, + array: &Array, + indices_array: &Array, ) -> VortexResult { let list_size = array.list_size() as usize; let indices: &[I] = indices_array.as_slice::(); diff --git a/vortex-array/src/arrays/fixed_size_list/mod.rs b/vortex-array/src/arrays/fixed_size_list/mod.rs index 3df8099d24c..875ee8ba393 100644 --- a/vortex-array/src/arrays/fixed_size_list/mod.rs +++ b/vortex-array/src/arrays/fixed_size_list/mod.rs @@ -2,7 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::FixedSizeListArray; +pub use array::FixedSizeListData; +pub use vtable::FixedSizeListArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs b/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs index 5f299dc46c9..35d2cbe20b9 100644 --- a/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs +++ b/vortex-array/src/arrays/fixed_size_list/vtable/mod.rs @@ -16,14 +16,14 @@ use crate::EmptyMetadata; use crate::ExecutionCtx; use crate::ExecutionResult; use crate::Precision; -use crate::arrays::FixedSizeListArray; +use crate::arrays::fixed_size_list::FixedSizeListData; use crate::arrays::fixed_size_list::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::hash::ArrayEq; use crate::hash::ArrayHash; use crate::serde::ArrayChildren; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::validity::Validity; use crate::vtable; use crate::vtable::Array; @@ -36,7 +36,7 @@ mod kernel; mod operations; mod validity; -vtable!(FixedSizeList); +vtable!(FixedSizeList, FixedSizeList, FixedSizeListData); #[derive(Clone, Debug)] pub struct FixedSizeList; @@ -46,12 +46,12 @@ impl FixedSizeList { } impl VTable for FixedSizeList { - type Array = FixedSizeListArray; + type ArrayData = FixedSizeListData; type Metadata = EmptyMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValidityHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &FixedSizeListData) -> &Self { &FixedSizeList } @@ -59,23 +59,19 @@ impl VTable for FixedSizeList { Self::ID } - fn len(array: &FixedSizeListArray) -> usize { + fn len(array: &FixedSizeListData) -> usize { array.len } - fn dtype(array: &FixedSizeListArray) -> &DType { + fn dtype(array: &FixedSizeListData) -> &DType { &array.dtype } - fn stats(array: &FixedSizeListArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &FixedSizeListData) -> &ArrayStats { + &array.stats_set } - fn array_hash( - array: &FixedSizeListArray, - state: &mut H, - precision: Precision, - ) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.elements().array_hash(state, precision); array.list_size().hash(state); @@ -83,11 +79,7 @@ impl VTable for FixedSizeList { array.len.hash(state); } - fn array_eq( - array: &FixedSizeListArray, - other: &FixedSizeListArray, - precision: Precision, - ) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.elements().array_eq(other.elements(), precision) && array.list_size() == other.list_size() @@ -95,23 +87,23 @@ impl VTable for FixedSizeList { && array.len == other.len } - fn nbuffers(_array: &FixedSizeListArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &FixedSizeListArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("FixedSizeListArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &FixedSizeListArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { vortex_panic!("FixedSizeListArray buffer_name index {idx} out of bounds") } - fn nchildren(array: &FixedSizeListArray) -> usize { + fn nchildren(array: &Array) -> usize { 1 + validity_nchildren(&array.validity) } - fn child(array: &FixedSizeListArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.elements().clone(), 1 => validity_to_child(&array.validity, array.len()) @@ -120,7 +112,7 @@ impl VTable for FixedSizeList { } } - fn child_name(_array: &FixedSizeListArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "elements".to_string(), 1 => "validity".to_string(), @@ -145,7 +137,7 @@ impl VTable for FixedSizeList { Self::PARENT_KERNELS.execute(array, parent, child_idx, ctx) } - fn metadata(_array: &FixedSizeListArray) -> VortexResult { + fn metadata(_array: &Array) -> VortexResult { Ok(EmptyMetadata) } @@ -172,7 +164,7 @@ impl VTable for FixedSizeList { _metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { vortex_ensure!( buffers.is_empty(), "`FixedSizeList::build` expects no buffers" @@ -199,10 +191,10 @@ impl VTable for FixedSizeList { let num_elements = len * (*list_size as usize); let elements = children.get(0, element_dtype.as_ref(), num_elements)?; - FixedSizeListArray::try_new(elements, *list_size, validity, len) + FixedSizeListData::try_new(elements, *list_size, validity, len) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 1 || children.len() == 2, "FixedSizeListArray expects 1 or 2 children, got {}", @@ -220,7 +212,7 @@ impl VTable for FixedSizeList { }; let new_array = - FixedSizeListArray::try_new(elements, array.list_size(), validity, array.len())?; + FixedSizeListData::try_new(elements, array.list_size(), validity, array.len())?; *array = new_array; Ok(()) } diff --git a/vortex-array/src/arrays/fixed_size_list/vtable/operations.rs b/vortex-array/src/arrays/fixed_size_list/vtable/operations.rs index 9b7a66349bd..115417d4e2c 100644 --- a/vortex-array/src/arrays/fixed_size_list/vtable/operations.rs +++ b/vortex-array/src/arrays/fixed_size_list/vtable/operations.rs @@ -5,13 +5,13 @@ use vortex_error::VortexResult; use crate::ExecutionCtx; use crate::arrays::FixedSizeList; -use crate::arrays::fixed_size_list::vtable::FixedSizeListArray; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for FixedSizeList { fn scalar_at( - array: &FixedSizeListArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { diff --git a/vortex-array/src/arrays/fixed_size_list/vtable/validity.rs b/vortex-array/src/arrays/fixed_size_list/vtable/validity.rs index 8a374872faf..587c9ac9718 100644 --- a/vortex-array/src/arrays/fixed_size_list/vtable/validity.rs +++ b/vortex-array/src/arrays/fixed_size_list/vtable/validity.rs @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use crate::arrays::fixed_size_list::vtable::FixedSizeListArray; +use crate::arrays::fixed_size_list::FixedSizeListData; use crate::validity::Validity; use crate::vtable::ValidityHelper; -impl ValidityHelper for FixedSizeListArray { +impl ValidityHelper for FixedSizeListData { fn validity(&self) -> &Validity { &self.validity } diff --git a/vortex-array/src/arrays/list/array.rs b/vortex-array/src/arrays/list/array.rs index d4148c4f480..4514b8fe688 100644 --- a/vortex-array/src/arrays/list/array.rs +++ b/vortex-array/src/arrays/list/array.rs @@ -27,6 +27,7 @@ use crate::match_each_native_ptype; use crate::scalar_fn::fns::operators::Operator; use crate::stats::ArrayStats; use crate::validity::Validity; +use crate::vtable::Array; /// A list array that stores variable-length lists of elements, similar to `Vec>`. /// @@ -81,7 +82,7 @@ use crate::validity::Validity; /// assert!(third_list.is_empty()); // [] /// ``` #[derive(Clone, Debug)] -pub struct ListArray { +pub struct ListData { pub(super) dtype: DType, pub(super) elements: ArrayRef, pub(super) offsets: ArrayRef, @@ -96,25 +97,25 @@ pub struct ListArrayParts { pub validity: Validity, } -impl ListArray { - /// Creates a new [`ListArray`]. +impl ListData { + /// Creates a new `ListArray`. /// /// # Panics /// /// Panics if the provided components do not satisfy the invariants documented - /// in [`ListArray::new_unchecked`]. + /// in `ListArray::new_unchecked`. pub fn new(elements: ArrayRef, offsets: ArrayRef, validity: Validity) -> Self { Self::try_new(elements, offsets, validity).vortex_expect("ListArray new") } /// Constructs a new `ListArray`. /// - /// See [`ListArray::new_unchecked`] for more information. + /// See `ListArray::new_unchecked` for more information. /// /// # Errors /// /// Returns an error if the provided components do not satisfy the invariants documented in - /// [`ListArray::new_unchecked`]. + /// `ListArray::new_unchecked`. pub fn try_new( elements: ArrayRef, offsets: ArrayRef, @@ -126,7 +127,7 @@ impl ListArray { Ok(unsafe { Self::new_unchecked(elements, offsets, validity) }) } - /// Creates a new [`ListArray`] without validation from these components: + /// Creates a new `ListArray` without validation from these components: /// /// * `elements` is a flat array containing all list elements concatenated. /// * `offsets` is an integer array where `offsets[i]` is the start index for list `i`. @@ -156,9 +157,9 @@ impl ListArray { } } - /// Validates the components that would be used to create a [`ListArray`]. + /// Validates the components that would be used to create a `ListArray`. /// - /// This function checks all the invariants required by [`ListArray::new_unchecked`]. + /// This function checks all the invariants required by `ListArray::new_unchecked`. pub fn validate( elements: &ArrayRef, offsets: &ArrayRef, @@ -251,6 +252,32 @@ impl ListArray { } } + /// Returns the dtype of the array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns the length of the array. + pub fn len(&self) -> usize { + self.offsets.len().saturating_sub(1) + } + + /// Returns `true` if the array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Returns the validity of the array. + #[allow(clippy::same_name_method)] + pub fn validity(&self) -> &Validity { + &self.validity + } + + /// Returns the validity as a [`Mask`](vortex_mask::Mask). + pub fn validity_mask(&self) -> vortex_mask::Mask { + self.validity.to_mask(self.len()) + } + /// Returns the offset at the given index from the list array. /// /// Returns an error if the index is out of bounds or scalar_at fails. @@ -313,9 +340,36 @@ impl ListArray { // where `reset_offsets` is infallible. // Also, `reset_offsets` can be made more efficient by replacing `sub_scalar` with a match on // the offset type and manual subtraction and fast path where `offsets[0] == 0`. +} + +impl Array { + /// Creates a new `ListArray`. + pub fn new(elements: ArrayRef, offsets: ArrayRef, validity: Validity) -> Self { + Array::try_from_data(ListData::new(elements, offsets, validity)) + .vortex_expect("ListData is always valid") + } + + /// Constructs a new `ListArray`. + pub fn try_new( + elements: ArrayRef, + offsets: ArrayRef, + validity: Validity, + ) -> VortexResult { + Array::try_from_data(ListData::try_new(elements, offsets, validity)?) + } + + /// Creates a new `ListArray` without validation. + /// + /// # Safety + /// + /// See [`ListData::new_unchecked`]. + pub unsafe fn new_unchecked(elements: ArrayRef, offsets: ArrayRef, validity: Validity) -> Self { + Array::try_from_data(unsafe { ListData::new_unchecked(elements, offsets, validity) }) + .vortex_expect("ListData is always valid") + } +} - /// Create a copy of this array by adjusting `offsets` to start at `0` and removing elements not - /// referenced by the `offsets`. +impl ListData { pub fn reset_offsets(&self, recurse: bool) -> VortexResult { let mut elements = self.sliced_elements()?; if recurse && elements.is_canonical() { diff --git a/vortex-array/src/arrays/list/compute/cast.rs b/vortex-array/src/arrays/list/compute/cast.rs index 1577ac2b9eb..ca4a6990479 100644 --- a/vortex-array/src/arrays/list/compute/cast.rs +++ b/vortex-array/src/arrays/list/compute/cast.rs @@ -10,10 +10,10 @@ use crate::arrays::ListArray; use crate::builtins::ArrayBuiltins; use crate::dtype::DType; use crate::scalar_fn::fns::cast::CastReduce; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl CastReduce for List { - fn cast(array: &ListArray, dtype: &DType) -> VortexResult> { + fn cast(array: &Array, dtype: &DType) -> VortexResult> { let Some(target_element_type) = dtype.as_list_element_opt() else { return Ok(None); }; diff --git a/vortex-array/src/arrays/list/compute/filter.rs b/vortex-array/src/arrays/list/compute/filter.rs index e2691c0e82e..73a2c39bcfd 100644 --- a/vortex-array/src/arrays/list/compute/filter.rs +++ b/vortex-array/src/arrays/list/compute/filter.rs @@ -23,7 +23,7 @@ use crate::arrays::filter::FilterKernel; use crate::dtype::IntegerPType; use crate::match_each_integer_ptype; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; /// Density threshold for choosing between indices and slices representation when expanding masks. /// @@ -94,7 +94,7 @@ fn process_element_range( impl FilterKernel for List { fn filter( - array: &ListArray, + array: &Array, mask: &Mask, ctx: &mut ExecutionCtx, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/list/compute/mask.rs b/vortex-array/src/arrays/list/compute/mask.rs index 46d5021033b..cc89fe8be24 100644 --- a/vortex-array/src/arrays/list/compute/mask.rs +++ b/vortex-array/src/arrays/list/compute/mask.rs @@ -9,10 +9,10 @@ use crate::arrays::List; use crate::arrays::ListArray; use crate::scalar_fn::fns::mask::MaskReduce; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl MaskReduce for List { - fn mask(array: &ListArray, mask: &ArrayRef) -> VortexResult> { + fn mask(array: &Array, mask: &ArrayRef) -> VortexResult> { ListArray::try_new( array.elements().clone(), array.offsets().clone(), diff --git a/vortex-array/src/arrays/list/compute/slice.rs b/vortex-array/src/arrays/list/compute/slice.rs index 46c571773ef..0c1f0ac9deb 100644 --- a/vortex-array/src/arrays/list/compute/slice.rs +++ b/vortex-array/src/arrays/list/compute/slice.rs @@ -10,10 +10,10 @@ use crate::IntoArray; use crate::arrays::List; use crate::arrays::ListArray; use crate::arrays::slice::SliceReduce; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl SliceReduce for List { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { Ok(Some( ListArray::new( array.elements().clone(), diff --git a/vortex-array/src/arrays/list/compute/take.rs b/vortex-array/src/arrays/list/compute/take.rs index ada95d3154a..b901a53f6f3 100644 --- a/vortex-array/src/arrays/list/compute/take.rs +++ b/vortex-array/src/arrays/list/compute/take.rs @@ -9,6 +9,7 @@ use crate::DynArray; use crate::IntoArray; use crate::arrays::List; use crate::arrays::ListArray; +use crate::arrays::Primitive; use crate::arrays::PrimitiveArray; use crate::arrays::dict::TakeExecute; use crate::builders::ArrayBuilder; @@ -18,7 +19,7 @@ use crate::dtype::Nullability; use crate::executor::ExecutionCtx; use crate::match_each_integer_ptype; use crate::match_smallest_offset_type; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; // TODO(connor)[ListView]: Re-revert to the version where we simply convert to a `ListView` and call // the `ListView::take` compute function once `ListView` is more stable. @@ -31,7 +32,7 @@ impl TakeExecute for List { /// non-contiguous indices would violate this requirement. #[expect(clippy::cognitive_complexity)] fn take( - array: &ListArray, + array: &Array, indices: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult> { @@ -50,8 +51,8 @@ impl TakeExecute for List { } fn _take( - array: &ListArray, - indices_array: &PrimitiveArray, + array: &Array, + indices_array: &Array, ctx: &mut ExecutionCtx, ) -> VortexResult { let data_validity = array.validity_mask()?; @@ -115,8 +116,8 @@ fn _take( } fn _take_nullable( - array: &ListArray, - indices_array: &PrimitiveArray, + array: &Array, + indices_array: &Array, ctx: &mut ExecutionCtx, ) -> VortexResult { let offsets_array = array.offsets().to_array().execute::(ctx)?; diff --git a/vortex-array/src/arrays/list/mod.rs b/vortex-array/src/arrays/list/mod.rs index 19dac621dbf..753a2a35758 100644 --- a/vortex-array/src/arrays/list/mod.rs +++ b/vortex-array/src/arrays/list/mod.rs @@ -2,8 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::ListArray; pub use array::ListArrayParts; +pub use array::ListData; +pub use vtable::ListArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/list/tests.rs b/vortex-array/src/arrays/list/tests.rs index c6b6b99246c..fd52d8207ed 100644 --- a/vortex-array/src/arrays/list/tests.rs +++ b/vortex-array/src/arrays/list/tests.rs @@ -912,8 +912,8 @@ fn test_recursive_compact_list_of_lists() { // Verify data integrity is preserved assert_eq!( - non_recursive.scalar_at(0).unwrap(), - recursive.scalar_at(0).unwrap() + non_recursive.clone().into_array().scalar_at(0).unwrap(), + recursive.clone().into_array().scalar_at(0).unwrap() ); } diff --git a/vortex-array/src/arrays/list/vtable/mod.rs b/vortex-array/src/arrays/list/vtable/mod.rs index 2749542d420..2b1d23519ca 100644 --- a/vortex-array/src/arrays/list/vtable/mod.rs +++ b/vortex-array/src/arrays/list/vtable/mod.rs @@ -18,7 +18,7 @@ use crate::ExecutionResult; use crate::IntoArray; use crate::Precision; use crate::ProstMetadata; -use crate::arrays::ListArray; +use crate::arrays::list::ListData; use crate::arrays::list::compute::PARENT_KERNELS; use crate::arrays::list::compute::rules::PARENT_RULES; use crate::arrays::listview::list_view_from_list; @@ -31,7 +31,7 @@ use crate::hash::ArrayHash; use crate::metadata::DeserializeMetadata; use crate::metadata::SerializeMetadata; use crate::serde::ArrayChildren; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::validity::Validity; use crate::vtable; use crate::vtable::Array; @@ -42,7 +42,7 @@ use crate::vtable::validity_nchildren; use crate::vtable::validity_to_child; mod operations; mod validity; -vtable!(List); +vtable!(List, List, ListData); #[derive(Clone, prost::Message)] pub struct ListMetadata { @@ -53,12 +53,12 @@ pub struct ListMetadata { } impl VTable for List { - type Array = ListArray; + type ArrayData = ListData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValidityHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &ListData) -> &Self { &List } @@ -66,49 +66,49 @@ impl VTable for List { Self::ID } - fn len(array: &ListArray) -> usize { + fn len(array: &ListData) -> usize { array.offsets.len().saturating_sub(1) } - fn dtype(array: &ListArray) -> &DType { + fn dtype(array: &ListData) -> &DType { &array.dtype } - fn stats(array: &ListArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &ListData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &ListArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.elements.array_hash(state, precision); array.offsets.array_hash(state, precision); array.validity.array_hash(state, precision); } - fn array_eq(array: &ListArray, other: &ListArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.elements.array_eq(&other.elements, precision) && array.offsets.array_eq(&other.offsets, precision) && array.validity.array_eq(&other.validity, precision) } - fn nbuffers(_array: &ListArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &ListArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("ListArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &ListArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { vortex_panic!("ListArray buffer_name index {idx} out of bounds") } - fn nchildren(array: &ListArray) -> usize { + fn nchildren(array: &Array) -> usize { 2 + validity_nchildren(&array.validity) } - fn child(array: &ListArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.elements().clone(), 1 => array.offsets().clone(), @@ -118,7 +118,7 @@ impl VTable for List { } } - fn child_name(_array: &ListArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "elements".to_string(), 1 => "offsets".to_string(), @@ -135,7 +135,7 @@ impl VTable for List { PARENT_RULES.evaluate(array, parent, child_idx) } - fn metadata(array: &ListArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(ListMetadata { elements_len: array.elements().len() as u64, offset_ptype: PType::try_from(array.offsets().dtype())? as i32, @@ -164,7 +164,7 @@ impl VTable for List { metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let validity = if children.len() == 2 { Validity::from(dtype.nullability()) } else if children.len() == 3 { @@ -189,10 +189,10 @@ impl VTable for List { len + 1, )?; - ListArray::try_new(elements, offsets, validity) + ListData::try_new(elements, offsets, validity) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 2 || children.len() == 3, "ListArray expects 2 or 3 children, got {}", @@ -212,14 +212,14 @@ impl VTable for List { Validity::from(array.dtype.nullability()) }; - let new_array = ListArray::try_new(elements, offsets, validity)?; + let new_array = ListData::try_new(elements, offsets, validity)?; *array = new_array; Ok(()) } fn execute(array: Arc>, ctx: &mut ExecutionCtx) -> VortexResult { Ok(ExecutionResult::done( - list_view_from_list(ListArray::clone(&array), ctx)?.into_array(), + list_view_from_list((*array).clone(), ctx)?.into_array(), )) } diff --git a/vortex-array/src/arrays/list/vtable/operations.rs b/vortex-array/src/arrays/list/vtable/operations.rs index dd938a36c4d..6f8095f0faf 100644 --- a/vortex-array/src/arrays/list/vtable/operations.rs +++ b/vortex-array/src/arrays/list/vtable/operations.rs @@ -7,12 +7,16 @@ use vortex_error::VortexResult; use crate::ExecutionCtx; use crate::arrays::List; -use crate::arrays::list::vtable::ListArray; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for List { - fn scalar_at(array: &ListArray, index: usize, _ctx: &mut ExecutionCtx) -> VortexResult { + fn scalar_at( + array: &Array, + index: usize, + _ctx: &mut ExecutionCtx, + ) -> VortexResult { // By the preconditions we know that the list scalar is not null. let elems = array.list_elements_at(index)?; let scalars: Vec = (0..elems.len()) diff --git a/vortex-array/src/arrays/list/vtable/validity.rs b/vortex-array/src/arrays/list/vtable/validity.rs index 49eebae5ce1..9347d69b78b 100644 --- a/vortex-array/src/arrays/list/vtable/validity.rs +++ b/vortex-array/src/arrays/list/vtable/validity.rs @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use crate::arrays::list::vtable::ListArray; +use crate::arrays::list::ListData; use crate::validity::Validity; use crate::vtable::ValidityHelper; -impl ValidityHelper for ListArray { +impl ValidityHelper for ListData { fn validity(&self) -> &Validity { &self.validity } diff --git a/vortex-array/src/arrays/listview/array.rs b/vortex-array/src/arrays/listview/array.rs index 3dfc9be786a..0973d078236 100644 --- a/vortex-array/src/arrays/listview/array.rs +++ b/vortex-array/src/arrays/listview/array.rs @@ -13,6 +13,7 @@ use vortex_error::vortex_err; use crate::ArrayRef; use crate::DynArray; use crate::ToCanonical; +use crate::arrays::ListView; use crate::arrays::Primitive; use crate::arrays::PrimitiveArray; use crate::arrays::bool; @@ -21,6 +22,7 @@ use crate::dtype::IntegerPType; use crate::match_each_integer_ptype; use crate::stats::ArrayStats; use crate::validity::Validity; +use crate::vtable::Array; /// The canonical encoding for variable-length list arrays. /// @@ -85,7 +87,7 @@ use crate::validity::Validity; /// /// [`ListArray`]: crate::arrays::ListArray #[derive(Clone, Debug)] -pub struct ListViewArray { +pub struct ListViewData { /// The [`DType`] of the list array. /// /// This type **must** be the variant [`DType::List`]. @@ -143,13 +145,13 @@ pub struct ListViewArrayParts { pub validity: Validity, } -impl ListViewArray { - /// Creates a new [`ListViewArray`]. +impl ListViewData { + /// Creates a new `ListViewArray`. /// /// # Panics /// /// Panics if the provided components do not satisfy the invariants documented - /// in [`ListViewArray::new_unchecked`]. + /// in `ListViewArray::new_unchecked`. pub fn new(elements: ArrayRef, offsets: ArrayRef, sizes: ArrayRef, validity: Validity) -> Self { Self::try_new(elements, offsets, sizes, validity) .vortex_expect("`ListViewArray` construction failed") @@ -160,7 +162,7 @@ impl ListViewArray { /// # Errors /// /// Returns an error if the provided components do not satisfy the invariants documented - /// in [`ListViewArray::new_unchecked`]. + /// in `ListViewArray::new_unchecked`. pub fn try_new( elements: ArrayRef, offsets: ArrayRef, @@ -180,7 +182,7 @@ impl ListViewArray { }) } - /// Creates a new [`ListViewArray`] without validation. + /// Creates a new `ListViewArray` without validation. /// /// This unsafe function does not check the validity of the data. Prefer calling [`new()`] or /// [`try_new()`] over this function, as they will check the validity of the data. @@ -221,7 +223,7 @@ impl ListViewArray { } } - /// Validates the components that would be used to create a [`ListViewArray`]. + /// Validates the components that would be used to create a `ListViewArray`. pub fn validate( elements: &ArrayRef, offsets: &ArrayRef, @@ -284,7 +286,7 @@ impl ListViewArray { Ok(()) } - /// Sets whether this [`ListViewArray`] is zero-copyable to a [`ListArray`]. + /// Sets whether this `ListViewArray` is zero-copyable to a [`ListArray`]. /// /// This is an optimization flag that enables more efficient conversion to [`ListArray`] without /// needing to copy or reorganize the data. @@ -293,7 +295,7 @@ impl ListViewArray { /// /// # Safety /// - /// When setting `is_zctl` to `true`, the caller must ensure that the [`ListViewArray`] is + /// When setting `is_zctl` to `true`, the caller must ensure that the `ListViewArray` is /// actually zero-copyable to a [`ListArray`]. This means: /// /// - Offsets must be sorted (but not strictly sorted, zero-length lists are allowed). @@ -352,11 +354,38 @@ impl ListViewArray { } } + /// Returns the dtype of the array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns the length of the array. + pub fn len(&self) -> usize { + debug_assert_eq!(self.offsets.len(), self.sizes.len()); + self.offsets.len() + } + + /// Returns `true` if the array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Returns the validity of the array. + #[allow(clippy::same_name_method)] + pub fn validity(&self) -> &Validity { + &self.validity + } + + /// Returns the validity as a [`Mask`](vortex_mask::Mask). + pub fn validity_mask(&self) -> vortex_mask::Mask { + self.validity.to_mask(self.len()) + } + /// Returns the offset at the given index. /// /// Note that it is possible the corresponding list view is null (which is only defined by the /// validity map). Regardless, we are still guaranteed that this offset is valid by the - /// invariants of [`ListViewArray`]. + /// invariants of `ListViewArray`. pub fn offset_at(&self, index: usize) -> usize { assert!( index < self.len(), @@ -383,7 +412,7 @@ impl ListViewArray { /// /// Note that it is possible the corresponding list view is null (which is only defined by the /// validity map). Regardless, we are still guaranteed that this size is valid by the invariants - /// of [`ListViewArray`]. + /// of `ListViewArray`. pub fn size_at(&self, index: usize) -> usize { assert!( index < self.len(), @@ -440,6 +469,51 @@ impl ListViewArray { } } +impl Array { + /// Creates a new `ListViewArray`. + pub fn new(elements: ArrayRef, offsets: ArrayRef, sizes: ArrayRef, validity: Validity) -> Self { + Array::try_from_data(ListViewData::new(elements, offsets, sizes, validity)) + .vortex_expect("ListViewData is always valid") + } + + /// Constructs a new `ListViewArray`. + pub fn try_new( + elements: ArrayRef, + offsets: ArrayRef, + sizes: ArrayRef, + validity: Validity, + ) -> VortexResult { + Array::try_from_data(ListViewData::try_new(elements, offsets, sizes, validity)?) + } + + /// Creates a new `ListViewArray` without validation. + /// + /// # Safety + /// + /// See [`ListViewData::new_unchecked`]. + pub unsafe fn new_unchecked( + elements: ArrayRef, + offsets: ArrayRef, + sizes: ArrayRef, + validity: Validity, + ) -> Self { + Array::try_from_data(unsafe { + ListViewData::new_unchecked(elements, offsets, sizes, validity) + }) + .vortex_expect("ListViewData is always valid") + } + + /// Mark whether this list view can be zero-copy converted to a list. + /// + /// # Safety + /// + /// See [`ListViewData::with_zero_copy_to_list`]. + pub unsafe fn with_zero_copy_to_list(self, is_zctl: bool) -> Self { + Array::try_from_data(unsafe { self.into_data().with_zero_copy_to_list(is_zctl) }) + .vortex_expect("data is always valid") + } +} + /// Helper function to validate `offsets` and `sizes` with specific types. fn validate_offsets_and_sizes( offsets_slice: &[O], @@ -491,7 +565,7 @@ where Ok(()) } -/// Helper function to validate if the [`ListViewArray`] components are actually zero-copyable to +/// Helper function to validate if the `ListViewArray` components are actually zero-copyable to /// [`ListArray`](crate::arrays::ListArray). fn validate_zctl( elements: &ArrayRef, diff --git a/vortex-array/src/arrays/listview/compute/cast.rs b/vortex-array/src/arrays/listview/compute/cast.rs index 06fb4f0bc8a..c7408087492 100644 --- a/vortex-array/src/arrays/listview/compute/cast.rs +++ b/vortex-array/src/arrays/listview/compute/cast.rs @@ -10,10 +10,10 @@ use crate::arrays::ListViewArray; use crate::builtins::ArrayBuiltins; use crate::dtype::DType; use crate::scalar_fn::fns::cast::CastReduce; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl CastReduce for ListView { - fn cast(array: &ListViewArray, dtype: &DType) -> VortexResult> { + fn cast(array: &Array, dtype: &DType) -> VortexResult> { // Check if we're casting to a `List` type. let Some(target_element_type) = dtype.as_list_element_opt() else { return Ok(None); diff --git a/vortex-array/src/arrays/listview/compute/mask.rs b/vortex-array/src/arrays/listview/compute/mask.rs index 5b486f5a542..3eb67b0e4b9 100644 --- a/vortex-array/src/arrays/listview/compute/mask.rs +++ b/vortex-array/src/arrays/listview/compute/mask.rs @@ -9,10 +9,10 @@ use crate::arrays::ListView; use crate::arrays::ListViewArray; use crate::scalar_fn::fns::mask::MaskReduce; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl MaskReduce for ListView { - fn mask(array: &ListViewArray, mask: &ArrayRef) -> VortexResult> { + fn mask(array: &Array, mask: &ArrayRef) -> VortexResult> { // SAFETY: masking the validity does not affect the invariants Ok(Some( unsafe { diff --git a/vortex-array/src/arrays/listview/compute/rules.rs b/vortex-array/src/arrays/listview/compute/rules.rs index 6eedee9d8f9..a04efb9ae65 100644 --- a/vortex-array/src/arrays/listview/compute/rules.rs +++ b/vortex-array/src/arrays/listview/compute/rules.rs @@ -16,7 +16,7 @@ use crate::optimizer::rules::ArrayParentReduceRule; use crate::optimizer::rules::ParentRuleSet; use crate::scalar_fn::fns::cast::CastReduceAdaptor; use crate::scalar_fn::fns::mask::MaskReduceAdaptor; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; pub(crate) const PARENT_RULES: ParentRuleSet = ParentRuleSet::new(&[ ParentRuleSet::lift(&ListViewFilterPushDown), @@ -34,7 +34,7 @@ impl ArrayParentReduceRule for ListViewFilterPushDown { fn reduce_parent( &self, - array: &ListViewArray, + array: &Array, parent: &FilterArray, _child_idx: usize, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/listview/compute/slice.rs b/vortex-array/src/arrays/listview/compute/slice.rs index be5855ce473..26bca8fba4d 100644 --- a/vortex-array/src/arrays/listview/compute/slice.rs +++ b/vortex-array/src/arrays/listview/compute/slice.rs @@ -10,16 +10,17 @@ use crate::IntoArray; use crate::arrays::ListView; use crate::arrays::ListViewArray; use crate::arrays::slice::SliceReduce; +use crate::vtable::Array; impl SliceReduce for ListView { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { Ok(Some( unsafe { ListViewArray::new_unchecked( array.elements().clone(), array.offsets().slice(range.clone())?, array.sizes().slice(range.clone())?, - array.validity()?.slice(range)?, + array.validity().slice(range)?, ) .with_zero_copy_to_list(array.is_zero_copy_to_list()) } diff --git a/vortex-array/src/arrays/listview/compute/take.rs b/vortex-array/src/arrays/listview/compute/take.rs index 0e6e7289579..8da6e204c0a 100644 --- a/vortex-array/src/arrays/listview/compute/take.rs +++ b/vortex-array/src/arrays/listview/compute/take.rs @@ -15,7 +15,7 @@ use crate::builtins::ArrayBuiltins; use crate::dtype::Nullability; use crate::match_each_integer_ptype; use crate::scalar::Scalar; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; // TODO(connor)[ListView]: Make use of this threshold after we start migrating operators. /// The threshold for triggering a rebuild of the [`ListViewArray`]. @@ -42,7 +42,7 @@ const REBUILD_DENSITY_THRESHOLD: f64 = 0.1; /// The trade-off is that we may keep unreferenced elements in memory, but this is acceptable since /// we're optimizing for read performance and the data isn't being copied. impl TakeReduce for ListView { - fn take(array: &ListViewArray, indices: &ArrayRef) -> VortexResult> { + fn take(array: &Array, indices: &ArrayRef) -> VortexResult> { let elements = array.elements(); let offsets = array.offsets(); let sizes = array.sizes(); diff --git a/vortex-array/src/arrays/listview/conversion.rs b/vortex-array/src/arrays/listview/conversion.rs index cddee9a2ec5..45027add335 100644 --- a/vortex-array/src/arrays/listview/conversion.rs +++ b/vortex-array/src/arrays/listview/conversion.rs @@ -23,11 +23,11 @@ use crate::builders::PrimitiveBuilder; use crate::dtype::IntegerPType; use crate::dtype::Nullability; use crate::match_each_integer_ptype; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; -/// Creates a [`ListViewArray`] from a [`ListArray`] by computing `sizes` from `offsets`. +/// Creates a `ListViewArray` from a `ListArray` by computing `sizes` from `offsets`. /// -/// The output [`ListViewArray`] will be zero-copyable back to a [`ListArray`], and additionally it +/// The output `ListViewArray` will be zero-copyable back to a `ListArray`, and additionally it /// will not have any leading or trailing garbage data. pub fn list_view_from_list(list: ListArray, ctx: &mut ExecutionCtx) -> VortexResult { // If the list is empty, create an empty `ListViewArray` with the same offset `DType` as the @@ -39,7 +39,8 @@ pub fn list_view_from_list(list: ListArray, ctx: &mut ExecutionCtx) -> VortexRes // We reset the offsets here because mostly for convenience, and also because callers of this // function might not expect the output `ListViewArray` to have a bunch of leading and trailing // garbage data when they turn it back into a `ListArray`. - let list = list.reset_offsets(false).vortex_expect("This can't fail"); + let list: ListArray = + Array::try_from_data(list.reset_offsets(false).vortex_expect("This can't fail"))?; let list_offsets = list.offsets().clone(); @@ -67,7 +68,7 @@ pub fn list_view_from_list(list: ListArray, ctx: &mut ExecutionCtx) -> VortexRes }) } -/// Builds a sizes array from a [`ListArray`] by computing differences between consecutive offsets. +/// Builds a sizes array from a `ListArray` by computing differences between consecutive offsets. fn build_sizes_from_offsets( list: &ListArray, ctx: &mut ExecutionCtx, @@ -99,13 +100,13 @@ fn build_sizes_from_offsets( // TODO(connor)[ListView]: Note that it is not exactly zero-copy because we have to add a single // offset at the end, but it is fast enough. -/// Creates a [`ListArray`] from a [`ListViewArray`]. The resulting [`ListArray`] will not have any +/// Creates a `ListArray` from a `ListViewArray`. The resulting `ListArray` will not have any /// leading or trailing garbage data. /// -/// If [`ListViewArray::is_zero_copy_to_list`] is `true`, then this operation is fast +/// If `ListViewArray::is_zero_copy_to_list` is `true`, then this operation is fast /// /// Otherwise, this function fall back to the (very) expensive path and will rebuild the -/// [`ListArray`] from scratch. +/// `ListArray` from scratch. pub fn list_from_list_view(list_view: ListViewArray) -> VortexResult { // Rebuild as zero-copyable to list array and also trim all leading and trailing elements. let zctl_array = list_view.rebuild(ListViewRebuildMode::MakeExact)?; @@ -131,12 +132,12 @@ pub fn list_from_list_view(list_view: ListViewArray) -> VortexResult // TODO(connor)[ListView]: We can optimize this by always keeping extra memory in `ListViewArray` // offsets for an `n+1`th offset. -/// Builds a [`ListArray`] offsets array from a [`ListViewArray`] by constructing `n+1` offsets. +/// Builds a `ListArray` offsets array from a `ListViewArray` by constructing `n+1` offsets. /// The last offset is computed as `last_offset + last_size`. /// /// # Safety /// -/// The [`ListViewArray`] must have offsets that are sorted, and every size must be equal to the gap +/// The `ListViewArray` must have offsets that are sorted, and every size must be equal to the gap /// between `offset[i]` and `offset[i + 1]`. unsafe fn build_list_offsets_from_list_view( list_view: &ListViewArray, @@ -178,7 +179,7 @@ unsafe fn build_list_offsets_from_list_view( offsets_builder.finish_into_primitive().into_array() } -/// Recursively converts all [`ListViewArray`]s to [`ListArray`]s in a nested array structure. +/// Recursively converts all `ListViewArray`s to `ListArray`s in a nested array structure. /// /// The conversion happens bottom-up, processing children before parents. pub fn recursive_list_from_list_view(array: ArrayRef) -> VortexResult { @@ -304,7 +305,6 @@ mod tests { use crate::assert_arrays_eq; use crate::dtype::FieldNames; use crate::validity::Validity; - use crate::vtable::ValidityHelper; #[test] fn test_list_to_listview_basic() -> VortexResult<()> { diff --git a/vortex-array/src/arrays/listview/mod.rs b/vortex-array/src/arrays/listview/mod.rs index dec40e6769d..4ca62ef0820 100644 --- a/vortex-array/src/arrays/listview/mod.rs +++ b/vortex-array/src/arrays/listview/mod.rs @@ -2,8 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::ListViewArray; pub use array::ListViewArrayParts; +pub use array::ListViewData; +pub use vtable::ListViewArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/listview/rebuild.rs b/vortex-array/src/arrays/listview/rebuild.rs index 0f094b40322..0456d2db619 100644 --- a/vortex-array/src/arrays/listview/rebuild.rs +++ b/vortex-array/src/arrays/listview/rebuild.rs @@ -23,7 +23,6 @@ use crate::dtype::PType; use crate::match_each_integer_ptype; use crate::scalar::Scalar; use crate::scalar_fn::fns::operators::Operator; -use crate::vtable::ValidityHelper; /// Modes for rebuilding a [`ListViewArray`]. pub enum ListViewRebuildMode { @@ -163,7 +162,7 @@ impl ListViewArray { let mut n_elements = NewOffset::zero(); for index in 0..len { - if !self.is_valid(index)? { + if !self.validity.is_valid(index)? { new_offsets.push(n_elements); new_sizes.push(S::zero()); continue; @@ -231,7 +230,7 @@ impl ListViewArray { let mut n_elements = NewOffset::zero(); for index in 0..len { - if !self.is_valid(index)? { + if !self.validity.is_valid(index)? { // For NULL lists, place them after the previous item's data to maintain the // no-overlap invariant for zero-copy to `ListArray` arrays. new_offsets.push(n_elements); @@ -382,7 +381,6 @@ mod tests { use crate::assert_arrays_eq; use crate::dtype::Nullability; use crate::validity::Validity; - use crate::vtable::ValidityHelper; #[test] fn test_rebuild_flatten_removes_overlaps() -> VortexResult<()> { diff --git a/vortex-array/src/arrays/listview/vtable/mod.rs b/vortex-array/src/arrays/listview/vtable/mod.rs index 4c710f39baa..72312dc5a46 100644 --- a/vortex-array/src/arrays/listview/vtable/mod.rs +++ b/vortex-array/src/arrays/listview/vtable/mod.rs @@ -18,7 +18,7 @@ use crate::ExecutionResult; use crate::Precision; use crate::ProstMetadata; use crate::SerializeMetadata; -use crate::arrays::ListViewArray; +use crate::arrays::listview::ListViewData; use crate::arrays::listview::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -27,7 +27,7 @@ use crate::dtype::PType; use crate::hash::ArrayEq; use crate::hash::ArrayHash; use crate::serde::ArrayChildren; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::validity::Validity; use crate::vtable; use crate::vtable::Array; @@ -38,7 +38,7 @@ use crate::vtable::validity_nchildren; use crate::vtable::validity_to_child; mod operations; mod validity; -vtable!(ListView); +vtable!(ListView, ListView, ListViewData); #[derive(Clone, Debug)] pub struct ListView; @@ -58,12 +58,12 @@ pub struct ListViewMetadata { } impl VTable for ListView { - type Array = ListViewArray; + type ArrayData = ListViewData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValidityHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &ListViewData) -> &Self { &ListView } @@ -71,24 +71,20 @@ impl VTable for ListView { Self::ID } - fn len(array: &ListViewArray) -> usize { + fn len(array: &ListViewData) -> usize { debug_assert_eq!(array.offsets().len(), array.sizes().len()); array.offsets().len() } - fn dtype(array: &ListViewArray) -> &DType { + fn dtype(array: &ListViewData) -> &DType { &array.dtype } - fn stats(array: &ListViewArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &ListViewData) -> &ArrayStats { + &array.stats_set } - fn array_hash( - array: &ListViewArray, - state: &mut H, - precision: Precision, - ) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.elements().array_hash(state, precision); array.offsets().array_hash(state, precision); @@ -96,7 +92,7 @@ impl VTable for ListView { array.validity.array_hash(state, precision); } - fn array_eq(array: &ListViewArray, other: &ListViewArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.elements().array_eq(other.elements(), precision) && array.offsets().array_eq(other.offsets(), precision) @@ -104,23 +100,23 @@ impl VTable for ListView { && array.validity.array_eq(&other.validity, precision) } - fn nbuffers(_array: &ListViewArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &ListViewArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("ListViewArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &ListViewArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { vortex_panic!("ListViewArray buffer_name index {idx} out of bounds") } - fn nchildren(array: &ListViewArray) -> usize { + fn nchildren(array: &Array) -> usize { 3 + validity_nchildren(&array.validity) } - fn child(array: &ListViewArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.elements().clone(), 1 => array.offsets().clone(), @@ -131,7 +127,7 @@ impl VTable for ListView { } } - fn child_name(_array: &ListViewArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "elements".to_string(), 1 => "offsets".to_string(), @@ -141,7 +137,7 @@ impl VTable for ListView { } } - fn metadata(array: &ListViewArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(ListViewMetadata { elements_len: array.elements().len() as u64, offset_ptype: PType::try_from(array.offsets().dtype())? as i32, @@ -170,7 +166,7 @@ impl VTable for ListView { metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { vortex_ensure!( buffers.is_empty(), "`ListViewArray::build` expects no buffers" @@ -213,10 +209,10 @@ impl VTable for ListView { len, )?; - ListViewArray::try_new(elements, offsets, sizes, validity) + ListViewData::try_new(elements, offsets, sizes, validity) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 3 || children.len() == 4, "ListViewArray expects 3 or 4 children, got {}", @@ -239,7 +235,7 @@ impl VTable for ListView { Validity::from(array.dtype.nullability()) }; - let new_array = ListViewArray::try_new(elements, offsets, sizes, validity)?; + let new_array = ListViewData::try_new(elements, offsets, sizes, validity)?; *array = new_array; Ok(()) } diff --git a/vortex-array/src/arrays/listview/vtable/operations.rs b/vortex-array/src/arrays/listview/vtable/operations.rs index 340a5ff5f06..e35fb210029 100644 --- a/vortex-array/src/arrays/listview/vtable/operations.rs +++ b/vortex-array/src/arrays/listview/vtable/operations.rs @@ -7,13 +7,13 @@ use vortex_error::VortexResult; use crate::ExecutionCtx; use crate::arrays::ListView; -use crate::arrays::listview::vtable::ListViewArray; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for ListView { fn scalar_at( - array: &ListViewArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { diff --git a/vortex-array/src/arrays/listview/vtable/validity.rs b/vortex-array/src/arrays/listview/vtable/validity.rs index 4a7fe9db11a..7d77f7fd8d2 100644 --- a/vortex-array/src/arrays/listview/vtable/validity.rs +++ b/vortex-array/src/arrays/listview/vtable/validity.rs @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use crate::arrays::listview::vtable::ListViewArray; +use crate::arrays::listview::ListViewData; use crate::validity::Validity; use crate::vtable::ValidityHelper; -impl ValidityHelper for ListViewArray { +impl ValidityHelper for ListViewData { fn validity(&self) -> &Validity { &self.validity } diff --git a/vortex-array/src/arrays/masked/array.rs b/vortex-array/src/arrays/masked/array.rs index 38317caacd7..02be15ceee2 100644 --- a/vortex-array/src/arrays/masked/array.rs +++ b/vortex-array/src/arrays/masked/array.rs @@ -5,19 +5,21 @@ use vortex_error::VortexResult; use vortex_error::vortex_bail; use crate::ArrayRef; +use crate::arrays::Masked; use crate::dtype::DType; use crate::stats::ArrayStats; use crate::validity::Validity; +use crate::vtable::Array; #[derive(Clone, Debug)] -pub struct MaskedArray { +pub struct MaskedData { pub(super) child: ArrayRef, pub(super) validity: Validity, pub(super) dtype: DType, pub(super) stats: ArrayStats, } -impl MaskedArray { +impl MaskedData { pub fn try_new(child: ArrayRef, validity: Validity) -> VortexResult { if matches!(validity, Validity::NonNullable) { vortex_bail!("MaskedArray must have nullable validity, got {validity:?}") @@ -45,7 +47,40 @@ impl MaskedArray { }) } + /// Returns the dtype of the array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns the length of the array. + pub fn len(&self) -> usize { + self.child.len() + } + + /// Returns `true` if the array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Returns the validity of the array. + #[allow(clippy::same_name_method)] + pub fn validity(&self) -> &Validity { + &self.validity + } + + /// Returns the validity as a [`Mask`](vortex_mask::Mask). + pub fn validity_mask(&self) -> vortex_mask::Mask { + self.validity.to_mask(self.len()) + } + pub fn child(&self) -> &ArrayRef { &self.child } } + +impl Array { + /// Constructs a new `MaskedArray`. + pub fn try_new(child: ArrayRef, validity: Validity) -> VortexResult { + Array::try_from_data(MaskedData::try_new(child, validity)?) + } +} diff --git a/vortex-array/src/arrays/masked/compute/filter.rs b/vortex-array/src/arrays/masked/compute/filter.rs index 31576a9c3ce..07d1b502f5a 100644 --- a/vortex-array/src/arrays/masked/compute/filter.rs +++ b/vortex-array/src/arrays/masked/compute/filter.rs @@ -9,10 +9,10 @@ use crate::IntoArray; use crate::arrays::Masked; use crate::arrays::MaskedArray; use crate::arrays::filter::FilterReduce; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl FilterReduce for Masked { - fn filter(array: &MaskedArray, mask: &Mask) -> VortexResult> { + fn filter(array: &Array, mask: &Mask) -> VortexResult> { // Filter the validity to get the new validity let filtered_validity = array.validity().filter(mask)?; diff --git a/vortex-array/src/arrays/masked/compute/mask.rs b/vortex-array/src/arrays/masked/compute/mask.rs index b0ad8b00be6..55266fb3497 100644 --- a/vortex-array/src/arrays/masked/compute/mask.rs +++ b/vortex-array/src/arrays/masked/compute/mask.rs @@ -5,16 +5,15 @@ use vortex_error::VortexResult; use crate::ArrayRef; use crate::arrays::Masked; -use crate::arrays::MaskedArray; use crate::arrays::scalar_fn::ScalarFnArrayExt; use crate::scalar_fn::EmptyOptions; use crate::scalar_fn::fns::mask::Mask as MaskExpr; use crate::scalar_fn::fns::mask::MaskReduce; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl MaskReduce for Masked { - fn mask(array: &MaskedArray, mask: &ArrayRef) -> VortexResult> { + fn mask(array: &Array, mask: &ArrayRef) -> VortexResult> { // AND the existing validity mask with the new mask and push into child. let combined_mask = array .validity() diff --git a/vortex-array/src/arrays/masked/compute/slice.rs b/vortex-array/src/arrays/masked/compute/slice.rs index eb81786c91b..f04961792ed 100644 --- a/vortex-array/src/arrays/masked/compute/slice.rs +++ b/vortex-array/src/arrays/masked/compute/slice.rs @@ -8,23 +8,15 @@ use vortex_error::VortexResult; use crate::ArrayRef; use crate::IntoArray; use crate::arrays::Masked; -use crate::arrays::MaskedArray; +use crate::arrays::MaskedData; use crate::arrays::slice::SliceReduce; -use crate::stats::ArrayStats; +use crate::vtable::Array; impl SliceReduce for Masked { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { let child = array.child.slice(range.clone())?; - let validity = array.validity.slice(range)?; + let validity = array.validity().clone().slice(range)?; - Ok(Some( - MaskedArray { - child, - validity, - dtype: array.dtype.clone(), - stats: ArrayStats::default(), - } - .into_array(), - )) + Ok(Some(MaskedData::try_new(child, validity)?.into_array())) } } diff --git a/vortex-array/src/arrays/masked/compute/take.rs b/vortex-array/src/arrays/masked/compute/take.rs index 2dad6672241..39c46cbc490 100644 --- a/vortex-array/src/arrays/masked/compute/take.rs +++ b/vortex-array/src/arrays/masked/compute/take.rs @@ -11,10 +11,10 @@ use crate::arrays::MaskedArray; use crate::arrays::dict::TakeReduce; use crate::builtins::ArrayBuiltins; use crate::scalar::Scalar; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl TakeReduce for Masked { - fn take(array: &MaskedArray, indices: &ArrayRef) -> VortexResult> { + fn take(array: &Array, indices: &ArrayRef) -> VortexResult> { let taken_child = if !indices.all_valid()? { // This is safe because we'll mask out these positions in the validity. let fill_scalar = Scalar::zero_value(indices.dtype()); diff --git a/vortex-array/src/arrays/masked/execute.rs b/vortex-array/src/arrays/masked/execute.rs index a1b49fedef5..fa41408fc83 100644 --- a/vortex-array/src/arrays/masked/execute.rs +++ b/vortex-array/src/arrays/masked/execute.rs @@ -24,7 +24,6 @@ use crate::dtype::Nullability; use crate::executor::ExecutionCtx; use crate::match_each_decimal_value_type; use crate::validity::Validity; -use crate::vtable::ValidityHelper; /// TODO: replace usage of compute fn. /// Apply a validity mask to a canonical array, ANDing with existing validity. @@ -132,7 +131,7 @@ fn mask_validity_varbinview( Ok(unsafe { VarBinViewArray::new_handle_unchecked( array.views_handle().clone(), - array.buffers().clone(), + array.data_buffers().clone(), dtype, new_validity, ) diff --git a/vortex-array/src/arrays/masked/mod.rs b/vortex-array/src/arrays/masked/mod.rs index 36de8fd05b0..3343468e593 100644 --- a/vortex-array/src/arrays/masked/mod.rs +++ b/vortex-array/src/arrays/masked/mod.rs @@ -2,7 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::MaskedArray; +pub use array::MaskedData; +pub use vtable::MaskedArray; pub(crate) mod compute; mod execute; diff --git a/vortex-array/src/arrays/masked/tests.rs b/vortex-array/src/arrays/masked/tests.rs index 6e3452b3568..2c723990d1b 100644 --- a/vortex-array/src/arrays/masked/tests.rs +++ b/vortex-array/src/arrays/masked/tests.rs @@ -47,7 +47,7 @@ fn test_canonical_dtype_matches_array_dtype() -> VortexResult<()> { let array = MaskedArray::try_new(child, Validity::AllValid).unwrap(); let canonical = array.to_canonical()?; - assert_eq!(canonical.as_ref().dtype(), array.dtype()); + assert_eq!(canonical.dtype(), array.dtype()); Ok(()) } @@ -101,11 +101,5 @@ fn test_masked_child_preserves_length(#[case] validity: Validity) { assert_eq!(array.len(), len); let mut ctx = LEGACY_SESSION.create_execution_ctx(); - assert!( - array - .validity() - .unwrap() - .mask_eq(&validity, &mut ctx) - .unwrap(), - ); + assert!(array.validity().mask_eq(&validity, &mut ctx).unwrap(),); } diff --git a/vortex-array/src/arrays/masked/vtable/canonical.rs b/vortex-array/src/arrays/masked/vtable/canonical.rs index 429af6f83ae..f0a995c9875 100644 --- a/vortex-array/src/arrays/masked/vtable/canonical.rs +++ b/vortex-array/src/arrays/masked/vtable/canonical.rs @@ -6,8 +6,8 @@ mod tests { use rstest::rstest; use vortex_error::VortexResult; + use crate::DynArray; use crate::IntoArray; - use crate::ToCanonical; use crate::arrays::MaskedArray; use crate::arrays::PrimitiveArray; use crate::dtype::Nullability; @@ -33,11 +33,8 @@ mod tests { #[case] expected_nullability: Nullability, ) -> VortexResult<()> { let canonical = array.to_canonical()?; - assert_eq!( - canonical.as_ref().dtype().nullability(), - expected_nullability - ); - assert_eq!(canonical.as_ref().dtype(), array.dtype()); + assert_eq!(canonical.dtype().nullability(), expected_nullability); + assert_eq!(canonical.dtype(), array.dtype()); Ok(()) } @@ -50,7 +47,7 @@ mod tests { .unwrap(); let canonical = array.to_canonical()?; - let prim = canonical.as_ref().to_primitive(); + let prim = canonical.into_primitive(); // Check that null positions match validity. assert_eq!(prim.valid_count().unwrap(), 3); @@ -71,11 +68,8 @@ mod tests { .unwrap(); let canonical = array.to_canonical()?; - assert_eq!(canonical.as_ref().valid_count().unwrap(), 3); - assert_eq!( - canonical.as_ref().dtype().nullability(), - Nullability::Nullable - ); + assert_eq!(canonical.to_array_ref().valid_count().unwrap(), 3); + assert_eq!(canonical.dtype().nullability(), Nullability::Nullable); Ok(()) } } diff --git a/vortex-array/src/arrays/masked/vtable/mod.rs b/vortex-array/src/arrays/masked/vtable/mod.rs index 526a6d42a4f..7f3062769ad 100644 --- a/vortex-array/src/arrays/masked/vtable/mod.rs +++ b/vortex-array/src/arrays/masked/vtable/mod.rs @@ -19,8 +19,8 @@ use crate::Canonical; use crate::EmptyMetadata; use crate::IntoArray; use crate::Precision; -use crate::arrays::ConstantArray; -use crate::arrays::MaskedArray; +use crate::arrays::ConstantData; +use crate::arrays::MaskedData; use crate::arrays::masked::compute::rules::PARENT_RULES; use crate::arrays::masked::mask_validity_canonical; use crate::buffer::BufferHandle; @@ -31,7 +31,7 @@ use crate::hash::ArrayEq; use crate::hash::ArrayHash; use crate::scalar::Scalar; use crate::serde::ArrayChildren; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::validity::Validity; use crate::vtable; use crate::vtable::Array; @@ -40,7 +40,7 @@ use crate::vtable::VTable; use crate::vtable::ValidityVTableFromValidityHelper; use crate::vtable::validity_nchildren; use crate::vtable::validity_to_child; -vtable!(Masked); +vtable!(Masked, Masked, MaskedData); #[derive(Clone, Debug)] pub struct Masked; @@ -50,13 +50,13 @@ impl Masked { } impl VTable for Masked { - type Array = MaskedArray; + type ArrayData = MaskedData; type Metadata = EmptyMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValidityHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Masked } @@ -64,47 +64,47 @@ impl VTable for Masked { Self::ID } - fn len(array: &MaskedArray) -> usize { + fn len(array: &MaskedData) -> usize { array.child.len() } - fn dtype(array: &MaskedArray) -> &DType { + fn dtype(array: &MaskedData) -> &DType { &array.dtype } - fn stats(array: &MaskedArray) -> StatsSetRef<'_> { - array.stats.to_ref(array.as_ref()) + fn stats(array: &MaskedData) -> &ArrayStats { + &array.stats } - fn array_hash(array: &MaskedArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.child.array_hash(state, precision); array.validity.array_hash(state, precision); array.dtype.hash(state); } - fn array_eq(array: &MaskedArray, other: &MaskedArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.child.array_eq(&other.child, precision) && array.validity.array_eq(&other.validity, precision) && array.dtype == other.dtype } - fn nbuffers(_array: &Self::Array) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &Self::Array, _idx: usize) -> BufferHandle { + fn buffer(_array: &Array, _idx: usize) -> BufferHandle { vortex_panic!("MaskedArray has no buffers") } - fn buffer_name(_array: &Self::Array, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(array: &Self::Array) -> usize { + fn nchildren(array: &Array) -> usize { 1 + validity_nchildren(&array.validity) } - fn child(array: &Self::Array, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.child.clone(), 1 => validity_to_child(&array.validity, array.child.len()) @@ -113,7 +113,7 @@ impl VTable for Masked { } } - fn child_name(_array: &Self::Array, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "child".to_string(), 1 => "validity".to_string(), @@ -121,7 +121,7 @@ impl VTable for Masked { } } - fn metadata(_array: &MaskedArray) -> VortexResult { + fn metadata(_array: &Array) -> VortexResult { Ok(EmptyMetadata) } @@ -145,7 +145,7 @@ impl VTable for Masked { _metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { if !buffers.is_empty() { vortex_bail!("Expected 0 buffer, got {}", buffers.len()); } @@ -164,7 +164,7 @@ impl VTable for Masked { ); }; - MaskedArray::try_new(child, validity) + MaskedData::try_new(child, validity) } fn execute(array: Arc>, ctx: &mut ExecutionCtx) -> VortexResult { @@ -173,7 +173,7 @@ impl VTable for Masked { // Fast path: all masked means result is all nulls. if validity_mask.all_false() { return Ok(ExecutionResult::done( - ConstantArray::new(Scalar::null(array.dtype().as_nullable()), array.len()) + ConstantData::new(Scalar::null(array.dtype().as_nullable()), array.len()) .into_array(), )); } @@ -198,7 +198,7 @@ impl VTable for Masked { PARENT_RULES.evaluate(array, parent, child_idx) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 1 || children.len() == 2, "MaskedArray expects 1 or 2 children, got {}", @@ -215,7 +215,7 @@ impl VTable for Masked { Validity::from(array.dtype.nullability()) }; - let new_array = MaskedArray::try_new(child, validity)?; + let new_array = MaskedData::try_new(child, validity)?; *array = new_array; Ok(()) } @@ -230,6 +230,7 @@ mod tests { use crate::ArrayContext; use crate::Canonical; + use crate::DynArray; use crate::IntoArray; use crate::LEGACY_SESSION; use crate::VortexSessionExecute; @@ -290,7 +291,7 @@ mod tests { assert!(decoded.is::()); assert_eq!( - array.as_ref().display_values().to_string(), + array.to_array().display_values().to_string(), decoded.display_values().to_string() ); } @@ -316,7 +317,7 @@ mod tests { let result: Canonical = array.into_array().execute(&mut ctx)?; assert_eq!( - result.as_ref().dtype().nullability(), + result.dtype().nullability(), Nullability::Nullable, "MaskedArray execute should produce Nullable dtype" ); diff --git a/vortex-array/src/arrays/masked/vtable/operations.rs b/vortex-array/src/arrays/masked/vtable/operations.rs index 5437bfde917..7406a315c90 100644 --- a/vortex-array/src/arrays/masked/vtable/operations.rs +++ b/vortex-array/src/arrays/masked/vtable/operations.rs @@ -3,16 +3,15 @@ use vortex_error::VortexResult; -use crate::DynArray; use crate::ExecutionCtx; use crate::arrays::Masked; -use crate::arrays::MaskedArray; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for Masked { fn scalar_at( - array: &MaskedArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { diff --git a/vortex-array/src/arrays/masked/vtable/validity.rs b/vortex-array/src/arrays/masked/vtable/validity.rs index 91b36534c66..25018a58688 100644 --- a/vortex-array/src/arrays/masked/vtable/validity.rs +++ b/vortex-array/src/arrays/masked/vtable/validity.rs @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use crate::arrays::MaskedArray; +use crate::arrays::MaskedData; use crate::validity::Validity; use crate::vtable::ValidityHelper; -impl ValidityHelper for MaskedArray { +impl ValidityHelper for MaskedData { fn validity(&self) -> &Validity { &self.validity } diff --git a/vortex-array/src/arrays/mod.rs b/vortex-array/src/arrays/mod.rs index 43f8a84d49e..ecc226ee77e 100644 --- a/vortex-array/src/arrays/mod.rs +++ b/vortex-array/src/arrays/mod.rs @@ -18,85 +18,106 @@ pub mod dict_test; pub mod bool; pub use bool::Bool; pub use bool::BoolArray; +pub use bool::BoolData; pub mod chunked; pub use chunked::Chunked; pub use chunked::ChunkedArray; +pub use chunked::ChunkedData; pub mod constant; pub use constant::Constant; pub use constant::ConstantArray; +pub use constant::ConstantData; pub mod datetime; pub use datetime::TemporalArray; +pub use datetime::TemporalData; pub mod decimal; pub use decimal::Decimal; pub use decimal::DecimalArray; +pub use decimal::DecimalData; pub mod dict; pub use dict::Dict; pub use dict::DictArray; +pub use dict::DictData; pub mod extension; pub use extension::Extension; pub use extension::ExtensionArray; +pub use extension::ExtensionData; pub mod filter; pub use filter::Filter; pub use filter::FilterArray; +pub use filter::FilterData; pub mod fixed_size_list; pub use fixed_size_list::FixedSizeList; pub use fixed_size_list::FixedSizeListArray; +pub use fixed_size_list::FixedSizeListData; pub mod list; pub use list::List; pub use list::ListArray; +pub use list::ListData; pub mod listview; pub use listview::ListView; pub use listview::ListViewArray; +pub use listview::ListViewData; pub mod masked; pub use masked::Masked; pub use masked::MaskedArray; +pub use masked::MaskedData; pub mod null; pub use null::Null; pub use null::NullArray; +pub use null::NullData; pub mod primitive; pub use primitive::Primitive; pub use primitive::PrimitiveArray; +pub use primitive::PrimitiveData; pub mod scalar_fn; pub use scalar_fn::ScalarFnArray; +pub use scalar_fn::ScalarFnData; pub use scalar_fn::ScalarFnVTable; pub mod shared; pub use shared::Shared; pub use shared::SharedArray; +pub use shared::SharedData; pub mod slice; pub use slice::Slice; pub use slice::SliceArray; +pub use slice::SliceData; pub mod struct_; pub use struct_::Struct; pub use struct_::StructArray; +pub use struct_::StructData; pub mod varbin; pub use varbin::VarBin; pub use varbin::VarBinArray; +pub use varbin::VarBinData; pub mod varbinview; pub use varbinview::VarBinView; pub use varbinview::VarBinViewArray; +pub use varbinview::VarBinViewData; pub mod variant; pub use variant::Variant; pub use variant::VariantArray; +pub use variant::VariantData; #[cfg(feature = "arbitrary")] pub mod arbitrary; diff --git a/vortex-array/src/arrays/null/compute/cast.rs b/vortex-array/src/arrays/null/compute/cast.rs index 15989cbe95e..b63bd5e7b26 100644 --- a/vortex-array/src/arrays/null/compute/cast.rs +++ b/vortex-array/src/arrays/null/compute/cast.rs @@ -8,13 +8,13 @@ use crate::ArrayRef; use crate::IntoArray; use crate::arrays::ConstantArray; use crate::arrays::Null; -use crate::arrays::NullArray; use crate::dtype::DType; use crate::scalar::Scalar; use crate::scalar_fn::fns::cast::CastReduce; +use crate::vtable::Array; impl CastReduce for Null { - fn cast(array: &NullArray, dtype: &DType) -> VortexResult> { + fn cast(array: &Array, dtype: &DType) -> VortexResult> { if !dtype.is_nullable() { vortex_bail!("Cannot cast Null to {}", dtype); } diff --git a/vortex-array/src/arrays/null/compute/filter.rs b/vortex-array/src/arrays/null/compute/filter.rs index fa27d267aca..bff66d9fd55 100644 --- a/vortex-array/src/arrays/null/compute/filter.rs +++ b/vortex-array/src/arrays/null/compute/filter.rs @@ -9,9 +9,10 @@ use crate::IntoArray; use crate::arrays::Null; use crate::arrays::NullArray; use crate::arrays::filter::FilterReduce; +use crate::vtable::Array; impl FilterReduce for Null { - fn filter(_array: &NullArray, mask: &Mask) -> VortexResult> { + fn filter(_array: &Array, mask: &Mask) -> VortexResult> { Ok(Some(NullArray::new(mask.true_count()).into_array())) } } diff --git a/vortex-array/src/arrays/null/compute/mask.rs b/vortex-array/src/arrays/null/compute/mask.rs index 8fcbe55c6ee..571bd06d5d3 100644 --- a/vortex-array/src/arrays/null/compute/mask.rs +++ b/vortex-array/src/arrays/null/compute/mask.rs @@ -6,11 +6,11 @@ use vortex_error::VortexResult; use crate::ArrayRef; use crate::IntoArray; use crate::arrays::Null; -use crate::arrays::NullArray; use crate::scalar_fn::fns::mask::MaskReduce; +use crate::vtable::Array; impl MaskReduce for Null { - fn mask(array: &NullArray, _mask: &ArrayRef) -> VortexResult> { + fn mask(array: &Array, _mask: &ArrayRef) -> VortexResult> { // Null array is already all nulls, masking has no effect. Ok(Some(array.clone().into_array())) } diff --git a/vortex-array/src/arrays/null/compute/mod.rs b/vortex-array/src/arrays/null/compute/mod.rs index 55fcf7b120b..f904486236e 100644 --- a/vortex-array/src/arrays/null/compute/mod.rs +++ b/vortex-array/src/arrays/null/compute/mod.rs @@ -14,6 +14,7 @@ mod test { use vortex_buffer::buffer; use vortex_mask::Mask; + use crate::DynArray; use crate::IntoArray; use crate::ToCanonical; use crate::arrays::NullArray; @@ -29,7 +30,10 @@ mod test { let sliced = nulls.slice(0..4).unwrap().to_null(); assert_eq!(sliced.len(), 4); - assert!(matches!(sliced.validity_mask().unwrap(), Mask::AllFalse(4))); + assert!(matches!( + DynArray::validity_mask(&sliced).unwrap(), + Mask::AllFalse(4) + )); } #[test] @@ -41,7 +45,10 @@ mod test { .to_null(); assert_eq!(taken.len(), 5); - assert!(matches!(taken.validity_mask().unwrap(), Mask::AllFalse(5))); + assert!(matches!( + DynArray::validity_mask(&taken).unwrap(), + Mask::AllFalse(5) + )); } #[test] diff --git a/vortex-array/src/arrays/null/compute/slice.rs b/vortex-array/src/arrays/null/compute/slice.rs index bcc7b13e953..4f7854eb73a 100644 --- a/vortex-array/src/arrays/null/compute/slice.rs +++ b/vortex-array/src/arrays/null/compute/slice.rs @@ -10,9 +10,10 @@ use crate::IntoArray; use crate::arrays::Null; use crate::arrays::NullArray; use crate::arrays::slice::SliceReduce; +use crate::vtable::Array; impl SliceReduce for Null { - fn slice(_array: &Self::Array, range: Range) -> VortexResult> { + fn slice(_array: &Array, range: Range) -> VortexResult> { Ok(Some(NullArray::new(range.len()).into_array())) } } diff --git a/vortex-array/src/arrays/null/compute/take.rs b/vortex-array/src/arrays/null/compute/take.rs index 73d16d0442c..ae7bbb323e1 100644 --- a/vortex-array/src/arrays/null/compute/take.rs +++ b/vortex-array/src/arrays/null/compute/take.rs @@ -13,10 +13,11 @@ use crate::arrays::dict::TakeReduce; use crate::arrays::dict::TakeReduceAdaptor; use crate::match_each_integer_ptype; use crate::optimizer::rules::ParentRuleSet; +use crate::vtable::Array; impl TakeReduce for Null { #[allow(clippy::cast_possible_truncation)] - fn take(array: &NullArray, indices: &ArrayRef) -> VortexResult> { + fn take(array: &Array, indices: &ArrayRef) -> VortexResult> { let indices = indices.to_primitive(); // Enforce all indices are valid diff --git a/vortex-array/src/arrays/null/mod.rs b/vortex-array/src/arrays/null/mod.rs index 24bb83b0580..71da96cf6c2 100644 --- a/vortex-array/src/arrays/null/mod.rs +++ b/vortex-array/src/arrays/null/mod.rs @@ -4,6 +4,7 @@ use std::hash::Hash; use std::sync::Arc; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_panic; @@ -20,7 +21,6 @@ use crate::dtype::DType; use crate::scalar::Scalar; use crate::serde::ArrayChildren; use crate::stats::ArrayStats; -use crate::stats::StatsSetRef; use crate::validity::Validity; use crate::vtable; use crate::vtable::Array; @@ -31,16 +31,16 @@ use crate::vtable::ValidityVTable; pub(crate) mod compute; -vtable!(Null); +vtable!(Null, Null, NullData); impl VTable for Null { - type Array = NullArray; + type ArrayData = NullData; type Metadata = EmptyMetadata; type OperationsVTable = Self; type ValidityVTable = Self; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Null } @@ -48,51 +48,51 @@ impl VTable for Null { Self::ID } - fn len(array: &NullArray) -> usize { + fn len(array: &NullData) -> usize { array.len } - fn dtype(_array: &NullArray) -> &DType { + fn dtype(_array: &NullData) -> &DType { &DType::Null } - fn stats(array: &NullArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &NullData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &NullArray, state: &mut H, _precision: Precision) { + fn array_hash(array: &Array, state: &mut H, _precision: Precision) { array.len.hash(state); } - fn array_eq(array: &NullArray, other: &NullArray, _precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, _precision: Precision) -> bool { array.len == other.len } - fn nbuffers(_array: &NullArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &NullArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("NullArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &NullArray, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(_array: &NullArray) -> usize { + fn nchildren(_array: &Array) -> usize { 0 } - fn child(_array: &NullArray, idx: usize) -> ArrayRef { + fn child(_array: &Array, idx: usize) -> ArrayRef { vortex_panic!("NullArray child index {idx} out of bounds") } - fn child_name(_array: &NullArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { vortex_panic!("NullArray child_name index {idx} out of bounds") } - fn metadata(_array: &NullArray) -> VortexResult { + fn metadata(_array: &Array) -> VortexResult { Ok(EmptyMetadata) } @@ -116,11 +116,11 @@ impl VTable for Null { _metadata: &Self::Metadata, _buffers: &[BufferHandle], _children: &dyn ArrayChildren, - ) -> VortexResult { - Ok(NullArray::new(len)) + ) -> VortexResult { + Ok(NullData::new(len)) } - fn with_children(_array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(_array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.is_empty(), "NullArray has no children, got {}", @@ -170,7 +170,7 @@ impl VTable for Null { /// # } /// ``` #[derive(Clone, Debug)] -pub struct NullArray { +pub struct NullData { len: usize, stats_set: ArrayStats, } @@ -182,17 +182,38 @@ impl Null { pub const ID: ArrayId = ArrayId::new_ref("vortex.null"); } -impl NullArray { +impl Array { + pub fn new(len: usize) -> Self { + Array::try_from_data(NullData::new(len)).vortex_expect("NullData is always valid") + } +} + +impl NullData { pub fn new(len: usize) -> Self { Self { len, stats_set: Default::default(), } } + + /// Returns the dtype of the array (always [`DType::Null`]). + pub fn dtype(&self) -> &DType { + &DType::Null + } + + /// Returns the length of the array. + pub fn len(&self) -> usize { + self.len + } + + /// Returns `true` if the array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } } impl OperationsVTable for Null { fn scalar_at( - _array: &NullArray, + _array: &Array, _index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -201,7 +222,7 @@ impl OperationsVTable for Null { } impl ValidityVTable for Null { - fn validity(_array: &NullArray) -> VortexResult { + fn validity(_array: &Array) -> VortexResult { Ok(Validity::AllInvalid) } } diff --git a/vortex-array/src/arrays/primitive/array/accessor.rs b/vortex-array/src/arrays/primitive/array/accessor.rs index a3b251e8b5f..26f284eb9e0 100644 --- a/vortex-array/src/arrays/primitive/array/accessor.rs +++ b/vortex-array/src/arrays/primitive/array/accessor.rs @@ -8,7 +8,6 @@ use crate::accessor::ArrayAccessor; use crate::arrays::PrimitiveArray; use crate::dtype::NativePType; use crate::validity::Validity; -use crate::vtable::ValidityHelper; impl ArrayAccessor for PrimitiveArray { fn with_iterator(&self, f: F) -> R diff --git a/vortex-array/src/arrays/primitive/array/cast.rs b/vortex-array/src/arrays/primitive/array/cast.rs index bb900863949..c8b0468d4cb 100644 --- a/vortex-array/src/arrays/primitive/array/cast.rs +++ b/vortex-array/src/arrays/primitive/array/cast.rs @@ -16,7 +16,6 @@ use crate::builtins::ArrayBuiltins; use crate::dtype::DType; use crate::dtype::NativePType; use crate::dtype::PType; -use crate::vtable::ValidityHelper; impl PrimitiveArray { /// Return a slice of the array's buffer. diff --git a/vortex-array/src/arrays/primitive/array/conversion.rs b/vortex-array/src/arrays/primitive/array/conversion.rs index b01988674c4..444b79dfe41 100644 --- a/vortex-array/src/arrays/primitive/array/conversion.rs +++ b/vortex-array/src/arrays/primitive/array/conversion.rs @@ -54,35 +54,18 @@ impl PrimitiveArray { /// Consume the array and get a host Buffer containing the data values. pub fn into_buffer(self) -> Buffer { - if T::PTYPE != self.ptype() { - vortex_panic!( - "Attempted to get buffer of type {} from array of type {}", - T::PTYPE, - self.ptype() - ) - } - - Buffer::from_byte_buffer(self.buffer.into_host_sync()) + self.into_data().into_buffer() } /// Extract a mutable buffer from the PrimitiveArray. Attempts to do this with zero-copy /// if the buffer is uniquely owned, otherwise will make a copy. pub fn into_buffer_mut(self) -> BufferMut { - self.try_into_buffer_mut() - .unwrap_or_else(|buffer| BufferMut::::copy_from(&buffer)) + self.into_data().into_buffer_mut() } /// Try to extract a mutable buffer from the PrimitiveArray with zero copy. pub fn try_into_buffer_mut(self) -> Result, Buffer> { - if T::PTYPE != self.ptype() { - vortex_panic!( - "Attempted to get buffer_mut of type {} from array of type {}", - T::PTYPE, - self.ptype() - ) - } - let buffer = Buffer::::from_byte_buffer(self.buffer.into_host_sync()); - buffer.try_into_mut() + self.into_data().try_into_buffer_mut() } } diff --git a/vortex-array/src/arrays/primitive/array/mod.rs b/vortex-array/src/arrays/primitive/array/mod.rs index 37c9b475800..faf0fa8143d 100644 --- a/vortex-array/src/arrays/primitive/array/mod.rs +++ b/vortex-array/src/arrays/primitive/array/mod.rs @@ -11,8 +11,10 @@ use vortex_buffer::ByteBufferMut; use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_err; +use vortex_error::vortex_panic; use crate::ToCanonical; +use crate::arrays::Primitive; use crate::dtype::DType; use crate::dtype::NativePType; use crate::dtype::Nullability; @@ -20,7 +22,7 @@ use crate::dtype::PType; use crate::match_each_native_ptype; use crate::stats::ArrayStats; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; mod accessor; mod cast; @@ -69,7 +71,7 @@ use crate::buffer::BufferHandle; /// # } /// ``` #[derive(Clone, Debug)] -pub struct PrimitiveArray { +pub struct PrimitiveData { pub(super) dtype: DType, pub(super) buffer: BufferHandle, pub(super) validity: Validity, @@ -83,7 +85,7 @@ pub struct PrimitiveArrayParts { } // TODO(connor): There are a lot of places where we could be using `new_unchecked` in the codebase. -impl PrimitiveArray { +impl PrimitiveData { /// Create a new array from a buffer handle. /// /// # Safety @@ -103,12 +105,12 @@ impl PrimitiveArray { } } - /// Creates a new [`PrimitiveArray`]. + /// Creates a new `PrimitiveArray`. /// /// # Panics /// /// Panics if the provided components do not satisfy the invariants documented - /// in [`PrimitiveArray::new_unchecked`]. + /// in `PrimitiveArray::new_unchecked`. pub fn new(buffer: impl Into>, validity: Validity) -> Self { let buffer = buffer.into(); Self::try_new(buffer, validity).vortex_expect("PrimitiveArray construction failed") @@ -116,12 +118,12 @@ impl PrimitiveArray { /// Constructs a new `PrimitiveArray`. /// - /// See [`PrimitiveArray::new_unchecked`] for more information. + /// See `PrimitiveArray::new_unchecked` for more information. /// /// # Errors /// /// Returns an error if the provided components do not satisfy the invariants documented in - /// [`PrimitiveArray::new_unchecked`]. + /// `PrimitiveArray::new_unchecked`. #[inline] pub fn try_new(buffer: Buffer, validity: Validity) -> VortexResult { Self::validate(&buffer, &validity)?; @@ -130,7 +132,7 @@ impl PrimitiveArray { Ok(unsafe { Self::new_unchecked(buffer, validity) }) } - /// Creates a new [`PrimitiveArray`] without validation from these components: + /// Creates a new `PrimitiveArray` without validation from these components: /// /// * `buffer` is a typed buffer containing the primitive values. /// * `validity` holds the null values. @@ -156,9 +158,9 @@ impl PrimitiveArray { } } - /// Validates the components that would be used to create a [`PrimitiveArray`]. + /// Validates the components that would be used to create a `PrimitiveArray`. /// - /// This function checks all the invariants required by [`PrimitiveArray::new_unchecked`]. + /// This function checks all the invariants required by `PrimitiveArray::new_unchecked`. #[inline] pub fn validate(buffer: &Buffer, validity: &Validity) -> VortexResult<()> { if let Some(len) = validity.maybe_len() @@ -179,7 +181,88 @@ impl PrimitiveArray { } } -impl PrimitiveArray { +impl Array { + pub fn empty(nullability: Nullability) -> Self { + Array::try_from_data(PrimitiveData::empty::(nullability)) + .vortex_expect("PrimitiveData is always valid") + } + + /// Creates a new `PrimitiveArray`. + /// + /// # Panics + /// + /// Panics if the provided components do not satisfy the invariants. + pub fn new(buffer: impl Into>, validity: Validity) -> Self { + Array::try_from_data(PrimitiveData::new(buffer, validity)) + .vortex_expect("PrimitiveData is always valid") + } + + /// Constructs a new `PrimitiveArray`. + pub fn try_new(buffer: Buffer, validity: Validity) -> VortexResult { + Array::try_from_data(PrimitiveData::try_new(buffer, validity)?) + } + + /// Creates a new `PrimitiveArray` without validation. + /// + /// # Safety + /// + /// See [`PrimitiveData::new_unchecked`]. + pub unsafe fn new_unchecked(buffer: Buffer, validity: Validity) -> Self { + Array::try_from_data(unsafe { PrimitiveData::new_unchecked(buffer, validity) }) + .vortex_expect("PrimitiveData is always valid") + } + + /// Create a new array from a buffer handle. + /// + /// # Safety + /// + /// See [`PrimitiveData::new_unchecked_from_handle`]. + pub unsafe fn new_unchecked_from_handle( + handle: BufferHandle, + ptype: PType, + validity: Validity, + ) -> Self { + Array::try_from_data(unsafe { + PrimitiveData::new_unchecked_from_handle(handle, ptype, validity) + }) + .vortex_expect("PrimitiveData is always valid") + } + + /// Creates a new `PrimitiveArray` from a [`BufferHandle`]. + pub fn from_buffer_handle(handle: BufferHandle, ptype: PType, validity: Validity) -> Self { + Array::try_from_data(PrimitiveData::from_buffer_handle(handle, ptype, validity)) + .vortex_expect("PrimitiveData is always valid") + } + + /// Creates a new `PrimitiveArray` from a [`ByteBuffer`]. + pub fn from_byte_buffer(buffer: ByteBuffer, ptype: PType, validity: Validity) -> Self { + Array::try_from_data(PrimitiveData::from_byte_buffer(buffer, ptype, validity)) + .vortex_expect("PrimitiveData is always valid") + } + + /// Create a PrimitiveArray from a byte buffer containing only the valid elements. + pub fn from_values_byte_buffer( + valid_elems_buffer: ByteBuffer, + ptype: PType, + validity: Validity, + n_rows: usize, + ) -> Self { + Array::try_from_data(PrimitiveData::from_values_byte_buffer( + valid_elems_buffer, + ptype, + validity, + n_rows, + )) + .vortex_expect("PrimitiveData is always valid") + } + + /// Validates the components that would be used to create a `PrimitiveArray`. + pub fn validate(buffer: &Buffer, validity: &Validity) -> VortexResult<()> { + PrimitiveData::validate(buffer, validity) + } +} + +impl PrimitiveData { /// Consume the primitive array and returns its component parts. pub fn into_parts(self) -> PrimitiveArrayParts { let ptype = self.ptype(); @@ -191,7 +274,33 @@ impl PrimitiveArray { } } -impl PrimitiveArray { +impl PrimitiveData { + /// Returns the dtype of the array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns the length of the array. + pub fn len(&self) -> usize { + self.buffer.len() / self.ptype().byte_width() + } + + /// Returns `true` if the array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Returns the validity of the array. + #[allow(clippy::same_name_method)] + pub fn validity(&self) -> &Validity { + &self.validity + } + + /// Returns the validity as a [`Mask`](vortex_mask::Mask). + pub fn validity_mask(&self) -> vortex_mask::Mask { + self.validity.to_mask(self.len()) + } + pub fn ptype(&self) -> PType { self.dtype().as_ptype() } @@ -244,13 +353,27 @@ impl PrimitiveArray { Self::from_byte_buffer(buffer, ptype, validity) } + /// Get a buffer in host memory holding all the values. + /// + /// NOTE: some values may be nonsense if the validity buffer indicates that the value is null. + pub fn to_buffer(&self) -> Buffer { + if T::PTYPE != self.ptype() { + vortex_panic!( + "Attempted to get buffer of type {} from array of type {}", + T::PTYPE, + self.ptype() + ) + } + Buffer::from_byte_buffer(self.buffer_handle().to_host_sync()) + } + /// Map each element in the array to a new value. /// /// This ignores validity and maps over all maybe-null elements. /// /// TODO(ngates): we could be smarter here if validity is sparse and only run the function /// over the valid elements. - pub fn map_each(self, f: F) -> PrimitiveArray + pub fn map_each(self, f: F) -> Self where T: NativePType, R: NativePType, @@ -261,14 +384,14 @@ impl PrimitiveArray { Ok(buffer_mut) => buffer_mut.map_each_in_place(f), Err(buffer) => BufferMut::from_iter(buffer.iter().copied().map(f)), }; - PrimitiveArray::new(buffer.freeze(), validity) + PrimitiveData::new(buffer.freeze(), validity) } /// Map each element in the array to a new value. /// /// This doesn't ignore validity and maps over all maybe-null elements, with a bool true if /// valid and false otherwise. - pub fn map_each_with_validity(self, f: F) -> VortexResult + pub fn map_each_with_validity(self, f: F) -> VortexResult where T: NativePType, R: NativePType, @@ -290,6 +413,38 @@ impl PrimitiveArray { BufferMut::::from_iter(buf_iter.zip(val.iter()).map(f)) } }; - Ok(PrimitiveArray::new(buffer.freeze(), validity.clone())) + Ok(PrimitiveData::new(buffer.freeze(), validity.clone())) + } + + /// Consume the array and get a host Buffer containing the data values. + pub fn into_buffer(self) -> Buffer { + if T::PTYPE != self.ptype() { + vortex_panic!( + "Attempted to get buffer of type {} from array of type {}", + T::PTYPE, + self.ptype() + ) + } + Buffer::from_byte_buffer(self.buffer.into_host_sync()) + } + + /// Extract a mutable buffer from the PrimitiveData. Attempts to do this with zero-copy + /// if the buffer is uniquely owned, otherwise will make a copy. + pub fn into_buffer_mut(self) -> BufferMut { + self.try_into_buffer_mut() + .unwrap_or_else(|buffer| BufferMut::::copy_from(&buffer)) + } + + /// Try to extract a mutable buffer from the PrimitiveData with zero copy. + pub fn try_into_buffer_mut(self) -> Result, Buffer> { + if T::PTYPE != self.ptype() { + vortex_panic!( + "Attempted to get buffer_mut of type {} from array of type {}", + T::PTYPE, + self.ptype() + ) + } + let buffer = Buffer::::from_byte_buffer(self.buffer.into_host_sync()); + buffer.try_into_mut() } } diff --git a/vortex-array/src/arrays/primitive/array/patch.rs b/vortex-array/src/arrays/primitive/array/patch.rs index 29e04e63f9c..72f351ccfaf 100644 --- a/vortex-array/src/arrays/primitive/array/patch.rs +++ b/vortex-array/src/arrays/primitive/array/patch.rs @@ -16,7 +16,6 @@ use crate::match_each_native_ptype; use crate::patches::PATCH_CHUNK_SIZE; use crate::patches::Patches; use crate::validity::Validity; -use crate::vtable::ValidityHelper; impl PrimitiveArray { pub fn patch(self, patches: &Patches, ctx: &mut ExecutionCtx) -> VortexResult { diff --git a/vortex-array/src/arrays/primitive/array/top_value.rs b/vortex-array/src/arrays/primitive/array/top_value.rs index 85e967383df..2f325bbd8a7 100644 --- a/vortex-array/src/arrays/primitive/array/top_value.rs +++ b/vortex-array/src/arrays/primitive/array/top_value.rs @@ -15,6 +15,7 @@ use crate::arrays::primitive::NativeValue; use crate::dtype::NativePType; use crate::match_each_native_ptype; use crate::scalar::PValue; +use crate::validity::Validity; impl PrimitiveArray { /// Compute most common present value of this array @@ -23,7 +24,7 @@ impl PrimitiveArray { return Ok(None); } - if self.all_invalid()? { + if matches!(self.validity(), Validity::AllInvalid) { return Ok(None); } diff --git a/vortex-array/src/arrays/primitive/compute/between.rs b/vortex-array/src/arrays/primitive/compute/between.rs index a0ae640766d..f3985c9ace2 100644 --- a/vortex-array/src/arrays/primitive/compute/between.rs +++ b/vortex-array/src/arrays/primitive/compute/between.rs @@ -9,18 +9,17 @@ use crate::ExecutionCtx; use crate::IntoArray; use crate::arrays::BoolArray; use crate::arrays::Primitive; -use crate::arrays::PrimitiveArray; use crate::dtype::NativePType; use crate::dtype::Nullability; use crate::match_each_native_ptype; use crate::scalar_fn::fns::between::BetweenKernel; use crate::scalar_fn::fns::between::BetweenOptions; use crate::scalar_fn::fns::between::StrictComparison; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl BetweenKernel for Primitive { fn between( - arr: &PrimitiveArray, + arr: &Array, lower: &ArrayRef, upper: &ArrayRef, options: &BetweenOptions, @@ -49,7 +48,7 @@ impl BetweenKernel for Primitive { } fn between_impl( - arr: &PrimitiveArray, + arr: &Array, lower: T, upper: T, nullability: Nullability, @@ -93,7 +92,7 @@ fn between_impl( } fn between_impl_( - arr: &PrimitiveArray, + arr: &Array, lower: T, lower_fn: impl Fn(T, T) -> bool, upper: T, diff --git a/vortex-array/src/arrays/primitive/compute/cast.rs b/vortex-array/src/arrays/primitive/compute/cast.rs index 17d6c20d7df..960c864f446 100644 --- a/vortex-array/src/arrays/primitive/compute/cast.rs +++ b/vortex-array/src/arrays/primitive/compute/cast.rs @@ -21,11 +21,11 @@ use crate::dtype::Nullability; use crate::dtype::PType; use crate::match_each_native_ptype; use crate::scalar_fn::fns::cast::CastKernel; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl CastKernel for Primitive { fn cast( - array: &PrimitiveArray, + array: &Array, dtype: &DType, ctx: &mut ExecutionCtx, ) -> VortexResult> { @@ -92,7 +92,7 @@ impl CastKernel for Primitive { } /// Returns `true` if all valid values in `array` are representable as `target_ptype`. -fn values_fit_in(array: &PrimitiveArray, target_ptype: PType, ctx: &mut ExecutionCtx) -> bool { +fn values_fit_in(array: &Array, target_ptype: PType, ctx: &mut ExecutionCtx) -> bool { let target_dtype = DType::Primitive(target_ptype, Nullability::NonNullable); aggregate_fn::fns::min_max::min_max(&array.clone().into_array(), ctx) .ok() @@ -144,7 +144,6 @@ mod test { use crate::dtype::Nullability; use crate::dtype::PType; use crate::validity::Validity; - use crate::vtable::ValidityHelper; #[allow(clippy::cognitive_complexity)] #[test] diff --git a/vortex-array/src/arrays/primitive/compute/fill_null.rs b/vortex-array/src/arrays/primitive/compute/fill_null.rs index 8889c82c483..651e3a20462 100644 --- a/vortex-array/src/arrays/primitive/compute/fill_null.rs +++ b/vortex-array/src/arrays/primitive/compute/fill_null.rs @@ -16,11 +16,11 @@ use crate::match_each_native_ptype; use crate::scalar::Scalar; use crate::scalar_fn::fns::fill_null::FillNullKernel; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl FillNullKernel for Primitive { fn fill_null( - array: &PrimitiveArray, + array: &Array, fill_value: &Scalar, ctx: &mut ExecutionCtx, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/primitive/compute/mask.rs b/vortex-array/src/arrays/primitive/compute/mask.rs index c8dcffe62ba..6e656162346 100644 --- a/vortex-array/src/arrays/primitive/compute/mask.rs +++ b/vortex-array/src/arrays/primitive/compute/mask.rs @@ -9,10 +9,10 @@ use crate::arrays::Primitive; use crate::arrays::PrimitiveArray; use crate::scalar_fn::fns::mask::MaskReduce; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl MaskReduce for Primitive { - fn mask(array: &PrimitiveArray, mask: &ArrayRef) -> VortexResult> { + fn mask(array: &Array, mask: &ArrayRef) -> VortexResult> { // SAFETY: validity and data buffer still have same length Ok(Some(unsafe { PrimitiveArray::new_unchecked_from_handle( diff --git a/vortex-array/src/arrays/primitive/compute/rules.rs b/vortex-array/src/arrays/primitive/compute/rules.rs index df6eb35d888..9f6587d8fb1 100644 --- a/vortex-array/src/arrays/primitive/compute/rules.rs +++ b/vortex-array/src/arrays/primitive/compute/rules.rs @@ -13,7 +13,7 @@ use crate::arrays::slice::SliceReduceAdaptor; use crate::optimizer::rules::ArrayParentReduceRule; use crate::optimizer::rules::ParentRuleSet; use crate::scalar_fn::fns::mask::MaskReduceAdaptor; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; pub(crate) const RULES: ParentRuleSet = ParentRuleSet::new(&[ ParentRuleSet::lift(&PrimitiveMaskedValidityRule), @@ -33,7 +33,7 @@ impl ArrayParentReduceRule for PrimitiveMaskedValidityRule { fn reduce_parent( &self, - array: &PrimitiveArray, + array: &Array, parent: &MaskedArray, _child_idx: usize, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/primitive/compute/slice.rs b/vortex-array/src/arrays/primitive/compute/slice.rs index 2844163e557..f3c1334caca 100644 --- a/vortex-array/src/arrays/primitive/compute/slice.rs +++ b/vortex-array/src/arrays/primitive/compute/slice.rs @@ -12,10 +12,10 @@ use crate::arrays::PrimitiveArray; use crate::arrays::slice::SliceReduce; use crate::dtype::NativePType; use crate::match_each_native_ptype; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl SliceReduce for Primitive { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { let result = match_each_native_ptype!(array.ptype(), |T| { PrimitiveArray::from_buffer_handle( array.buffer_handle().slice_typed::(range.clone()), diff --git a/vortex-array/src/arrays/primitive/compute/take/mod.rs b/vortex-array/src/arrays/primitive/compute/take/mod.rs index 7eb0cc0161d..a577788ca5b 100644 --- a/vortex-array/src/arrays/primitive/compute/take/mod.rs +++ b/vortex-array/src/arrays/primitive/compute/take/mod.rs @@ -28,7 +28,7 @@ use crate::executor::ExecutionCtx; use crate::match_each_integer_ptype; use crate::match_each_native_ptype; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; // Kernel selection happens on the first call to `take` and uses a combination of compile-time // and runtime feature detection to infer the best kernel for the platform. @@ -55,8 +55,8 @@ static PRIMITIVE_TAKE_KERNEL: LazyLock<&'static dyn TakeImpl> = LazyLock::new(|| trait TakeImpl: Send + Sync { fn take( &self, - array: &PrimitiveArray, - indices: &PrimitiveArray, + array: &Array, + indices: &Array, validity: Validity, ) -> VortexResult; } @@ -67,8 +67,8 @@ struct TakeKernelScalar; impl TakeImpl for TakeKernelScalar { fn take( &self, - array: &PrimitiveArray, - indices: &PrimitiveArray, + array: &Array, + indices: &Array, validity: Validity, ) -> VortexResult { match_each_native_ptype!(array.ptype(), |T| { @@ -82,7 +82,7 @@ impl TakeImpl for TakeKernelScalar { impl TakeExecute for Primitive { fn take( - array: &PrimitiveArray, + array: &Array, indices: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/primitive/mod.rs b/vortex-array/src/arrays/primitive/mod.rs index 14092475a18..522a03afc86 100644 --- a/vortex-array/src/arrays/primitive/mod.rs +++ b/vortex-array/src/arrays/primitive/mod.rs @@ -2,10 +2,11 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::PrimitiveArray; pub use array::PrimitiveArrayParts; +pub use array::PrimitiveData; pub use array::chunk_range; pub use array::patch_chunk; +pub use vtable::PrimitiveArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/primitive/vtable/mod.rs b/vortex-array/src/arrays/primitive/vtable/mod.rs index 98de20652a3..b963d0b5cb5 100644 --- a/vortex-array/src/arrays/primitive/vtable/mod.rs +++ b/vortex-array/src/arrays/primitive/vtable/mod.rs @@ -14,7 +14,7 @@ use crate::ArrayRef; use crate::EmptyMetadata; use crate::ExecutionCtx; use crate::ExecutionResult; -use crate::arrays::PrimitiveArray; +use crate::arrays::PrimitiveData; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::dtype::PType; @@ -40,19 +40,19 @@ use crate::Precision; use crate::arrays::primitive::compute::rules::RULES; use crate::hash::ArrayEq; use crate::hash::ArrayHash; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::vtable::ArrayId; -vtable!(Primitive); +vtable!(Primitive, Primitive, PrimitiveData); impl VTable for Primitive { - type Array = PrimitiveArray; + type ArrayData = PrimitiveData; type Metadata = EmptyMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValidityHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Primitive } @@ -60,53 +60,53 @@ impl VTable for Primitive { Self::ID } - fn len(array: &PrimitiveArray) -> usize { + fn len(array: &PrimitiveData) -> usize { array.buffer_handle().len() / array.ptype().byte_width() } - fn dtype(array: &PrimitiveArray) -> &DType { + fn dtype(array: &PrimitiveData) -> &DType { &array.dtype } - fn stats(array: &PrimitiveArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &PrimitiveData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &PrimitiveArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.buffer.array_hash(state, precision); array.validity.array_hash(state, precision); } - fn array_eq(array: &PrimitiveArray, other: &PrimitiveArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.buffer.array_eq(&other.buffer, precision) && array.validity.array_eq(&other.validity, precision) } - fn nbuffers(_array: &PrimitiveArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 1 } - fn buffer(array: &PrimitiveArray, idx: usize) -> BufferHandle { + fn buffer(array: &Array, idx: usize) -> BufferHandle { match idx { 0 => array.buffer_handle().clone(), _ => vortex_panic!("PrimitiveArray buffer index {idx} out of bounds"), } } - fn buffer_name(_array: &PrimitiveArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { match idx { 0 => Some("values".to_string()), _ => None, } } - fn nchildren(array: &PrimitiveArray) -> usize { + fn nchildren(array: &Array) -> usize { validity_nchildren(&array.validity) } - fn child(array: &PrimitiveArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => validity_to_child(&array.validity, array.len()) .vortex_expect("PrimitiveArray child index out of bounds"), @@ -114,11 +114,11 @@ impl VTable for Primitive { } } - fn child_name(_array: &PrimitiveArray, _idx: usize) -> String { + fn child_name(_array: &Array, _idx: usize) -> String { "validity".to_string() } - fn metadata(_array: &PrimitiveArray) -> VortexResult { + fn metadata(_array: &Array) -> VortexResult { Ok(EmptyMetadata) } @@ -142,7 +142,7 @@ impl VTable for Primitive { _metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { if buffers.len() != 1 { vortex_bail!("Expected 1 buffer, got {}", buffers.len()); } @@ -183,13 +183,13 @@ impl VTable for Primitive { // SAFETY: checked ahead of time unsafe { - Ok(PrimitiveArray::new_unchecked_from_handle( + Ok(PrimitiveData::new_unchecked_from_handle( buffer, ptype, validity, )) } } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() <= 1, "PrimitiveArray can have at most 1 child (validity), got {}", @@ -197,7 +197,7 @@ impl VTable for Primitive { ); array.validity = if children.is_empty() { - Validity::from(array.dtype().nullability()) + Validity::from(array.dtype.nullability()) } else { Validity::Array(children.into_iter().next().vortex_expect("checked")) }; diff --git a/vortex-array/src/arrays/primitive/vtable/operations.rs b/vortex-array/src/arrays/primitive/vtable/operations.rs index 89e6ce7acf9..6f92c289a5c 100644 --- a/vortex-array/src/arrays/primitive/vtable/operations.rs +++ b/vortex-array/src/arrays/primitive/vtable/operations.rs @@ -5,14 +5,14 @@ use vortex_error::VortexResult; use crate::ExecutionCtx; use crate::arrays::Primitive; -use crate::arrays::primitive::vtable::PrimitiveArray; use crate::match_each_native_ptype; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for Primitive { fn scalar_at( - array: &PrimitiveArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { diff --git a/vortex-array/src/arrays/primitive/vtable/validity.rs b/vortex-array/src/arrays/primitive/vtable/validity.rs index 8c1c3df5b27..f26b6ab3cf0 100644 --- a/vortex-array/src/arrays/primitive/vtable/validity.rs +++ b/vortex-array/src/arrays/primitive/vtable/validity.rs @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use crate::arrays::primitive::vtable::PrimitiveArray; +use crate::arrays::PrimitiveData; use crate::validity::Validity; use crate::vtable::ValidityHelper; -impl ValidityHelper for PrimitiveArray { +impl ValidityHelper for PrimitiveData { fn validity(&self) -> &Validity { &self.validity } diff --git a/vortex-array/src/arrays/scalar_fn/array.rs b/vortex-array/src/arrays/scalar_fn/array.rs index d027a74d6ec..23a55bdb3e0 100644 --- a/vortex-array/src/arrays/scalar_fn/array.rs +++ b/vortex-array/src/arrays/scalar_fn/array.rs @@ -10,9 +10,10 @@ use crate::arrays::ScalarFnVTable; use crate::dtype::DType; use crate::scalar_fn::ScalarFnRef; use crate::stats::ArrayStats; +use crate::vtable::Array; #[derive(Clone, Debug)] -pub struct ScalarFnArray { +pub struct ScalarFnData { pub(super) vtable: ScalarFnVTable, pub(super) dtype: DType, pub(super) len: usize, @@ -20,7 +21,7 @@ pub struct ScalarFnArray { pub(super) stats: ArrayStats, } -impl ScalarFnArray { +impl ScalarFnData { /// Create a new ScalarFnArray from a scalar function and its children. pub fn try_new( scalar_fn: ScalarFnRef, @@ -44,6 +45,21 @@ impl ScalarFnArray { }) } + /// Returns the dtype of the array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns the length of the array. + pub fn len(&self) -> usize { + self.len + } + + /// Returns `true` if the array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + /// Get the scalar function bound to this array. #[allow(clippy::same_name_method)] #[inline(always)] @@ -56,3 +72,27 @@ impl ScalarFnArray { &self.children } } + +impl Array { + /// Get the scalar function bound to this array. + #[allow(clippy::same_name_method)] + #[inline(always)] + pub fn scalar_fn(&self) -> &ScalarFnRef { + self.data().scalar_fn() + } + + /// Get the children arrays of this scalar function array. + #[allow(clippy::same_name_method)] + pub fn children(&self) -> &[ArrayRef] { + self.data().children() + } + + /// Create a new ScalarFnArray from a scalar function and its children. + pub fn try_new( + scalar_fn: ScalarFnRef, + children: Vec, + len: usize, + ) -> VortexResult { + Array::try_from_data(ScalarFnData::try_new(scalar_fn, children, len)?) + } +} diff --git a/vortex-array/src/arrays/scalar_fn/mod.rs b/vortex-array/src/arrays/scalar_fn/mod.rs index 4e8e31222c7..d19d1157d0b 100644 --- a/vortex-array/src/arrays/scalar_fn/mod.rs +++ b/vortex-array/src/arrays/scalar_fn/mod.rs @@ -6,5 +6,5 @@ mod metadata; mod rules; mod vtable; -pub use array::*; +pub use array::ScalarFnData; pub use vtable::*; diff --git a/vortex-array/src/arrays/scalar_fn/rules.rs b/vortex-array/src/arrays/scalar_fn/rules.rs index d0b9dd74183..9bd79ad28f7 100644 --- a/vortex-array/src/arrays/scalar_fn/rules.rs +++ b/vortex-array/src/arrays/scalar_fn/rules.rs @@ -9,6 +9,7 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::ArrayRef; +use crate::ArrayVisitor; use crate::Canonical; use crate::DynArray; use crate::IntoArray; @@ -17,6 +18,7 @@ use crate::arrays::ConstantArray; use crate::arrays::Filter; use crate::arrays::FilterArray; use crate::arrays::ScalarFnArray; +use crate::arrays::ScalarFnData; use crate::arrays::ScalarFnVTable; use crate::arrays::Slice; use crate::arrays::SliceArray; @@ -32,6 +34,7 @@ use crate::scalar_fn::ReduceNodeRef; use crate::scalar_fn::ScalarFnRef; use crate::scalar_fn::fns::pack::Pack; use crate::validity::Validity; +use crate::vtable::Array; pub(super) const RULES: ReduceRuleSet = ReduceRuleSet::new(&[ &ScalarFnPackToStructRule, @@ -48,7 +51,7 @@ pub(super) const PARENT_RULES: ParentRuleSet = ParentRuleSet::ne #[derive(Debug)] struct ScalarFnPackToStructRule; impl ArrayReduceRule for ScalarFnPackToStructRule { - fn reduce(&self, array: &ScalarFnArray) -> VortexResult> { + fn reduce(&self, array: &Array) -> VortexResult> { let Some(pack_options) = array.scalar_fn().as_opt::() else { return Ok(None); }; @@ -73,7 +76,7 @@ impl ArrayReduceRule for ScalarFnPackToStructRule { #[derive(Debug)] struct ScalarFnConstantRule; impl ArrayReduceRule for ScalarFnConstantRule { - fn reduce(&self, array: &ScalarFnArray) -> VortexResult> { + fn reduce(&self, array: &Array) -> VortexResult> { if !array.children.iter().all(|c| c.is::()) { return Ok(None); } @@ -93,7 +96,7 @@ impl ArrayParentReduceRule for ScalarFnSliceReduceRule { fn reduce_parent( &self, - array: &ScalarFnArray, + array: &Array, parent: &SliceArray, _child_idx: usize, ) -> VortexResult> { @@ -106,14 +109,7 @@ impl ArrayParentReduceRule for ScalarFnSliceReduceRule { .collect::>()?; Ok(Some( - ScalarFnArray { - vtable: array.vtable.clone(), - dtype: array.dtype.clone(), - len: range.len(), - children, - stats: Default::default(), - } - .into_array(), + ScalarFnData::try_new(array.scalar_fn().clone(), children, range.len())?.into_array(), )) } } @@ -121,65 +117,44 @@ impl ArrayParentReduceRule for ScalarFnSliceReduceRule { #[derive(Debug)] struct ScalarFnAbstractReduceRule; impl ArrayReduceRule for ScalarFnAbstractReduceRule { - fn reduce(&self, array: &ScalarFnArray) -> VortexResult> { + fn reduce(&self, array: &Array) -> VortexResult> { + // TODO(ngates): blergh! + let array_ref = array.to_array_ref(); if let Some(reduced) = array .scalar_fn() - .reduce(array, &ArrayReduceCtx { len: array.len })? + .reduce(&array_ref, &ArrayReduceCtx { len: array.len })? { return Ok(Some( reduced .as_any() .downcast_ref::() .vortex_expect("ReduceNode is not an ArrayRef") - .clone(), + .to_array(), )); } Ok(None) } } -impl ReduceNode for ScalarFnArray { - fn as_any(&self) -> &dyn Any { - self - } - - fn node_dtype(&self) -> VortexResult { - Ok(self.dtype().clone()) - } - - #[allow(clippy::same_name_method)] - fn scalar_fn(&self) -> Option<&ScalarFnRef> { - Some(ScalarFnArray::scalar_fn(self)) - } - - fn child(&self, idx: usize) -> ReduceNodeRef { - Arc::new(self.children()[idx].clone()) - } - - fn child_count(&self) -> usize { - self.children.len() - } -} - impl ReduceNode for ArrayRef { fn as_any(&self) -> &dyn Any { self } fn node_dtype(&self) -> VortexResult { - self.as_ref().node_dtype() + Ok(self.as_ref().dtype().clone()) } fn scalar_fn(&self) -> Option<&ScalarFnRef> { - self.as_ref().scalar_fn() + self.as_opt::().map(|a| a.scalar_fn()) } fn child(&self, idx: usize) -> ReduceNodeRef { - self.as_ref().child(idx) + Arc::new(self.nth_child(idx).vortex_expect("child idx out of bounds")) } fn child_count(&self) -> usize { - self.as_ref().child_count() + self.nchildren() } } @@ -202,7 +177,7 @@ impl ReduceCtx for ArrayReduceCtx { c.as_any() .downcast_ref::() .vortex_expect("ReduceNode is not an ArrayRef") - .clone() + .to_array() }) .collect(), self.len, @@ -220,7 +195,7 @@ impl ArrayParentReduceRule for ScalarFnUnaryFilterPushDownRule { fn reduce_parent( &self, - child: &ScalarFnArray, + child: &Array, parent: &FilterArray, _child_idx: usize, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs index 059f247306a..bc2dd03f754 100644 --- a/vortex-array/src/arrays/scalar_fn/vtable/mod.rs +++ b/vortex-array/src/arrays/scalar_fn/vtable/mod.rs @@ -23,7 +23,7 @@ use crate::ArrayRef; use crate::DynArray; use crate::IntoArray; use crate::Precision; -use crate::arrays::scalar_fn::array::ScalarFnArray; +use crate::arrays::scalar_fn::array::ScalarFnData; use crate::arrays::scalar_fn::metadata::ScalarFnMetadata; use crate::arrays::scalar_fn::rules::PARENT_RULES; use crate::arrays::scalar_fn::rules::RULES; @@ -42,13 +42,13 @@ use crate::scalar_fn::ScalarFnRef; use crate::scalar_fn::ScalarFnVTableExt; use crate::scalar_fn::VecExecutionArgs; use crate::serde::ArrayChildren; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::vtable; use crate::vtable::Array; use crate::vtable::ArrayId; use crate::vtable::VTable; -vtable!(ScalarFn, ScalarFnVTable); +vtable!(ScalarFn, ScalarFnVTable, ScalarFnData); #[derive(Clone, Debug)] pub struct ScalarFnVTable { @@ -56,12 +56,12 @@ pub struct ScalarFnVTable { } impl VTable for ScalarFnVTable { - type Array = ScalarFnArray; + type ArrayData = ScalarFnData; type Metadata = ScalarFnMetadata; type OperationsVTable = Self; type ValidityVTable = Self; - fn vtable(array: &Self::Array) -> &Self { + fn vtable(array: &ScalarFnData) -> &Self { &array.vtable } @@ -69,19 +69,19 @@ impl VTable for ScalarFnVTable { self.scalar_fn.id() } - fn len(array: &ScalarFnArray) -> usize { + fn len(array: &ScalarFnData) -> usize { array.len } - fn dtype(array: &ScalarFnArray) -> &DType { + fn dtype(array: &ScalarFnData) -> &DType { &array.dtype } - fn stats(array: &ScalarFnArray) -> StatsSetRef<'_> { - array.stats.to_ref(array.as_ref()) + fn stats(array: &ScalarFnData) -> &ArrayStats { + &array.stats } - fn array_hash(array: &ScalarFnArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.len.hash(state); array.dtype.hash(state); array.scalar_fn().hash(state); @@ -90,7 +90,7 @@ impl VTable for ScalarFnVTable { } } - fn array_eq(array: &ScalarFnArray, other: &ScalarFnArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { if array.len != other.len { return false; } @@ -108,27 +108,27 @@ impl VTable for ScalarFnVTable { true } - fn nbuffers(_array: &ScalarFnArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &ScalarFnArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("ScalarFnArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &ScalarFnArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { vortex_panic!("ScalarFnArray buffer_name index {idx} out of bounds") } - fn nchildren(array: &ScalarFnArray) -> usize { + fn nchildren(array: &Array) -> usize { array.children.len() } - fn child(array: &ScalarFnArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { array.children[idx].clone() } - fn child_name(array: &ScalarFnArray, idx: usize) -> String { + fn child_name(array: &Array, idx: usize) -> String { array .scalar_fn() .signature() @@ -137,7 +137,7 @@ impl VTable for ScalarFnVTable { .to_string() } - fn metadata(array: &Self::Array) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { let child_dtypes = array.children().iter().map(|c| c.dtype().clone()).collect(); Ok(ScalarFnMetadata { scalar_fn: array.scalar_fn().clone(), @@ -166,7 +166,7 @@ impl VTable for ScalarFnVTable { metadata: &ScalarFnMetadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let children: Vec<_> = metadata .child_dtypes .iter() @@ -183,7 +183,7 @@ impl VTable for ScalarFnVTable { ); } - Ok(ScalarFnArray { + Ok(ScalarFnData { vtable: ScalarFnVTable { scalar_fn: metadata.scalar_fn.clone(), }, @@ -194,7 +194,7 @@ impl VTable for ScalarFnVTable { }) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == array.children.len(), "ScalarFnArray expects {} children, got {}", @@ -246,7 +246,7 @@ pub trait ScalarFnArrayExt: scalar_fn::ScalarFnVTable { let child_dtypes = children.iter().map(|c| c.dtype().clone()).collect_vec(); let dtype = scalar_fn.return_dtype(&child_dtypes)?; - Ok(ScalarFnArray { + Ok(ScalarFnData { vtable: ScalarFnVTable { scalar_fn }, dtype, len, diff --git a/vortex-array/src/arrays/scalar_fn/vtable/operations.rs b/vortex-array/src/arrays/scalar_fn/vtable/operations.rs index 3b05537e015..82993cc15b9 100644 --- a/vortex-array/src/arrays/scalar_fn/vtable/operations.rs +++ b/vortex-array/src/arrays/scalar_fn/vtable/operations.rs @@ -9,16 +9,16 @@ use crate::IntoArray; use crate::LEGACY_SESSION; use crate::VortexSessionExecute; use crate::arrays::ConstantArray; -use crate::arrays::scalar_fn::array::ScalarFnArray; use crate::arrays::scalar_fn::vtable::ScalarFnVTable; use crate::columnar::Columnar; use crate::scalar::Scalar; use crate::scalar_fn::VecExecutionArgs; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for ScalarFnVTable { fn scalar_at( - array: &ScalarFnArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -38,7 +38,7 @@ impl OperationsVTable for ScalarFnVTable { "Scalar function {} returned non-constant array from execution over all scalar inputs", array.scalar_fn(), ); - arr.as_ref().scalar_at(0)? + arr.to_array_ref().scalar_at(0)? } Columnar::Constant(constant) => constant.scalar().clone(), }; @@ -64,7 +64,7 @@ mod tests { use crate::IntoArray; use crate::arrays::BoolArray; use crate::arrays::PrimitiveArray; - use crate::arrays::scalar_fn::array::ScalarFnArray; + use crate::arrays::ScalarFnArray; use crate::assert_arrays_eq; use crate::scalar_fn::ScalarFn; use crate::scalar_fn::fns::binary::Binary; diff --git a/vortex-array/src/arrays/scalar_fn/vtable/validity.rs b/vortex-array/src/arrays/scalar_fn/vtable/validity.rs index fc4a3b5a6c1..a5a4e3e2c0c 100644 --- a/vortex-array/src/arrays/scalar_fn/vtable/validity.rs +++ b/vortex-array/src/arrays/scalar_fn/vtable/validity.rs @@ -7,7 +7,6 @@ use crate::ArrayRef; use crate::IntoArray; use crate::LEGACY_SESSION; use crate::VortexSessionExecute; -use crate::arrays::scalar_fn::array::ScalarFnArray; use crate::arrays::scalar_fn::vtable::ArrayExpr; use crate::arrays::scalar_fn::vtable::FakeEq; use crate::arrays::scalar_fn::vtable::ScalarFnVTable; @@ -18,6 +17,7 @@ use crate::scalar_fn::VecExecutionArgs; use crate::scalar_fn::fns::literal::Literal; use crate::scalar_fn::fns::root::Root; use crate::validity::Validity; +use crate::vtable::Array; use crate::vtable::ValidityVTable; /// Execute an expression tree recursively. @@ -50,7 +50,7 @@ fn execute_expr(expr: &Expression, row_count: usize) -> VortexResult { } impl ValidityVTable for ScalarFnVTable { - fn validity(array: &ScalarFnArray) -> VortexResult { + fn validity(array: &Array) -> VortexResult { let inputs: Vec<_> = array .children .iter() diff --git a/vortex-array/src/arrays/shared/array.rs b/vortex-array/src/arrays/shared/array.rs index c69ae39395d..99091602e1e 100644 --- a/vortex-array/src/arrays/shared/array.rs +++ b/vortex-array/src/arrays/shared/array.rs @@ -7,20 +7,23 @@ use std::sync::OnceLock; use async_lock::Mutex as AsyncMutex; use vortex_error::SharedVortexResult; +use vortex_error::VortexExpect; use vortex_error::VortexResult; use crate::ArrayRef; use crate::Canonical; use crate::IntoArray; +use crate::arrays::Shared; use crate::dtype::DType; use crate::stats::ArrayStats; +use crate::vtable::Array; /// A lazily-executing array wrapper with a one-way transition from source to cached form. /// /// Before materialization, operations delegate to the source array. /// After materialization (via `get_or_compute`), operations delegate to the cached result. #[derive(Debug, Clone)] -pub struct SharedArray { +pub struct SharedData { source: ArrayRef, cached: Arc>>, async_compute_lock: Arc>, @@ -28,7 +31,7 @@ pub struct SharedArray { pub(super) stats: ArrayStats, } -impl SharedArray { +impl SharedData { pub fn new(source: ArrayRef) -> Self { Self { dtype: source.dtype().clone(), @@ -91,6 +94,30 @@ impl SharedArray { result.clone().map_err(Into::into) } + /// Returns the length of this array. + pub fn len(&self) -> usize { + self.current_array_ref().len() + } + + /// Returns the [`DType`] of this array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns `true` if this array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } +} + +impl Array { + /// Creates a new `SharedArray`. + pub fn new(source: ArrayRef) -> Self { + Array::try_from_data(SharedData::new(source)).vortex_expect("SharedData is always valid") + } +} + +impl SharedData { pub(super) fn set_source(&mut self, source: ArrayRef) { self.dtype = source.dtype().clone(); self.source = source; diff --git a/vortex-array/src/arrays/shared/mod.rs b/vortex-array/src/arrays/shared/mod.rs index 3fb9ed7f77e..34108bcd619 100644 --- a/vortex-array/src/arrays/shared/mod.rs +++ b/vortex-array/src/arrays/shared/mod.rs @@ -4,8 +4,9 @@ mod array; mod vtable; -pub use array::SharedArray; +pub use array::SharedData; pub use vtable::Shared; +pub use vtable::SharedArray; #[cfg(test)] mod tests; diff --git a/vortex-array/src/arrays/shared/vtable.rs b/vortex-array/src/arrays/shared/vtable.rs index 1c4c45e52b3..703bee260c1 100644 --- a/vortex-array/src/arrays/shared/vtable.rs +++ b/vortex-array/src/arrays/shared/vtable.rs @@ -15,13 +15,13 @@ use crate::EmptyMetadata; use crate::ExecutionCtx; use crate::ExecutionResult; use crate::Precision; -use crate::arrays::SharedArray; +use crate::arrays::shared::SharedData; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::hash::ArrayEq; use crate::hash::ArrayHash; use crate::scalar::Scalar; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::validity::Validity; use crate::vtable; use crate::vtable::Array; @@ -30,7 +30,7 @@ use crate::vtable::OperationsVTable; use crate::vtable::VTable; use crate::vtable::ValidityVTable; -vtable!(Shared); +vtable!(Shared, Shared, SharedData); // TODO(ngates): consider hooking Shared into the iterative execution model. Cache either the // most executed, or after each iteration, and return a shared cache for each execution. @@ -42,11 +42,11 @@ impl Shared { } impl VTable for Shared { - type Array = SharedArray; + type ArrayData = SharedData; type Metadata = EmptyMetadata; type OperationsVTable = Self; type ValidityVTable = Self; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &SharedData) -> &Self { &Shared } @@ -54,61 +54,61 @@ impl VTable for Shared { Self::ID } - fn len(array: &SharedArray) -> usize { + fn len(array: &SharedData) -> usize { array.current_array_ref().len() } - fn dtype(array: &SharedArray) -> &DType { + fn dtype(array: &SharedData) -> &DType { &array.dtype } - fn stats(array: &SharedArray) -> StatsSetRef<'_> { - array.stats.to_ref(array.as_ref()) + fn stats(array: &SharedData) -> &ArrayStats { + &array.stats } - fn array_hash(array: &SharedArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { let current = array.current_array_ref(); current.array_hash(state, precision); array.dtype.hash(state); } - fn array_eq(array: &SharedArray, other: &SharedArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { let current = array.current_array_ref(); let other_current = other.current_array_ref(); current.array_eq(other_current, precision) && array.dtype == other.dtype } - fn nbuffers(_array: &Self::Array) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &Self::Array, _idx: usize) -> BufferHandle { + fn buffer(_array: &Array, _idx: usize) -> BufferHandle { vortex_panic!("SharedArray has no buffers") } - fn buffer_name(_array: &Self::Array, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(_array: &Self::Array) -> usize { + fn nchildren(_array: &Array) -> usize { 1 } - fn child(array: &Self::Array, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.current_array_ref().clone(), _ => vortex_panic!("SharedArray child index {idx} out of bounds"), } } - fn child_name(_array: &Self::Array, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "source".to_string(), _ => vortex_panic!("SharedArray child_name index {idx} out of bounds"), } } - fn metadata(_array: &Self::Array) -> VortexResult { + fn metadata(_array: &Array) -> VortexResult { Ok(EmptyMetadata) } @@ -132,12 +132,12 @@ impl VTable for Shared { _metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn crate::serde::ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let child = children.get(0, dtype, len)?; - Ok(SharedArray::new(child)) + Ok(SharedData::new(child)) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_error::vortex_ensure!( children.len() == 1, "SharedArray expects exactly 1 child, got {}", @@ -159,7 +159,7 @@ impl VTable for Shared { } impl OperationsVTable for Shared { fn scalar_at( - array: &SharedArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -168,7 +168,7 @@ impl OperationsVTable for Shared { } impl ValidityVTable for Shared { - fn validity(array: &SharedArray) -> VortexResult { + fn validity(array: &Array) -> VortexResult { array.current_array_ref().validity() } } diff --git a/vortex-array/src/arrays/slice/array.rs b/vortex-array/src/arrays/slice/array.rs index 8a0dbbb642c..64ce20a6b12 100644 --- a/vortex-array/src/arrays/slice/array.rs +++ b/vortex-array/src/arrays/slice/array.rs @@ -8,10 +8,13 @@ use vortex_error::VortexResult; use vortex_error::vortex_panic; use crate::ArrayRef; +use crate::arrays::Slice; +use crate::dtype::DType; use crate::stats::ArrayStats; +use crate::vtable::Array; #[derive(Clone, Debug)] -pub struct SliceArray { +pub struct SliceData { pub(super) child: ArrayRef, pub(super) range: Range, pub(super) stats: ArrayStats, @@ -22,7 +25,7 @@ pub struct SliceArrayParts { pub range: Range, } -impl SliceArray { +impl SliceData { pub fn try_new(child: ArrayRef, range: Range) -> VortexResult { if range.end > child.len() { vortex_panic!( @@ -42,6 +45,21 @@ impl SliceArray { Self::try_new(child, range).vortex_expect("failed") } + /// Returns the length of this array. + pub fn len(&self) -> usize { + self.range.len() + } + + /// Returns the [`DType`] of this array. + pub fn dtype(&self) -> &DType { + self.child.dtype() + } + + /// Returns `true` if this array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + /// The range used to slice the child array. pub fn slice_range(&self) -> &Range { &self.range @@ -51,7 +69,22 @@ impl SliceArray { pub fn child(&self) -> &ArrayRef { &self.child } +} + +impl Array { + /// Constructs a new `SliceArray`. + pub fn try_new(child: ArrayRef, range: Range) -> VortexResult { + Array::try_from_data(SliceData::try_new(child, range)?) + } + + /// Constructs a new `SliceArray`. + pub fn new(child: ArrayRef, range: Range) -> Self { + Array::try_from_data(SliceData::new(child, range)) + .vortex_expect("SliceData is always valid") + } +} +impl SliceData { /// Consume the slice array and return its components. pub fn into_parts(self) -> SliceArrayParts { SliceArrayParts { diff --git a/vortex-array/src/arrays/slice/mod.rs b/vortex-array/src/arrays/slice/mod.rs index c9ad498ebe0..4502c51b038 100644 --- a/vortex-array/src/arrays/slice/mod.rs +++ b/vortex-array/src/arrays/slice/mod.rs @@ -15,7 +15,8 @@ mod vtable; use std::ops::Range; -pub use array::*; +pub use array::SliceArrayParts; +pub use array::SliceData; use vortex_error::VortexResult; pub use vtable::*; @@ -26,6 +27,7 @@ use crate::IntoArray; use crate::kernel::ExecuteParentKernel; use crate::matcher::Matcher; use crate::optimizer::rules::ArrayParentReduceRule; +use crate::vtable::Array; use crate::vtable::VTable; pub trait SliceReduce: VTable { @@ -40,7 +42,7 @@ pub trait SliceReduce: VTable { /// The range is guaranteed to be within bounds of the array (i.e., `range.end <= array.len()`). /// /// Additionally, the range is guaranteed to be non-empty (i.e., `range.start < range.end`). - fn slice(array: &Self::Array, range: Range) -> VortexResult>; + fn slice(array: &Array, range: Range) -> VortexResult>; } pub trait SliceKernel: VTable { @@ -55,18 +57,18 @@ pub trait SliceKernel: VTable { /// /// Additionally, the range is guaranteed to be non-empty (i.e., `range.start < range.end`). fn slice( - array: &Self::Array, + array: &Array, range: Range, ctx: &mut ExecutionCtx, ) -> VortexResult>; } -fn precondition(array: &V::Array, range: &Range) -> Option { - if range.start == 0 && range.end == array.len() { - return Some(array.to_array()); +fn precondition(array: &Array, range: &Range) -> Option { + if range.start == 0 && range.end == V::len(array) { + return Some(array.clone().into_array()); }; if range.start == range.end { - return Some(Canonical::empty(array.dtype()).into_array()); + return Some(Canonical::empty(V::dtype(array)).into_array()); } None } @@ -83,7 +85,7 @@ where fn reduce_parent( &self, - array: &V::Array, + array: &Array, parent: ::Match<'_>, child_idx: usize, ) -> VortexResult> { @@ -107,7 +109,7 @@ where fn execute_parent( &self, - array: &V::Array, + array: &Array, parent: ::Match<'_>, child_idx: usize, ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/arrays/slice/slice_.rs b/vortex-array/src/arrays/slice/slice_.rs index 6c1f10628be..468b92e6e0f 100644 --- a/vortex-array/src/arrays/slice/slice_.rs +++ b/vortex-array/src/arrays/slice/slice_.rs @@ -10,9 +10,10 @@ use crate::IntoArray; use crate::arrays::Slice; use crate::arrays::SliceArray; use crate::arrays::slice::SliceReduce; +use crate::vtable::Array; impl SliceReduce for Slice { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { let inner_range = array.slice_range(); let combined_start = inner_range.start + range.start; diff --git a/vortex-array/src/arrays/slice/vtable.rs b/vortex-array/src/arrays/slice/vtable.rs index 13652915f6e..55d1f1e43f5 100644 --- a/vortex-array/src/arrays/slice/vtable.rs +++ b/vortex-array/src/arrays/slice/vtable.rs @@ -21,8 +21,9 @@ use crate::ArrayHash; use crate::ArrayRef; use crate::Canonical; use crate::DynArray; +use crate::IntoArray; use crate::Precision; -use crate::arrays::slice::array::SliceArray; +use crate::arrays::slice::array::SliceData; use crate::arrays::slice::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -30,7 +31,7 @@ use crate::executor::ExecutionCtx; use crate::executor::ExecutionResult; use crate::scalar::Scalar; use crate::serde::ArrayChildren; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::validity::Validity; use crate::vtable; use crate::vtable::Array; @@ -39,7 +40,7 @@ use crate::vtable::OperationsVTable; use crate::vtable::VTable; use crate::vtable::ValidityVTable; -vtable!(Slice); +vtable!(Slice, Slice, SliceData); #[derive(Clone, Debug)] pub struct Slice; @@ -49,11 +50,11 @@ impl Slice { } impl VTable for Slice { - type Array = SliceArray; + type ArrayData = SliceData; type Metadata = SliceMetadata; type OperationsVTable = Self; type ValidityVTable = Self; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &SliceData) -> &Self { &Slice } @@ -61,59 +62,59 @@ impl VTable for Slice { Slice::ID } - fn len(array: &SliceArray) -> usize { + fn len(array: &SliceData) -> usize { array.range.len() } - fn dtype(array: &SliceArray) -> &DType { + fn dtype(array: &SliceData) -> &DType { array.child.dtype() } - fn stats(array: &SliceArray) -> StatsSetRef<'_> { - array.stats.to_ref(array.as_ref()) + fn stats(array: &SliceData) -> &ArrayStats { + &array.stats } - fn array_hash(array: &SliceArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.child.array_hash(state, precision); array.range.start.hash(state); array.range.end.hash(state); } - fn array_eq(array: &SliceArray, other: &SliceArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.child.array_eq(&other.child, precision) && array.range == other.range } - fn nbuffers(_array: &Self::Array) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &Self::Array, _idx: usize) -> BufferHandle { + fn buffer(_array: &Array, _idx: usize) -> BufferHandle { vortex_panic!("SliceArray has no buffers") } - fn buffer_name(_array: &Self::Array, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(_array: &Self::Array) -> usize { + fn nchildren(_array: &Array) -> usize { 1 } - fn child(array: &Self::Array, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.child.clone(), _ => vortex_panic!("SliceArray child index {idx} out of bounds"), } } - fn child_name(_array: &Self::Array, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "child".to_string(), _ => vortex_panic!("SliceArray child_name index {idx} out of bounds"), } } - fn metadata(array: &Self::Array) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(SliceMetadata(array.range.clone())) } @@ -138,17 +139,17 @@ impl VTable for Slice { metadata: &SliceMetadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { assert_eq!(len, metadata.0.len()); let child = children.get(0, dtype, metadata.0.end)?; - Ok(SliceArray { + Ok(SliceData { child, range: metadata.0.clone(), stats: Default::default(), }) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 1, "SliceArray expects exactly 1 child, got {}", @@ -175,7 +176,7 @@ impl VTable for Slice { // TODO(ngates): we should inline canonical slice logic here. Canonical::from(canonical) - .as_ref() + .into_array() .slice(array.range.clone()) .map(ExecutionResult::done) } @@ -190,7 +191,7 @@ impl VTable for Slice { } impl OperationsVTable for Slice { fn scalar_at( - array: &SliceArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -199,7 +200,7 @@ impl OperationsVTable for Slice { } impl ValidityVTable for Slice { - fn validity(array: &SliceArray) -> VortexResult { + fn validity(array: &Array) -> VortexResult { array.child.validity()?.slice(array.range.clone()) } } diff --git a/vortex-array/src/arrays/struct_/array.rs b/vortex-array/src/arrays/struct_/array.rs index a351cc84a5d..15f8ec9be74 100644 --- a/vortex-array/src/arrays/struct_/array.rs +++ b/vortex-array/src/arrays/struct_/array.rs @@ -9,17 +9,19 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_err; +use vortex_mask::Mask; use crate::ArrayRef; use crate::DynArray; use crate::IntoArray; +use crate::arrays::Struct; use crate::dtype::DType; use crate::dtype::FieldName; use crate::dtype::FieldNames; use crate::dtype::StructFields; use crate::stats::ArrayStats; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; /// A struct array that stores multiple named fields as columns, similar to a database row. /// @@ -140,7 +142,7 @@ use crate::vtable::ValidityHelper; /// assert_eq!(id_field.len(), 3); /// ``` #[derive(Clone, Debug)] -pub struct StructArray { +pub struct StructData { pub(super) len: usize, pub(super) dtype: DType, pub(super) fields: Arc<[ArrayRef]>, @@ -154,7 +156,33 @@ pub struct StructArrayParts { pub validity: Validity, } -impl StructArray { +impl StructData { + /// Returns the length of this array. + pub fn len(&self) -> usize { + self.len + } + + /// Returns the [`DType`] of this array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns `true` if this array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Returns the [`Validity`] of this array. + #[allow(clippy::same_name_method)] + pub fn validity(&self) -> &Validity { + &self.validity + } + + /// Returns the validity as a [`Mask`]. + pub fn validity_mask(&self) -> Mask { + self.validity.to_mask(self.len()) + } + /// Return the struct fields without the validity of the struct applied pub fn unmasked_fields(&self) -> &Arc<[ArrayRef]> { &self.fields @@ -201,12 +229,12 @@ impl StructArray { .vortex_expect("StructArray::new_with_len should not fail") } - /// Creates a new [`StructArray`]. + /// Creates a new `StructArray`. /// /// # Panics /// /// Panics if the provided components do not satisfy the invariants documented - /// in [`StructArray::new_unchecked`]. + /// in `StructArray::new_unchecked`. pub fn new( names: FieldNames, fields: impl Into>, @@ -219,12 +247,12 @@ impl StructArray { /// Constructs a new `StructArray`. /// - /// See [`StructArray::new_unchecked`] for more information. + /// See `StructArray::new_unchecked` for more information. /// /// # Errors /// /// Returns an error if the provided components do not satisfy the invariants documented in - /// [`StructArray::new_unchecked`]. + /// `StructArray::new_unchecked`. pub fn try_new( names: FieldNames, fields: impl Into>, @@ -241,7 +269,7 @@ impl StructArray { Ok(unsafe { Self::new_unchecked(fields, dtype, length, validity) }) } - /// Creates a new [`StructArray`] without validation from these components: + /// Creates a new `StructArray` without validation from these components: /// /// * `fields` is a vector of arrays, one for each field in the struct. /// * `dtype` contains the field names and types. @@ -287,9 +315,9 @@ impl StructArray { } } - /// Validates the components that would be used to create a [`StructArray`]. + /// Validates the components that would be used to create a `StructArray`. /// - /// This function checks all the invariants required by [`StructArray::new_unchecked`]. + /// This function checks all the invariants required by `StructArray::new_unchecked`. pub fn validate( fields: &[ArrayRef], dtype: &StructFields, @@ -419,7 +447,7 @@ impl StructArray { children.push(fields[idx].clone()); } - StructArray::try_new( + StructData::try_new( FieldNames::from(names.as_slice()), children, self.len(), @@ -455,8 +483,94 @@ impl StructArray { } None } +} + +impl Array { + /// Creates a new `StructArray`. + pub fn new( + names: FieldNames, + fields: impl Into>, + length: usize, + validity: Validity, + ) -> Self { + Array::try_from_data(StructData::new(names, fields, length, validity)) + .vortex_expect("StructData is always valid") + } + + /// Constructs a new `StructArray`. + pub fn try_new( + names: FieldNames, + fields: impl Into>, + length: usize, + validity: Validity, + ) -> VortexResult { + Array::try_from_data(StructData::try_new(names, fields, length, validity)?) + } + + /// Creates a new `StructArray` without validation. + /// + /// # Safety + /// + /// See [`StructData::new_unchecked`]. + pub unsafe fn new_unchecked( + fields: impl Into>, + dtype: StructFields, + length: usize, + validity: Validity, + ) -> Self { + Array::try_from_data(unsafe { StructData::new_unchecked(fields, dtype, length, validity) }) + .vortex_expect("StructData is always valid") + } + + /// Constructs a new `StructArray` with an explicit dtype. + pub fn try_new_with_dtype( + fields: impl Into>, + dtype: StructFields, + length: usize, + validity: Validity, + ) -> VortexResult { + Array::try_from_data(StructData::try_new_with_dtype( + fields, dtype, length, validity, + )?) + } + + /// Construct a `StructArray` from named fields. + pub fn from_fields>(items: &[(N, ArrayRef)]) -> VortexResult { + Array::try_from_data(StructData::from_fields(items)?) + } + + /// Decompose this struct array into its constituent parts. + pub fn into_parts(self) -> StructArrayParts { + self.into_data().into_parts() + } + + /// Create a `StructArray` from an iterator of (name, array) pairs with validity. + pub fn try_from_iter_with_validity< + N: AsRef, + A: IntoArray, + T: IntoIterator, + >( + iter: T, + validity: Validity, + ) -> VortexResult { + Array::try_from_data(StructData::try_from_iter_with_validity(iter, validity)?) + } + + /// Create a `StructArray` from an iterator of (name, array) pairs. + pub fn try_from_iter, A: IntoArray, T: IntoIterator>( + iter: T, + ) -> VortexResult { + Array::try_from_data(StructData::try_from_iter(iter)?) + } + + /// Create a fieldless `StructArray` with the given length. + pub fn new_fieldless_with_len(len: usize) -> Self { + Array::try_from_data(StructData::new_fieldless_with_len(len)) + .vortex_expect("StructData is always valid") + } +} - /// Create a new StructArray by appending a new column onto the existing array. +impl StructData { pub fn with_column(&self, name: impl Into, array: ArrayRef) -> VortexResult { let name = name.into(); let struct_dtype = self.struct_fields().clone(); diff --git a/vortex-array/src/arrays/struct_/compute/cast.rs b/vortex-array/src/arrays/struct_/compute/cast.rs index 291830556c9..786e6febaf3 100644 --- a/vortex-array/src/arrays/struct_/compute/cast.rs +++ b/vortex-array/src/arrays/struct_/compute/cast.rs @@ -15,11 +15,11 @@ use crate::builtins::ArrayBuiltins; use crate::dtype::DType; use crate::scalar::Scalar; use crate::scalar_fn::fns::cast::CastKernel; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl CastKernel for Struct { fn cast( - array: &StructArray, + array: &Array, dtype: &DType, _ctx: &mut ExecutionCtx, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/struct_/compute/mask.rs b/vortex-array/src/arrays/struct_/compute/mask.rs index c10e1974f0c..c020d2e91fd 100644 --- a/vortex-array/src/arrays/struct_/compute/mask.rs +++ b/vortex-array/src/arrays/struct_/compute/mask.rs @@ -9,10 +9,10 @@ use crate::arrays::Struct; use crate::arrays::StructArray; use crate::scalar_fn::fns::mask::MaskReduce; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl MaskReduce for Struct { - fn mask(array: &StructArray, mask: &ArrayRef) -> VortexResult> { + fn mask(array: &Array, mask: &ArrayRef) -> VortexResult> { StructArray::try_new_with_dtype( array.unmasked_fields().clone(), array.struct_fields().clone(), diff --git a/vortex-array/src/arrays/struct_/compute/rules.rs b/vortex-array/src/arrays/struct_/compute/rules.rs index 910d5ebe481..5aa540785a9 100644 --- a/vortex-array/src/arrays/struct_/compute/rules.rs +++ b/vortex-array/src/arrays/struct_/compute/rules.rs @@ -24,7 +24,7 @@ use crate::scalar_fn::fns::get_item::GetItem; use crate::scalar_fn::fns::mask::Mask; use crate::scalar_fn::fns::mask::MaskReduceAdaptor; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; pub(crate) const PARENT_RULES: ParentRuleSet = ParentRuleSet::new(&[ ParentRuleSet::lift(&StructCastPushDownRule), @@ -47,7 +47,7 @@ impl ArrayParentReduceRule for StructCastPushDownRule { fn reduce_parent( &self, - array: &StructArray, + array: &Array, parent: ScalarFnArrayView, _child_idx: usize, ) -> VortexResult> { @@ -103,7 +103,7 @@ impl ArrayParentReduceRule for StructGetItemRule { fn reduce_parent( &self, - child: &StructArray, + child: &Array, parent: ScalarFnArrayView<'_, GetItem>, _child_idx: usize, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/struct_/compute/slice.rs b/vortex-array/src/arrays/struct_/compute/slice.rs index beb38e8c74c..174523b1dcb 100644 --- a/vortex-array/src/arrays/struct_/compute/slice.rs +++ b/vortex-array/src/arrays/struct_/compute/slice.rs @@ -11,10 +11,10 @@ use crate::IntoArray; use crate::arrays::Struct; use crate::arrays::StructArray; use crate::arrays::slice::SliceReduce; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl SliceReduce for Struct { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { let fields: Vec<_> = array .unmasked_fields() .iter() diff --git a/vortex-array/src/arrays/struct_/compute/take.rs b/vortex-array/src/arrays/struct_/compute/take.rs index 6694d64e6e6..b8a070257af 100644 --- a/vortex-array/src/arrays/struct_/compute/take.rs +++ b/vortex-array/src/arrays/struct_/compute/take.rs @@ -12,10 +12,10 @@ use crate::arrays::dict::TakeReduce; use crate::builtins::ArrayBuiltins; use crate::scalar::Scalar; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl TakeReduce for Struct { - fn take(array: &StructArray, indices: &ArrayRef) -> VortexResult> { + fn take(array: &Array, indices: &ArrayRef) -> VortexResult> { // If the struct array is empty then the indices must be all null, otherwise it will access // an out of bounds element. if array.is_empty() { diff --git a/vortex-array/src/arrays/struct_/compute/zip.rs b/vortex-array/src/arrays/struct_/compute/zip.rs index 425d07a28a3..36d119fe894 100644 --- a/vortex-array/src/arrays/struct_/compute/zip.rs +++ b/vortex-array/src/arrays/struct_/compute/zip.rs @@ -15,11 +15,11 @@ use crate::arrays::StructArray; use crate::builtins::ArrayBuiltins; use crate::scalar_fn::fns::zip::ZipKernel; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl ZipKernel for Struct { fn zip( - if_true: &StructArray, + if_true: &Array, if_false: &ArrayRef, mask: &ArrayRef, ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/arrays/struct_/mod.rs b/vortex-array/src/arrays/struct_/mod.rs index 727df32c4a2..b867f903901 100644 --- a/vortex-array/src/arrays/struct_/mod.rs +++ b/vortex-array/src/arrays/struct_/mod.rs @@ -2,8 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::StructArray; pub use array::StructArrayParts; +pub use array::StructData; +pub use vtable::StructArray; pub(crate) mod compute; mod vtable; diff --git a/vortex-array/src/arrays/struct_/vtable/mod.rs b/vortex-array/src/arrays/struct_/vtable/mod.rs index acaac4e764e..c760b6f091f 100644 --- a/vortex-array/src/arrays/struct_/vtable/mod.rs +++ b/vortex-array/src/arrays/struct_/vtable/mod.rs @@ -16,7 +16,7 @@ use crate::ArrayRef; use crate::EmptyMetadata; use crate::ExecutionCtx; use crate::ExecutionResult; -use crate::arrays::StructArray; +use crate::arrays::StructData; use crate::arrays::struct_::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -36,18 +36,18 @@ use std::hash::Hash; use crate::Precision; use crate::hash::ArrayEq; use crate::hash::ArrayHash; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::vtable::ArrayId; -vtable!(Struct); +vtable!(Struct, Struct, StructData); impl VTable for Struct { - type Array = StructArray; + type ArrayData = StructData; type Metadata = EmptyMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValidityHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Struct } @@ -55,19 +55,19 @@ impl VTable for Struct { Self::ID } - fn len(array: &StructArray) -> usize { + fn len(array: &StructData) -> usize { array.len } - fn dtype(array: &StructArray) -> &DType { + fn dtype(array: &StructData) -> &DType { &array.dtype } - fn stats(array: &StructArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &StructData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &StructArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.len.hash(state); array.dtype.hash(state); for field in array.fields.iter() { @@ -76,7 +76,7 @@ impl VTable for Struct { array.validity.array_hash(state, precision); } - fn array_eq(array: &StructArray, other: &StructArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.len == other.len && array.dtype == other.dtype && array.fields.len() == other.fields.len() @@ -88,23 +88,23 @@ impl VTable for Struct { && array.validity.array_eq(&other.validity, precision) } - fn nbuffers(_array: &StructArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &StructArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("StructArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &StructArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { vortex_panic!("StructArray buffer_name index {idx} out of bounds") } - fn nchildren(array: &StructArray) -> usize { + fn nchildren(array: &Array) -> usize { validity_nchildren(&array.validity) + array.unmasked_fields().len() } - fn child(array: &StructArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { let vc = validity_nchildren(&array.validity); if idx < vc { validity_to_child(&array.validity, array.len()) @@ -114,7 +114,7 @@ impl VTable for Struct { } } - fn child_name(array: &StructArray, idx: usize) -> String { + fn child_name(array: &Array, idx: usize) -> String { let vc = validity_nchildren(&array.validity); if idx < vc { "validity".to_string() @@ -123,7 +123,7 @@ impl VTable for Struct { } } - fn metadata(_array: &StructArray) -> VortexResult { + fn metadata(_array: &Array) -> VortexResult { Ok(EmptyMetadata) } @@ -147,7 +147,7 @@ impl VTable for Struct { _metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let DType::Struct(struct_dtype, nullability) = dtype else { vortex_bail!("Expected struct dtype, found {:?}", dtype) }; @@ -176,10 +176,10 @@ impl VTable for Struct { }) .try_collect()?; - StructArray::try_new_with_dtype(children, struct_dtype.clone(), len, validity) + StructData::try_new_with_dtype(children, struct_dtype.clone(), len, validity) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { let DType::Struct(struct_dtype, _nullability) = &array.dtype else { vortex_bail!("Expected struct dtype, found {:?}", array.dtype) }; diff --git a/vortex-array/src/arrays/struct_/vtable/operations.rs b/vortex-array/src/arrays/struct_/vtable/operations.rs index a1b8549b838..5ad8d29d1da 100644 --- a/vortex-array/src/arrays/struct_/vtable/operations.rs +++ b/vortex-array/src/arrays/struct_/vtable/operations.rs @@ -6,13 +6,13 @@ use vortex_error::VortexResult; use crate::DynArray; use crate::ExecutionCtx; use crate::arrays::Struct; -use crate::arrays::StructArray; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for Struct { fn scalar_at( - array: &StructArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { diff --git a/vortex-array/src/arrays/struct_/vtable/validity.rs b/vortex-array/src/arrays/struct_/vtable/validity.rs index 90dff1e618d..7a02d8057b7 100644 --- a/vortex-array/src/arrays/struct_/vtable/validity.rs +++ b/vortex-array/src/arrays/struct_/vtable/validity.rs @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use crate::arrays::StructArray; +use crate::arrays::StructData; use crate::validity::Validity; use crate::vtable::ValidityHelper; -impl ValidityHelper for StructArray { +impl ValidityHelper for StructData { fn validity(&self) -> &Validity { &self.validity } diff --git a/vortex-array/src/arrays/varbin/accessor.rs b/vortex-array/src/arrays/varbin/accessor.rs index dea926defe2..990c264e4f3 100644 --- a/vortex-array/src/arrays/varbin/accessor.rs +++ b/vortex-array/src/arrays/varbin/accessor.rs @@ -8,7 +8,6 @@ use crate::accessor::ArrayAccessor; use crate::arrays::VarBinArray; use crate::match_each_integer_ptype; use crate::validity::Validity; -use crate::vtable::ValidityHelper; impl ArrayAccessor<[u8]> for VarBinArray { fn with_iterator(&self, f: F) -> R diff --git a/vortex-array/src/arrays/varbin/array.rs b/vortex-array/src/arrays/varbin/array.rs index 5c08545d6ba..3118683f9a8 100644 --- a/vortex-array/src/arrays/varbin/array.rs +++ b/vortex-array/src/arrays/varbin/array.rs @@ -7,10 +7,12 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_ensure; use vortex_error::vortex_err; +use vortex_mask::Mask; use crate::ArrayRef; use crate::DynArray; use crate::ToCanonical; +use crate::arrays::VarBin; use crate::arrays::varbin::builder::VarBinBuilder; use crate::buffer::BufferHandle; use crate::dtype::DType; @@ -19,9 +21,10 @@ use crate::dtype::Nullability; use crate::match_each_integer_ptype; use crate::stats::ArrayStats; use crate::validity::Validity; +use crate::vtable::Array; #[derive(Clone, Debug)] -pub struct VarBinArray { +pub struct VarBinData { pub(super) dtype: DType, pub(super) bytes: BufferHandle, pub(super) offsets: ArrayRef, @@ -29,23 +32,23 @@ pub struct VarBinArray { pub(super) stats_set: ArrayStats, } -impl VarBinArray { - /// Creates a new [`VarBinArray`]. +impl VarBinData { + /// Creates a new `VarBinArray`. /// /// # Panics /// /// Panics if the provided components do not satisfy the invariants documented - /// in [`VarBinArray::new_unchecked`]. + /// in `VarBinArray::new_unchecked`. pub fn new(offsets: ArrayRef, bytes: ByteBuffer, dtype: DType, validity: Validity) -> Self { Self::try_new(offsets, bytes, dtype, validity).vortex_expect("VarBinArray new") } - /// Creates a new [`VarBinArray`]. + /// Creates a new `VarBinArray`. /// /// # Panics /// /// Panics if the provided components do not satisfy the invariants documented - /// in [`VarBinArray::new_unchecked`]. + /// in `VarBinArray::new_unchecked`. pub fn new_from_handle( offset: ArrayRef, bytes: BufferHandle, @@ -57,12 +60,12 @@ impl VarBinArray { /// Constructs a new `VarBinArray`. /// - /// See [`VarBinArray::new_unchecked`] for more information. + /// See `VarBinArray::new_unchecked` for more information. /// /// # Errors /// /// Returns an error if the provided components do not satisfy the invariants documented in - /// [`VarBinArray::new_unchecked`]. + /// `VarBinArray::new_unchecked`. pub fn try_new( offsets: ArrayRef, bytes: ByteBuffer, @@ -79,12 +82,12 @@ impl VarBinArray { /// Constructs a new `VarBinArray` from a `BufferHandle` of memory that may exist /// on the CPU or GPU. /// - /// See [`VarBinArray::new_unchecked`] for more information. + /// See `VarBinArray::new_unchecked` for more information. /// /// # Errors /// /// Returns an error if the provided components do not satisfy the invariants documented in - /// [`VarBinArray::new_unchecked`]. + /// `VarBinArray::new_unchecked`. pub fn try_new_from_handle( offsets: ArrayRef, bytes: BufferHandle, @@ -97,7 +100,7 @@ impl VarBinArray { Ok(unsafe { Self::new_unchecked_from_handle(offsets, bytes, dtype, validity) }) } - /// Creates a new [`VarBinArray`] without validation from these components: + /// Creates a new `VarBinArray` without validation from these components: /// /// * `offsets` is an array of byte offsets into the `bytes` buffer. /// * `bytes` is a buffer containing all the variable-length data concatenated. @@ -138,7 +141,7 @@ impl VarBinArray { } } - /// Creates a new [`VarBinArray`] without validation from its components, with string data + /// Creates a new `VarBinArray` without validation from its components, with string data /// stored in a `BufferHandle` (CPU or GPU). /// /// # Safety @@ -163,9 +166,9 @@ impl VarBinArray { } } - /// Validates the components that would be used to create a [`VarBinArray`]. + /// Validates the components that would be used to create a `VarBinArray`. /// - /// This function checks all the invariants required by [`VarBinArray::new_unchecked`]. + /// This function checks all the invariants required by `VarBinArray::new_unchecked`. pub fn validate( offsets: &ArrayRef, bytes: &BufferHandle, @@ -257,6 +260,32 @@ impl VarBinArray { Ok(()) } + /// Returns the length of this array. + pub fn len(&self) -> usize { + self.offsets().len().saturating_sub(1) + } + + /// Returns the [`DType`] of this array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns `true` if this array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Returns the [`Validity`] of this array. + #[allow(clippy::same_name_method)] + pub fn validity(&self) -> &Validity { + &self.validity + } + + /// Returns the validity as a [`Mask`]. + pub fn validity_mask(&self) -> Mask { + self.validity.to_mask(self.len()) + } + #[inline] pub fn offsets(&self) -> &ArrayRef { &self.offsets @@ -307,7 +336,7 @@ impl VarBinArray { for v in vec { builder.append_value(v.as_ref()); } - builder.finish(dtype) + builder.finish(dtype).into_data() } #[expect( @@ -323,7 +352,7 @@ impl VarBinArray { for v in iter { builder.append(v.as_ref().map(|o| o.as_ref())); } - builder.finish(dtype) + builder.finish(dtype).into_data() } pub fn from_iter_nonnull, I: IntoIterator>( @@ -335,9 +364,59 @@ impl VarBinArray { for v in iter { builder.append_value(v); } - builder.finish(dtype) + builder.finish(dtype).into_data() + } +} + +/// Forwarding constructors for `VarBinArray` (= `Array`). +impl Array { + pub fn from_vec>(vec: Vec, dtype: DType) -> Self { + Array::try_from_data(VarBinData::from_vec(vec, dtype)) + .vortex_expect("VarBinData is always valid") + } + + #[expect( + clippy::same_name_method, + reason = "intentionally named from_iter like Iterator::from_iter" + )] + pub fn from_iter, I: IntoIterator>>( + iter: I, + dtype: DType, + ) -> Self { + Array::try_from_data(VarBinData::from_iter(iter, dtype)) + .vortex_expect("VarBinData is always valid") + } + + pub fn from_iter_nonnull, I: IntoIterator>( + iter: I, + dtype: DType, + ) -> Self { + Array::try_from_data(VarBinData::from_iter_nonnull(iter, dtype)) + .vortex_expect("VarBinData is always valid") + } + + /// Create from a vector of string slices. + pub fn from_strs(value: Vec<&str>) -> Self { + Self::from_vec(value, DType::Utf8(Nullability::NonNullable)) + } + + /// Create from a vector of optional string slices. + pub fn from_nullable_strs(value: Vec>) -> Self { + Self::from_iter(value, DType::Utf8(Nullability::Nullable)) + } + + /// Create from a vector of byte slices. + pub fn from_bytes(value: Vec<&[u8]>) -> Self { + Self::from_vec(value, DType::Binary(Nullability::NonNullable)) + } + + /// Create from a vector of optional byte slices. + pub fn from_nullable_bytes(value: Vec>) -> Self { + Self::from_iter(value, DType::Binary(Nullability::Nullable)) } +} +impl VarBinData { /// Get value offset at a given index /// /// Note: There's 1 more offsets than the elements in the array, thus last offset is at array length index @@ -375,74 +454,202 @@ impl VarBinArray { } } -impl From> for VarBinArray { +impl Array { + /// Creates a new `VarBinArray`. + pub fn new(offsets: ArrayRef, bytes: ByteBuffer, dtype: DType, validity: Validity) -> Self { + Array::try_from_data(VarBinData::new(offsets, bytes, dtype, validity)) + .vortex_expect("VarBinData is always valid") + } + + /// Creates a new `VarBinArray` without validation. + /// + /// # Safety + /// + /// See [`VarBinData::new_unchecked`]. + pub unsafe fn new_unchecked( + offsets: ArrayRef, + bytes: ByteBuffer, + dtype: DType, + validity: Validity, + ) -> Self { + Array::try_from_data(unsafe { VarBinData::new_unchecked(offsets, bytes, dtype, validity) }) + .vortex_expect("VarBinData is always valid") + } + + /// Creates a new `VarBinArray` without validation from a [`BufferHandle`]. + /// + /// # Safety + /// + /// See [`VarBinData::new_unchecked_from_handle`]. + pub unsafe fn new_unchecked_from_handle( + offsets: ArrayRef, + bytes: BufferHandle, + dtype: DType, + validity: Validity, + ) -> Self { + Array::try_from_data(unsafe { + VarBinData::new_unchecked_from_handle(offsets, bytes, dtype, validity) + }) + .vortex_expect("VarBinData is always valid") + } + + /// Constructs a new `VarBinArray`. + pub fn try_new( + offsets: ArrayRef, + bytes: ByteBuffer, + dtype: DType, + validity: Validity, + ) -> VortexResult { + Array::try_from_data(VarBinData::try_new(offsets, bytes, dtype, validity)?) + } +} + +impl From> for VarBinData { fn from(value: Vec<&[u8]>) -> Self { Self::from_vec(value, DType::Binary(Nullability::NonNullable)) } } -impl From>> for VarBinArray { +impl From>> for VarBinData { fn from(value: Vec>) -> Self { Self::from_vec(value, DType::Binary(Nullability::NonNullable)) } } -impl From> for VarBinArray { +impl From> for VarBinData { fn from(value: Vec) -> Self { Self::from_vec(value, DType::Utf8(Nullability::NonNullable)) } } -impl From> for VarBinArray { +impl From> for VarBinData { fn from(value: Vec<&str>) -> Self { Self::from_vec(value, DType::Utf8(Nullability::NonNullable)) } } -impl From>> for VarBinArray { +impl From>> for VarBinData { fn from(value: Vec>) -> Self { Self::from_iter(value, DType::Binary(Nullability::Nullable)) } } -impl From>>> for VarBinArray { +impl From>>> for VarBinData { fn from(value: Vec>>) -> Self { Self::from_iter(value, DType::Binary(Nullability::Nullable)) } } -impl From>> for VarBinArray { +impl From>> for VarBinData { fn from(value: Vec>) -> Self { Self::from_iter(value, DType::Utf8(Nullability::Nullable)) } } -impl From>> for VarBinArray { +impl From>> for VarBinData { fn from(value: Vec>) -> Self { Self::from_iter(value, DType::Utf8(Nullability::Nullable)) } } -impl<'a> FromIterator> for VarBinArray { +impl<'a> FromIterator> for VarBinData { fn from_iter>>(iter: T) -> Self { Self::from_iter(iter, DType::Binary(Nullability::Nullable)) } } -impl FromIterator>> for VarBinArray { +impl FromIterator>> for VarBinData { fn from_iter>>>(iter: T) -> Self { Self::from_iter(iter, DType::Binary(Nullability::Nullable)) } } -impl FromIterator> for VarBinArray { +impl FromIterator> for VarBinData { fn from_iter>>(iter: T) -> Self { Self::from_iter(iter, DType::Utf8(Nullability::Nullable)) } } -impl<'a> FromIterator> for VarBinArray { +impl<'a> FromIterator> for VarBinData { fn from_iter>>(iter: T) -> Self { Self::from_iter(iter, DType::Utf8(Nullability::Nullable)) } } + +// --- From and FromIterator forwarding for Array --- + +impl From> for Array { + fn from(value: Vec<&[u8]>) -> Self { + Array::try_from_data(VarBinData::from(value)).vortex_expect("VarBinData is always valid") + } +} + +impl From>> for Array { + fn from(value: Vec>) -> Self { + Array::try_from_data(VarBinData::from(value)).vortex_expect("VarBinData is always valid") + } +} + +impl From> for Array { + fn from(value: Vec) -> Self { + Array::try_from_data(VarBinData::from(value)).vortex_expect("VarBinData is always valid") + } +} + +impl From> for Array { + fn from(value: Vec<&str>) -> Self { + Array::try_from_data(VarBinData::from(value)).vortex_expect("VarBinData is always valid") + } +} + +impl From>> for Array { + fn from(value: Vec>) -> Self { + Array::try_from_data(VarBinData::from(value)).vortex_expect("VarBinData is always valid") + } +} + +impl From>>> for Array { + fn from(value: Vec>>) -> Self { + Array::try_from_data(VarBinData::from(value)).vortex_expect("VarBinData is always valid") + } +} + +impl From>> for Array { + fn from(value: Vec>) -> Self { + Array::try_from_data(VarBinData::from(value)).vortex_expect("VarBinData is always valid") + } +} + +impl From>> for Array { + fn from(value: Vec>) -> Self { + Array::try_from_data(VarBinData::from(value)).vortex_expect("VarBinData is always valid") + } +} + +impl<'a> FromIterator> for Array { + fn from_iter>>(iter: T) -> Self { + Array::try_from_data(>::from_iter(iter)) + .vortex_expect(" is always valid") + } +} + +impl FromIterator>> for Array { + fn from_iter>>>(iter: T) -> Self { + Array::try_from_data(>::from_iter(iter)) + .vortex_expect(" is always valid") + } +} + +impl FromIterator> for Array { + fn from_iter>>(iter: T) -> Self { + Array::try_from_data(>::from_iter(iter)) + .vortex_expect(" is always valid") + } +} + +impl<'a> FromIterator> for Array { + fn from_iter>>(iter: T) -> Self { + Array::try_from_data(>::from_iter(iter)) + .vortex_expect(" is always valid") + } +} diff --git a/vortex-array/src/arrays/varbin/builder.rs b/vortex-array/src/arrays/varbin/builder.rs index 8dd5066a889..b6ee42a8c5f 100644 --- a/vortex-array/src/arrays/varbin/builder.rs +++ b/vortex-array/src/arrays/varbin/builder.rs @@ -7,6 +7,7 @@ use vortex_buffer::BufferMut; use vortex_error::vortex_panic; use crate::IntoArray; +use crate::arrays::Primitive; use crate::arrays::PrimitiveArray; use crate::arrays::VarBinArray; use crate::dtype::DType; @@ -14,6 +15,7 @@ use crate::dtype::IntegerPType; use crate::expr::stats::Precision; use crate::expr::stats::Stat; use crate::validity::Validity; +use crate::vtable::VTable; pub struct VarBinBuilder { offsets: BufferMut, @@ -103,9 +105,7 @@ impl VarBinBuilder { offsets.statistics().compute_is_sorted().unwrap_or(false), "VarBinBuilder offsets must be sorted" ); - offsets - .statistics() - .set(Stat::IsSorted, Precision::Exact(true.into())); + Primitive::stats(&offsets).set(Stat::IsSorted, Precision::Exact(true.into())); // SAFETY: The builder maintains all invariants: // - Offsets are monotonically increasing starting from 0 (guaranteed by builder logic). diff --git a/vortex-array/src/arrays/varbin/compute/cast.rs b/vortex-array/src/arrays/varbin/compute/cast.rs index 4d1f46084ac..05af7ac5d35 100644 --- a/vortex-array/src/arrays/varbin/compute/cast.rs +++ b/vortex-array/src/arrays/varbin/compute/cast.rs @@ -9,10 +9,10 @@ use crate::arrays::VarBin; use crate::arrays::VarBinArray; use crate::dtype::DType; use crate::scalar_fn::fns::cast::CastReduce; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl CastReduce for VarBin { - fn cast(array: &VarBinArray, dtype: &DType) -> VortexResult> { + fn cast(array: &Array, dtype: &DType) -> VortexResult> { if !array.dtype().eq_ignore_nullability(dtype) { return Ok(None); } diff --git a/vortex-array/src/arrays/varbin/compute/compare.rs b/vortex-array/src/arrays/varbin/compute/compare.rs index 07af710f762..2b67bd29d1a 100644 --- a/vortex-array/src/arrays/varbin/compute/compare.rs +++ b/vortex-array/src/arrays/varbin/compute/compare.rs @@ -17,7 +17,6 @@ use crate::IntoArray; use crate::arrays::BoolArray; use crate::arrays::PrimitiveArray; use crate::arrays::VarBin; -use crate::arrays::VarBinArray; use crate::arrays::VarBinViewArray; use crate::arrow::Datum; use crate::arrow::from_arrow_array_with_len; @@ -28,12 +27,12 @@ use crate::match_each_integer_ptype; use crate::scalar_fn::fns::binary::CompareKernel; use crate::scalar_fn::fns::operators::CompareOperator; use crate::scalar_fn::fns::operators::Operator; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; // This implementation exists so we can have custom translation of RHS to arrow that's not the same as IntoCanonical impl CompareKernel for VarBin { fn compare( - lhs: &VarBinArray, + lhs: &Array, rhs: &ArrayRef, operator: CompareOperator, ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/arrays/varbin/compute/filter.rs b/vortex-array/src/arrays/varbin/compute/filter.rs index ba41c60f273..c9ed97a8fc4 100644 --- a/vortex-array/src/arrays/varbin/compute/filter.rs +++ b/vortex-array/src/arrays/varbin/compute/filter.rs @@ -23,11 +23,11 @@ use crate::dtype::DType; use crate::dtype::IntegerPType; use crate::match_each_integer_ptype; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl FilterKernel for VarBin { fn filter( - array: &VarBinArray, + array: &Array, mask: &Mask, ctx: &mut ExecutionCtx, ) -> VortexResult> { @@ -36,7 +36,7 @@ impl FilterKernel for VarBin { } fn filter_select_var_bin( - arr: &VarBinArray, + arr: &Array, mask: &Mask, ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -55,7 +55,7 @@ fn filter_select_var_bin( } fn filter_select_var_bin_by_slice( - values: &VarBinArray, + values: &Array, mask_slices: &[(usize, usize)], selection_count: usize, ctx: &mut ExecutionCtx, @@ -154,7 +154,7 @@ fn update_non_nullable_slice( } fn filter_select_var_bin_by_index( - values: &VarBinArray, + values: &Array, mask_indices: &[usize], selection_count: usize, ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/arrays/varbin/compute/mask.rs b/vortex-array/src/arrays/varbin/compute/mask.rs index 3169adaf0ff..60d80400766 100644 --- a/vortex-array/src/arrays/varbin/compute/mask.rs +++ b/vortex-array/src/arrays/varbin/compute/mask.rs @@ -9,10 +9,10 @@ use crate::arrays::VarBin; use crate::arrays::VarBinArray; use crate::scalar_fn::fns::mask::MaskReduce; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl MaskReduce for VarBin { - fn mask(array: &VarBinArray, mask: &ArrayRef) -> VortexResult> { + fn mask(array: &Array, mask: &ArrayRef) -> VortexResult> { Ok(Some( VarBinArray::try_new( array.offsets().clone(), diff --git a/vortex-array/src/arrays/varbin/compute/slice.rs b/vortex-array/src/arrays/varbin/compute/slice.rs index 5c14088c324..6e65e09bbaa 100644 --- a/vortex-array/src/arrays/varbin/compute/slice.rs +++ b/vortex-array/src/arrays/varbin/compute/slice.rs @@ -10,21 +10,22 @@ use crate::IntoArray; use crate::arrays::VarBin; use crate::arrays::VarBinArray; use crate::arrays::slice::SliceReduce; +use crate::vtable::Array; impl SliceReduce for VarBin { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { VarBin::_slice(array, range).map(Some) } } impl VarBin { - pub fn _slice(array: &VarBinArray, range: Range) -> VortexResult { + pub fn _slice(array: &Array, range: Range) -> VortexResult { Ok(unsafe { VarBinArray::new_unchecked_from_handle( array.offsets().slice(range.start..range.end + 1)?, array.bytes_handle().clone(), array.dtype().clone(), - array.validity()?.slice(range)?, + array.validity().slice(range)?, ) .into_array() }) diff --git a/vortex-array/src/arrays/varbin/compute/take.rs b/vortex-array/src/arrays/varbin/compute/take.rs index 48ebf506d02..c81ff679497 100644 --- a/vortex-array/src/arrays/varbin/compute/take.rs +++ b/vortex-array/src/arrays/varbin/compute/take.rs @@ -20,10 +20,11 @@ use crate::dtype::IntegerPType; use crate::executor::ExecutionCtx; use crate::match_each_integer_ptype; use crate::validity::Validity; +use crate::vtable::Array; impl TakeExecute for VarBin { fn take( - array: &VarBinArray, + array: &Array, indices: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult> { diff --git a/vortex-array/src/arrays/varbin/mod.rs b/vortex-array/src/arrays/varbin/mod.rs index 6cdfb228a6d..dc3fa89f746 100644 --- a/vortex-array/src/arrays/varbin/mod.rs +++ b/vortex-array/src/arrays/varbin/mod.rs @@ -2,7 +2,8 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::VarBinArray; +pub use array::VarBinData; +pub use vtable::VarBinArray; pub(crate) mod compute; diff --git a/vortex-array/src/arrays/varbin/vtable/canonical.rs b/vortex-array/src/arrays/varbin/vtable/canonical.rs index 17dae4a4fbe..b57c798a811 100644 --- a/vortex-array/src/arrays/varbin/vtable/canonical.rs +++ b/vortex-array/src/arrays/varbin/vtable/canonical.rs @@ -22,7 +22,7 @@ pub(crate) fn varbin_to_canonical( array: &VarBinArray, ctx: &mut ExecutionCtx, ) -> VortexResult { - let (dtype, bytes, offsets, validity) = array.clone().into_parts(); + let (dtype, bytes, offsets, validity) = array.clone().into_data().into_parts(); let offsets = offsets.execute::(ctx)?; diff --git a/vortex-array/src/arrays/varbin/vtable/mod.rs b/vortex-array/src/arrays/varbin/vtable/mod.rs index 4980994dbfb..c2ae961417f 100644 --- a/vortex-array/src/arrays/varbin/vtable/mod.rs +++ b/vortex-array/src/arrays/varbin/vtable/mod.rs @@ -16,7 +16,7 @@ use crate::ExecutionResult; use crate::IntoArray; use crate::ProstMetadata; use crate::SerializeMetadata; -use crate::arrays::VarBinArray; +use crate::arrays::varbin::VarBinData; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::dtype::Nullability; @@ -44,9 +44,9 @@ use crate::Precision; use crate::arrays::varbin::compute::rules::PARENT_RULES; use crate::hash::ArrayEq; use crate::hash::ArrayHash; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; -vtable!(VarBin); +vtable!(VarBin, VarBin, VarBinData); #[derive(Clone, prost::Message)] pub struct VarBinMetadata { @@ -55,12 +55,12 @@ pub struct VarBinMetadata { } impl VTable for VarBin { - type Array = VarBinArray; + type ArrayData = VarBinData; type Metadata = ProstMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValidityHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &VarBinData) -> &Self { &VarBin } @@ -68,55 +68,55 @@ impl VTable for VarBin { Self::ID } - fn len(array: &VarBinArray) -> usize { + fn len(array: &VarBinData) -> usize { array.offsets().len().saturating_sub(1) } - fn dtype(array: &VarBinArray) -> &DType { + fn dtype(array: &VarBinData) -> &DType { &array.dtype } - fn stats(array: &VarBinArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &VarBinData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &VarBinArray, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); array.bytes().array_hash(state, precision); array.offsets().array_hash(state, precision); array.validity.array_hash(state, precision); } - fn array_eq(array: &VarBinArray, other: &VarBinArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.bytes().array_eq(other.bytes(), precision) && array.offsets().array_eq(other.offsets(), precision) && array.validity.array_eq(&other.validity, precision) } - fn nbuffers(_array: &VarBinArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 1 } - fn buffer(array: &VarBinArray, idx: usize) -> BufferHandle { + fn buffer(array: &Array, idx: usize) -> BufferHandle { match idx { 0 => array.bytes_handle().clone(), _ => vortex_panic!("VarBinArray buffer index {idx} out of bounds"), } } - fn buffer_name(_array: &VarBinArray, idx: usize) -> Option { + fn buffer_name(_array: &Array, idx: usize) -> Option { match idx { 0 => Some("bytes".to_string()), _ => vortex_panic!("VarBinArray buffer_name index {idx} out of bounds"), } } - fn nchildren(array: &VarBinArray) -> usize { + fn nchildren(array: &Array) -> usize { 1 + validity_nchildren(&array.validity) } - fn child(array: &VarBinArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.offsets().clone(), 1 => validity_to_child(&array.validity, array.len()) @@ -125,7 +125,7 @@ impl VTable for VarBin { } } - fn child_name(_array: &VarBinArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "offsets".to_string(), 1 => "validity".to_string(), @@ -133,7 +133,7 @@ impl VTable for VarBin { } } - fn metadata(array: &VarBinArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Ok(ProstMetadata(VarBinMetadata { offsets_ptype: PType::try_from(array.offsets().dtype()) .vortex_expect("Must be a valid PType") as i32, @@ -162,7 +162,7 @@ impl VTable for VarBin { metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let validity = if children.len() == 1 { Validity::from(dtype.nullability()) } else if children.len() == 2 { @@ -183,10 +183,10 @@ impl VTable for VarBin { } let bytes = buffers[0].clone().try_to_host_sync()?; - VarBinArray::try_new(offsets, bytes, dtype.clone(), validity) + VarBinData::try_new(offsets, bytes, dtype.clone(), validity) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { match children.len() { 1 => { let [offsets]: [ArrayRef; 1] = children diff --git a/vortex-array/src/arrays/varbin/vtable/operations.rs b/vortex-array/src/arrays/varbin/vtable/operations.rs index caf484be143..f18ac59f9de 100644 --- a/vortex-array/src/arrays/varbin/vtable/operations.rs +++ b/vortex-array/src/arrays/varbin/vtable/operations.rs @@ -5,14 +5,14 @@ use vortex_error::VortexResult; use crate::ExecutionCtx; use crate::arrays::VarBin; -use crate::arrays::VarBinArray; use crate::arrays::varbin::varbin_scalar; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for VarBin { fn scalar_at( - array: &VarBinArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { diff --git a/vortex-array/src/arrays/varbin/vtable/validity.rs b/vortex-array/src/arrays/varbin/vtable/validity.rs index f436968206c..6c4b9e92c39 100644 --- a/vortex-array/src/arrays/varbin/vtable/validity.rs +++ b/vortex-array/src/arrays/varbin/vtable/validity.rs @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use crate::arrays::VarBinArray; +use crate::arrays::varbin::VarBinData; use crate::validity::Validity; use crate::vtable::ValidityHelper; -impl ValidityHelper for VarBinArray { +impl ValidityHelper for VarBinData { fn validity(&self) -> &Validity { &self.validity } diff --git a/vortex-array/src/arrays/varbinview/accessor.rs b/vortex-array/src/arrays/varbinview/accessor.rs index d494c4711a7..72c98beee5e 100644 --- a/vortex-array/src/arrays/varbinview/accessor.rs +++ b/vortex-array/src/arrays/varbinview/accessor.rs @@ -7,14 +7,13 @@ use crate::ToCanonical; use crate::accessor::ArrayAccessor; use crate::arrays::VarBinViewArray; use crate::validity::Validity; -use crate::vtable::ValidityHelper; impl ArrayAccessor<[u8]> for VarBinViewArray { fn with_iterator FnOnce(&mut dyn Iterator>) -> R, R>( &self, f: F, ) -> R { - let bytes = (0..self.nbuffers()) + let bytes = (0..self.data_buffers().len()) .map(|i| self.buffer(i)) .collect::>(); diff --git a/vortex-array/src/arrays/varbinview/array.rs b/vortex-array/src/arrays/varbinview/array.rs index 0c1276c928f..4c2c3a93220 100644 --- a/vortex-array/src/arrays/varbinview/array.rs +++ b/vortex-array/src/arrays/varbinview/array.rs @@ -1,6 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors +use std::mem::size_of; use std::sync::Arc; use vortex_buffer::Alignment; @@ -12,7 +13,9 @@ use vortex_error::vortex_bail; use vortex_error::vortex_ensure; use vortex_error::vortex_err; use vortex_error::vortex_panic; +use vortex_mask::Mask; +use crate::arrays::VarBinView; use crate::arrays::varbinview::BinaryView; use crate::buffer::BufferHandle; use crate::builders::ArrayBuilder; @@ -21,6 +24,7 @@ use crate::dtype::DType; use crate::dtype::Nullability; use crate::stats::ArrayStats; use crate::validity::Validity; +use crate::vtable::Array; /// A variable-length binary view array that stores strings and binary data efficiently. /// @@ -82,7 +86,7 @@ use crate::validity::Validity; /// assert_eq!(second.as_slice(), b"this string is outlined"); // Long string /// ``` #[derive(Clone, Debug)] -pub struct VarBinViewArray { +pub struct VarBinViewData { pub(super) dtype: DType, pub(super) buffers: Arc<[BufferHandle]>, pub(super) views: BufferHandle, @@ -97,13 +101,13 @@ pub struct VarBinViewArrayParts { pub validity: Validity, } -impl VarBinViewArray { - /// Creates a new [`VarBinViewArray`]. +impl VarBinViewData { + /// Creates a new `VarBinViewArray`. /// /// # Panics /// /// Panics if the provided components do not satisfy the invariants documented - /// in [`VarBinViewArray::new_unchecked`]. + /// in `VarBinViewArray::new_unchecked`. pub fn new( views: Buffer, buffers: Arc<[ByteBuffer]>, @@ -114,12 +118,12 @@ impl VarBinViewArray { .vortex_expect("VarBinViewArray construction failed") } - /// Creates a new [`VarBinViewArray`] with device or host memory. + /// Creates a new `VarBinViewArray` with device or host memory. /// /// # Panics /// /// Panics if the provided components do not satisfy the invariants documented - /// in [`VarBinViewArray::new_unchecked`]. + /// in `VarBinViewArray::new_unchecked`. pub fn new_handle( views: BufferHandle, buffers: Arc<[BufferHandle]>, @@ -132,12 +136,12 @@ impl VarBinViewArray { /// Constructs a new `VarBinViewArray`. /// - /// See [`VarBinViewArray::new_unchecked`] for more information. + /// See `VarBinViewArray::new_unchecked` for more information. /// /// # Errors /// /// Returns an error if the provided components do not satisfy the invariants documented in - /// [`VarBinViewArray::new_unchecked`]. + /// `VarBinViewArray::new_unchecked`. pub fn try_new( views: Buffer, buffers: Arc<[ByteBuffer]>, @@ -152,12 +156,12 @@ impl VarBinViewArray { /// Constructs a new `VarBinViewArray`. /// - /// See [`VarBinViewArray::new_unchecked`] for more information. + /// See `VarBinViewArray::new_unchecked` for more information. /// /// # Errors /// /// Returns an error if the provided components do not satisfy the invariants documented in - /// [`VarBinViewArray::new_unchecked`]. + /// `VarBinViewArray::new_unchecked`. pub fn try_new_handle( views: BufferHandle, buffers: Arc<[BufferHandle]>, @@ -183,7 +187,7 @@ impl VarBinViewArray { Ok(unsafe { Self::new_handle_unchecked(views, buffers, dtype, validity) }) } - /// Creates a new [`VarBinViewArray`] without validation from these components: + /// Creates a new `VarBinViewArray` without validation from these components: /// /// * `views` is a buffer of 16-byte view entries (one per logical element). /// * `buffers` contains the backing storage for strings longer than 12 bytes. @@ -253,9 +257,9 @@ impl VarBinViewArray { } } - /// Validates the components that would be used to create a [`VarBinViewArray`]. + /// Validates the components that would be used to create a `VarBinViewArray`. /// - /// This function checks all the invariants required by [`VarBinViewArray::new_unchecked`]. + /// This function checks all the invariants required by `VarBinViewArray::new_unchecked`. pub fn validate( views: &Buffer, buffers: &Arc<[ByteBuffer]>, @@ -309,7 +313,7 @@ impl VarBinViewArray { let end_offset = start_offset.saturating_add(view.size as usize); let buf = buffers.get(buf_index).ok_or_else(|| - vortex_err!(InvalidArgument: "view at index {idx} references invalid buffer: {buf_index} out of bounds for VarBinViewArray with {} buffers", + vortex_err!(InvalidArgument: "view at index {idx} references invalid buffer: {buf_index} out of bounds for VarBinViewData with {} buffers", buffers.len()))?; vortex_ensure!( @@ -342,6 +346,32 @@ impl VarBinViewArray { Ok(()) } + /// Returns the length of this array. + pub fn len(&self) -> usize { + self.views.len() / size_of::() + } + + /// Returns the [`DType`] of this array. + pub fn dtype(&self) -> &DType { + &self.dtype + } + + /// Returns `true` if this array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Returns the [`Validity`] of this array. + #[allow(clippy::same_name_method)] + pub fn validity(&self) -> &Validity { + &self.validity + } + + /// Returns the validity as a [`Mask`]. + pub fn validity_mask(&self) -> Mask { + self.validity.to_mask(self.len()) + } + /// Splits the array into owned parts pub fn into_parts(self) -> VarBinViewArrayParts { VarBinViewArrayParts { @@ -352,11 +382,6 @@ impl VarBinViewArray { } } - /// Number of raw string data buffers held by this array. - pub fn nbuffers(&self) -> usize { - self.buffers.len() - } - /// Access to the primitive views buffer. /// /// Variable-sized binary view buffer contain a "view" child array, with 16-byte entries that @@ -406,18 +431,18 @@ impl VarBinViewArray { /// at construction time. #[inline] pub fn buffer(&self, idx: usize) -> &ByteBuffer { - if idx >= self.nbuffers() { + if idx >= self.data_buffers().len() { vortex_panic!( "{idx} buffer index out of bounds, there are {} buffers", - self.nbuffers() + self.data_buffers().len() ); } self.buffers[idx].as_host() } - /// Iterate over the underlying raw data buffers, not including the views buffer. + /// The underlying raw data buffers, not including the views buffer. #[inline] - pub fn buffers(&self) -> &Arc<[BufferHandle]> { + pub fn data_buffers(&self) -> &Arc<[BufferHandle]> { &self.buffers } @@ -440,7 +465,7 @@ impl VarBinViewArray { } } - builder.finish_into_varbinview() + builder.finish_into_varbinview().into_data() } pub fn from_iter_str, I: IntoIterator>(iter: I) -> Self { @@ -454,7 +479,7 @@ impl VarBinViewArray { builder.append_value(item.as_ref()); } - builder.finish_into_varbinview() + builder.finish_into_varbinview().into_data() } pub fn from_iter_nullable_str, I: IntoIterator>>( @@ -473,7 +498,7 @@ impl VarBinViewArray { } } - builder.finish_into_varbinview() + builder.finish_into_varbinview().into_data() } pub fn from_iter_bin, I: IntoIterator>(iter: I) -> Self { @@ -487,7 +512,7 @@ impl VarBinViewArray { builder.append_value(item.as_ref()); } - builder.finish_into_varbinview() + builder.finish_into_varbinview().into_data() } pub fn from_iter_nullable_bin, I: IntoIterator>>( @@ -506,30 +531,154 @@ impl VarBinViewArray { } } - builder.finish_into_varbinview() + builder.finish_into_varbinview().into_data() } } -impl<'a> FromIterator> for VarBinViewArray { +impl Array { + /// Construct a `VarBinViewArray` from an iterator of optional byte slices. + #[expect( + clippy::same_name_method, + reason = "intentionally named from_iter like Iterator::from_iter" + )] + pub fn from_iter, I: IntoIterator>>( + iter: I, + dtype: DType, + ) -> Self { + Array::try_from_data(VarBinViewData::from_iter(iter, dtype)) + .vortex_expect("VarBinViewData is always valid") + } + + pub fn from_iter_str, I: IntoIterator>(iter: I) -> Self { + Array::try_from_data(VarBinViewData::from_iter_str(iter)) + .vortex_expect("VarBinViewData is always valid") + } + + pub fn from_iter_nullable_str, I: IntoIterator>>( + iter: I, + ) -> Self { + Array::try_from_data(VarBinViewData::from_iter_nullable_str(iter)) + .vortex_expect("VarBinViewData is always valid") + } + + pub fn from_iter_bin, I: IntoIterator>(iter: I) -> Self { + Array::try_from_data(VarBinViewData::from_iter_bin(iter)) + .vortex_expect("VarBinViewData is always valid") + } + + pub fn from_iter_nullable_bin, I: IntoIterator>>( + iter: I, + ) -> Self { + Array::try_from_data(VarBinViewData::from_iter_nullable_bin(iter)) + .vortex_expect("VarBinViewData is always valid") + } + + /// Creates a new `VarBinViewArray`. + pub fn try_new( + views: Buffer, + buffers: Arc<[ByteBuffer]>, + dtype: DType, + validity: Validity, + ) -> VortexResult { + Array::try_from_data(VarBinViewData::try_new(views, buffers, dtype, validity)?) + } + + /// Creates a new `VarBinViewArray` without validation. + /// + /// # Safety + /// + /// See [`VarBinViewData::new_unchecked`]. + pub unsafe fn new_unchecked( + views: Buffer, + buffers: Arc<[ByteBuffer]>, + dtype: DType, + validity: Validity, + ) -> Self { + Array::try_from_data(unsafe { + VarBinViewData::new_unchecked(views, buffers, dtype, validity) + }) + .vortex_expect("VarBinViewData is always valid") + } + + /// Creates a new `VarBinViewArray` with device or host memory. + pub fn new_handle( + views: BufferHandle, + buffers: Arc<[BufferHandle]>, + dtype: DType, + validity: Validity, + ) -> Self { + Array::try_from_data(VarBinViewData::new_handle(views, buffers, dtype, validity)) + .vortex_expect("VarBinViewData is always valid") + } + + /// Construct a new array from `BufferHandle`s without validation. + /// + /// # Safety + /// + /// See [`VarBinViewData::new_handle_unchecked`]. + pub unsafe fn new_handle_unchecked( + views: BufferHandle, + buffers: Arc<[BufferHandle]>, + dtype: DType, + validity: Validity, + ) -> Self { + Array::try_from_data(unsafe { + VarBinViewData::new_handle_unchecked(views, buffers, dtype, validity) + }) + .vortex_expect("VarBinViewData is always valid") + } +} + +impl<'a> FromIterator> for VarBinViewData { fn from_iter>>(iter: T) -> Self { Self::from_iter_nullable_bin(iter) } } -impl FromIterator>> for VarBinViewArray { +impl FromIterator>> for VarBinViewData { fn from_iter>>>(iter: T) -> Self { Self::from_iter_nullable_bin(iter) } } -impl FromIterator> for VarBinViewArray { +impl FromIterator> for VarBinViewData { fn from_iter>>(iter: T) -> Self { Self::from_iter_nullable_str(iter) } } -impl<'a> FromIterator> for VarBinViewArray { +impl<'a> FromIterator> for VarBinViewData { fn from_iter>>(iter: T) -> Self { Self::from_iter_nullable_str(iter) } } + +// --- FromIterator forwarding for Array --- + +impl<'a> FromIterator> for Array { + fn from_iter>>(iter: T) -> Self { + Array::try_from_data(>::from_iter(iter)) + .vortex_expect(" is always valid") + } +} + +impl FromIterator>> for Array { + fn from_iter>>>(iter: T) -> Self { + Array::try_from_data(>::from_iter(iter)) + .vortex_expect(" is always valid") + } +} + +impl FromIterator> for Array { + fn from_iter>>(iter: T) -> Self { + Array::try_from_data(>::from_iter(iter)) + .vortex_expect(" is always valid") + } +} + +impl<'a> FromIterator> for Array { + fn from_iter>>(iter: T) -> Self { + Array::try_from_data(>::from_iter(iter)) + .vortex_expect(" is always valid") + } +} diff --git a/vortex-array/src/arrays/varbinview/compact.rs b/vortex-array/src/arrays/varbinview/compact.rs index e446f6ae789..c7709fb4895 100644 --- a/vortex-array/src/arrays/varbinview/compact.rs +++ b/vortex-array/src/arrays/varbinview/compact.rs @@ -36,7 +36,7 @@ impl VarBinViewArray { } fn should_compact(&self) -> VortexResult { - let nbuffers = self.nbuffers(); + let nbuffers = self.data_buffers().len(); // If the array is entirely inlined strings, do not attempt to compact. if nbuffers == 0 { @@ -93,7 +93,7 @@ impl VarBinViewArray { pub(crate) fn buffer_utilizations(&self) -> VortexResult> { let mut utilizations: Vec = self - .buffers() + .data_buffers() .iter() .map(|buf| { let len = u32::try_from(buf.len()).vortex_expect("buffer sizes must fit in u32"); @@ -207,8 +207,8 @@ mod tests { ]); // Verify it has buffers - assert!(original.nbuffers() > 0); - let original_buffers = original.nbuffers(); + assert!(!original.data_buffers().is_empty()); + let original_buffers = original.data_buffers().len(); // Take only the first and last elements (indices 0 and 4) let indices = buffer![0u32, 4u32].into_array(); @@ -217,7 +217,7 @@ mod tests { .execute::(&mut LEGACY_SESSION.create_execution_ctx()) .unwrap(); // The taken array should still have the same number of buffers - assert_eq!(taken.nbuffers(), original_buffers); + assert_eq!(taken.data_buffers().len(), original_buffers); // Now optimize the taken array let optimized_array = taken.compact_buffers().unwrap(); @@ -225,7 +225,7 @@ mod tests { // The optimized array should have compacted buffers // Since both remaining strings are short, they should be inlined // so we might have 0 buffers, or 1 buffer if any were not inlined - assert!(optimized_array.nbuffers() <= 1); + assert!(optimized_array.data_buffers().len() <= 1); // Verify the data is still correct assert_arrays_eq!( @@ -260,7 +260,7 @@ mod tests { let optimized_array = taken_array.compact_buffers().unwrap(); // The optimized array should have exactly 1 buffer (consolidated) - assert_eq!(optimized_array.nbuffers(), 1); + assert_eq!(optimized_array.data_buffers().len(), 1); // Verify the data is still correct assert_arrays_eq!( @@ -275,12 +275,12 @@ mod tests { let original = VarBinViewArray::from_iter_str(["a", "bb", "ccc", "dddd"]); // This should have no buffers - assert_eq!(original.nbuffers(), 0); + assert_eq!(original.data_buffers().len(), 0); // Optimize should return the same array let optimized_array = original.compact_buffers().unwrap(); - assert_eq!(optimized_array.nbuffers(), 0); + assert_eq!(optimized_array.data_buffers().len(), 0); assert_arrays_eq!(optimized_array, original); } @@ -293,13 +293,13 @@ mod tests { let original = VarBinViewArray::from_iter_str([str1, str2]); // Should have 1 compact buffer - assert_eq!(original.nbuffers(), 1); + assert_eq!(original.data_buffers().len(), 1); assert_eq!(original.buffer(0).len(), str1.len() + str2.len()); // Optimize should return the same array (no change needed) let optimized_array = original.compact_buffers().unwrap(); - assert_eq!(optimized_array.nbuffers(), 1); + assert_eq!(optimized_array.data_buffers().len(), 1); assert_arrays_eq!(optimized_array, original); } @@ -312,7 +312,7 @@ mod tests { "another very long string that definitely needs a buffer to store it", ]); - let original_buffers = original.nbuffers(); + let original_buffers = original.data_buffers().len(); assert!(original_buffers > 0); // Take only first element @@ -325,7 +325,7 @@ mod tests { let compacted = taken.compact_with_threshold(0.0).unwrap(); // Should still have the same number of buffers as the taken array - assert_eq!(compacted.nbuffers(), taken.nbuffers()); + assert_eq!(compacted.data_buffers().len(), taken.data_buffers().len()); // Verify correctness assert_arrays_eq!(compacted, taken); @@ -348,13 +348,13 @@ mod tests { .execute::(&mut LEGACY_SESSION.create_execution_ctx()) .unwrap(); - let original_buffers = taken.nbuffers(); + let original_buffers = taken.data_buffers().len(); // Compact with threshold=1.0 (aggressive compaction) let compacted = taken.compact_with_threshold(1.0).unwrap(); // Should have compacted buffers - assert!(compacted.nbuffers() <= original_buffers); + assert!(compacted.data_buffers().len() <= original_buffers); // Verify correctness assert_arrays_eq!(compacted, taken); @@ -370,13 +370,13 @@ mod tests { let original = VarBinViewArray::from_iter_str([str1, str2, str3]); // All strings should be in one well-utilized buffer - assert_eq!(original.nbuffers(), 1); + assert_eq!(original.data_buffers().len(), 1); // Compact with high threshold let compacted = original.compact_with_threshold(0.8).unwrap(); // Well-utilized buffer should be preserved - assert_eq!(compacted.nbuffers(), 1); + assert_eq!(compacted.data_buffers().len(), 1); // Verify all data is correct assert_arrays_eq!(compacted, original); @@ -430,7 +430,7 @@ mod tests { .unwrap(); // Get buffer stats before compaction let utils_before = taken.buffer_utilizations().unwrap(); - let original_buffer_count = taken.nbuffers(); + let original_buffer_count = taken.data_buffers().len(); // Compact with a threshold that should trigger slicing // The range utilization should be high even if overall utilization is low @@ -438,7 +438,7 @@ mod tests { // After compaction, we should still have buffers (sliced, not rewritten) assert!( - compacted.nbuffers() > 0, + !compacted.data_buffers().is_empty(), "Should have buffers after slice compaction" ); @@ -449,7 +449,7 @@ mod tests { // (it was sliced, not rewritten into multiple buffers) if original_buffer_count == 1 && utils_before[0].range_utilization() >= 0.8 { assert_eq!( - compacted.nbuffers(), + compacted.data_buffers().len(), 1, "Slice strategy should maintain single buffer" ); diff --git a/vortex-array/src/arrays/varbinview/compute/cast.rs b/vortex-array/src/arrays/varbinview/compute/cast.rs index 5486e576740..46e6b7ca163 100644 --- a/vortex-array/src/arrays/varbinview/compute/cast.rs +++ b/vortex-array/src/arrays/varbinview/compute/cast.rs @@ -9,10 +9,10 @@ use crate::arrays::VarBinView; use crate::arrays::VarBinViewArray; use crate::dtype::DType; use crate::scalar_fn::fns::cast::CastReduce; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl CastReduce for VarBinView { - fn cast(array: &VarBinViewArray, dtype: &DType) -> VortexResult> { + fn cast(array: &Array, dtype: &DType) -> VortexResult> { if !array.dtype().eq_ignore_nullability(dtype) { return Ok(None); } @@ -29,7 +29,7 @@ impl CastReduce for VarBinView { Ok(Some( VarBinViewArray::new_handle_unchecked( array.views_handle().clone(), - array.buffers().clone(), + array.data_buffers().clone(), new_dtype, new_validity, ) diff --git a/vortex-array/src/arrays/varbinview/compute/mask.rs b/vortex-array/src/arrays/varbinview/compute/mask.rs index dae65ab40bd..deb661207d1 100644 --- a/vortex-array/src/arrays/varbinview/compute/mask.rs +++ b/vortex-array/src/arrays/varbinview/compute/mask.rs @@ -9,16 +9,16 @@ use crate::arrays::VarBinView; use crate::arrays::VarBinViewArray; use crate::scalar_fn::fns::mask::MaskReduce; use crate::validity::Validity; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl MaskReduce for VarBinView { - fn mask(array: &VarBinViewArray, mask: &ArrayRef) -> VortexResult> { + fn mask(array: &Array, mask: &ArrayRef) -> VortexResult> { // SAFETY: masking the validity does not affect the invariants unsafe { Ok(Some( VarBinViewArray::new_handle_unchecked( array.views_handle().clone(), - array.buffers().clone(), + array.data_buffers().clone(), array.dtype().as_nullable(), array .validity() diff --git a/vortex-array/src/arrays/varbinview/compute/slice.rs b/vortex-array/src/arrays/varbinview/compute/slice.rs index 02582841601..1f7d8d8a1bc 100644 --- a/vortex-array/src/arrays/varbinview/compute/slice.rs +++ b/vortex-array/src/arrays/varbinview/compute/slice.rs @@ -12,17 +12,18 @@ use crate::arrays::VarBinView; use crate::arrays::VarBinViewArray; use crate::arrays::slice::SliceReduce; use crate::arrays::varbinview::BinaryView; +use crate::vtable::Array; impl SliceReduce for VarBinView { - fn slice(array: &Self::Array, range: Range) -> VortexResult> { + fn slice(array: &Array, range: Range) -> VortexResult> { Ok(Some( VarBinViewArray::new_handle( array .views_handle() .slice_typed::(range.clone()), - Arc::clone(array.buffers()), + Arc::clone(array.data_buffers()), array.dtype().clone(), - array.validity()?.slice(range)?, + array.validity().slice(range)?, ) .into_array(), )) diff --git a/vortex-array/src/arrays/varbinview/compute/take.rs b/vortex-array/src/arrays/varbinview/compute/take.rs index b3620aaaaf0..ed204da9802 100644 --- a/vortex-array/src/arrays/varbinview/compute/take.rs +++ b/vortex-array/src/arrays/varbinview/compute/take.rs @@ -19,12 +19,12 @@ use crate::arrays::varbinview::BinaryView; use crate::buffer::BufferHandle; use crate::executor::ExecutionCtx; use crate::match_each_integer_ptype; -use crate::vtable::ValidityHelper; +use crate::vtable::Array; impl TakeExecute for VarBinView { /// Take involves creating a new array that references the old array, just with the given set of views. fn take( - array: &VarBinViewArray, + array: &Array, indices: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult> { @@ -41,7 +41,7 @@ impl TakeExecute for VarBinView { Ok(Some( VarBinViewArray::new_handle_unchecked( BufferHandle::new_host(views_buffer.into_byte_buffer()), - array.buffers().clone(), + array.data_buffers().clone(), array .dtype() .union_nullability(indices.dtype().nullability()), diff --git a/vortex-array/src/arrays/varbinview/compute/zip.rs b/vortex-array/src/arrays/varbinview/compute/zip.rs index b4211c726a2..56557f8d3eb 100644 --- a/vortex-array/src/arrays/varbinview/compute/zip.rs +++ b/vortex-array/src/arrays/varbinview/compute/zip.rs @@ -18,12 +18,13 @@ use crate::arrays::varbinview::BinaryView; use crate::builders::DeduplicatedBuffers; use crate::builders::LazyBitBufferBuilder; use crate::scalar_fn::fns::zip::ZipKernel; +use crate::vtable::Array; // A dedicated VarBinView zip kernel that builds the result directly by adjusting views and validity, // instead of routing through the generic builder (which would redo buffer lookups per mask slice). impl ZipKernel for VarBinView { fn zip( - if_true: &VarBinViewArray, + if_true: &Array, if_false: &ArrayRef, mask: &ArrayRef, ctx: &mut ExecutionCtx, @@ -45,9 +46,9 @@ impl ZipKernel for VarBinView { // to the new buffer index in the result array let mut buffers = DeduplicatedBuffers::default(); let true_lookup = - buffers.extend_from_iter(if_true.buffers().iter().map(|b| b.as_host().clone())); + buffers.extend_from_iter(if_true.data_buffers().iter().map(|b| b.as_host().clone())); let false_lookup = - buffers.extend_from_iter(if_false.buffers().iter().map(|b| b.as_host().clone())); + buffers.extend_from_iter(if_false.data_buffers().iter().map(|b| b.as_host().clone())); let mut views_builder = BufferMut::::with_capacity(len); let mut validity_builder = LazyBitBufferBuilder::new(len); @@ -127,7 +128,7 @@ impl ZipKernel for VarBinView { } fn push_range( - array: &VarBinViewArray, + array: &Array, buffer_lookup: &[u32], validity: &Mask, range: Range, diff --git a/vortex-array/src/arrays/varbinview/mod.rs b/vortex-array/src/arrays/varbinview/mod.rs index b0520591e0c..d29fd5bf3e5 100644 --- a/vortex-array/src/arrays/varbinview/mod.rs +++ b/vortex-array/src/arrays/varbinview/mod.rs @@ -2,8 +2,9 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors mod array; -pub use array::VarBinViewArray; pub use array::VarBinViewArrayParts; +pub use array::VarBinViewData; +pub use vtable::VarBinViewArray; mod accessor; pub(crate) mod compact; diff --git a/vortex-array/src/arrays/varbinview/vtable/mod.rs b/vortex-array/src/arrays/varbinview/vtable/mod.rs index 212c1c2bb6c..553400a3b28 100644 --- a/vortex-array/src/arrays/varbinview/vtable/mod.rs +++ b/vortex-array/src/arrays/varbinview/vtable/mod.rs @@ -19,15 +19,15 @@ use crate::EmptyMetadata; use crate::ExecutionCtx; use crate::ExecutionResult; use crate::Precision; -use crate::arrays::VarBinViewArray; use crate::arrays::varbinview::BinaryView; +use crate::arrays::varbinview::VarBinViewData; use crate::arrays::varbinview::compute::rules::PARENT_RULES; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::hash::ArrayEq; use crate::hash::ArrayHash; use crate::serde::ArrayChildren; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::validity::Validity; use crate::vtable; use crate::vtable::Array; @@ -39,7 +39,7 @@ use crate::vtable::validity_to_child; mod kernel; mod operations; mod validity; -vtable!(VarBinView); +vtable!(VarBinView, VarBinView, VarBinViewData); #[derive(Clone, Debug)] pub struct VarBinView; @@ -49,12 +49,12 @@ impl VarBinView { } impl VTable for VarBinView { - type Array = VarBinViewArray; + type ArrayData = VarBinViewData; type Metadata = EmptyMetadata; type OperationsVTable = Self; type ValidityVTable = ValidityVTableFromValidityHelper; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &VarBinViewData) -> &Self { &VarBinView } @@ -62,23 +62,19 @@ impl VTable for VarBinView { Self::ID } - fn len(array: &VarBinViewArray) -> usize { + fn len(array: &VarBinViewData) -> usize { array.views_handle().len() / size_of::() } - fn dtype(array: &VarBinViewArray) -> &DType { + fn dtype(array: &VarBinViewData) -> &DType { &array.dtype } - fn stats(array: &VarBinViewArray) -> StatsSetRef<'_> { - array.stats_set.to_ref(array.as_ref()) + fn stats(array: &VarBinViewData) -> &ArrayStats { + &array.stats_set } - fn array_hash( - array: &VarBinViewArray, - state: &mut H, - precision: Precision, - ) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.dtype.hash(state); for buffer in array.buffers.iter() { buffer.array_hash(state, precision); @@ -87,7 +83,7 @@ impl VTable for VarBinView { array.validity.array_hash(state, precision); } - fn array_eq(array: &VarBinViewArray, other: &VarBinViewArray, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.dtype == other.dtype && array.buffers.len() == other.buffers.len() && array @@ -99,14 +95,14 @@ impl VTable for VarBinView { && array.validity.array_eq(&other.validity, precision) } - fn nbuffers(array: &VarBinViewArray) -> usize { - array.buffers().len() + 1 + fn nbuffers(array: &Array) -> usize { + array.data_buffers().len() + 1 } - fn buffer(array: &VarBinViewArray, idx: usize) -> BufferHandle { - let ndata = array.buffers().len(); + fn buffer(array: &Array, idx: usize) -> BufferHandle { + let ndata = array.data_buffers().len(); if idx < ndata { - array.buffers()[idx].clone() + array.data_buffers()[idx].clone() } else if idx == ndata { array.views_handle().clone() } else { @@ -114,8 +110,8 @@ impl VTable for VarBinView { } } - fn buffer_name(array: &VarBinViewArray, idx: usize) -> Option { - let ndata = array.buffers().len(); + fn buffer_name(array: &Array, idx: usize) -> Option { + let ndata = array.data_buffers().len(); if idx < ndata { Some(format!("buffer_{idx}")) } else if idx == ndata { @@ -125,11 +121,11 @@ impl VTable for VarBinView { } } - fn nchildren(array: &VarBinViewArray) -> usize { + fn nchildren(array: &Array) -> usize { validity_nchildren(&array.validity) } - fn child(array: &VarBinViewArray, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => validity_to_child(&array.validity, array.len()) .vortex_expect("VarBinViewArray validity child out of bounds"), @@ -137,14 +133,14 @@ impl VTable for VarBinView { } } - fn child_name(_array: &VarBinViewArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "validity".to_string(), _ => vortex_panic!("VarBinViewArray child_name index {idx} out of bounds"), } } - fn metadata(_array: &VarBinViewArray) -> VortexResult { + fn metadata(_array: &Array) -> VortexResult { Ok(EmptyMetadata) } @@ -168,7 +164,7 @@ impl VTable for VarBinView { _metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { let Some((views_handle, data_handles)) = buffers.split_last() else { vortex_bail!("Expected at least 1 buffer, got 0"); }; @@ -196,7 +192,7 @@ impl VTable for VarBinView { // If any buffer is on device, skip host validation and use try_new_handle. if buffers.iter().any(|b| b.is_on_device()) { - return VarBinViewArray::try_new_handle( + return VarBinViewData::try_new_handle( views_handle.clone(), Arc::from(data_handles.to_vec()), dtype.clone(), @@ -210,10 +206,10 @@ impl VTable for VarBinView { .collect::>(); let views = Buffer::::from_byte_buffer(views_handle.clone().as_host().clone()); - VarBinViewArray::try_new(views, Arc::from(data_buffers), dtype.clone(), validity) + VarBinViewData::try_new(views, Arc::from(data_buffers), dtype.clone(), validity) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { match children.len() { 0 => {} 1 => { diff --git a/vortex-array/src/arrays/varbinview/vtable/operations.rs b/vortex-array/src/arrays/varbinview/vtable/operations.rs index 095015c449a..eb18be44489 100644 --- a/vortex-array/src/arrays/varbinview/vtable/operations.rs +++ b/vortex-array/src/arrays/varbinview/vtable/operations.rs @@ -5,14 +5,14 @@ use vortex_error::VortexResult; use crate::ExecutionCtx; use crate::arrays::VarBinView; -use crate::arrays::VarBinViewArray; use crate::arrays::varbin::varbin_scalar; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for VarBinView { fn scalar_at( - array: &VarBinViewArray, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { diff --git a/vortex-array/src/arrays/varbinview/vtable/validity.rs b/vortex-array/src/arrays/varbinview/vtable/validity.rs index bc8410ba5c0..85b42dc9ff2 100644 --- a/vortex-array/src/arrays/varbinview/vtable/validity.rs +++ b/vortex-array/src/arrays/varbinview/vtable/validity.rs @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use crate::arrays::VarBinViewArray; +use crate::arrays::varbinview::VarBinViewData; use crate::validity::Validity; use crate::vtable::ValidityHelper; -impl ValidityHelper for VarBinViewArray { +impl ValidityHelper for VarBinViewData { fn validity(&self) -> &Validity { &self.validity } diff --git a/vortex-array/src/arrays/variant/mod.rs b/vortex-array/src/arrays/variant/mod.rs index eae22a0eff4..666098ae83d 100644 --- a/vortex-array/src/arrays/variant/mod.rs +++ b/vortex-array/src/arrays/variant/mod.rs @@ -3,8 +3,14 @@ mod vtable; +use vortex_error::VortexExpect; + pub use self::vtable::Variant; +pub use self::vtable::VariantArray; use crate::ArrayRef; +use crate::dtype::DType; +use crate::stats::ArrayStats; +use crate::vtable::Array; /// The canonical in-memory representation of variant (semi-structured) data. /// @@ -15,14 +21,31 @@ use crate::ArrayRef; /// always the child's dtype. The child's validity determines which rows are /// null. #[derive(Clone, Debug)] -pub struct VariantArray { +pub struct VariantData { child: ArrayRef, + pub(crate) stats_set: ArrayStats, } -impl VariantArray { +impl VariantData { /// Creates a new VariantArray. Nullability comes from the child's dtype. pub fn new(child: ArrayRef) -> Self { - Self { child } + let stats_set = child.statistics().to_array_stats(); + Self { child, stats_set } + } + + /// Returns the length of this array. + pub fn len(&self) -> usize { + self.child.len() + } + + /// Returns the [`DType`] of this array. + pub fn dtype(&self) -> &DType { + self.child.dtype() + } + + /// Returns `true` if this array is empty. + pub fn is_empty(&self) -> bool { + self.len() == 0 } /// Returns a reference to the underlying child array. @@ -30,3 +53,10 @@ impl VariantArray { &self.child } } + +impl Array { + /// Creates a new `VariantArray`. + pub fn new(child: ArrayRef) -> Self { + Array::try_from_data(VariantData::new(child)).vortex_expect("VariantData is always valid") + } +} diff --git a/vortex-array/src/arrays/variant/vtable/mod.rs b/vortex-array/src/arrays/variant/vtable/mod.rs index dbe780b681c..75ccb058385 100644 --- a/vortex-array/src/arrays/variant/vtable/mod.rs +++ b/vortex-array/src/arrays/variant/vtable/mod.rs @@ -19,17 +19,17 @@ use crate::EmptyMetadata; use crate::ExecutionCtx; use crate::ExecutionResult; use crate::Precision; -use crate::arrays::VariantArray; +use crate::arrays::variant::VariantData; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::serde::ArrayChildren; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::vtable; use crate::vtable::Array; use crate::vtable::ArrayId; use crate::vtable::VTable; -vtable!(Variant); +vtable!(Variant, Variant, VariantData); #[derive(Clone, Debug)] pub struct Variant; @@ -39,7 +39,7 @@ impl Variant { } impl VTable for Variant { - type Array = VariantArray; + type ArrayData = VariantData; type Metadata = EmptyMetadata; @@ -47,7 +47,7 @@ impl VTable for Variant { type ValidityVTable = Self; - fn vtable(_array: &Self::Array) -> &Self { + fn vtable(_array: &Self::ArrayData) -> &Self { &Variant } @@ -55,57 +55,57 @@ impl VTable for Variant { Self::ID } - fn len(array: &Self::Array) -> usize { + fn len(array: &Self::ArrayData) -> usize { array.child.len() } - fn dtype(array: &Self::Array) -> &DType { + fn dtype(array: &Self::ArrayData) -> &DType { array.child.dtype() } - fn stats(array: &Self::Array) -> StatsSetRef<'_> { - array.child.statistics() + fn stats(array: &Self::ArrayData) -> &ArrayStats { + &array.stats_set } - fn array_hash(array: &Self::Array, state: &mut H, precision: Precision) { + fn array_hash(array: &Array, state: &mut H, precision: Precision) { array.child.array_hash(state, precision); } - fn array_eq(array: &Self::Array, other: &Self::Array, precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool { array.child.array_eq(&other.child, precision) } - fn nbuffers(_array: &Self::Array) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &Self::Array, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("VariantArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &Self::Array, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(_array: &Self::Array) -> usize { + fn nchildren(_array: &Array) -> usize { 1 } - fn child(array: &Self::Array, idx: usize) -> ArrayRef { + fn child(array: &Array, idx: usize) -> ArrayRef { match idx { 0 => array.child.clone(), _ => vortex_panic!("VariantArray child index {idx} out of bounds"), } } - fn child_name(_array: &Self::Array, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { match idx { 0 => "child".to_string(), _ => vortex_panic!("VariantArray child_name index {idx} out of bounds"), } } - fn metadata(_array: &Self::Array) -> VortexResult { + fn metadata(_array: &Array) -> VortexResult { Ok(EmptyMetadata) } @@ -129,7 +129,7 @@ impl VTable for Variant { _metadata: &Self::Metadata, _buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult { + ) -> VortexResult { vortex_ensure!(matches!(dtype, DType::Variant(_)), "Expected Variant DType"); vortex_ensure!( children.len() == 1, @@ -138,10 +138,10 @@ impl VTable for Variant { ); // The child carries the nullability for the whole VariantArray. let child = children.get(0, dtype, len)?; - Ok(VariantArray::new(child)) + Ok(VariantData::new(child)) } - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.len() == 1, "VariantArray expects exactly 1 child, got {}", diff --git a/vortex-array/src/arrays/variant/vtable/operations.rs b/vortex-array/src/arrays/variant/vtable/operations.rs index e2e29921a52..7e79473de0a 100644 --- a/vortex-array/src/arrays/variant/vtable/operations.rs +++ b/vortex-array/src/arrays/variant/vtable/operations.rs @@ -6,11 +6,12 @@ use vortex_error::VortexResult; use crate::ExecutionCtx; use crate::arrays::Variant; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::OperationsVTable; impl OperationsVTable for Variant { fn scalar_at( - array: &::Array, + array: &Array, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { diff --git a/vortex-array/src/arrays/variant/vtable/validity.rs b/vortex-array/src/arrays/variant/vtable/validity.rs index 8e1b1d804ad..3c3450164aa 100644 --- a/vortex-array/src/arrays/variant/vtable/validity.rs +++ b/vortex-array/src/arrays/variant/vtable/validity.rs @@ -5,11 +5,11 @@ use vortex_error::VortexResult; use crate::arrays::Variant; use crate::validity::Validity; -use crate::vtable::VTable; +use crate::vtable::Array; use crate::vtable::ValidityVTable; impl ValidityVTable for Variant { - fn validity(array: &::Array) -> VortexResult { + fn validity(array: &Array) -> VortexResult { array.child().validity() } } diff --git a/vortex-array/src/arrow/convert.rs b/vortex-array/src/arrow/convert.rs index c901bdc7fd2..ebda6f44768 100644 --- a/vortex-array/src/arrow/convert.rs +++ b/vortex-array/src/arrow/convert.rs @@ -1300,14 +1300,14 @@ mod tests { // Verify metadata - should be VarBinViewArray with correct buffer count and dtype let varbin_view_array = vortex_array.as_::(); assert_eq!( - varbin_view_array.buffers().len(), + varbin_view_array.data_buffers().len(), arrow_array.data_buffers().len() ); assert_eq!(varbin_view_array.dtype(), &DType::Utf8(true.into())); let varbin_view_array_non_null = vortex_array_non_null.as_::(); assert_eq!( - varbin_view_array_non_null.buffers().len(), + varbin_view_array_non_null.data_buffers().len(), arrow_array_non_null.data_buffers().len() ); assert_eq!( @@ -1340,14 +1340,14 @@ mod tests { // Verify metadata - should be VarBinViewArray with correct buffer count and dtype let varbin_view_array = vortex_array.as_::(); assert_eq!( - varbin_view_array.buffers().len(), + varbin_view_array.data_buffers().len(), arrow_array.data_buffers().len() ); assert_eq!(varbin_view_array.dtype(), &DType::Binary(true.into())); let varbin_view_array_non_null = vortex_array_non_null.as_::(); assert_eq!( - varbin_view_array_non_null.buffers().len(), + varbin_view_array_non_null.data_buffers().len(), arrow_array_non_null.data_buffers().len() ); assert_eq!( diff --git a/vortex-array/src/arrow/executor/byte.rs b/vortex-array/src/arrow/executor/byte.rs index 4fbf13b1544..e00650f69a8 100644 --- a/vortex-array/src/arrow/executor/byte.rs +++ b/vortex-array/src/arrow/executor/byte.rs @@ -23,7 +23,6 @@ use crate::builtins::ArrayBuiltins; use crate::dtype::DType; use crate::dtype::NativePType; use crate::dtype::Nullability; -use crate::vtable::ValidityHelper; /// Convert a Vortex array into an Arrow GenericBinaryArray. pub(super) fn to_arrow_byte_array( diff --git a/vortex-array/src/arrow/executor/byte_view.rs b/vortex-array/src/arrow/executor/byte_view.rs index 0e6b4923325..42cfe4b2fe7 100644 --- a/vortex-array/src/arrow/executor/byte_view.rs +++ b/vortex-array/src/arrow/executor/byte_view.rs @@ -18,7 +18,6 @@ use crate::builtins::ArrayBuiltins; use crate::dtype::DType; use crate::dtype::Nullability; use crate::dtype::arrow::FromArrowType; -use crate::vtable::ValidityHelper; /// Convert a canonical VarBinViewArray directly to Arrow. pub fn canonical_varbinview_to_arrow( @@ -27,7 +26,7 @@ pub fn canonical_varbinview_to_arrow( let views = ScalarBuffer::::from(array.views_handle().as_host().clone().into_arrow_buffer()); let buffers: Vec<_> = array - .buffers() + .data_buffers() .iter() .map(|buffer| buffer.as_host().clone().into_arrow_buffer()) .collect(); @@ -46,7 +45,7 @@ pub fn execute_varbinview_to_arrow( let views = ScalarBuffer::::from(array.views_handle().as_host().clone().into_arrow_buffer()); let buffers: Vec<_> = array - .buffers() + .data_buffers() .iter() .map(|buffer| buffer.as_host().clone().into_arrow_buffer()) .collect(); diff --git a/vortex-array/src/arrow/executor/dictionary.rs b/vortex-array/src/arrow/executor/dictionary.rs index 3fbe5eea340..5d9b75182b3 100644 --- a/vortex-array/src/arrow/executor/dictionary.rs +++ b/vortex-array/src/arrow/executor/dictionary.rs @@ -78,7 +78,7 @@ fn dict_to_dict( values_type: &DataType, ctx: &mut ExecutionCtx, ) -> VortexResult { - let DictArrayParts { codes, values, .. } = array.into_parts(); + let DictArrayParts { codes, values, .. } = array.into_data().into_parts(); let codes = codes.execute_arrow(Some(codes_type), ctx)?; let values = values.execute_arrow(Some(values_type), ctx)?; make_dict_array(codes_type, codes, values) diff --git a/vortex-array/src/arrow/executor/fixed_size_list.rs b/vortex-array/src/arrow/executor/fixed_size_list.rs index 26f4d96ff6b..6764377bccd 100644 --- a/vortex-array/src/arrow/executor/fixed_size_list.rs +++ b/vortex-array/src/arrow/executor/fixed_size_list.rs @@ -13,7 +13,6 @@ use crate::arrays::FixedSizeList; use crate::arrays::FixedSizeListArray; use crate::arrow::ArrowArrayExecutor; use crate::arrow::executor::validity::to_arrow_null_buffer; -use crate::vtable::ValidityHelper; pub(super) fn to_arrow_fixed_list( array: ArrayRef, diff --git a/vortex-array/src/arrow/executor/list.rs b/vortex-array/src/arrow/executor/list.rs index dc2d9bd0e25..1a620200b2f 100644 --- a/vortex-array/src/arrow/executor/list.rs +++ b/vortex-array/src/arrow/executor/list.rs @@ -30,7 +30,6 @@ use crate::builtins::ArrayBuiltins; use crate::dtype::DType; use crate::dtype::NativePType; use crate::dtype::Nullability; -use crate::vtable::ValidityHelper; /// Convert a Vortex VarBinArray into an Arrow [`GenericListArray`](arrow_array:array::GenericListArray). pub(super) fn to_arrow_list( @@ -141,7 +140,7 @@ fn list_view_zctl( sizes, validity, .. - } = array.into_parts(); + } = array.into_data().into_parts(); // For ZCTL, we know that we only care about the final size. assert!(!sizes.is_empty()); diff --git a/vortex-array/src/arrow/executor/list_view.rs b/vortex-array/src/arrow/executor/list_view.rs index ad822f6db5e..fb536bc3c1b 100644 --- a/vortex-array/src/arrow/executor/list_view.rs +++ b/vortex-array/src/arrow/executor/list_view.rs @@ -49,7 +49,7 @@ fn list_view_to_list_view( sizes, validity, .. - } = array.into_parts(); + } = array.into_data().into_parts(); let elements = elements.execute_arrow(Some(elements_field.data_type()), ctx)?; vortex_ensure!( diff --git a/vortex-array/src/builders/bool.rs b/vortex-array/src/builders/bool.rs index 7e4b979fcda..f5ff6a49f79 100644 --- a/vortex-array/src/builders/bool.rs +++ b/vortex-array/src/builders/bool.rs @@ -115,11 +115,8 @@ impl ArrayBuilder for BoolBuilder { let bool_array = array.to_bool(); self.inner.append_buffer(&bool_array.to_bit_buffer()); - self.nulls.append_validity_mask( - bool_array - .validity_mask() - .vortex_expect("validity_mask in extend_from_array_unchecked"), - ); + self.nulls + .append_validity_mask(bool_array.validity_mask().vortex_expect("validity_mask")); } fn reserve_exact(&mut self, additional: usize) { @@ -163,7 +160,6 @@ mod tests { use crate::dtype::DType; use crate::dtype::Nullability; use crate::scalar::Scalar; - use crate::vtable::ValidityHelper; fn make_opt_bool_chunks(len: usize, chunk_count: usize) -> ArrayRef { let mut rng = StdRng::seed_from_u64(0); diff --git a/vortex-array/src/builders/decimal.rs b/vortex-array/src/builders/decimal.rs index d4f64e8b7ce..d3811314a04 100644 --- a/vortex-array/src/builders/decimal.rs +++ b/vortex-array/src/builders/decimal.rs @@ -202,11 +202,8 @@ impl ArrayBuilder for DecimalBuilder { .extend(decimal_array.buffer::().iter().copied()); }); - self.nulls.append_validity_mask( - decimal_array - .validity_mask() - .vortex_expect("validity_mask in extend_from_array_unchecked"), - ); + self.nulls + .append_validity_mask(decimal_array.validity_mask().vortex_expect("validity_mask")); } fn reserve_exact(&mut self, additional: usize) { diff --git a/vortex-array/src/builders/dict/primitive.rs b/vortex-array/src/builders/dict/primitive.rs index 911c17ed09e..ca42a61bcf6 100644 --- a/vortex-array/src/builders/dict/primitive.rs +++ b/vortex-array/src/builders/dict/primitive.rs @@ -157,7 +157,6 @@ mod test { use itertools::Itertools; use vortex_buffer::buffer; - use crate::DynArray; use crate::IntoArray as _; use crate::assert_arrays_eq; use crate::builders::dict::dict_encode; diff --git a/vortex-array/src/builders/fixed_size_list.rs b/vortex-array/src/builders/fixed_size_list.rs index c7ecf0a59b4..cbe661d917b 100644 --- a/vortex-array/src/builders/fixed_size_list.rs +++ b/vortex-array/src/builders/fixed_size_list.rs @@ -287,7 +287,6 @@ mod tests { use crate::dtype::PType::I32; use crate::scalar::Scalar; use crate::validity::Validity; - use crate::vtable::ValidityHelper; #[test] fn test_empty() { diff --git a/vortex-array/src/builders/list.rs b/vortex-array/src/builders/list.rs index 37c44b3cada..ad7196d3f1f 100644 --- a/vortex-array/src/builders/list.rs +++ b/vortex-array/src/builders/list.rs @@ -301,7 +301,7 @@ impl ArrayBuilder for ListBuilder { } fn finish_into_canonical(&mut self) -> Canonical { - Canonical::List(self.finish_into_list().to_listview()) + Canonical::List(self.finish_into_list().into_array().to_listview()) } } @@ -330,7 +330,6 @@ mod tests { use crate::executor::VortexSessionExecute; use crate::scalar::Scalar; use crate::validity::Validity; - use crate::vtable::ValidityHelper; #[test] fn test_empty() { diff --git a/vortex-array/src/builders/listview.rs b/vortex-array/src/builders/listview.rs index c8e4044c915..6a62275aa58 100644 --- a/vortex-array/src/builders/listview.rs +++ b/vortex-array/src/builders/listview.rs @@ -441,7 +441,6 @@ mod tests { use crate::dtype::Nullability::Nullable; use crate::dtype::PType::I32; use crate::scalar::Scalar; - use crate::vtable::ValidityHelper; #[test] fn test_empty() { diff --git a/vortex-array/src/builders/primitive.rs b/vortex-array/src/builders/primitive.rs index 4070a22e70d..e103e39afd1 100644 --- a/vortex-array/src/builders/primitive.rs +++ b/vortex-array/src/builders/primitive.rs @@ -180,11 +180,8 @@ impl ArrayBuilder for PrimitiveBuilder { ); self.values.extend_from_slice(array.as_slice::()); - self.nulls.append_validity_mask( - array - .validity_mask() - .vortex_expect("validity_mask in extend_from_array_unchecked"), - ); + self.nulls + .append_validity_mask(array.validity_mask().vortex_expect("validity_mask")); } fn reserve_exact(&mut self, additional: usize) { @@ -614,7 +611,6 @@ mod tests { // values[2] might be any value since it's null. // Check validity - first two should be valid, third should be null. - use crate::vtable::ValidityHelper; assert!(array.validity().is_valid(0).unwrap()); assert!(array.validity().is_valid(1).unwrap()); assert!(!array.validity().is_valid(2).unwrap()); diff --git a/vortex-array/src/builders/struct_.rs b/vortex-array/src/builders/struct_.rs index 825070b327c..ed8dbbfc2ff 100644 --- a/vortex-array/src/builders/struct_.rs +++ b/vortex-array/src/builders/struct_.rs @@ -175,11 +175,8 @@ impl ArrayBuilder for StructBuilder { builder.extend_from_array(a); } - self.nulls.append_validity_mask( - array - .validity_mask() - .vortex_expect("validity_mask in extend_from_array_unchecked"), - ); + self.nulls + .append_validity_mask(array.validity_mask().vortex_expect("validity_mask")); } fn reserve_exact(&mut self, capacity: usize) { diff --git a/vortex-array/src/builders/varbinview.rs b/vortex-array/src/builders/varbinview.rs index 80c19abd820..4ade6a2ca66 100644 --- a/vortex-array/src/builders/varbinview.rs +++ b/vortex-array/src/builders/varbinview.rs @@ -289,11 +289,7 @@ impl ArrayBuilder for VarBinViewBuilder { let array = array.to_varbinview(); self.flush_in_progress(); - self.push_only_validity_mask( - array - .validity_mask() - .vortex_expect("validity_mask in extend_from_array_unchecked"), - ); + self.push_only_validity_mask(array.validity_mask().vortex_expect("validity_mask")); let view_adjustment = self.completed @@ -309,33 +305,32 @@ impl ArrayBuilder for VarBinViewBuilder { .iter() .map(|view| adjustment.adjust_view(view)), ), - ViewAdjustment::Rewriting(adjustment) => match array - .validity_mask() - .vortex_expect("validity_mask in extend_from_array_unchecked") - { - Mask::AllTrue(_) => { - for (idx, &view) in array.views().iter().enumerate() { - let new_view = self.push_view(view, &adjustment, &array, idx); - self.views_builder.push(new_view); + ViewAdjustment::Rewriting(adjustment) => { + match array.validity_mask().vortex_expect("validity_mask") { + Mask::AllTrue(_) => { + for (idx, &view) in array.views().iter().enumerate() { + let new_view = self.push_view(view, &adjustment, &array, idx); + self.views_builder.push(new_view); + } } - } - Mask::AllFalse(_) => { - self.views_builder - .push_n(BinaryView::empty_view(), array.len()); - } - Mask::Values(v) => { - for (idx, (&view, is_valid)) in - array.views().iter().zip(v.bit_buffer().iter()).enumerate() - { - let new_view = if !is_valid { - BinaryView::empty_view() - } else { - self.push_view(view, &adjustment, &array, idx) - }; - self.views_builder.push(new_view); + Mask::AllFalse(_) => { + self.views_builder + .push_n(BinaryView::empty_view(), array.len()); + } + Mask::Values(v) => { + for (idx, (&view, is_valid)) in + array.views().iter().zip(v.bit_buffer().iter()).enumerate() + { + let new_view = if !is_valid { + BinaryView::empty_view() + } else { + self.push_view(view, &adjustment, &array, idx) + }; + self.views_builder.push(new_view); + } } } - }, + } } } @@ -601,7 +596,7 @@ impl BuffersWithOffsets { return Self::AllKept { buffers: Arc::from( array - .buffers() + .data_buffers() .to_vec() .into_iter() .map(|b| b.unwrap_host()) @@ -624,20 +619,19 @@ impl BuffersWithOffsets { } } - let buffers_with_offsets_iter = - buffer_utilizations - .iter() - .zip(array.buffers().iter()) - .map(|(utilization, buffer)| { - match compaction_strategy(utilization, compaction_threshold) { - CompactionStrategy::KeepFull => (Some(buffer.as_host().clone()), 0), - CompactionStrategy::Slice { start, end } => ( - Some(buffer.as_host().slice(start as usize..end as usize)), - start, - ), - CompactionStrategy::Rewrite => (None, 0), - } - }); + let buffers_with_offsets_iter = buffer_utilizations + .iter() + .zip(array.data_buffers().iter()) + .map(|(utilization, buffer)| { + match compaction_strategy(utilization, compaction_threshold) { + CompactionStrategy::KeepFull => (Some(buffer.as_host().clone()), 0), + CompactionStrategy::Slice { start, end } => ( + Some(buffer.as_host().slice(start as usize..end as usize)), + start, + ), + CompactionStrategy::Rewrite => (None, 0), + } + }); match (has_rewrite, has_nonzero_offset) { // keep all buffers @@ -831,6 +825,7 @@ impl RewritingViewAdjustment { mod tests { use vortex_error::VortexResult; + use crate::DynArray; use crate::IntoArray; use crate::LEGACY_SESSION; use crate::VortexSessionExecute; @@ -906,7 +901,7 @@ mod tests { builder.finish_into_varbinview() }; - assert_eq!(array.buffers().len(), 1); + assert_eq!(array.data_buffers().len(), 1); let mut builder = VarBinViewBuilder::with_buffer_deduplication(DType::Utf8(Nullability::Nullable), 10); diff --git a/vortex-array/src/canonical.rs b/vortex-array/src/canonical.rs index fe0c563ad1e..e4216873f06 100644 --- a/vortex-array/src/canonical.rs +++ b/vortex-array/src/canonical.rs @@ -410,9 +410,10 @@ impl Canonical { } } -impl AsRef for Canonical { - fn as_ref(&self) -> &(dyn DynArray + 'static) { - match_each_canonical!(self, |arr| arr.as_ref()) +impl Canonical { + /// Convert to a type-erased [`ArrayRef`]. + pub fn to_array_ref(&self) -> ArrayRef { + self.clone().into_array() } } @@ -565,7 +566,7 @@ impl Executable for CanonicalValidity { ptype, buffer, validity, - } = p.into_parts(); + } = p.into_data().into_parts(); Ok(CanonicalValidity(Canonical::Primitive(unsafe { PrimitiveArray::new_unchecked_from_handle(buffer, ptype, validity.execute(ctx)?) }))) @@ -576,7 +577,7 @@ impl Executable for CanonicalValidity { values, values_type, validity, - } = d.into_parts(); + } = d.into_data().into_parts(); Ok(CanonicalValidity(Canonical::Decimal(unsafe { DecimalArray::new_unchecked_handle( values, @@ -592,7 +593,7 @@ impl Executable for CanonicalValidity { buffers, views, validity, - } = vbv.into_parts(); + } = vbv.into_data().into_parts(); Ok(CanonicalValidity(Canonical::VarBinView(unsafe { VarBinViewArray::new_handle_unchecked( views, @@ -610,7 +611,7 @@ impl Executable for CanonicalValidity { sizes, validity, .. - } = l.into_parts(); + } = l.into_data().into_parts(); Ok(CanonicalValidity(Canonical::List(unsafe { ListViewArray::new_unchecked(elements, offsets, sizes, validity.execute(ctx)?) .with_zero_copy_to_list(zctl) @@ -619,7 +620,7 @@ impl Executable for CanonicalValidity { Canonical::FixedSizeList(fsl) => { let list_size = fsl.list_size(); let len = fsl.len(); - let (elements, validity, _) = fsl.into_parts(); + let (elements, validity, _) = fsl.into_data().into_parts(); Ok(CanonicalValidity(Canonical::FixedSizeList( FixedSizeListArray::new(elements, list_size, validity.execute(ctx)?, len), ))) @@ -685,7 +686,7 @@ impl Executable for RecursiveCanonical { ptype, buffer, validity, - } = p.into_parts(); + } = p.into_data().into_parts(); Ok(RecursiveCanonical(Canonical::Primitive(unsafe { PrimitiveArray::new_unchecked_from_handle(buffer, ptype, validity.execute(ctx)?) }))) @@ -696,7 +697,7 @@ impl Executable for RecursiveCanonical { values, values_type, validity, - } = d.into_parts(); + } = d.into_data().into_parts(); Ok(RecursiveCanonical(Canonical::Decimal(unsafe { DecimalArray::new_unchecked_handle( values, @@ -712,7 +713,7 @@ impl Executable for RecursiveCanonical { buffers, views, validity, - } = vbv.into_parts(); + } = vbv.into_data().into_parts(); Ok(RecursiveCanonical(Canonical::VarBinView(unsafe { VarBinViewArray::new_handle_unchecked( views, @@ -730,7 +731,7 @@ impl Executable for RecursiveCanonical { sizes, validity, .. - } = l.into_parts(); + } = l.into_data().into_parts(); Ok(RecursiveCanonical(Canonical::List(unsafe { ListViewArray::new_unchecked( elements.execute::(ctx)?.0.into_array(), @@ -744,7 +745,7 @@ impl Executable for RecursiveCanonical { Canonical::FixedSizeList(fsl) => { let list_size = fsl.list_size(); let len = fsl.len(); - let (elements, validity, _) = fsl.into_parts(); + let (elements, validity, _) = fsl.into_data().into_parts(); Ok(RecursiveCanonical(Canonical::FixedSizeList( FixedSizeListArray::new( elements.execute::(ctx)?.0.into_array(), @@ -808,7 +809,7 @@ impl Executable for Buffer { fn execute(array: ArrayRef, ctx: &mut ExecutionCtx) -> VortexResult { let array = PrimitiveArray::execute(array, ctx)?; vortex_ensure!( - array.all_valid()?, + matches!(array.validity(), Validity::NonNullable | Validity::AllValid), "Cannot execute to native buffer: array is not all-valid." ); Ok(array.into_buffer()) @@ -969,19 +970,20 @@ impl From> for Canonical { } } -impl AsRef for CanonicalView<'_> { - fn as_ref(&self) -> &dyn DynArray { +impl CanonicalView<'_> { + /// Convert to a type-erased [`ArrayRef`]. + pub fn to_array_ref(&self) -> ArrayRef { match self { - CanonicalView::Null(a) => a.as_ref(), - CanonicalView::Bool(a) => a.as_ref(), - CanonicalView::Primitive(a) => a.as_ref(), - CanonicalView::Decimal(a) => a.as_ref(), - CanonicalView::VarBinView(a) => a.as_ref(), - CanonicalView::List(a) => a.as_ref(), - CanonicalView::FixedSizeList(a) => a.as_ref(), - CanonicalView::Struct(a) => a.as_ref(), - CanonicalView::Extension(a) => a.as_ref(), - CanonicalView::Variant(a) => a.as_ref(), + CanonicalView::Null(a) => (*a).clone().into_array(), + CanonicalView::Bool(a) => (*a).clone().into_array(), + CanonicalView::Primitive(a) => (*a).clone().into_array(), + CanonicalView::Decimal(a) => (*a).clone().into_array(), + CanonicalView::VarBinView(a) => (*a).clone().into_array(), + CanonicalView::List(a) => (*a).clone().into_array(), + CanonicalView::FixedSizeList(a) => (*a).clone().into_array(), + CanonicalView::Struct(a) => (*a).clone().into_array(), + CanonicalView::Extension(a) => (*a).clone().into_array(), + CanonicalView::Variant(a) => (*a).clone().into_array(), } } } diff --git a/vortex-array/src/columnar.rs b/vortex-array/src/columnar.rs index 8734a446bd3..d6c4cbe64d1 100644 --- a/vortex-array/src/columnar.rs +++ b/vortex-array/src/columnar.rs @@ -89,11 +89,12 @@ pub enum ColumnarView<'a> { Constant(&'a ConstantArray), } -impl<'a> AsRef for ColumnarView<'a> { - fn as_ref(&self) -> &dyn DynArray { +impl ColumnarView<'_> { + /// Convert to a type-erased [`ArrayRef`]. + pub fn to_array_ref(&self) -> ArrayRef { match self { - ColumnarView::Canonical(canonical) => canonical.as_ref(), - ColumnarView::Constant(constant) => constant.as_ref(), + ColumnarView::Canonical(canonical) => canonical.to_array_ref(), + ColumnarView::Constant(constant) => (*constant).clone().into_array(), } } } diff --git a/vortex-array/src/compute/conformance/consistency.rs b/vortex-array/src/compute/conformance/consistency.rs index e6055da5e2c..71fbb48f2e0 100644 --- a/vortex-array/src/compute/conformance/consistency.rs +++ b/vortex-array/src/compute/conformance/consistency.rs @@ -1033,7 +1033,7 @@ fn test_slice_aggregate_consistency(array: &ArrayRef) { .vortex_expect("slice should succeed in conformance test"); let canonical = array.to_canonical().vortex_expect("to_canonical failed"); let canonical_sliced = canonical - .as_ref() + .to_array_ref() .slice(start..end) .vortex_expect("slice should succeed in conformance test"); @@ -1281,7 +1281,7 @@ fn test_cast_slice_consistency(array: &ArrayRef) { // Get the corresponding value from the canonical array (adjusted for slice offset) let canonical_val = canonical - .as_ref() + .to_array_ref() .scalar_at(start + i) .vortex_expect("scalar_at should succeed in conformance test"); diff --git a/vortex-array/src/kernel.rs b/vortex-array/src/kernel.rs index e87c9f1811f..b8f65850bb0 100644 --- a/vortex-array/src/kernel.rs +++ b/vortex-array/src/kernel.rs @@ -22,6 +22,7 @@ use vortex_error::VortexResult; use crate::ArrayRef; use crate::ExecutionCtx; use crate::matcher::Matcher; +use crate::vtable::Array; use crate::vtable::VTable; /// A collection of [`ExecuteParentKernel`]s registered for a specific child encoding. @@ -58,7 +59,7 @@ impl ParentKernelSet { /// Evaluate the parent kernels on the given child and parent arrays. pub fn execute( &self, - child: &V::Array, + child: &Array, parent: &ArrayRef, child_idx: usize, ctx: &mut ExecutionCtx, @@ -92,7 +93,7 @@ pub trait ExecuteParentKernel: Debug + Send + Sync + 'static { /// Attempt to execute the parent array fused with the child array. fn execute_parent( &self, - array: &V::Array, + array: &Array, parent: ::Match<'_>, child_idx: usize, ctx: &mut ExecutionCtx, @@ -108,7 +109,7 @@ pub trait DynParentKernel: Send + Sync { /// Attempt to execute the parent array fused with the child array. fn execute_parent( &self, - child: &V::Array, + child: &Array, parent: &ArrayRef, child_idx: usize, ctx: &mut ExecutionCtx, @@ -138,7 +139,7 @@ impl> DynParentKernel for ParentKernelAd fn execute_parent( &self, - child: &V::Array, + child: &Array, parent: &ArrayRef, child_idx: usize, ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/optimizer/rules.rs b/vortex-array/src/optimizer/rules.rs index 138f07a29c0..671896b5edc 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::array::ArrayRef; use crate::matcher::Matcher; +use crate::vtable::Array; use crate::vtable::VTable; /// A metadata-only rewrite rule that transforms an array based on its own structure (Layer 1). @@ -39,7 +40,7 @@ pub trait ArrayReduceRule: 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 - fn reduce(&self, array: &V::Array) -> VortexResult>; + fn reduce(&self, array: &Array) -> VortexResult>; } /// A metadata-only rewrite rule where a child encoding rewrites its parent (Layer 2). @@ -59,7 +60,7 @@ pub trait ArrayParentReduceRule: Debug + Send + Sync + 'static { /// - `Err(e)` if an error occurred fn reduce_parent( &self, - array: &V::Array, + array: &Array, parent: ::Match<'_>, child_idx: usize, ) -> VortexResult>; @@ -72,7 +73,7 @@ pub trait DynArrayParentReduceRule: Debug + Send + Sync { fn reduce_parent( &self, - array: &V::Array, + array: &Array, parent: &ArrayRef, child_idx: usize, ) -> VortexResult>; @@ -103,7 +104,7 @@ impl> DynArrayParentReduceRule fn reduce_parent( &self, - child: &V::Array, + child: &Array, parent: &ArrayRef, child_idx: usize, ) -> VortexResult> { @@ -129,7 +130,7 @@ impl ReduceRuleSet { } /// Evaluate the reduction rules on the given array. - pub fn evaluate(&self, array: &V::Array) -> VortexResult> { + pub fn evaluate(&self, array: &Array) -> VortexResult> { for rule in self.rules.iter() { if let Some(reduced) = rule.reduce(array)? { return Ok(Some(reduced)); @@ -169,7 +170,7 @@ impl ParentRuleSet { /// Evaluate the parent reduction rules on the given child and parent arrays. pub fn evaluate( &self, - child: &V::Array, + child: &Array, parent: &ArrayRef, child_idx: usize, ) -> VortexResult> { diff --git a/vortex-array/src/patches.rs b/vortex-array/src/patches.rs index e57ec9c64ec..c176718fe98 100644 --- a/vortex-array/src/patches.rs +++ b/vortex-array/src/patches.rs @@ -45,7 +45,6 @@ use crate::search_sorted::SearchResult; use crate::search_sorted::SearchSorted; use crate::search_sorted::SearchSortedSide; use crate::validity::Validity; -use crate::vtable::ValidityHelper; /// One patch index offset is stored for each chunk. /// This allows for constant time patch index lookups. diff --git a/vortex-array/src/scalar_fn/fns/between/kernel.rs b/vortex-array/src/scalar_fn/fns/between/kernel.rs index 00d4cb4e85d..0f3d7840a97 100644 --- a/vortex-array/src/scalar_fn/fns/between/kernel.rs +++ b/vortex-array/src/scalar_fn/fns/between/kernel.rs @@ -15,6 +15,7 @@ use crate::arrays::scalar_fn::ExactScalarFn; use crate::arrays::scalar_fn::ScalarFnArrayView; use crate::kernel::ExecuteParentKernel; use crate::optimizer::rules::ArrayParentReduceRule; +use crate::vtable::Array; use crate::vtable::VTable; /// Reduce rule for between: restructure the array without reading buffers. @@ -22,7 +23,7 @@ use crate::vtable::VTable; /// Returns `Ok(None)` if the rule doesn't apply or buffer access is needed. pub trait BetweenReduce: VTable { fn between( - array: &Self::Array, + array: &Array, lower: &ArrayRef, upper: &ArrayRef, options: &BetweenOptions, @@ -34,7 +35,7 @@ pub trait BetweenReduce: VTable { /// Returns `Ok(None)` if this kernel cannot handle the given inputs. pub trait BetweenKernel: VTable { fn between( - array: &Self::Array, + array: &Array, lower: &ArrayRef, upper: &ArrayRef, options: &BetweenOptions, @@ -54,7 +55,7 @@ where fn reduce_parent( &self, - array: &V::Array, + array: &Array, parent: ScalarFnArrayView<'_, Between>, child_idx: usize, ) -> VortexResult> { @@ -88,7 +89,7 @@ where fn execute_parent( &self, - array: &V::Array, + array: &Array, parent: ScalarFnArrayView<'_, Between>, child_idx: usize, ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/scalar_fn/fns/binary/compare.rs b/vortex-array/src/scalar_fn/fns/binary/compare.rs index 7c31ee6aab2..019c482227c 100644 --- a/vortex-array/src/scalar_fn/fns/binary/compare.rs +++ b/vortex-array/src/scalar_fn/fns/binary/compare.rs @@ -29,6 +29,7 @@ use crate::kernel::ExecuteParentKernel; use crate::scalar::Scalar; use crate::scalar_fn::fns::binary::Binary; use crate::scalar_fn::fns::operators::CompareOperator; +use crate::vtable::Array; use crate::vtable::VTable; /// Trait for encoding-specific comparison kernels that operate in encoded space. @@ -38,7 +39,7 @@ use crate::vtable::VTable; /// the left-hand side, swapping the operator when necessary. pub trait CompareKernel: VTable { fn compare( - lhs: &Self::Array, + lhs: &Array, rhs: &ArrayRef, operator: CompareOperator, ctx: &mut ExecutionCtx, @@ -61,7 +62,7 @@ where fn execute_parent( &self, - array: &V::Array, + array: &Array, parent: ScalarFnArrayView<'_, Binary>, child_idx: usize, ctx: &mut ExecutionCtx, @@ -85,8 +86,8 @@ where _ => return Ok(None), }; - let len = array.len(); - let nullable = array.dtype().is_nullable() || other.dtype().is_nullable(); + let len = V::len(array); + let nullable = V::dtype(array).is_nullable() || other.dtype().is_nullable(); // Empty array → empty bool result if len == 0 { diff --git a/vortex-array/src/scalar_fn/fns/cast/kernel.rs b/vortex-array/src/scalar_fn/fns/cast/kernel.rs index 74b98ca4725..09f7ed3506c 100644 --- a/vortex-array/src/scalar_fn/fns/cast/kernel.rs +++ b/vortex-array/src/scalar_fn/fns/cast/kernel.rs @@ -13,6 +13,7 @@ use crate::kernel::ExecuteParentKernel; use crate::matcher::Matcher; use crate::optimizer::rules::ArrayParentReduceRule; use crate::scalar_fn::fns::cast::Cast; +use crate::vtable::Array; use crate::vtable::VTable; /// Reduce rule for cast: restructure the array without reading buffers. @@ -23,7 +24,7 @@ use crate::vtable::VTable; /// /// Returns `Ok(None)` if the rule doesn't apply to this array/dtype combination. pub trait CastReduce: VTable { - fn cast(array: &Self::Array, dtype: &DType) -> VortexResult>; + fn cast(array: &Array, dtype: &DType) -> VortexResult>; } /// Execute kernel for cast: perform the actual value conversion, potentially reading buffers. @@ -34,7 +35,7 @@ pub trait CastReduce: VTable { /// Returns `Ok(None)` if this kernel cannot handle the given dtype conversion. pub trait CastKernel: VTable { fn cast( - array: &Self::Array, + array: &Array, dtype: &DType, ctx: &mut ExecutionCtx, ) -> VortexResult>; @@ -52,12 +53,12 @@ where fn reduce_parent( &self, - array: &V::Array, + array: &Array, parent: ScalarFnArrayView<'_, Cast>, _child_idx: usize, ) -> VortexResult> { let dtype = parent.options; - if array.dtype() == dtype { + if V::dtype(array) == dtype { return Ok(Some(array.clone().into_array())); } ::cast(array, dtype) @@ -76,13 +77,13 @@ where fn execute_parent( &self, - array: &V::Array, + array: &Array, parent: ::Match<'_>, _child_idx: usize, ctx: &mut ExecutionCtx, ) -> VortexResult> { let dtype = parent.options; - if array.dtype() == dtype { + if V::dtype(array) == dtype { return Ok(Some(array.clone().into_array())); } ::cast(array, dtype, ctx) diff --git a/vortex-array/src/scalar_fn/fns/cast/mod.rs b/vortex-array/src/scalar_fn/fns/cast/mod.rs index fa4124bf5a0..3e8abbbb34e 100644 --- a/vortex-array/src/scalar_fn/fns/cast/mod.rs +++ b/vortex-array/src/scalar_fn/fns/cast/mod.rs @@ -119,8 +119,8 @@ impl ScalarFnVTable for Cast { Some(result) => Ok(result), None => vortex_bail!( "No CastKernel to cast canonical array {} from {} to {}", - canonical.as_ref().encoding_id(), - canonical.as_ref().dtype(), + canonical.to_array_ref().encoding_id(), + canonical.to_array_ref().dtype(), target_dtype, ), } diff --git a/vortex-array/src/scalar_fn/fns/fill_null/kernel.rs b/vortex-array/src/scalar_fn/fns/fill_null/kernel.rs index 44f83f5417b..3e56e42a007 100644 --- a/vortex-array/src/scalar_fn/fns/fill_null/kernel.rs +++ b/vortex-array/src/scalar_fn/fns/fill_null/kernel.rs @@ -17,6 +17,7 @@ use crate::kernel::ExecuteParentKernel; use crate::optimizer::rules::ArrayParentReduceRule; use crate::scalar::Scalar; use crate::scalar_fn::fns::fill_null::FillNull as FillNullExpr; +use crate::vtable::Array; use crate::vtable::VTable; /// Fill nulls in an array with a scalar value without reading buffers. @@ -30,7 +31,7 @@ use crate::vtable::VTable; /// The fill value is guaranteed to be non-null. The array is guaranteed to have mixed /// validity (neither all-valid nor all-invalid). pub trait FillNullReduce: VTable { - fn fill_null(array: &Self::Array, fill_value: &Scalar) -> VortexResult>; + fn fill_null(array: &Array, fill_value: &Scalar) -> VortexResult>; } /// Fill nulls in an array with a scalar value, potentially reading buffers. @@ -44,7 +45,7 @@ pub trait FillNullReduce: VTable { /// validity (neither all-valid nor all-invalid). pub trait FillNullKernel: VTable { fn fill_null( - array: &Self::Array, + array: &Array, fill_value: &Scalar, ctx: &mut ExecutionCtx, ) -> VortexResult>; @@ -104,7 +105,7 @@ where fn reduce_parent( &self, - array: &V::Array, + array: &Array, parent: ScalarFnArrayView<'_, FillNullExpr>, child_idx: usize, ) -> VortexResult> { @@ -118,7 +119,7 @@ where let fill_value = scalar_fn_array.children()[1] .as_constant() .vortex_expect("fill_null fill_value must be constant"); - let arr = array.to_array(); + let arr = array.clone().into_array(); if let Some(result) = precondition(&arr, &fill_value)? { return Ok(Some(result)); } @@ -138,7 +139,7 @@ where fn execute_parent( &self, - array: &V::Array, + array: &Array, parent: ScalarFnArrayView<'_, FillNullExpr>, child_idx: usize, ctx: &mut ExecutionCtx, @@ -153,7 +154,7 @@ where let fill_value = scalar_fn_array.children()[1] .as_constant() .vortex_expect("fill_null fill_value must be constant"); - let arr = array.to_array(); + let arr = array.clone().into_array(); if let Some(result) = precondition(&arr, &fill_value)? { return Ok(Some(result)); } diff --git a/vortex-array/src/scalar_fn/fns/fill_null/mod.rs b/vortex-array/src/scalar_fn/fns/fill_null/mod.rs index 5958524998b..656029bf82d 100644 --- a/vortex-array/src/scalar_fn/fns/fill_null/mod.rs +++ b/vortex-array/src/scalar_fn/fns/fill_null/mod.rs @@ -162,7 +162,7 @@ fn fill_null_canonical( fill_value: &Scalar, ctx: &mut ExecutionCtx, ) -> VortexResult { - let arr = canonical.as_ref().to_array(); + let arr = canonical.to_array_ref(); if let Some(result) = precondition(&arr, fill_value)? { // The result of precondition may return another ScalarFn, in which case we should // apply it immediately. @@ -181,7 +181,7 @@ fn fill_null_canonical( .ok_or_else(|| vortex_err!("FillNullKernel for DecimalArray returned None")), other => vortex_bail!( "No FillNullKernel for canonical array {}", - other.as_ref().encoding_id() + other.to_array_ref().encoding_id() ), } } diff --git a/vortex-array/src/scalar_fn/fns/get_item.rs b/vortex-array/src/scalar_fn/fns/get_item.rs index 1e0469bae27..cc87765e3a2 100644 --- a/vortex-array/src/scalar_fn/fns/get_item.rs +++ b/vortex-array/src/scalar_fn/fns/get_item.rs @@ -116,7 +116,7 @@ impl ScalarFnVTable for GetItem { match input.dtype().nullability() { Nullability::NonNullable => Ok(field), - Nullability::Nullable => field.mask(input.validity()?.to_array(input.len())), + Nullability::Nullable => field.mask(input.validity().to_array(input.len())), } } diff --git a/vortex-array/src/scalar_fn/fns/like/kernel.rs b/vortex-array/src/scalar_fn/fns/like/kernel.rs index 839ffa734e9..1a2344a3f9e 100644 --- a/vortex-array/src/scalar_fn/fns/like/kernel.rs +++ b/vortex-array/src/scalar_fn/fns/like/kernel.rs @@ -13,6 +13,7 @@ use crate::kernel::ExecuteParentKernel; use crate::optimizer::rules::ArrayParentReduceRule; use crate::scalar_fn::fns::like::Like as LikeExpr; use crate::scalar_fn::fns::like::LikeOptions; +use crate::vtable::Array; use crate::vtable::VTable; /// Like pattern matching on an array without reading buffers. @@ -25,7 +26,7 @@ use crate::vtable::VTable; /// the parent `ScalarFnArray`. pub trait LikeReduce: VTable { fn like( - array: &Self::Array, + array: &Array, pattern: &ArrayRef, options: LikeOptions, ) -> VortexResult>; @@ -40,7 +41,7 @@ pub trait LikeReduce: VTable { /// the parent `ScalarFnArray`. pub trait LikeKernel: VTable { fn like( - array: &Self::Array, + array: &Array, pattern: &ArrayRef, options: LikeOptions, ctx: &mut ExecutionCtx, @@ -59,7 +60,7 @@ where fn reduce_parent( &self, - array: &V::Array, + array: &Array, parent: ScalarFnArrayView<'_, LikeExpr>, child_idx: usize, ) -> VortexResult> { @@ -88,7 +89,7 @@ where fn execute_parent( &self, - array: &V::Array, + array: &Array, parent: ScalarFnArrayView<'_, LikeExpr>, child_idx: usize, ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/scalar_fn/fns/list_contains/kernel.rs b/vortex-array/src/scalar_fn/fns/list_contains/kernel.rs index 13be6bfc26a..532d078dcf3 100644 --- a/vortex-array/src/scalar_fn/fns/list_contains/kernel.rs +++ b/vortex-array/src/scalar_fn/fns/list_contains/kernel.rs @@ -12,6 +12,7 @@ use crate::arrays::scalar_fn::ScalarFnArrayView; use crate::kernel::ExecuteParentKernel; use crate::optimizer::rules::ArrayParentReduceRule; use crate::scalar_fn::fns::list_contains::ListContains as ListContainsExpr; +use crate::vtable::Array; use crate::vtable::VTable; /// Check list-contains without reading buffers (metadata-only). @@ -25,7 +26,7 @@ use crate::vtable::VTable; /// /// Return `None` if the operation cannot be resolved from metadata alone. pub trait ListContainsElementReduce: VTable { - fn list_contains(list: &ArrayRef, element: &Self::Array) -> VortexResult>; + fn list_contains(list: &ArrayRef, element: &Array) -> VortexResult>; } /// Check list-contains, potentially reading buffers. @@ -36,7 +37,7 @@ pub trait ListContainsElementReduce: VTable { pub trait ListContainsElementKernel: VTable { fn list_contains( list: &ArrayRef, - element: &Self::Array, + element: &Array, ctx: &mut ExecutionCtx, ) -> VortexResult>; } @@ -53,7 +54,7 @@ where fn reduce_parent( &self, - array: &V::Array, + array: &Array, parent: ScalarFnArrayView<'_, ListContainsExpr>, child_idx: usize, ) -> VortexResult> { @@ -81,7 +82,7 @@ where fn execute_parent( &self, - array: &V::Array, + array: &Array, parent: ScalarFnArrayView<'_, ListContainsExpr>, child_idx: usize, ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/scalar_fn/fns/list_contains/mod.rs b/vortex-array/src/scalar_fn/fns/list_contains/mod.rs index dd0b2d46918..c924af2f576 100644 --- a/vortex-array/src/scalar_fn/fns/list_contains/mod.rs +++ b/vortex-array/src/scalar_fn/fns/list_contains/mod.rs @@ -51,7 +51,6 @@ use crate::scalar_fn::fns::binary::Binary; use crate::scalar_fn::fns::literal::Literal; use crate::scalar_fn::fns::operators::Operator; use crate::validity::Validity; -use crate::vtable::ValidityHelper; #[derive(Clone)] pub struct ListContains; @@ -297,6 +296,8 @@ fn list_contains_scalar( Operator::Eq, &[elems.clone(), rhs.clone().into_array()], )?; + + // TODO(ngates): we should execute this into a Columnar and check for constant. let matches = matching_elements.execute::(ctx)?; // Fast path: no elements match. @@ -782,7 +783,7 @@ mod tests { }; let elem = ConstantArray::new(scalar, list_array.len()); let expr = list_contains(root(), lit(elem.scalar().clone())); - let result = list_array.apply(&expr).unwrap(); + let result = list_array.to_array().apply(&expr).unwrap(); assert_arrays_eq!(result, expected); } @@ -799,7 +800,7 @@ mod tests { .into_array(); let expr = list_contains(root(), lit(2i32)); - let contains = list_array.apply(&expr).unwrap(); + let contains = list_array.to_array().apply(&expr).unwrap(); assert!(contains.is::(), "Expected constant result"); let expected = BoolArray::from_iter([true, true]); assert_arrays_eq!(contains, expected); @@ -817,7 +818,7 @@ mod tests { .into_array(); let expr = list_contains(root(), lit(2i32)); - let contains = list_array.apply(&expr).unwrap(); + let contains = list_array.to_array().apply(&expr).unwrap(); assert!(contains.is::(), "Expected constant result"); let expected = BoolArray::new( @@ -860,7 +861,7 @@ mod tests { }; let expr = list_contains(root(), lit(42i32)); - let result = list_array.apply(&expr).unwrap(); + let result = list_array.to_array().apply(&expr).unwrap(); let expected = BoolArray::from_iter([false, false, false, false]); assert_arrays_eq!(result, expected); @@ -885,7 +886,7 @@ mod tests { // Searching for null let null_scalar = Scalar::null(DType::Primitive(I32, Nullability::Nullable)); let expr = list_contains(root(), lit(null_scalar)); - let result = list_array.apply(&expr).unwrap(); + let result = list_array.to_array().apply(&expr).unwrap(); let expected = BoolArray::new( [false, false, false].into_iter().collect(), @@ -895,7 +896,7 @@ mod tests { // Searching for non-null let expr2 = list_contains(root(), lit(42i32)); - let result2 = list_array.apply(&expr2).unwrap(); + let result2 = list_array.to_array().apply(&expr2).unwrap(); let expected2 = BoolArray::from_iter([false, false, false]); assert_arrays_eq!(result2, expected2); @@ -912,13 +913,13 @@ mod tests { ListViewArray::new(elements.into_array(), offsets, sizes, Validity::NonNullable); let expr = list_contains(root(), lit(2i32)); - let result = list_array.apply(&expr).unwrap(); + let result = list_array.to_array().apply(&expr).unwrap(); let expected = BoolArray::from_iter([false, true, false, false]); assert_arrays_eq!(result, expected); let expr5 = list_contains(root(), lit(5i32)); - let result5 = list_array.apply(&expr5).unwrap(); + let result5 = list_array.to_array().apply(&expr5).unwrap(); let expected5 = BoolArray::from_iter([false, false, true, false]); assert_arrays_eq!(result5, expected5); @@ -934,13 +935,13 @@ mod tests { ListViewArray::new(elements.into_array(), offsets, sizes, Validity::NonNullable); let expr = list_contains(root(), lit(255i32)); - let result = list_array.apply(&expr).unwrap(); + let result = list_array.to_array().apply(&expr).unwrap(); let expected = BoolArray::from_iter([false, false, false, true]); assert_arrays_eq!(result, expected); let expr_zero = list_contains(root(), lit(0i32)); - let result_zero = list_array.apply(&expr_zero).unwrap(); + let result_zero = list_array.to_array().apply(&expr_zero).unwrap(); let expected_zero = BoolArray::from_iter([true, false, false, false]); assert_arrays_eq!(result_zero, expected_zero); diff --git a/vortex-array/src/scalar_fn/fns/mask/kernel.rs b/vortex-array/src/scalar_fn/fns/mask/kernel.rs index 7c8da9303da..707a4ae4bb8 100644 --- a/vortex-array/src/scalar_fn/fns/mask/kernel.rs +++ b/vortex-array/src/scalar_fn/fns/mask/kernel.rs @@ -12,6 +12,7 @@ use crate::arrays::scalar_fn::ScalarFnArrayView; use crate::kernel::ExecuteParentKernel; use crate::optimizer::rules::ArrayParentReduceRule; use crate::scalar_fn::fns::mask::Mask as MaskExpr; +use crate::vtable::Array; use crate::vtable::VTable; /// Mask an array without reading buffers. @@ -27,7 +28,7 @@ use crate::vtable::VTable; /// The mask is guaranteed to have the same length as the array. Trivial cases /// (`AllValid`, `AllInvalid`, `NonNullable`) are handled by the caller before dispatch. pub trait MaskReduce: VTable { - fn mask(array: &Self::Array, mask: &ArrayRef) -> VortexResult>; + fn mask(array: &Array, mask: &ArrayRef) -> VortexResult>; } /// Mask an array, potentially reading buffers. @@ -43,7 +44,7 @@ pub trait MaskReduce: VTable { /// (`AllValid`, `AllInvalid`, `NonNullable`) are handled by the caller before dispatch. pub trait MaskKernel: VTable { fn mask( - array: &Self::Array, + array: &Array, mask: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult>; @@ -61,7 +62,7 @@ where fn reduce_parent( &self, - array: &V::Array, + array: &Array, parent: ScalarFnArrayView<'_, MaskExpr>, child_idx: usize, ) -> VortexResult> { @@ -93,7 +94,7 @@ where fn execute_parent( &self, - array: &V::Array, + array: &Array, parent: ScalarFnArrayView<'_, MaskExpr>, child_idx: usize, ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/scalar_fn/fns/not/kernel.rs b/vortex-array/src/scalar_fn/fns/not/kernel.rs index 1546fb43992..24c4ad40944 100644 --- a/vortex-array/src/scalar_fn/fns/not/kernel.rs +++ b/vortex-array/src/scalar_fn/fns/not/kernel.rs @@ -10,6 +10,7 @@ use crate::arrays::scalar_fn::ScalarFnArrayView; use crate::kernel::ExecuteParentKernel; use crate::optimizer::rules::ArrayParentReduceRule; use crate::scalar_fn::fns::not::Not as NotExpr; +use crate::vtable::Array; use crate::vtable::VTable; /// Invert a boolean array without reading buffers. @@ -18,7 +19,7 @@ use crate::vtable::VTable; /// and structure without needing to read or execute on the underlying buffers. /// Implementations should return `None` if the operation requires buffer access. pub trait NotReduce: VTable { - fn invert(array: &Self::Array) -> VortexResult>; + fn invert(array: &Array) -> VortexResult>; } /// Invert a boolean array, potentially reading buffers. @@ -26,7 +27,7 @@ pub trait NotReduce: VTable { /// Unlike [`NotReduce`], this trait is for invert implementations that may need /// to read and execute on the underlying buffers to produce the result. pub trait NotKernel: VTable { - fn invert(array: &Self::Array, ctx: &mut ExecutionCtx) -> VortexResult>; + fn invert(array: &Array, ctx: &mut ExecutionCtx) -> VortexResult>; } /// Adaptor that wraps a [`NotReduce`] impl as an [`ArrayParentReduceRule`]. @@ -41,7 +42,7 @@ where fn reduce_parent( &self, - array: &V::Array, + array: &Array, _parent: ScalarFnArrayView<'_, NotExpr>, _child_idx: usize, ) -> VortexResult> { @@ -61,7 +62,7 @@ where fn execute_parent( &self, - array: &V::Array, + array: &Array, _parent: ScalarFnArrayView<'_, NotExpr>, _child_idx: usize, ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/scalar_fn/fns/not/mod.rs b/vortex-array/src/scalar_fn/fns/not/mod.rs index bdeae78cc66..15d841e76a3 100644 --- a/vortex-array/src/scalar_fn/fns/not/mod.rs +++ b/vortex-array/src/scalar_fn/fns/not/mod.rs @@ -103,7 +103,7 @@ impl ScalarFnVTable for Not { // For boolean array if let Some(bool) = child.as_opt::() { - return Ok(BoolArray::new(!bool.to_bit_buffer(), bool.validity()?).into_array()); + return Ok(BoolArray::new(!bool.to_bit_buffer(), bool.validity().clone()).into_array()); } // Otherwise, execute and try again diff --git a/vortex-array/src/scalar_fn/fns/pack.rs b/vortex-array/src/scalar_fn/fns/pack.rs index 42741d2476f..37a00e61aeb 100644 --- a/vortex-array/src/scalar_fn/fns/pack.rs +++ b/vortex-array/src/scalar_fn/fns/pack.rs @@ -177,7 +177,6 @@ mod tests { use crate::scalar_fn::ScalarFnVTableExt; use crate::scalar_fn::fns::pack::StructArray; use crate::validity::Validity; - use crate::vtable::ValidityHelper; fn test_array() -> ArrayRef { StructArray::from_fields(&[ diff --git a/vortex-array/src/scalar_fn/fns/zip/kernel.rs b/vortex-array/src/scalar_fn/fns/zip/kernel.rs index 2ee5b0bf5eb..e2f661743d4 100644 --- a/vortex-array/src/scalar_fn/fns/zip/kernel.rs +++ b/vortex-array/src/scalar_fn/fns/zip/kernel.rs @@ -12,6 +12,7 @@ use crate::arrays::scalar_fn::ScalarFnArrayView; use crate::kernel::ExecuteParentKernel; use crate::optimizer::rules::ArrayParentReduceRule; use crate::scalar_fn::fns::zip::Zip as ZipExpr; +use crate::vtable::Array; use crate::vtable::VTable; /// Zip two arrays using a mask without reading buffers. @@ -24,7 +25,7 @@ use crate::vtable::VTable; /// the parent `ScalarFnArray`. pub trait ZipReduce: VTable { fn zip( - array: &Self::Array, + array: &Array, if_false: &ArrayRef, mask: &ArrayRef, ) -> VortexResult>; @@ -39,7 +40,7 @@ pub trait ZipReduce: VTable { /// the parent `ScalarFnArray`. pub trait ZipKernel: VTable { fn zip( - array: &Self::Array, + array: &Array, if_false: &ArrayRef, mask: &ArrayRef, ctx: &mut ExecutionCtx, @@ -58,7 +59,7 @@ where fn reduce_parent( &self, - array: &V::Array, + array: &Array, parent: ScalarFnArrayView<'_, ZipExpr>, child_idx: usize, ) -> VortexResult> { @@ -87,7 +88,7 @@ where fn execute_parent( &self, - array: &V::Array, + array: &Array, parent: ScalarFnArrayView<'_, ZipExpr>, child_idx: usize, ctx: &mut ExecutionCtx, diff --git a/vortex-array/src/scalar_fn/fns/zip/mod.rs b/vortex-array/src/scalar_fn/fns/zip/mod.rs index e5f5f18d964..64bb75ea8d9 100644 --- a/vortex-array/src/scalar_fn/fns/zip/mod.rs +++ b/vortex-array/src/scalar_fn/fns/zip/mod.rs @@ -444,7 +444,7 @@ mod tests { .execute::(&mut ctx) .unwrap(); let zipped = zipped.as_opt::().unwrap(); - assert_eq!(zipped.nbuffers(), 2); + assert_eq!(zipped.data_buffers().len(), 2); let expected = arrow_zip( mask.into_array() diff --git a/vortex-array/src/validity.rs b/vortex-array/src/validity.rs index c25a7d6eb6b..5fdf69e902d 100644 --- a/vortex-array/src/validity.rs +++ b/vortex-array/src/validity.rs @@ -21,6 +21,7 @@ use crate::Canonical; use crate::DynArray; use crate::ExecutionCtx; use crate::IntoArray; +use crate::ToCanonical; use crate::arrays::BoolArray; use crate::arrays::ConstantArray; use crate::arrays::scalar_fn::ScalarFnArrayExt; @@ -204,6 +205,17 @@ impl Validity { } } + /// Converts this validity into a [`Mask`] of the given length. + /// + /// Valid elements are `true` and invalid elements are `false`. + pub fn to_mask(&self, length: usize) -> Mask { + match self { + Self::NonNullable | Self::AllValid => Mask::new_true(length), + Self::AllInvalid => Mask::new_false(length), + Self::Array(a) => ToCanonical::to_bool(a.as_ref()).to_mask(), + } + } + pub fn execute_mask(&self, length: usize, ctx: &mut ExecutionCtx) -> VortexResult { match self { Self::NonNullable | Self::AllValid => Ok(Mask::AllTrue(length)), diff --git a/vortex-array/src/vtable/dyn_.rs b/vortex-array/src/vtable/dyn_.rs index 0c8f081a041..a871c56bf5c 100644 --- a/vortex-array/src/vtable/dyn_.rs +++ b/vortex-array/src/vtable/dyn_.rs @@ -18,6 +18,7 @@ use crate::IntoArray; use crate::buffer::BufferHandle; use crate::dtype::DType; use crate::executor::ExecutionCtx; +use crate::scalar_fn::ReduceNode; use crate::serde::ArrayChildren; use crate::stats::ArrayStats; use crate::vtable::Array; @@ -101,7 +102,7 @@ impl DynVTable for V { // Wrap in Array for safe downcasting. // SAFETY: We just validated that V::len(&inner) == len and V::dtype(&inner) == dtype. let array = unsafe { - Array::new_unchecked( + Array::from_data_unchecked( self.clone(), dtype.clone(), len, @@ -119,7 +120,7 @@ impl DynVTable for V { } fn reduce(&self, array: &ArrayRef) -> VortexResult> { - let Some(reduced) = V::reduce(downcast::(array))? else { + let Some(reduced) = V::reduce(downcast_owned::(array.clone()))? else { return Ok(None); }; vortex_ensure!( diff --git a/vortex-array/src/vtable/mod.rs b/vortex-array/src/vtable/mod.rs index e37da0c75cf..3534bb4c398 100644 --- a/vortex-array/src/vtable/mod.rs +++ b/vortex-array/src/vtable/mod.rs @@ -10,7 +10,6 @@ mod validity; use std::fmt::Debug; use std::hash::Hasher; -use std::ops::Deref; use std::sync::Arc; pub use dyn_::*; @@ -35,7 +34,7 @@ use crate::dtype::DType; use crate::executor::ExecutionCtx; use crate::patches::Patches; use crate::serde::ArrayChildren; -use crate::stats::StatsSetRef; +use crate::stats::ArrayStats; use crate::validity::Validity; /// The array [`VTable`] encapsulates logic for an Array type within Vortex. @@ -52,7 +51,7 @@ use crate::validity::Validity; /// out of bounds). Post-conditions are validated after invocation of the vtable function and will /// panic if violated. pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { - type Array: 'static + Send + Sync + Clone + Debug + Deref + IntoArray; + type ArrayData: 'static + Send + Sync + Clone + Debug + IntoArray; type Metadata: Debug; type OperationsVTable: OperationsVTable; @@ -61,55 +60,55 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { /// Returns the VTable from the array instance. /// // NOTE(ngates): this function is temporary while we migrate Arrays over to the unified vtable - fn vtable(array: &Self::Array) -> &Self; + fn vtable(array: &Self::ArrayData) -> &Self; /// Returns the ID of the array. fn id(&self) -> ArrayId; /// Returns the length of the array. - fn len(array: &Self::Array) -> usize; + fn len(array: &Self::ArrayData) -> usize; /// Returns the DType of the array. - fn dtype(array: &Self::Array) -> &DType; + fn dtype(array: &Self::ArrayData) -> &DType; /// Returns the stats set for the array. - fn stats(array: &Self::Array) -> StatsSetRef<'_>; + fn stats(array: &Self::ArrayData) -> &ArrayStats; /// Hashes the array contents. - fn array_hash(array: &Self::Array, state: &mut H, precision: Precision); + fn array_hash(array: &Array, state: &mut H, precision: Precision); /// Compares two arrays of the same type for equality. - fn array_eq(array: &Self::Array, other: &Self::Array, precision: Precision) -> bool; + fn array_eq(array: &Array, other: &Array, precision: Precision) -> bool; /// Returns the number of buffers in the array. - fn nbuffers(array: &Self::Array) -> usize; + fn nbuffers(array: &Array) -> usize; /// Returns the buffer at the given index. /// /// # Panics /// Panics if `idx >= nbuffers(array)`. - fn buffer(array: &Self::Array, idx: usize) -> BufferHandle; + fn buffer(array: &Array, idx: usize) -> BufferHandle; /// Returns the name of the buffer at the given index, or `None` if unnamed. - fn buffer_name(array: &Self::Array, idx: usize) -> Option; + fn buffer_name(array: &Array, idx: usize) -> Option; /// Returns the number of children in the array. - fn nchildren(array: &Self::Array) -> usize; + fn nchildren(array: &Array) -> usize; /// Returns the child at the given index. /// /// # Panics /// Panics if `idx >= nchildren(array)`. - fn child(array: &Self::Array, idx: usize) -> ArrayRef; + fn child(array: &Array, idx: usize) -> ArrayRef; /// Returns the name of the child at the given index. /// /// # Panics /// Panics if `idx >= nchildren(array)`. - fn child_name(array: &Self::Array, idx: usize) -> String; + fn child_name(array: &Array, idx: usize) -> String; /// Exports metadata for an array. - fn metadata(array: &Self::Array) -> VortexResult; + fn metadata(array: &Array) -> VortexResult; /// Serialize metadata into a byte buffer for IPC or file storage. /// Return `None` if the array cannot be serialized. @@ -126,7 +125,7 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { /// Writes the array into a canonical builder. fn append_to_builder( - array: &Self::Array, + array: &Array, builder: &mut dyn ArrayBuilder, ctx: &mut ExecutionCtx, ) -> VortexResult<()> { @@ -142,10 +141,10 @@ pub trait VTable: 'static + Clone + Sized + Send + Sync + Debug { metadata: &Self::Metadata, buffers: &[BufferHandle], children: &dyn ArrayChildren, - ) -> VortexResult; + ) -> VortexResult; /// Replaces the children in `array` with `children`. - fn with_children(array: &mut Self::Array, children: Vec) -> VortexResult<()>; + fn with_children(array: &mut Self::ArrayData, children: Vec) -> VortexResult<()>; /// Execute this array by returning an [`ExecutionResult`]. fn execute(array: Arc>, ctx: &mut ExecutionCtx) -> VortexResult; @@ -235,44 +234,25 @@ pub fn patches_child_name(idx: usize) -> &'static str { } } -/// vtable! macro — generates IntoArray, From, Deref, AsRef for inner array types. +/// vtable! macro — generates IntoArray, From, and type alias for array types. /// -/// During the migration, IntoArray creates [`Array`] (the new typed wrapper) while -/// Deref/AsRef go through AlsoArrayAdapter for backward-compatible DynArray access. +/// Three forms: +/// - `vtable!(Foo)` — short for `vtable!(Foo, Foo)` (legacy form) +/// - `vtable!(Foo, FooVT)` — legacy form where `FooArray` is the inner struct name +/// - `vtable!(Foo, FooVT, FooData)` — new form where `FooData` is the inner struct, +/// and `FooArray` is generated as a type alias for `Array` #[macro_export] macro_rules! vtable { ($V:ident) => { $crate::vtable!($V, $V); }; + // Legacy form: FooArray is the inner struct name, no type alias generated. ($Base:ident, $VT:ident) => { $crate::aliases::paste::paste! { - impl AsRef for [<$Base Array>] { - fn as_ref(&self) -> &dyn $crate::DynArray { - // We can unsafe cast ourselves to an ArrayAdapter. - unsafe { &*(self as *const [<$Base Array>] as *const $crate::ArrayAdapter<$VT>) } - } - } - - impl std::ops::Deref for [<$Base Array>] { - type Target = dyn $crate::DynArray; - - fn deref(&self) -> &Self::Target { - // We can unsafe cast ourselves to an ArrayAdapter. - unsafe { &*(self as *const [<$Base Array>] as *const $crate::ArrayAdapter<$VT>) } - } - } - impl $crate::IntoArray for [<$Base Array>] { fn into_array(self) -> $crate::ArrayRef { - use $crate::vtable::VTable; - let vtable = $VT::vtable(&self).clone(); - let dtype = $VT::dtype(&self).clone(); - let len = $VT::len(&self); - let stats = $VT::stats(&self).to_array_stats(); - // SAFETY: dtype and len are extracted from `self` via VTable methods. - std::sync::Arc::new(unsafe { - $crate::vtable::Array::new_unchecked(vtable, dtype, len, self, stats) - }) + use $crate::aliases::vortex_error::VortexExpect; + std::sync::Arc::new($crate::vtable::Array::<$VT>::try_from_data(self).vortex_expect("data is always valid")) } } @@ -292,4 +272,25 @@ macro_rules! vtable { } } }; + // New form: Data is the inner struct, FooArray is a type alias for Array. + ($Base:ident, $VT:ident, $Data:ident) => { + $crate::aliases::paste::paste! { + /// Type alias: `FooArray = Array`. + pub type [<$Base Array>] = $crate::vtable::Array<$VT>; + + impl $crate::IntoArray for $Data { + fn into_array(self) -> $crate::ArrayRef { + use $crate::aliases::vortex_error::VortexExpect; + std::sync::Arc::new($crate::vtable::Array::<$VT>::try_from_data(self).vortex_expect("data is always valid")) + } + } + + impl From<$Data> for $crate::ArrayRef { + fn from(value: $Data) -> $crate::ArrayRef { + use $crate::IntoArray; + value.into_array() + } + } + } + }; } diff --git a/vortex-array/src/vtable/operations.rs b/vortex-array/src/vtable/operations.rs index bdda1b3675a..04594f2ab00 100644 --- a/vortex-array/src/vtable/operations.rs +++ b/vortex-array/src/vtable/operations.rs @@ -6,6 +6,7 @@ use vortex_error::vortex_bail; use crate::ExecutionCtx; use crate::scalar::Scalar; +use crate::vtable::Array; use crate::vtable::NotSupported; use crate::vtable::VTable; @@ -16,11 +17,11 @@ pub trait OperationsVTable { /// /// Bounds-checking has already been performed by the time this function is called, /// and the index is guaranteed to be non-null. - fn scalar_at(array: &V::Array, index: usize, ctx: &mut ExecutionCtx) -> VortexResult; + fn scalar_at(array: &Array, index: usize, ctx: &mut ExecutionCtx) -> VortexResult; } impl OperationsVTable for NotSupported { - fn scalar_at(array: &V::Array, _index: usize, _ctx: &mut ExecutionCtx) -> VortexResult { + fn scalar_at(array: &Array, _index: usize, _ctx: &mut ExecutionCtx) -> VortexResult { vortex_bail!( "Legacy scalar_at operation is not supported for {} arrays", array.encoding_id() diff --git a/vortex-array/src/vtable/typed.rs b/vortex-array/src/vtable/typed.rs index 4bba86291bb..be39089d285 100644 --- a/vortex-array/src/vtable/typed.rs +++ b/vortex-array/src/vtable/typed.rs @@ -6,8 +6,11 @@ use std::fmt::Debug; use std::fmt::Formatter; use std::ops::Deref; +use std::ops::DerefMut; use std::sync::Arc; +use vortex_error::VortexResult; + use crate::ArrayRef; use crate::IntoArray; use crate::dtype::DType; @@ -28,35 +31,47 @@ pub struct Array { vtable: V, pub(crate) dtype: DType, pub(crate) len: usize, - pub(crate) array: V::Array, + pub(crate) data: V::ArrayData, pub(crate) stats: ArrayStats, } #[allow(clippy::same_name_method)] impl Array { - /// Create a new typed array without validating that the inner array's dtype/len match. + /// Create a new typed array from encoding-specific data. + /// + /// Extracts dtype, len, vtable, and stats from the data via [`VTable`] methods. + pub fn try_from_data(data: V::ArrayData) -> VortexResult { + let vtable = V::vtable(&data).clone(); + let dtype = V::dtype(&data).clone(); + let len = V::len(&data); + let stats = V::stats(&data).clone(); + // SAFETY: dtype and len are extracted from `data` via VTable methods. + Ok(unsafe { Self::from_data_unchecked(vtable, dtype, len, data, stats) }) + } + + /// Create a new typed array without validation. /// /// # Safety /// - /// The caller must ensure that `V::dtype(&array) == &dtype` and `V::len(&array) == len`. - pub unsafe fn new_unchecked( + /// The caller must ensure that `V::dtype(&data) == &dtype` and `V::len(&data) == len`. + pub unsafe fn from_data_unchecked( vtable: V, dtype: DType, len: usize, - array: V::Array, + data: V::ArrayData, stats: ArrayStats, ) -> Self { Self { vtable, dtype, len, - array, + data, stats, } } /// Returns a reference to the vtable. - pub fn typed_vtable(&self) -> &V { + pub fn vtable(&self) -> &V { &self.vtable } @@ -91,13 +106,13 @@ impl Array { } /// Returns a reference to the inner encoding-specific array data. - pub fn inner(&self) -> &V::Array { - &self.array + pub fn data(&self) -> &V::ArrayData { + &self.data } /// Consumes this array and returns the inner encoding-specific data. - pub fn into_inner(self) -> V::Array { - self.array + pub fn into_data(self) -> V::ArrayData { + self.data } /// Returns a cloned [`ArrayRef`] for this array. @@ -106,11 +121,112 @@ impl Array { } } +impl Array +where + V::ArrayData: crate::vtable::ValidityHelper, +{ + /// Returns a reference to the validity of this array. + /// + /// This inherent method shadows `DynArray::validity()` to provide direct access + /// to the concrete validity without going through `VortexResult`. + #[allow(clippy::same_name_method)] + pub fn validity(&self) -> &crate::validity::Validity { + crate::vtable::ValidityHelper::validity(&self.data) + } + + /// Returns the validity mask for this array. + #[allow(clippy::same_name_method)] + pub fn validity_mask(&self) -> VortexResult { + Ok(self.validity().to_mask(self.len)) + } +} + +/// Public API methods on `Array` — these shadow the `DynArray` trait methods +/// so callers don't need to import `DynArray`. +impl Array { + /// Performs a constant-time slice of the array. + #[allow(clippy::same_name_method)] + pub fn slice(&self, range: std::ops::Range) -> VortexResult { + ::slice(self, range) + } + + /// Fetch the scalar at the given index. + #[allow(clippy::same_name_method)] + pub fn scalar_at(&self, index: usize) -> VortexResult { + ::scalar_at(self, index) + } + + /// Wraps the array in a FilterArray such that it is logically filtered by the given mask. + #[allow(clippy::same_name_method)] + pub fn filter(&self, mask: vortex_mask::Mask) -> VortexResult { + ::filter(self, mask) + } + + /// Wraps the array in a DictArray such that it is logically taken by the given indices. + #[allow(clippy::same_name_method)] + pub fn take(&self, indices: ArrayRef) -> VortexResult { + ::take(self, indices) + } + + /// Returns whether the item at `index` is valid. + #[allow(clippy::same_name_method)] + pub fn is_valid(&self, index: usize) -> VortexResult { + ::is_valid(self, index) + } + + /// Returns whether the item at `index` is invalid. + #[allow(clippy::same_name_method)] + pub fn is_invalid(&self, index: usize) -> VortexResult { + ::is_invalid(self, index) + } + + /// Returns whether all items in the array are valid. + #[allow(clippy::same_name_method)] + pub fn all_valid(&self) -> VortexResult { + ::all_valid(self) + } + + /// Returns whether all items in the array are invalid. + #[allow(clippy::same_name_method)] + pub fn all_invalid(&self) -> VortexResult { + ::all_invalid(self) + } + + /// Returns the canonical representation of the array. + #[allow(clippy::same_name_method)] + pub fn to_canonical(&self) -> VortexResult { + ::to_canonical(self) + } + + /// Total size of the array in bytes, including all children and buffers. + pub fn nbytes(&self) -> u64 { + self.to_array_ref().nbytes() + } + + /// Returns the number of buffers this array would serialize. + #[allow(clippy::same_name_method)] + pub fn nbuffers(&self) -> usize { + V::nbuffers(self) + } + + /// If this array is a constant, returns the scalar value. + // TODO(ngates): remove this... we already know if we're constant or not + pub fn as_constant(&self) -> Option { + self.to_array_ref().as_constant() + } +} + impl Deref for Array { - type Target = V::Array; + type Target = V::ArrayData; + + fn deref(&self) -> &V::ArrayData { + &self.data + } +} - fn deref(&self) -> &V::Array { - &self.array +impl DerefMut for Array { + fn deref_mut(&mut self) -> &mut V::ArrayData { + &mut self.data } } @@ -120,7 +236,7 @@ impl Clone for Array { vtable: self.vtable.clone(), dtype: self.dtype.clone(), len: self.len, - array: self.array.clone(), + data: self.data.clone(), stats: self.stats.clone(), } } @@ -132,7 +248,7 @@ impl Debug for Array { .field("encoding", &self.vtable.id()) .field("dtype", &self.dtype) .field("len", &self.len) - .field("inner", &self.array) + .field("inner", &self.data) .finish() } } diff --git a/vortex-array/src/vtable/validity.rs b/vortex-array/src/vtable/validity.rs index ed2929e958e..11b83a1f197 100644 --- a/vortex-array/src/vtable/validity.rs +++ b/vortex-array/src/vtable/validity.rs @@ -6,6 +6,7 @@ use vortex_error::VortexResult; use crate::ArrayRef; use crate::DynArray; use crate::validity::Validity; +use crate::vtable::Array; use crate::vtable::VTable; pub trait ValidityVTable { @@ -14,7 +15,7 @@ pub trait ValidityVTable { /// ## Pre-conditions /// /// - The array DType is nullable. - fn validity(array: &V::Array) -> VortexResult; + fn validity(array: &Array) -> VortexResult; } /// An implementation of the [`ValidityVTable`] for arrays that hold validity as a child array. @@ -27,10 +28,10 @@ pub trait ValidityHelper { impl ValidityVTable for ValidityVTableFromValidityHelper where - V::Array: ValidityHelper, + V::ArrayData: ValidityHelper, { - fn validity(array: &V::Array) -> VortexResult { - Ok(array.validity().clone()) + fn validity(array: &Array) -> VortexResult { + Ok(array.data().validity().clone()) } } @@ -49,10 +50,10 @@ pub trait ValiditySliceHelper { impl ValidityVTable for ValidityVTableFromValiditySliceHelper where - V::Array: ValiditySliceHelper, + V::ArrayData: ValiditySliceHelper, { - fn validity(array: &V::Array) -> VortexResult { - array.sliced_validity() + fn validity(array: &Array) -> VortexResult { + array.data().sliced_validity() } } @@ -61,15 +62,15 @@ where pub struct ValidityVTableFromChild; pub trait ValidityChild { - fn validity_child(array: &V::Array) -> &ArrayRef; + fn validity_child(array: &V::ArrayData) -> &ArrayRef; } impl ValidityVTable for ValidityVTableFromChild where V: ValidityChild, { - fn validity(array: &V::Array) -> VortexResult { - V::validity_child(array).validity() + fn validity(array: &Array) -> VortexResult { + V::validity_child(array.data()).validity() } } @@ -88,9 +89,9 @@ pub trait ValidityChildSliceHelper { impl ValidityVTable for ValidityVTableFromChildSliceHelper where - V::Array: ValidityChildSliceHelper, + V::ArrayData: ValidityChildSliceHelper, { - fn validity(array: &V::Array) -> VortexResult { - array.sliced_child_array()?.validity() + fn validity(array: &Array) -> VortexResult { + array.data().sliced_child_array()?.validity() } } diff --git a/vortex-bench/src/conversions.rs b/vortex-bench/src/conversions.rs index 1ab3c1e7f20..3f21ab30ba0 100644 --- a/vortex-bench/src/conversions.rs +++ b/vortex-bench/src/conversions.rs @@ -19,6 +19,7 @@ use tracing::info; use tracing::trace; use vortex::VortexSessionDefault; use vortex::array::ArrayRef; +use vortex::array::IntoArray; use vortex::array::VortexSessionExecute; use vortex::array::arrays::ChunkedArray; use vortex::array::arrow::FromArrowArray; @@ -214,7 +215,7 @@ pub async fn write_parquet_as_vortex( let data = parquet_to_vortex_chunks(parquet_path).await?; let write_options = compaction.apply_options(SESSION.write_options()); write_options - .write(&mut output_file, data.to_array_stream()) + .write(&mut output_file, data.into_array().to_array_stream()) .await?; output_file.flush().await?; Ok(()) diff --git a/vortex-bench/src/datasets/taxi_data.rs b/vortex-bench/src/datasets/taxi_data.rs index 133f7c55586..cc3c6f61b81 100644 --- a/vortex-bench/src/datasets/taxi_data.rs +++ b/vortex-bench/src/datasets/taxi_data.rs @@ -8,6 +8,7 @@ use async_trait::async_trait; use tokio::fs::File as TokioFile; use tokio::io::AsyncWriteExt; use vortex::array::ArrayRef; +use vortex::array::IntoArray; use vortex::array::stream::ArrayStreamExt; use vortex::file::OpenOptionsSessionExt; use vortex::file::WriteOptionsSessionExt; @@ -93,7 +94,7 @@ pub async fn taxi_data_vortex() -> Result { SESSION .write_options() - .write(&mut output_file, data.to_array_stream()) + .write(&mut output_file, data.into_array().to_array_stream()) .await?; output_file.flush().await?; Ok(buf) @@ -112,7 +113,7 @@ pub async fn taxi_data_vortex_compact() -> Result { let data = parquet_to_vortex_chunks(taxi_data_parquet().await?).await?; write_options - .write(&mut output_file, data.to_array_stream()) + .write(&mut output_file, data.into_array().to_array_stream()) .await?; output_file.flush().await?; diff --git a/vortex-bench/src/downloadable_dataset.rs b/vortex-bench/src/downloadable_dataset.rs index 7aa140ec1b2..78ab162d688 100644 --- a/vortex-bench/src/downloadable_dataset.rs +++ b/vortex-bench/src/downloadable_dataset.rs @@ -4,6 +4,7 @@ use async_trait::async_trait; use tokio::fs::File; use vortex::array::ArrayRef; +use vortex::array::IntoArray; use vortex::array::stream::ArrayStreamExt; use vortex::file::OpenOptionsSessionExt; use vortex::file::WriteOptionsSessionExt; @@ -69,7 +70,7 @@ impl Dataset for DownloadableDataset { &mut File::create(path) .await .map_err(|e| anyhow::anyhow!("Failed to create file: {}", e))?, - data.to_array_stream(), + data.into_array().to_array_stream(), ) .await .map_err(|e| anyhow::anyhow!("Failed to write vortex file: {}", e))?; diff --git a/vortex-bench/src/public_bi.rs b/vortex-bench/src/public_bi.rs index 0539266ed0d..3602cd2cd33 100644 --- a/vortex-bench/src/public_bi.rs +++ b/vortex-bench/src/public_bi.rs @@ -26,6 +26,7 @@ use tracing::info; use tracing::trace; use url::Url; use vortex::array::ArrayRef; +use vortex::array::IntoArray; use vortex::array::stream::ArrayStreamExt; use vortex::error::VortexResult; use vortex::error::vortex_err; @@ -371,7 +372,7 @@ impl PBIData { &mut File::create(output_path) .await .map_err(|e| anyhow::anyhow!("Failed to create file: {}", e))?, - data.to_array_stream(), + data.into_array().to_array_stream(), ) .await .map_err(|e| anyhow::anyhow!("Failed to write vortex file: {}", e))?; diff --git a/vortex-btrblocks/public-api.lock b/vortex-btrblocks/public-api.lock index 55d23a96a26..e891c8e189f 100644 --- a/vortex-btrblocks/public-api.lock +++ b/vortex-btrblocks/public-api.lock @@ -270,15 +270,15 @@ impl vortex_btrblocks::CompressorStats for vortex_btrblocks::IntegerStats pub type vortex_btrblocks::IntegerStats::ArrayVTable = vortex_array::arrays::primitive::vtable::Primitive -pub fn vortex_btrblocks::IntegerStats::generate(input: &::Array) -> Self +pub fn vortex_btrblocks::IntegerStats::generate(input: &::ArrayData) -> Self -pub fn vortex_btrblocks::IntegerStats::generate_opts(input: &vortex_array::arrays::primitive::array::PrimitiveArray, opts: vortex_btrblocks::GenerateStatsOptions) -> Self +pub fn vortex_btrblocks::IntegerStats::generate_opts(input: &vortex_array::arrays::primitive::array::PrimitiveData, opts: vortex_btrblocks::GenerateStatsOptions) -> Self pub fn vortex_btrblocks::IntegerStats::sample(&self, sample_size: u32, sample_count: u32) -> Self pub fn vortex_btrblocks::IntegerStats::sample_opts(&self, sample_size: u32, sample_count: u32, opts: vortex_btrblocks::GenerateStatsOptions) -> Self -pub fn vortex_btrblocks::IntegerStats::source(&self) -> &vortex_array::arrays::primitive::array::PrimitiveArray +pub fn vortex_btrblocks::IntegerStats::source(&self) -> &vortex_array::arrays::primitive::array::PrimitiveData pub trait vortex_btrblocks::CanonicalCompressor @@ -304,28 +304,28 @@ pub trait vortex_btrblocks::CompressorStats: core::fmt::Debug + core::clone::Clo pub type vortex_btrblocks::CompressorStats::ArrayVTable: vortex_array::vtable::VTable -pub fn vortex_btrblocks::CompressorStats::generate(input: &::Array) -> Self +pub fn vortex_btrblocks::CompressorStats::generate(input: &::ArrayData) -> Self -pub fn vortex_btrblocks::CompressorStats::generate_opts(input: &::Array, opts: vortex_btrblocks::GenerateStatsOptions) -> Self +pub fn vortex_btrblocks::CompressorStats::generate_opts(input: &::ArrayData, opts: vortex_btrblocks::GenerateStatsOptions) -> Self pub fn vortex_btrblocks::CompressorStats::sample(&self, sample_size: u32, sample_count: u32) -> Self pub fn vortex_btrblocks::CompressorStats::sample_opts(&self, sample_size: u32, sample_count: u32, opts: vortex_btrblocks::GenerateStatsOptions) -> Self -pub fn vortex_btrblocks::CompressorStats::source(&self) -> &::Array +pub fn vortex_btrblocks::CompressorStats::source(&self) -> &::ArrayData impl vortex_btrblocks::CompressorStats for vortex_btrblocks::IntegerStats pub type vortex_btrblocks::IntegerStats::ArrayVTable = vortex_array::arrays::primitive::vtable::Primitive -pub fn vortex_btrblocks::IntegerStats::generate(input: &::Array) -> Self +pub fn vortex_btrblocks::IntegerStats::generate(input: &::ArrayData) -> Self -pub fn vortex_btrblocks::IntegerStats::generate_opts(input: &vortex_array::arrays::primitive::array::PrimitiveArray, opts: vortex_btrblocks::GenerateStatsOptions) -> Self +pub fn vortex_btrblocks::IntegerStats::generate_opts(input: &vortex_array::arrays::primitive::array::PrimitiveData, opts: vortex_btrblocks::GenerateStatsOptions) -> Self pub fn vortex_btrblocks::IntegerStats::sample(&self, sample_size: u32, sample_count: u32) -> Self pub fn vortex_btrblocks::IntegerStats::sample_opts(&self, sample_size: u32, sample_count: u32, opts: vortex_btrblocks::GenerateStatsOptions) -> Self -pub fn vortex_btrblocks::IntegerStats::source(&self) -> &vortex_array::arrays::primitive::array::PrimitiveArray +pub fn vortex_btrblocks::IntegerStats::source(&self) -> &vortex_array::arrays::primitive::array::PrimitiveData -pub fn vortex_btrblocks::integer_dictionary_encode(stats: &vortex_btrblocks::IntegerStats) -> vortex_array::arrays::dict::array::DictArray +pub fn vortex_btrblocks::integer_dictionary_encode(stats: &vortex_btrblocks::IntegerStats) -> vortex_array::arrays::dict::vtable::DictArray diff --git a/vortex-btrblocks/src/canonical_compressor.rs b/vortex-btrblocks/src/canonical_compressor.rs index 46252060a1f..113ec639b01 100644 --- a/vortex-btrblocks/src/canonical_compressor.rs +++ b/vortex-btrblocks/src/canonical_compressor.rs @@ -23,7 +23,6 @@ use vortex_array::arrays::listview::list_from_list_view; use vortex_array::dtype::DType; use vortex_array::dtype::Nullability; use vortex_array::extension::datetime::TemporalMetadata; -use vortex_array::vtable::ValidityHelper; use vortex_error::VortexResult; use vortex_error::vortex_bail; @@ -282,7 +281,7 @@ impl CanonicalCompressor for BtrBlocksCompressor { let mut ctx = LEGACY_SESSION.create_execution_ctx(); if is_constant(&ext_array.clone().into_array(), &mut ctx)? { return Ok(ConstantArray::new( - temporal_array.as_ref().scalar_at(0)?, + temporal_array.clone().into_array().scalar_at(0)?, ext_array.len(), ) .into_array()); @@ -320,7 +319,6 @@ impl CanonicalCompressor for BtrBlocksCompressor { #[cfg(test)] mod tests { use rstest::rstest; - use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::arrays::List; use vortex_array::arrays::ListView; diff --git a/vortex-btrblocks/src/compressor/decimal.rs b/vortex-btrblocks/src/compressor/decimal.rs index bf738a72839..fafe58200d4 100644 --- a/vortex-btrblocks/src/compressor/decimal.rs +++ b/vortex-btrblocks/src/compressor/decimal.rs @@ -8,8 +8,7 @@ use vortex_array::arrays::DecimalArray; use vortex_array::arrays::PrimitiveArray; use vortex_array::arrays::decimal::narrowed_decimal; use vortex_array::dtype::DecimalType; -use vortex_array::vtable::ValidityHelper; -use vortex_decimal_byte_parts::DecimalBytePartsArray; +use vortex_decimal_byte_parts::DecimalByteParts; use vortex_error::VortexResult; use crate::BtrBlocksCompressor; @@ -39,5 +38,5 @@ pub fn compress_decimal( Excludes::none(), )?; - DecimalBytePartsArray::try_new(compressed, decimal.decimal_dtype()).map(|d| d.into_array()) + DecimalByteParts::try_new(compressed, decimal.decimal_dtype()).map(|d| d.into_array()) } diff --git a/vortex-btrblocks/src/compressor/float/dictionary.rs b/vortex-btrblocks/src/compressor/float/dictionary.rs index 33c024af4b3..24703f4a356 100644 --- a/vortex-btrblocks/src/compressor/float/dictionary.rs +++ b/vortex-btrblocks/src/compressor/float/dictionary.rs @@ -10,7 +10,6 @@ use vortex_array::arrays::DictArray; use vortex_array::arrays::PrimitiveArray; use vortex_array::dtype::half::f16; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::Buffer; use super::stats::ErasedDistinctValues; @@ -132,6 +131,6 @@ mod tests { Validity::Array(BoolArray::from_iter([true, true, true, false, true]).into_array()), ) .into_array(); - assert_arrays_eq!(undict.as_ref(), expected.as_ref()); + assert_arrays_eq!(undict, expected); } } diff --git a/vortex-btrblocks/src/compressor/float/mod.rs b/vortex-btrblocks/src/compressor/float/mod.rs index 57bb4dc65f3..69b8c462d38 100644 --- a/vortex-btrblocks/src/compressor/float/mod.rs +++ b/vortex-btrblocks/src/compressor/float/mod.rs @@ -9,11 +9,11 @@ use std::hash::Hasher; use enum_iterator::Sequence; use vortex_alp::ALP; -use vortex_alp::ALPArray; use vortex_alp::RDEncoder; use vortex_alp::alp_encode; use vortex_array::ArrayRef; use vortex_array::Canonical; +use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::ToCanonical; use vortex_array::arrays::ConstantArray; @@ -24,11 +24,9 @@ use vortex_array::arrays::dict::DictArrayParts; use vortex_array::dtype::PType; use vortex_array::scalar::Scalar; use vortex_array::vtable::VTable; -use vortex_array::vtable::ValidityHelper; use vortex_error::VortexResult; use vortex_error::vortex_panic; use vortex_sparse::Sparse; -use vortex_sparse::SparseArray; use self::dictionary::dictionary_encode; pub use self::stats::FloatStats; @@ -93,7 +91,7 @@ impl<'a> Compressor for FloatCompressor<'a> { type SchemeType = dyn FloatScheme; type StatsType = FloatStats; - fn gen_stats(&self, array: &::Array) -> Self::StatsType { + fn gen_stats(&self, array: &::ArrayData) -> Self::StatsType { if self .btr_blocks_compressor .float_schemes() @@ -262,14 +260,15 @@ impl Scheme for ConstantScheme { _ctx: CompressorContext, _excludes: &[FloatCode], ) -> VortexResult { + let source_ref = stats.source().clone().into_array(); let scalar_idx = - (0..stats.source().len()).position(|idx| stats.source().is_valid(idx).unwrap_or(false)); + (0..stats.source().len()).position(|idx| source_ref.is_valid(idx).unwrap_or(false)); match scalar_idx { Some(idx) => { - let scalar = stats.source().scalar_at(idx)?; + let scalar = source_ref.scalar_at(idx)?; let const_arr = ConstantArray::new(scalar, stats.src.len()).into_array(); - if !stats.source().all_valid()? { + if !source_ref.all_valid()? { Ok(MaskedArray::try_new(const_arr, stats.src.validity().clone())?.into_array()) } else { Ok(const_arr) @@ -320,9 +319,8 @@ impl Scheme for ALPScheme { ctx: CompressorContext, excludes: &[FloatCode], ) -> VortexResult { - let alp_encoded = alp_encode(&stats.source().to_primitive(), None)?; - let alp = alp_encoded.as_::(); - let alp_ints = alp.encoded().to_primitive(); + let alp_encoded = alp_encode(&stats.source().clone().into_array().to_primitive(), None)?; + let alp_ints = alp_encoded.encoded().to_primitive(); // Compress the ALP ints. // Patches are not compressed. They should be infrequent, and if they are not then we want @@ -341,9 +339,9 @@ impl Scheme for ALPScheme { Excludes::int_only(&int_excludes), )?; - let patches = alp.patches().map(compress_patches).transpose()?; + let patches = alp_encoded.patches().map(compress_patches).transpose()?; - Ok(ALPArray::new(compressed_alp_ints, alp.exponents(), patches).into_array()) + Ok(ALP::new(compressed_alp_ints, alp_encoded.exponents(), patches).into_array()) } } @@ -376,13 +374,13 @@ impl Scheme for ALPRDScheme { _ctx: CompressorContext, _excludes: &[FloatCode], ) -> VortexResult { - let encoder = match stats.source().ptype() { - PType::F32 => RDEncoder::new(stats.source().as_slice::()), - PType::F64 => RDEncoder::new(stats.source().as_slice::()), + let encoder = match stats.src.ptype() { + PType::F32 => RDEncoder::new(stats.src.as_slice::()), + PType::F64 => RDEncoder::new(stats.src.as_slice::()), ptype => vortex_panic!("cannot ALPRD compress ptype {ptype}"), }; - let mut alp_rd = encoder.encode(stats.source()); + let mut alp_rd = encoder.encode(&stats.src); let patches = alp_rd .left_parts_patches() @@ -431,7 +429,7 @@ impl Scheme for DictScheme { ) -> VortexResult { let dict = dictionary_encode(stats); let has_all_values_referenced = dict.has_all_values_referenced(); - let DictArrayParts { codes, values, .. } = dict.into_parts(); + let DictArrayParts { codes, values, .. } = dict.into_data().into_parts(); let compressed_codes = compressor.compress_canonical( Canonical::Primitive(codes.to_primitive()), @@ -501,7 +499,7 @@ impl Scheme for NullDominated { assert!(ctx.allowed_cascading > 0); // We pass None as we only run this pathway for NULL-dominated float arrays - let sparse_encoded = SparseArray::encode(&stats.src.clone().into_array(), None)?; + let sparse_encoded = Sparse::encode(&stats.src.clone().into_array(), None)?; if let Some(sparse) = sparse_encoded.as_opt::() { // Compress the values @@ -511,12 +509,12 @@ impl Scheme for NullDominated { let indices = sparse.patches().indices().to_primitive().narrow()?; let compressed_indices = compressor.compress_canonical( - Canonical::Primitive(indices.to_primitive()), + Canonical::Primitive(indices), ctx.descend(), Excludes::int_only(&new_excludes), )?; - SparseArray::try_new( + Sparse::try_new( compressed_indices, sparse.patches().values().clone(), sparse.len(), @@ -545,12 +543,10 @@ impl Scheme for PcoScheme { _ctx: CompressorContext, _excludes: &[FloatCode], ) -> VortexResult { - Ok(vortex_pco::PcoArray::from_primitive( - stats.source(), - pco::DEFAULT_COMPRESSION_LEVEL, - 8192, - )? - .into_array()) + Ok( + vortex_pco::Pco::from_primitive(&stats.src, pco::DEFAULT_COMPRESSION_LEVEL, 8192)? + .into_array(), + ) } } @@ -637,7 +633,7 @@ mod tests { let decoded = compressed; let expected = Buffer::copy_from(&values).into_array(); - assert_arrays_eq!(decoded.as_ref(), expected.as_ref()); + assert_arrays_eq!(decoded, expected); Ok(()) } diff --git a/vortex-btrblocks/src/compressor/float/stats.rs b/vortex-btrblocks/src/compressor/float/stats.rs index 818ba40d2cf..1574a6c4c81 100644 --- a/vortex-btrblocks/src/compressor/float/stats.rs +++ b/vortex-btrblocks/src/compressor/float/stats.rs @@ -11,6 +11,7 @@ use vortex_array::ToCanonical; use vortex_array::arrays::Primitive; use vortex_array::arrays::PrimitiveArray; use vortex_array::arrays::primitive::NativeValue; +use vortex_array::arrays::primitive::PrimitiveData; use vortex_array::dtype::NativePType; use vortex_array::dtype::PType; use vortex_array::dtype::half::f16; @@ -83,12 +84,14 @@ impl FloatStats { impl CompressorStats for FloatStats { type ArrayVTable = Primitive; - fn generate_opts(input: &PrimitiveArray, opts: GenerateStatsOptions) -> Self { - Self::generate_opts_fallible(input, opts) + fn generate_opts(input: &PrimitiveData, opts: GenerateStatsOptions) -> Self { + let array = + PrimitiveArray::try_from_data(input.clone()).vortex_expect("data is always valid"); + Self::generate_opts_fallible(&array, opts) .vortex_expect("FloatStats::generate_opts should not fail") } - fn source(&self) -> &PrimitiveArray { + fn source(&self) -> &PrimitiveData { &self.src } diff --git a/vortex-btrblocks/src/compressor/integer/dictionary.rs b/vortex-btrblocks/src/compressor/integer/dictionary.rs index 70a29aaeedd..f04cb7a1f06 100644 --- a/vortex-btrblocks/src/compressor/integer/dictionary.rs +++ b/vortex-btrblocks/src/compressor/integer/dictionary.rs @@ -9,7 +9,6 @@ use vortex_array::IntoArray; use vortex_array::arrays::DictArray; use vortex_array::arrays::PrimitiveArray; use vortex_array::validity::Validity; -use vortex_array::vtable::ValidityHelper; use vortex_buffer::Buffer; use super::IntegerStats; @@ -148,6 +147,6 @@ mod tests { Validity::Array(BoolArray::from_iter([true, true, true, false, true]).into_array()), ) .into_array(); - assert_arrays_eq!(undict.as_ref(), expected.as_ref()); + assert_arrays_eq!(undict, expected); } } diff --git a/vortex-btrblocks/src/compressor/integer/mod.rs b/vortex-btrblocks/src/compressor/integer/mod.rs index 58ee4f62e76..8a191a88204 100644 --- a/vortex-btrblocks/src/compressor/integer/mod.rs +++ b/vortex-btrblocks/src/compressor/integer/mod.rs @@ -11,6 +11,7 @@ use enum_iterator::Sequence; pub use stats::IntegerStats; use vortex_array::ArrayRef; use vortex_array::Canonical; +use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::ToCanonical; use vortex_array::arrays::ConstantArray; @@ -20,21 +21,19 @@ use vortex_array::arrays::Primitive; use vortex_array::arrays::PrimitiveArray; use vortex_array::scalar::Scalar; use vortex_array::vtable::VTable; -use vortex_array::vtable::ValidityHelper; use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_err; -use vortex_fastlanes::FoRArray; +use vortex_fastlanes::FoR; use vortex_fastlanes::bitpack_compress::bit_width_histogram; use vortex_fastlanes::bitpack_compress::bitpack_encode; use vortex_fastlanes::bitpack_compress::find_best_bit_width; -use vortex_runend::RunEndArray; +use vortex_runend::RunEnd; use vortex_runend::compress::runend_encode; use vortex_sequence::sequence_encode; use vortex_sparse::Sparse; -use vortex_sparse::SparseArray; -use vortex_zigzag::ZigZagArray; +use vortex_zigzag::ZigZag; use vortex_zigzag::zigzag_encode; use self::dictionary::dictionary_encode; @@ -86,7 +85,7 @@ impl<'a> Compressor for IntCompressor<'a> { &UncompressedScheme } - fn gen_stats(&self, array: &::Array) -> Self::StatsType { + fn gen_stats(&self, array: &::ArrayData) -> Self::StatsType { if self .btr_blocks_compressor .int_schemes() @@ -294,14 +293,15 @@ impl Scheme for ConstantScheme { _ctx: CompressorContext, _excludes: &[IntCode], ) -> VortexResult { + let source_ref = stats.source().clone().into_array(); let scalar_idx = - (0..stats.source().len()).position(|idx| stats.source().is_valid(idx).unwrap_or(false)); + (0..stats.source().len()).position(|idx| source_ref.is_valid(idx).unwrap_or(false)); match scalar_idx { Some(idx) => { - let scalar = stats.source().scalar_at(idx)?; + let scalar = source_ref.scalar_at(idx)?; let const_arr = ConstantArray::new(scalar, stats.src.len()).into_array(); - if !stats.source().all_valid()? { + if !source_ref.all_valid()? { Ok(MaskedArray::try_new(const_arr, stats.src.validity().clone())?.into_array()) } else { Ok(const_arr) @@ -384,7 +384,7 @@ impl Scheme for FORScheme { ctx: CompressorContext, excludes: &[IntCode], ) -> VortexResult { - let for_array = FoRArray::encode(stats.src.clone())?; + let for_array = FoR::encode(stats.src.clone())?; let biased = for_array.encoded().to_primitive(); let biased_stats = IntegerStats::generate_opts( &biased, @@ -404,11 +404,10 @@ impl Scheme for FORScheme { let compressed = BitPackingScheme.compress(compressor, &biased_stats, leaf_ctx, excludes)?; - let for_compressed = FoRArray::try_new(compressed, for_array.reference_scalar().clone())?; + let for_compressed = FoR::try_new(compressed, for_array.reference_scalar().clone())?; for_compressed - .as_ref() .statistics() - .inherit_from(for_array.as_ref().statistics()); + .inherit_from(for_array.into_array().statistics()); Ok(for_compressed.into_array()) } } @@ -476,7 +475,7 @@ impl Scheme for ZigZagScheme { tracing::debug!("zigzag output: {}", compressed.encoding_id()); - Ok(ZigZagArray::try_new(compressed)?.into_array()) + Ok(ZigZag::try_new(compressed)?.into_array()) } } @@ -515,13 +514,13 @@ impl Scheme for BitPackingScheme { _ctx: CompressorContext, _excludes: &[IntCode], ) -> VortexResult { - let histogram = bit_width_histogram(stats.source())?; - let bw = find_best_bit_width(stats.source().ptype(), &histogram)?; + let histogram = bit_width_histogram(&stats.src)?; + let bw = find_best_bit_width(stats.src.ptype(), &histogram)?; // If best bw is determined to be the current bit-width, return the original array. - if bw as usize == stats.source().ptype().bit_width() { - return Ok(stats.source().clone().into_array()); + if bw as usize == stats.src.ptype().bit_width() { + return Ok(stats.src.clone().into_array()); } - let mut packed = bitpack_encode(stats.source(), bw, Some(&histogram))?; + let mut packed = bitpack_encode(&stats.src, bw, Some(&histogram))?; let patches = packed.patches().map(compress_patches).transpose()?; packed.replace_patches(patches); @@ -600,7 +599,7 @@ impl Scheme for SparseScheme { .into_array()); } - let sparse_encoded = SparseArray::encode( + let sparse_encoded = Sparse::encode( &stats.src.clone().into_array(), Some(Scalar::primitive_value( top_pvalue, @@ -628,7 +627,7 @@ impl Scheme for SparseScheme { Excludes::int_only(&new_excludes), )?; - SparseArray::try_new( + Sparse::try_new( compressed_indices, compressed_values, sparse.len(), @@ -769,7 +768,7 @@ impl Scheme for RunEndScheme { new_excludes.extend_from_slice(excludes); let compressed_ends = compressor.compress_canonical( - Canonical::Primitive(ends.to_primitive()), + Canonical::Primitive(ends), ctx.descend(), Excludes::int_only(&new_excludes), )?; @@ -783,7 +782,7 @@ impl Scheme for RunEndScheme { // SAFETY: compression doesn't affect invariants unsafe { Ok( - RunEndArray::new_unchecked(compressed_ends, compressed_values, 0, stats.src.len()) + RunEnd::new_unchecked(compressed_ends, compressed_values, 0, stats.src.len()) .into_array(), ) } @@ -872,12 +871,10 @@ impl Scheme for PcoScheme { _ctx: CompressorContext, _excludes: &[IntCode], ) -> VortexResult { - Ok(vortex_pco::PcoArray::from_primitive( - stats.source(), - pco::DEFAULT_COMPRESSION_LEVEL, - 8192, - )? - .into_array()) + Ok( + vortex_pco::Pco::from_primitive(&stats.src, pco::DEFAULT_COMPRESSION_LEVEL, 8192)? + .into_array(), + ) } } @@ -896,7 +893,6 @@ mod tests { use vortex_array::arrays::PrimitiveArray; use vortex_array::assert_arrays_eq; use vortex_array::validity::Validity; - use vortex_array::vtable::ValidityHelper; use vortex_buffer::Buffer; use vortex_buffer::BufferMut; use vortex_buffer::buffer; @@ -979,7 +975,7 @@ mod tests { let expected = PrimitiveArray::new(buffer![189u8, 189, 189, 0, 0], array.validity().clone()) .into_array(); - assert_arrays_eq!(decoded.as_ref(), expected.as_ref()); + assert_arrays_eq!(decoded, expected); Ok(()) } @@ -1005,7 +1001,7 @@ mod tests { array.validity().clone(), ) .into_array(); - assert_arrays_eq!(decoded.as_ref(), expected.as_ref()); + assert_arrays_eq!(decoded, expected); Ok(()) } @@ -1023,7 +1019,7 @@ mod tests { assert!(compressed.is::()); let decoded = compressed; let expected = PrimitiveArray::from_option_iter(values.into_iter().map(Some)).into_array(); - assert_arrays_eq!(decoded.as_ref(), expected.as_ref()); + assert_arrays_eq!(decoded, expected); Ok(()) } @@ -1045,7 +1041,7 @@ mod tests { let decoded = compressed; let expected = Buffer::copy_from(&values).into_array(); - assert_arrays_eq!(decoded.as_ref(), expected.as_ref()); + assert_arrays_eq!(decoded, expected); Ok(()) } diff --git a/vortex-btrblocks/src/compressor/integer/stats.rs b/vortex-btrblocks/src/compressor/integer/stats.rs index 111a1b7a155..da24f43e62b 100644 --- a/vortex-btrblocks/src/compressor/integer/stats.rs +++ b/vortex-btrblocks/src/compressor/integer/stats.rs @@ -5,11 +5,13 @@ use std::hash::Hash; use num_traits::PrimInt; use rustc_hash::FxBuildHasher; +use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::ToCanonical; use vortex_array::arrays::Primitive; use vortex_array::arrays::PrimitiveArray; use vortex_array::arrays::primitive::NativeValue; +use vortex_array::arrays::primitive::PrimitiveData; use vortex_array::dtype::IntegerPType; use vortex_array::expr::stats::Stat; use vortex_array::match_each_integer_ptype; @@ -177,12 +179,14 @@ impl IntegerStats { impl CompressorStats for IntegerStats { type ArrayVTable = Primitive; - fn generate_opts(input: &PrimitiveArray, opts: GenerateStatsOptions) -> Self { - Self::generate_opts_fallible(input, opts) + fn generate_opts(input: &PrimitiveData, opts: GenerateStatsOptions) -> Self { + let array = + PrimitiveArray::try_from_data(input.clone()).vortex_expect("data is always valid"); + Self::generate_opts_fallible(&array, opts) .vortex_expect("IntegerStats::generate_opts should not fail") } - fn source(&self) -> &PrimitiveArray { + fn source(&self) -> &PrimitiveData { &self.src } @@ -347,12 +351,13 @@ where u32::MAX }; - let min = array + let array_ref = array.clone().into_array(); + let min = array_ref .statistics() .compute_as::(Stat::Min) .vortex_expect("min should be computed"); - let max = array + let max = array_ref .statistics() .compute_as::(Stat::Max) .vortex_expect("max should be computed"); diff --git a/vortex-btrblocks/src/compressor/mod.rs b/vortex-btrblocks/src/compressor/mod.rs index 5c3a31271cd..fd1dcf0f6a7 100644 --- a/vortex-btrblocks/src/compressor/mod.rs +++ b/vortex-btrblocks/src/compressor/mod.rs @@ -16,6 +16,7 @@ //! result. If compression did not shrink the array, the original is returned. use vortex_array::ArrayRef; +use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::arrays::ConstantArray; use vortex_array::scalar::Scalar; @@ -56,7 +57,7 @@ pub trait Compressor { type StatsType: CompressorStats; /// Generates statistics for the given array to guide compression scheme selection. - fn gen_stats(&self, array: &::Array) -> Self::StatsType; + fn gen_stats(&self, array: &::ArrayData) -> Self::StatsType; /// Returns all available compression schemes for this compressor. fn schemes(&self) -> &[&'static Self::SchemeType]; @@ -144,20 +145,24 @@ where fn compress( &self, btr_blocks_compressor: &BtrBlocksCompressor, - array: &<::ArrayVTable as VTable>::Array, + array: &<::ArrayVTable as VTable>::ArrayData, ctx: CompressorContext, excludes: &[::CodeType], ) -> VortexResult { + let array_ref = array.clone().into_array(); + // Avoid compressing empty arrays. - if array.is_empty() { - return Ok(array.to_array()); + if array_ref.is_empty() { + return Ok(array_ref); } // Avoid compressing all-null arrays. - if array.all_invalid()? { - return Ok( - ConstantArray::new(Scalar::null(array.dtype().clone()), array.len()).into_array(), - ); + if array_ref.all_invalid()? { + return Ok(ConstantArray::new( + Scalar::null(array_ref.dtype().clone()), + array_ref.len(), + ) + .into_array()); } // Generate stats on the array directly. @@ -165,11 +170,11 @@ where let best_scheme = self.choose_scheme(btr_blocks_compressor, &stats, ctx, excludes)?; let output = best_scheme.compress(btr_blocks_compressor, &stats, ctx, excludes)?; - if output.nbytes() < array.nbytes() { + if output.nbytes() < array_ref.nbytes() { Ok(output) } else { tracing::debug!("resulting tree too large: {}", output.encoding_id()); - Ok(array.to_array()) + Ok(array_ref) } } } diff --git a/vortex-btrblocks/src/compressor/rle.rs b/vortex-btrblocks/src/compressor/rle.rs index baa3e7b2656..908a032e8a7 100644 --- a/vortex-btrblocks/src/compressor/rle.rs +++ b/vortex-btrblocks/src/compressor/rle.rs @@ -11,7 +11,7 @@ use vortex_array::IntoArray; use vortex_array::ToCanonical; use vortex_array::arrays::PrimitiveArray; use vortex_error::VortexResult; -use vortex_fastlanes::RLEArray; +use vortex_fastlanes::RLE; use crate::BtrBlocksCompressor; use crate::CanonicalCompressor; @@ -114,7 +114,7 @@ impl Scheme for RLEScheme { ctx: CompressorContext, excludes: &[C::Code], ) -> VortexResult { - let rle_array = RLEArray::encode(RLEStats::source(stats))?; + let rle_array = RLE::encode(RLEStats::source(stats))?; if ctx.allowed_cascading == 0 { return Ok(rle_array.into_array()); @@ -155,7 +155,7 @@ impl Scheme for RLEScheme { // SAFETY: Recursive compression doesn't affect the invariants. unsafe { - Ok(RLEArray::new_unchecked( + Ok(RLE::new_unchecked( compressed_values, compressed_indices, compressed_offsets, @@ -187,11 +187,11 @@ fn try_compress_delta( let compressed_deltas = compressor.compress_canonical(Canonical::Primitive(deltas), ctx, excludes)?; - vortex_fastlanes::DeltaArray::try_new( + vortex_fastlanes::DeltaData::try_new( compressed_bases, compressed_deltas, 0, primitive_array.len(), ) - .map(vortex_fastlanes::DeltaArray::into_array) + .map(vortex_fastlanes::DeltaData::into_array) } diff --git a/vortex-btrblocks/src/compressor/string.rs b/vortex-btrblocks/src/compressor/string.rs index cac9cf969cd..5d0878d3d44 100644 --- a/vortex-btrblocks/src/compressor/string.rs +++ b/vortex-btrblocks/src/compressor/string.rs @@ -7,6 +7,7 @@ use std::hash::Hasher; use enum_iterator::Sequence; use vortex_array::ArrayRef; use vortex_array::Canonical; +use vortex_array::DynArray; use vortex_array::IntoArray; use vortex_array::LEGACY_SESSION; use vortex_array::ToCanonical; @@ -18,18 +19,17 @@ use vortex_array::arrays::MaskedArray; use vortex_array::arrays::VarBinArray; use vortex_array::arrays::VarBinView; use vortex_array::arrays::VarBinViewArray; +use vortex_array::arrays::varbinview::VarBinViewData; use vortex_array::builders::dict::dict_encode; use vortex_array::scalar::Scalar; use vortex_array::vtable::VTable; -use vortex_array::vtable::ValidityHelper; use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_err; -use vortex_fsst::FSSTArray; +use vortex_fsst::FSST; use vortex_fsst::fsst_compress; use vortex_fsst::fsst_train_compressor; use vortex_sparse::Sparse; -use vortex_sparse::SparseArray; use vortex_utils::aliases::hash_set::HashSet; use super::integer::DictScheme as IntDictScheme; @@ -103,12 +103,14 @@ impl StringStats { impl CompressorStats for StringStats { type ArrayVTable = VarBinView; - fn generate_opts(input: &VarBinViewArray, opts: GenerateStatsOptions) -> Self { - Self::generate_opts_fallible(input, opts) + fn generate_opts(input: &VarBinViewData, opts: GenerateStatsOptions) -> Self { + let array = + VarBinViewArray::try_from_data(input.clone()).vortex_expect("data is always valid"); + Self::generate_opts_fallible(&array, opts) .vortex_expect("StringStats::generate_opts should not fail") } - fn source(&self) -> &VarBinViewArray { + fn source(&self) -> &VarBinViewData { &self.src } @@ -145,7 +147,7 @@ impl<'a> Compressor for StringCompressor<'a> { type SchemeType = dyn StringScheme; type StatsType = StringStats; - fn gen_stats(&self, array: &::Array) -> Self::StatsType { + fn gen_stats(&self, array: &::ArrayData) -> Self::StatsType { if self .btr_blocks_compressor .string_schemes() @@ -359,7 +361,7 @@ impl Scheme for FSSTScheme { ) -> VortexResult { let fsst = { let compressor = fsst_train_compressor(&stats.src); - fsst_compress(&stats.src, &compressor) + fsst_compress(&stats.src, stats.src.len(), stats.src.dtype(), &compressor) }; let compressed_original_lengths = compressor.compress_canonical( @@ -380,7 +382,7 @@ impl Scheme for FSSTScheme { fsst.codes().validity().clone(), )?; - let fsst = FSSTArray::try_new( + let fsst = FSST::try_new( fsst.dtype().clone(), fsst.symbols().clone(), fsst.symbol_lengths().clone(), @@ -433,14 +435,15 @@ impl Scheme for ConstantScheme { _ctx: CompressorContext, _excludes: &[Self::CodeType], ) -> VortexResult { + let source_ref = stats.source().clone().into_array(); let scalar_idx = - (0..stats.source().len()).position(|idx| stats.source().is_valid(idx).unwrap_or(false)); + (0..stats.source().len()).position(|idx| source_ref.is_valid(idx).unwrap_or(false)); match scalar_idx { Some(idx) => { - let scalar = stats.source().scalar_at(idx)?; + let scalar = source_ref.scalar_at(idx)?; let const_arr = ConstantArray::new(scalar, stats.src.len()).into_array(); - if !stats.source().all_valid()? { + if !source_ref.all_valid()? { Ok(MaskedArray::try_new(const_arr, stats.src.validity().clone())?.into_array()) } else { Ok(const_arr) @@ -499,7 +502,7 @@ impl Scheme for NullDominated { assert!(ctx.allowed_cascading > 0); // We pass None as we only run this pathway for NULL-dominated string arrays - let sparse_encoded = SparseArray::encode(&stats.src.clone().into_array(), None)?; + let sparse_encoded = Sparse::encode(&stats.src.clone().into_array(), None)?; if let Some(sparse) = sparse_encoded.as_opt::() { // Compress the indices only (not the values for strings) @@ -512,7 +515,7 @@ impl Scheme for NullDominated { Excludes::int_only(&new_excludes), )?; - SparseArray::try_new( + Sparse::try_new( compressed_indices, sparse.patches().values().clone(), sparse.len(), @@ -541,11 +544,8 @@ impl Scheme for ZstdScheme { _ctx: CompressorContext, _excludes: &[StringCode], ) -> VortexResult { - let compacted = stats.source().compact_buffers()?; - Ok( - vortex_zstd::ZstdArray::from_var_bin_view_without_dict(&compacted, 3, 8192)? - .into_array(), - ) + let compacted = stats.src.compact_buffers()?; + Ok(vortex_zstd::Zstd::from_var_bin_view_without_dict(&compacted, 3, 8192)?.into_array()) } } @@ -566,7 +566,7 @@ impl Scheme for ZstdBuffersScheme { _excludes: &[StringCode], ) -> VortexResult { Ok( - vortex_zstd::ZstdBuffersArray::compress(&stats.source().clone().into_array(), 3)? + vortex_zstd::ZstdBuffersData::compress(&stats.src.clone().into_array(), 3)? .into_array(), ) } diff --git a/vortex-btrblocks/src/compressor/temporal.rs b/vortex-btrblocks/src/compressor/temporal.rs index 6fb917be58d..11ab8fcb4d6 100644 --- a/vortex-btrblocks/src/compressor/temporal.rs +++ b/vortex-btrblocks/src/compressor/temporal.rs @@ -8,7 +8,7 @@ use vortex_array::Canonical; use vortex_array::IntoArray; use vortex_array::ToCanonical; use vortex_array::arrays::TemporalArray; -use vortex_datetime_parts::DateTimePartsArray; +use vortex_datetime_parts::DateTimeParts; use vortex_datetime_parts::TemporalParts; use vortex_datetime_parts::split_temporal; use vortex_error::VortexResult; @@ -48,5 +48,5 @@ pub fn compress_temporal( Excludes::none(), )?; - Ok(DateTimePartsArray::try_new(dtype, days, seconds, subseconds)?.into_array()) + Ok(DateTimeParts::try_new(dtype, days, seconds, subseconds)?.into_array()) } diff --git a/vortex-btrblocks/src/scheme.rs b/vortex-btrblocks/src/scheme.rs index 1b12a5930e5..03107adfec0 100644 --- a/vortex-btrblocks/src/scheme.rs +++ b/vortex-btrblocks/src/scheme.rs @@ -25,6 +25,7 @@ use std::hash::Hash; use std::hash::Hasher; use vortex_array::ArrayRef; +use vortex_array::IntoArray; use vortex_error::VortexResult; use crate::BtrBlocksCompressor; @@ -105,7 +106,8 @@ pub trait SchemeExt: Scheme { let sample = if ctx.is_sample { stats.clone() } else { - let source_len = stats.source().len(); + let source_ref = stats.source().clone().into_array(); + let source_len = source_ref.len(); let sample_count = sample_count_approx_one_percent(source_len); tracing::trace!( @@ -120,7 +122,7 @@ pub trait SchemeExt: Scheme { let after = self .compress(btr_blocks_compressor, &sample, ctx.as_sample(), excludes)? .nbytes(); - let before = sample.source().nbytes(); + let before = sample.source().clone().into_array().nbytes(); tracing::debug!( "estimate_compression_ratio_with_sampling(compressor={self:#?} ctx={ctx:?}) = {}", diff --git a/vortex-btrblocks/src/stats.rs b/vortex-btrblocks/src/stats.rs index b3e25cfb8d6..e0de4dce1d7 100644 --- a/vortex-btrblocks/src/stats.rs +++ b/vortex-btrblocks/src/stats.rs @@ -40,18 +40,18 @@ pub trait CompressorStats: Debug + Clone { type ArrayVTable: VTable; /// Generates stats with default options. - fn generate(input: &::Array) -> Self { + fn generate(input: &::ArrayData) -> Self { Self::generate_opts(input, GenerateStatsOptions::default()) } /// Generates stats with provided options. fn generate_opts( - input: &::Array, + input: &::ArrayData, opts: GenerateStatsOptions, ) -> Self; /// Returns the underlying source array that statistics were generated from. - fn source(&self) -> &::Array; + fn source(&self) -> &::ArrayData; /// Sample the array with default options. fn sample(&self, sample_size: u32, sample_count: u32) -> Self { diff --git a/vortex-cuda/benches/bitpacked_cuda.rs b/vortex-cuda/benches/bitpacked_cuda.rs index 44c911f545c..620596f76eb 100644 --- a/vortex-cuda/benches/bitpacked_cuda.rs +++ b/vortex-cuda/benches/bitpacked_cuda.rs @@ -24,6 +24,7 @@ use vortex::array::validity::Validity::NonNullable; use vortex::buffer::Buffer; use vortex::dtype::NativePType; use vortex::encodings::fastlanes::BitPackedArray; +use vortex::encodings::fastlanes::BitPackedData; use vortex::encodings::fastlanes::unpack_iter::BitPacked; use vortex::error::VortexExpect; use vortex::session::VortexSession; @@ -56,8 +57,11 @@ where .collect(); let primitive_array = PrimitiveArray::new(Buffer::from(values), NonNullable); - BitPackedArray::encode(&primitive_array.into_array(), bit_width) - .vortex_expect("failed to create BitPacked array") + BitPackedArray::try_from_data( + BitPackedData::encode(&primitive_array.into_array(), bit_width) + .vortex_expect("failed to create BitPacked array"), + ) + .vortex_expect("BitPackedData is always valid") } /// Create a bit-packed array with the given bit width and patch frequency. @@ -96,8 +100,11 @@ where .collect(); let primitive_array = PrimitiveArray::new(Buffer::from(values), NonNullable).into_array(); - BitPackedArray::encode(&primitive_array, bit_width) - .vortex_expect("failed to create BitPacked array with patches") + BitPackedArray::try_from_data( + BitPackedData::encode(&primitive_array, bit_width) + .vortex_expect("failed to create BitPacked array with patches"), + ) + .vortex_expect("BitPackedData is always valid") } /// Generic benchmark function for a specific type and bit width diff --git a/vortex-cuda/benches/date_time_parts_cuda.rs b/vortex-cuda/benches/date_time_parts_cuda.rs index b4c15496865..a91111e3f8a 100644 --- a/vortex-cuda/benches/date_time_parts_cuda.rs +++ b/vortex-cuda/benches/date_time_parts_cuda.rs @@ -25,6 +25,7 @@ use vortex::buffer::Buffer; use vortex::dtype::DType; use vortex::dtype::Nullability; use vortex::encodings::datetime_parts::DateTimePartsArray; +use vortex::encodings::datetime_parts::DateTimePartsData; use vortex::error::VortexExpect; use vortex::extension::datetime::TimeUnit; use vortex::extension::datetime::Timestamp; @@ -44,8 +45,11 @@ fn make_datetimeparts_array(len: usize, time_unit: TimeUnit) -> DateTimePartsArr let dtype = DType::Extension(Timestamp::new(time_unit, Nullability::NonNullable).erased()); - DateTimePartsArray::try_new(dtype, days_arr, seconds_arr, subseconds_arr) - .vortex_expect("Failed to create DateTimePartsArray") + DateTimePartsArray::try_from_data( + DateTimePartsData::try_new(dtype, days_arr, seconds_arr, subseconds_arr) + .vortex_expect("Failed to create DateTimePartsArray"), + ) + .vortex_expect("DateTimePartsData is always valid") } fn benchmark_datetimeparts(c: &mut Criterion) { diff --git a/vortex-cuda/benches/dynamic_dispatch_cuda.rs b/vortex-cuda/benches/dynamic_dispatch_cuda.rs index bb23ead6066..21537b51031 100644 --- a/vortex-cuda/benches/dynamic_dispatch_cuda.rs +++ b/vortex-cuda/benches/dynamic_dispatch_cuda.rs @@ -25,13 +25,13 @@ use vortex::array::scalar::Scalar; use vortex::array::validity::Validity::NonNullable; use vortex::buffer::Buffer; use vortex::dtype::PType; -use vortex::encodings::alp::ALPArray; +use vortex::encodings::alp::ALP; use vortex::encodings::alp::ALPFloat; use vortex::encodings::alp::Exponents; use vortex::encodings::alp::alp_encode; -use vortex::encodings::fastlanes::BitPackedArray; -use vortex::encodings::fastlanes::FoRArray; -use vortex::encodings::runend::RunEndArray; +use vortex::encodings::fastlanes::BitPackedData; +use vortex::encodings::fastlanes::FoRData; +use vortex::encodings::runend::RunEnd; use vortex::error::VortexExpect; use vortex::error::VortexResult; use vortex::error::vortex_err; @@ -186,9 +186,9 @@ fn bench_for_bitpacked(c: &mut Criterion) { .map(|i| (i as u64 % (max_val + 1)) as u32) .collect(); let prim = PrimitiveArray::new(Buffer::from(residuals), NonNullable); - let bp = BitPackedArray::encode(&prim.into_array(), bit_width).vortex_expect("bitpack"); + let bp = BitPackedData::encode(&prim.into_array(), bit_width).vortex_expect("bitpack"); let for_arr = - FoRArray::try_new(bp.into_array(), Scalar::from(reference)).vortex_expect("for"); + FoRData::try_new(bp.into_array(), Scalar::from(reference)).vortex_expect("for"); let array = for_arr.into_array(); group.bench_with_input( @@ -230,7 +230,7 @@ fn bench_dict_bp_codes(c: &mut Criterion) { let codes: Vec = (0..*len).map(|i| (i % dict_size) as u32).collect(); let codes_prim = PrimitiveArray::new(Buffer::from(codes), NonNullable); - let codes_bp = BitPackedArray::encode(&codes_prim.into_array(), dict_bit_width) + let codes_bp = BitPackedData::encode(&codes_prim.into_array(), dict_bit_width) .vortex_expect("bitpack codes"); let values_prim = PrimitiveArray::new(Buffer::from(dict_values.clone()), NonNullable); let dict = DictArray::new(codes_bp.into_array(), values_prim.into_array()); @@ -277,7 +277,7 @@ fn bench_runend(c: &mut Criterion) { let ends_arr = PrimitiveArray::new(Buffer::from(ends), NonNullable).into_array(); let values_arr = PrimitiveArray::new(Buffer::from(values), NonNullable).into_array(); - let re = RunEndArray::new(ends_arr, values_arr); + let re = RunEnd::new(ends_arr, values_arr); let array = re.into_array(); group.bench_with_input( @@ -318,9 +318,9 @@ fn bench_dict_bp_codes_bp_for_values(c: &mut Criterion) { // Dict values: residuals 0..63 bitpacked, FoR adds 1_000_000 let dict_residuals: Vec = (0..dict_size as u32).collect(); let dict_prim = PrimitiveArray::new(Buffer::from(dict_residuals), NonNullable); - let dict_bp = BitPackedArray::encode(&dict_prim.into_array(), dict_bit_width) + let dict_bp = BitPackedData::encode(&dict_prim.into_array(), dict_bit_width) .vortex_expect("bitpack dict"); - let dict_for = FoRArray::try_new(dict_bp.into_array(), Scalar::from(dict_reference)) + let dict_for = FoRData::try_new(dict_bp.into_array(), Scalar::from(dict_reference)) .vortex_expect("for dict"); for (len, len_str) in BENCH_ARGS { @@ -328,7 +328,7 @@ fn bench_dict_bp_codes_bp_for_values(c: &mut Criterion) { let codes: Vec = (0..*len).map(|i| (i % dict_size) as u32).collect(); let codes_prim = PrimitiveArray::new(Buffer::from(codes), NonNullable); - let codes_bp = BitPackedArray::encode(&codes_prim.into_array(), codes_bit_width) + let codes_bp = BitPackedData::encode(&codes_prim.into_array(), codes_bit_width) .vortex_expect("bitpack codes"); let dict = DictArray::new(codes_bp.into_array(), dict_for.clone().into_array()); @@ -379,12 +379,12 @@ fn bench_alp_for_bitpacked(c: &mut Criterion) { // Encode: ALP → FoR → BitPacked let alp = alp_encode(&float_prim, Some(exponents)).vortex_expect("alp_encode"); assert!(alp.patches().is_none()); - let for_arr = FoRArray::encode(alp.encoded().to_primitive()).vortex_expect("for encode"); + let for_arr = FoRData::encode(alp.encoded().to_primitive()).vortex_expect("for encode"); let bp = - BitPackedArray::encode(for_arr.encoded(), bit_width).vortex_expect("bitpack encode"); + BitPackedData::encode(for_arr.encoded(), bit_width).vortex_expect("bitpack encode"); - let tree = ALPArray::new( - FoRArray::try_new(bp.into_array(), for_arr.reference_scalar().clone()) + let tree = ALP::new( + FoRData::try_new(bp.into_array(), for_arr.reference_scalar().clone()) .vortex_expect("for_new") .into_array(), exponents, diff --git a/vortex-cuda/benches/for_cuda.rs b/vortex-cuda/benches/for_cuda.rs index 31f7b270e92..eb87eb6d770 100644 --- a/vortex-cuda/benches/for_cuda.rs +++ b/vortex-cuda/benches/for_cuda.rs @@ -25,8 +25,9 @@ use vortex::array::validity::Validity; use vortex::buffer::Buffer; use vortex::dtype::NativePType; use vortex::dtype::PType; -use vortex::encodings::fastlanes::BitPackedArray; +use vortex::encodings::fastlanes::BitPackedData; use vortex::encodings::fastlanes::FoRArray; +use vortex::encodings::fastlanes::FoRData; use vortex::error::VortexExpect; use vortex::scalar::Scalar; use vortex::session::VortexSession; @@ -55,12 +56,18 @@ where PrimitiveArray::new(Buffer::from(data), Validity::NonNullable).into_array(); if bp && T::PTYPE != PType::U8 { - let child = BitPackedArray::encode(&primitive_array, 8).vortex_expect("failed to bitpack"); - FoRArray::try_new(child.into_array(), reference.into()) - .vortex_expect("failed to create FoR array") + let child = BitPackedData::encode(&primitive_array, 8).vortex_expect("failed to bitpack"); + FoRArray::try_from_data( + FoRData::try_new(child.into_array(), reference.into()) + .vortex_expect("failed to create FoR array"), + ) + .vortex_expect("FoRData is always valid") } else { - FoRArray::try_new(primitive_array, reference.into()) - .vortex_expect("failed to create FoR array") + FoRArray::try_from_data( + FoRData::try_new(primitive_array, reference.into()) + .vortex_expect("failed to create FoR array"), + ) + .vortex_expect("FoRData is always valid") } } diff --git a/vortex-cuda/benches/runend_cuda.rs b/vortex-cuda/benches/runend_cuda.rs index ced52c19c40..c073f60634c 100644 --- a/vortex-cuda/benches/runend_cuda.rs +++ b/vortex-cuda/benches/runend_cuda.rs @@ -23,6 +23,7 @@ use vortex::array::arrays::PrimitiveArray; use vortex::array::validity::Validity; use vortex::buffer::Buffer; use vortex::dtype::NativePType; +use vortex::encodings::runend::RunEnd; use vortex::encodings::runend::RunEndArray; use vortex::session::VortexSession; use vortex_cuda::CudaSession; @@ -54,7 +55,7 @@ where let ends_array = PrimitiveArray::new(Buffer::from(ends), Validity::NonNullable).into_array(); let values_array = PrimitiveArray::new(Buffer::from(values), Validity::NonNullable).into_array(); - RunEndArray::new(ends_array, values_array) + RunEnd::new(ends_array, values_array) } /// Benchmark run-end decoding for a specific type with varying run lengths diff --git a/vortex-cuda/benches/zstd_cuda.rs b/vortex-cuda/benches/zstd_cuda.rs index 41be9fa8cf9..7fe68380439 100644 --- a/vortex-cuda/benches/zstd_cuda.rs +++ b/vortex-cuda/benches/zstd_cuda.rs @@ -13,6 +13,7 @@ use cudarc::driver::DevicePtrMut; use cudarc::driver::sys::CUevent_flags; use futures::executor::block_on; use vortex::array::arrays::VarBinViewArray; +use vortex::encodings::zstd::Zstd; use vortex::encodings::zstd::ZstdArray; use vortex::encodings::zstd::ZstdArrayParts; use vortex::error::VortexExpect; @@ -58,7 +59,7 @@ fn make_zstd_array(num_strings: usize) -> VortexResult<(ZstdArray, usize)> { let zstd_compression_level = -10; // Less compression but faster. let zstd_array = // Disable dictionary as nvCOMP doesn't support ZSTD dictionaries. - ZstdArray::from_var_bin_view_without_dict(&var_bin_view, zstd_compression_level, 2048)?; + Zstd::from_var_bin_view_without_dict(&var_bin_view, zstd_compression_level, 2048)?; Ok((zstd_array, uncompressed_size)) } @@ -139,7 +140,7 @@ fn benchmark_zstd_cuda_decompress(c: &mut Criterion) { for _ in 0..iters { let ZstdArrayParts { frames, metadata, .. - } = zstd_array.clone().into_parts(); + } = zstd_array.clone().into_data().into_parts(); let exec = block_on(zstd_kernel_prepare(frames, &metadata, &mut cuda_ctx)) .vortex_expect("kernel setup failed"); let kernel_time = block_on(execute_zstd_kernel(exec, &mut cuda_ctx)) diff --git a/vortex-cuda/src/arrow/canonical.rs b/vortex-cuda/src/arrow/canonical.rs index 65115cbf2f3..e1c63057ad9 100644 --- a/vortex-cuda/src/arrow/canonical.rs +++ b/vortex-cuda/src/arrow/canonical.rs @@ -12,7 +12,6 @@ use vortex::array::arrays::decimal::DecimalArrayParts; use vortex::array::arrays::primitive::PrimitiveArrayParts; use vortex::array::arrays::struct_::StructArrayParts; use vortex::array::buffer::BufferHandle; -use vortex::array::vtable::ValidityHelper; use vortex::dtype::DecimalType; use vortex::error::VortexResult; use vortex::error::vortex_bail; @@ -69,7 +68,7 @@ fn export_canonical( let len = primitive.len(); let PrimitiveArrayParts { buffer, validity, .. - } = primitive.into_parts(); + } = primitive.into_data().into_parts(); check_validity_empty(&validity)?; @@ -96,7 +95,7 @@ fn export_canonical( values_type, validity, .. - } = decimal.into_parts(); + } = decimal.into_data().into_parts(); // verify that there is no null buffer check_validity_empty(&validity)?; @@ -121,7 +120,7 @@ fn export_canonical( let PrimitiveArrayParts { buffer, validity, .. - } = values.into_parts(); + } = values.into_data().into_parts(); check_validity_empty(&validity)?; diff --git a/vortex-cuda/src/arrow/varbinview.rs b/vortex-cuda/src/arrow/varbinview.rs index 891724b84f6..12edc39c9bf 100644 --- a/vortex-cuda/src/arrow/varbinview.rs +++ b/vortex-cuda/src/arrow/varbinview.rs @@ -38,7 +38,7 @@ pub(crate) async fn copy_varbinview_to_varbin( buffers, validity, .. - } = array.into_parts(); + } = array.into_data().into_parts(); // TODO(aduffy): handle nulls check_validity_empty(&validity)?; diff --git a/vortex-cuda/src/canonical.rs b/vortex-cuda/src/canonical.rs index d4eb37e09f3..70ab7f550ce 100644 --- a/vortex-cuda/src/canonical.rs +++ b/vortex-cuda/src/canonical.rs @@ -81,7 +81,7 @@ impl CanonicalCudaExt for Canonical { buffer, validity, .. - } = prim.into_parts(); + } = prim.into_data().into_parts(); Ok(Canonical::Primitive(PrimitiveArray::from_byte_buffer( buffer.try_into_host()?.await?, ptype, @@ -95,7 +95,7 @@ impl CanonicalCudaExt for Canonical { values_type, validity, .. - } = decimal.into_parts(); + } = decimal.into_data().into_parts(); Ok(Canonical::Decimal(unsafe { DecimalArray::new_unchecked_handle( BufferHandle::new_host(values.try_into_host()?.await?), @@ -111,7 +111,7 @@ impl CanonicalCudaExt for Canonical { buffers, validity, dtype, - } = varbinview.into_parts(); + } = varbinview.into_data().into_parts(); // Copy all device views to host let host_views = views.try_into_host()?.await?; diff --git a/vortex-cuda/src/dynamic_dispatch/mod.rs b/vortex-cuda/src/dynamic_dispatch/mod.rs index 11642b85890..57578d73cfa 100644 --- a/vortex-cuda/src/dynamic_dispatch/mod.rs +++ b/vortex-cuda/src/dynamic_dispatch/mod.rs @@ -434,14 +434,15 @@ mod tests { use vortex::array::validity::Validity::NonNullable; use vortex::buffer::Buffer; use vortex::dtype::PType; - use vortex::encodings::alp::ALPArray; + use vortex::encodings::alp::ALP; use vortex::encodings::alp::ALPFloat; use vortex::encodings::alp::Exponents; use vortex::encodings::alp::alp_encode; + use vortex::encodings::fastlanes::BitPacked; use vortex::encodings::fastlanes::BitPackedArray; - use vortex::encodings::fastlanes::FoRArray; - use vortex::encodings::runend::RunEndArray; - use vortex::encodings::zigzag::ZigZagArray; + use vortex::encodings::fastlanes::FoR; + use vortex::encodings::runend::RunEnd; + use vortex::encodings::zigzag::ZigZag; use vortex::error::VortexExpect; use vortex::error::VortexResult; use vortex::session::VortexSession; @@ -464,7 +465,7 @@ mod tests { .map(|i| ((i as u64) % (max_val + 1)) as u32) .collect(); let primitive = PrimitiveArray::new(Buffer::from(values), NonNullable); - BitPackedArray::encode(&primitive.into_array(), bit_width) + BitPacked::encode(&primitive.into_array(), bit_width) .vortex_expect("failed to create BitPacked array") } @@ -702,7 +703,7 @@ mod tests { let expected: Vec = raw.iter().map(|&v| v + reference).collect(); let bp = bitpacked_array_u32(bit_width, len); - let for_arr = FoRArray::try_new(bp.into_array(), Scalar::from(reference))?; + let for_arr = FoR::try_new(bp.into_array(), Scalar::from(reference))?; let cuda_ctx = CudaSession::create_execution_ctx(&VortexSession::empty())?; let plan = dispatch_plan(&for_arr.into_array(), &cuda_ctx)?; @@ -728,7 +729,7 @@ mod tests { let ends_arr = PrimitiveArray::new(Buffer::from(ends), NonNullable).into_array(); let values_arr = PrimitiveArray::new(Buffer::from(values), NonNullable).into_array(); - let re = RunEndArray::new(ends_arr, values_arr); + let re = RunEnd::new(ends_arr, values_arr); let cuda_ctx = CudaSession::create_execution_ctx(&VortexSession::empty())?; let plan = dispatch_plan(&re.into_array(), &cuda_ctx)?; @@ -754,12 +755,12 @@ mod tests { // BitPack+FoR the dict values let dict_prim = PrimitiveArray::new(Buffer::from(dict_residuals), NonNullable); - let dict_bp = BitPackedArray::encode(&dict_prim.into_array(), 6)?; - let dict_for = FoRArray::try_new(dict_bp.into_array(), Scalar::from(dict_reference))?; + let dict_bp = BitPacked::encode(&dict_prim.into_array(), 6)?; + let dict_for = FoR::try_new(dict_bp.into_array(), Scalar::from(dict_reference))?; // BitPack the codes let codes_prim = PrimitiveArray::new(Buffer::from(codes), NonNullable); - let codes_bp = BitPackedArray::encode(&codes_prim.into_array(), 6)?; + let codes_bp = BitPacked::encode(&codes_prim.into_array(), 6)?; let dict = DictArray::try_new(codes_bp.into_array(), dict_for.into_array())?; @@ -786,11 +787,11 @@ mod tests { let alp = alp_encode(&float_prim, Some(exponents))?; assert!(alp.patches().is_none()); - let for_arr = FoRArray::encode(alp.encoded().to_primitive())?; - let bp = BitPackedArray::encode(for_arr.encoded(), 6)?; + let for_arr = FoR::encode(alp.encoded().to_primitive())?; + let bp = BitPacked::encode(for_arr.encoded(), 6)?; - let tree = ALPArray::new( - FoRArray::try_new(bp.into_array(), for_arr.reference_scalar().clone())?.into_array(), + let tree = ALP::new( + FoR::try_new(bp.into_array(), for_arr.reference_scalar().clone())?.into_array(), exponents, None, ); @@ -821,8 +822,8 @@ mod tests { .collect(); let prim = PrimitiveArray::new(Buffer::from(raw), NonNullable); - let bp = BitPackedArray::encode(&prim.into_array(), bit_width)?; - let zz = ZigZagArray::try_new(bp.into_array())?; + let bp = BitPacked::encode(&prim.into_array(), bit_width)?; + let zz = ZigZag::try_new(bp.into_array())?; let cuda_ctx = CudaSession::create_execution_ctx(&VortexSession::empty())?; let plan = dispatch_plan(&zz.into_array(), &cuda_ctx)?; @@ -850,8 +851,8 @@ mod tests { let ends_arr = PrimitiveArray::new(Buffer::from(ends), NonNullable).into_array(); let values_arr = PrimitiveArray::new(Buffer::from(values), NonNullable).into_array(); - let re = RunEndArray::new(ends_arr, values_arr); - let for_arr = FoRArray::try_new(re.into_array(), Scalar::from(reference))?; + let re = RunEnd::new(ends_arr, values_arr); + let for_arr = FoR::try_new(re.into_array(), Scalar::from(reference))?; let cuda_ctx = CudaSession::create_execution_ctx(&VortexSession::empty())?; let plan = dispatch_plan(&for_arr.into_array(), &cuda_ctx)?; @@ -880,7 +881,7 @@ mod tests { let codes_prim = PrimitiveArray::new(Buffer::from(codes), NonNullable); let values_prim = PrimitiveArray::new(Buffer::from(dict_values), NonNullable); let dict = DictArray::try_new(codes_prim.into_array(), values_prim.into_array())?; - let for_arr = FoRArray::try_new(dict.into_array(), Scalar::from(reference))?; + let for_arr = FoR::try_new(dict.into_array(), Scalar::from(reference))?; let cuda_ctx = CudaSession::create_execution_ctx(&VortexSession::empty())?; let plan = dispatch_plan(&for_arr.into_array(), &cuda_ctx)?; @@ -904,8 +905,8 @@ mod tests { // BitPack codes, then wrap in FoR (reference=0 so values unchanged) let bit_width: u8 = 3; let codes_prim = PrimitiveArray::new(Buffer::from(codes), NonNullable); - let codes_bp = BitPackedArray::encode(&codes_prim.into_array(), bit_width)?; - let codes_for = FoRArray::try_new(codes_bp.into_array(), Scalar::from(0u32))?; + let codes_bp = BitPacked::encode(&codes_prim.into_array(), bit_width)?; + let codes_for = FoR::try_new(codes_bp.into_array(), Scalar::from(0u32))?; let values_prim = PrimitiveArray::new(Buffer::from(dict_values), NonNullable); let dict = DictArray::try_new(codes_for.into_array(), values_prim.into_array())?; @@ -930,7 +931,7 @@ mod tests { let bit_width: u8 = 2; let codes_prim = PrimitiveArray::new(Buffer::from(codes), NonNullable); - let codes_bp = BitPackedArray::encode(&codes_prim.into_array(), bit_width)?; + let codes_bp = BitPacked::encode(&codes_prim.into_array(), bit_width)?; let values_prim = PrimitiveArray::new(Buffer::from(dict_values), NonNullable); let dict = DictArray::try_new(codes_bp.into_array(), values_prim.into_array())?; @@ -971,7 +972,7 @@ mod tests { let ends_arr = PrimitiveArray::new(Buffer::from(ends), NonNullable).into_array(); let values_arr = PrimitiveArray::new(Buffer::from(values), NonNullable).into_array(); - let re = RunEndArray::new(ends_arr, values_arr); + let re = RunEnd::new(ends_arr, values_arr); // DispatchPlan::new should return Unfused because u64 ends != i32 values in byte width. assert!(matches!( @@ -1056,8 +1057,8 @@ mod tests { .collect(); let prim = PrimitiveArray::new(Buffer::from(raw), NonNullable); - let bp = BitPackedArray::encode(&prim.into_array(), bit_width)?; - let zz = ZigZagArray::try_new(bp.into_array())?; + let bp = BitPacked::encode(&prim.into_array(), bit_width)?; + let zz = ZigZag::try_new(bp.into_array())?; let sliced = zz.into_array().slice(slice_start..slice_end)?; let expected: Vec = all_decoded[slice_start..slice_end].to_vec(); @@ -1152,7 +1153,7 @@ mod tests { let data: Vec = (0..len).map(|i| (i as u32) % max_val).collect(); let prim = PrimitiveArray::new(Buffer::from(data.clone()), NonNullable); - let bp = BitPackedArray::encode(&prim.into_array(), bit_width)?; + let bp = BitPacked::encode(&prim.into_array(), bit_width)?; let sliced = bp.into_array().slice(slice_start..slice_end)?; let expected: Vec = data[slice_start..slice_end].to_vec(); @@ -1198,8 +1199,8 @@ mod tests { let encoded_data: Vec = (0..len).map(|i| (i as u32) % max_val).collect(); let prim = PrimitiveArray::new(Buffer::from(encoded_data.clone()), NonNullable); - let bp = BitPackedArray::encode(&prim.into_array(), bit_width)?; - let for_arr = FoRArray::try_new(bp.into_array(), Scalar::from(reference))?; + let bp = BitPacked::encode(&prim.into_array(), bit_width)?; + let for_arr = FoR::try_new(bp.into_array(), Scalar::from(reference))?; let all_decoded: Vec = encoded_data.iter().map(|&v| v + reference).collect(); @@ -1220,6 +1221,58 @@ mod tests { Ok(()) } + #[rstest] + #[case(0, 1024)] + #[case(0, 3000)] + #[case(0, 4096)] + #[case(400, 600)] + #[case(500, 1024)] + #[case(500, 2048)] + #[case(500, 4500)] + #[case(777, 3333)] + #[case(1024, 2048)] + #[case(1024, 4096)] + #[case(1500, 3500)] + #[case(2048, 4096)] + #[case(2500, 4500)] + #[case(3333, 4444)] + #[crate::test] + fn test_sliced_runend( + #[case] slice_start: usize, + #[case] slice_end: usize, + ) -> VortexResult<()> { + let ends: Vec = vec![500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000]; + let values: Vec = vec![10, 20, 30, 40, 50, 60, 70, 80, 90, 100]; + let len = 5000; + + let all_decoded: Vec = (0..len) + .map(|i| { + let run = ends.iter().position(|&e| (i as u32) < e).unwrap(); + values[run] + }) + .collect(); + + let ends_arr = PrimitiveArray::new(Buffer::from(ends), NonNullable).into_array(); + let values_arr = PrimitiveArray::new(Buffer::from(values), NonNullable).into_array(); + let re = RunEnd::new(ends_arr, values_arr); + + let sliced = re.into_array().slice(slice_start..slice_end)?; + let expected: Vec = all_decoded[slice_start..slice_end].to_vec(); + + let cuda_ctx = CudaSession::create_execution_ctx(&VortexSession::empty())?; + let plan = dispatch_plan(&sliced, &cuda_ctx)?; + + let actual = run_dynamic_dispatch_plan( + &cuda_ctx, + expected.len(), + &plan.dispatch_plan, + plan.shared_mem_bytes, + )?; + assert_eq!(actual, expected); + + Ok(()) + } + #[rstest] #[case(0, 1024)] #[case(0, 3000)] @@ -1251,12 +1304,12 @@ mod tests { // BitPack+FoR the dict values let dict_prim = PrimitiveArray::new(Buffer::from(dict_residuals), NonNullable); - let dict_bp = BitPackedArray::encode(&dict_prim.into_array(), 6)?; - let dict_for = FoRArray::try_new(dict_bp.into_array(), Scalar::from(dict_reference))?; + let dict_bp = BitPacked::encode(&dict_prim.into_array(), 6)?; + let dict_for = FoR::try_new(dict_bp.into_array(), Scalar::from(dict_reference))?; // BitPack the codes let codes_prim = PrimitiveArray::new(Buffer::from(codes), NonNullable); - let codes_bp = BitPackedArray::encode(&codes_prim.into_array(), 6)?; + let codes_bp = BitPacked::encode(&codes_prim.into_array(), 6)?; let dict = DictArray::try_new(codes_bp.into_array(), dict_for.into_array())?; @@ -1289,11 +1342,11 @@ mod tests { #[case] len: usize, ) -> VortexResult<()> { use vortex::dtype::Nullability; - use vortex::encodings::sequence::SequenceArray; + use vortex::encodings::sequence::Sequence; let expected: Vec = (0..len).map(|i| base + (i as u32) * multiplier).collect(); - let seq = SequenceArray::try_new_typed(base, multiplier, Nullability::NonNullable, len)?; + let seq = Sequence::try_new_typed(base, multiplier, Nullability::NonNullable, len)?; let cuda_ctx = CudaSession::create_execution_ctx(&VortexSession::empty())?; let plan = dispatch_plan(&seq.into_array(), &cuda_ctx)?; @@ -1322,11 +1375,11 @@ mod tests { #[case] len: usize, ) -> VortexResult<()> { use vortex::dtype::Nullability; - use vortex::encodings::sequence::SequenceArray; + use vortex::encodings::sequence::Sequence; let expected: Vec = (0..len).map(|i| base + (i as i32) * multiplier).collect(); - let seq = SequenceArray::try_new_typed(base, multiplier, Nullability::NonNullable, len)?; + let seq = Sequence::try_new_typed(base, multiplier, Nullability::NonNullable, len)?; let cuda_ctx = CudaSession::create_execution_ctx(&VortexSession::empty())?; let plan = dispatch_plan(&seq.into_array(), &cuda_ctx)?; diff --git a/vortex-cuda/src/hybrid_dispatch/mod.rs b/vortex-cuda/src/hybrid_dispatch/mod.rs index 36a04e6402f..301e3c4efab 100644 --- a/vortex-cuda/src/hybrid_dispatch/mod.rs +++ b/vortex-cuda/src/hybrid_dispatch/mod.rs @@ -88,7 +88,7 @@ pub async fn try_gpu_dispatch( // TODO(0ax1): execute subtrees concurrently using separate CUDA streams. for subtree in &pending_subtrees { let canonical = subtree.clone().execute_cuda(ctx).await?; - subtree_buffers.push(canonical.into_primitive().into_parts().buffer); + subtree_buffers.push(canonical.into_primitive().into_data().into_parts().buffer); } let num_subtrees = subtree_buffers.len(); @@ -118,8 +118,8 @@ mod tests { use vortex::array::assert_arrays_eq; use vortex::array::validity::Validity::NonNullable; use vortex::buffer::Buffer; - use vortex::encodings::fastlanes::BitPackedArray; - use vortex::encodings::fastlanes::FoRArray; + use vortex::encodings::fastlanes::BitPacked; + use vortex::encodings::fastlanes::FoR; use vortex::error::VortexExpect; use vortex::error::VortexResult; use vortex::mask::Mask; @@ -135,12 +135,12 @@ mod tests { let mut ctx = CudaSession::create_execution_ctx(&VortexSession::empty()).vortex_expect("ctx"); let values: Vec = (0..2048).map(|i| (i % 128) as u32).collect(); - let bp = BitPackedArray::encode( + let bp = BitPacked::encode( &PrimitiveArray::new(Buffer::from(values), NonNullable).into_array(), 7, ) .vortex_expect("bp"); - let arr = FoRArray::try_new(bp.into_array(), 1000u32.into()).vortex_expect("for"); + let arr = FoR::try_new(bp.into_array(), 1000u32.into()).vortex_expect("for"); let cpu = arr.to_canonical()?.into_array(); let gpu = arr @@ -158,19 +158,19 @@ mod tests { /// Exercises the unsigned type reinterpretation in CudaDispatchPlan::execute. #[crate::test] async fn test_fused_f32() -> VortexResult<()> { - use vortex::encodings::alp::ALPArray; + use vortex::encodings::alp::ALP; use vortex::encodings::alp::Exponents; let mut ctx = CudaSession::create_execution_ctx(&VortexSession::empty()).vortex_expect("ctx"); let encoded: Vec = (0i32..2048).map(|i| i % 500).collect(); - let bp = BitPackedArray::encode( + let bp = BitPacked::encode( &PrimitiveArray::new(Buffer::from(encoded), NonNullable).into_array(), 9, ) .vortex_expect("bp"); - let alp = ALPArray::try_new( - FoRArray::try_new(bp.into_array(), 0i32.into()) + let alp = ALP::try_new( + FoR::try_new(bp.into_array(), 0i32.into()) .vortex_expect("for") .into_array(), Exponents { e: 0, f: 2 }, @@ -195,7 +195,7 @@ mod tests { use vortex::array::patches::Patches; use vortex::array::validity::Validity::NonNullable as NN; use vortex::buffer::buffer; - use vortex::encodings::alp::ALPArray; + use vortex::encodings::alp::ALP; use vortex::encodings::alp::Exponents; let mut ctx = @@ -213,7 +213,7 @@ mod tests { None, ) .unwrap(); - let arr = ALPArray::try_new(encoded, Exponents { e: 0, f: 2 }, Some(patches))?; + let arr = ALP::try_new(encoded, Exponents { e: 0, f: 2 }, Some(patches))?; let cpu = arr.to_canonical()?.into_array(); let gpu = arr @@ -237,7 +237,7 @@ mod tests { use vortex::array::session::ArraySessionExt; use vortex::encodings::fastlanes; use vortex::encodings::zstd::ZstdBuffers; - use vortex::encodings::zstd::ZstdBuffersArray; + use vortex::encodings::zstd::ZstdBuffersData; let mut session = VortexSession::empty(); fastlanes::initialize(&mut session); @@ -253,14 +253,12 @@ mod tests { NonNullable, ) .into_array(); - let vals = FoRArray::try_new( - BitPackedArray::encode(&vals, 6) - .vortex_expect("bp") - .into_array(), + let vals = FoR::try_new( + BitPacked::encode(&vals, 6).vortex_expect("bp").into_array(), 0u32.into(), ) .vortex_expect("for"); - let vals = ZstdBuffersArray::compress(&vals.into_array(), 3).vortex_expect("zstd"); + let vals = ZstdBuffersData::compress(&vals.into_array(), 3).vortex_expect("zstd"); // codes = FoR(BitPacked) let codes = PrimitiveArray::new( @@ -268,8 +266,8 @@ mod tests { NonNullable, ) .into_array(); - let codes = FoRArray::try_new( - BitPackedArray::encode(&codes, 6) + let codes = FoR::try_new( + BitPacked::encode(&codes, 6) .vortex_expect("bp") .into_array(), 0u32.into(), @@ -302,12 +300,12 @@ mod tests { let len = 2048u32; let data: Vec = (0..len).map(|i| i % 128).collect(); - let bp = BitPackedArray::encode( + let bp = BitPacked::encode( &PrimitiveArray::new(Buffer::from(data.clone()), NonNullable).into_array(), 7, ) .vortex_expect("bp"); - let for_arr = FoRArray::try_new(bp.into_array(), 100u32.into()).vortex_expect("for"); + let for_arr = FoR::try_new(bp.into_array(), 100u32.into()).vortex_expect("for"); // Keep every other element. let mask = Mask::from_iter((0..len as usize).map(|i| i % 2 == 0)); diff --git a/vortex-cuda/src/kernel/arrays/dict.rs b/vortex-cuda/src/kernel/arrays/dict.rs index b9b2c803331..6159d284d34 100644 --- a/vortex-cuda/src/kernel/arrays/dict.rs +++ b/vortex-cuda/src/kernel/arrays/dict.rs @@ -65,7 +65,7 @@ impl CudaExecute for DictExecutor { #[expect(clippy::cognitive_complexity)] async fn execute_dict_prim(dict: DictArray, ctx: &mut CudaExecutionCtx) -> VortexResult { - let DictArrayParts { values, codes, .. } = dict.into_parts(); + let DictArrayParts { values, codes, .. } = dict.into_data().into_parts(); // Execute both children to get them as primitives on the device let values_canonical = values.execute_cuda(ctx).await?; @@ -98,12 +98,12 @@ async fn execute_dict_prim_typed 0, "Non empty array"); let offset = offset as usize; @@ -198,7 +198,7 @@ mod tests { let array = PrimitiveArray::new(iter.collect::>(), NonNullable); // Last two items should be patched - let bp_with_patches = BitPackedArray::encode(&array.into_array(), bw)?; + let bp_with_patches = BitPacked::encode(&array.into_array(), bw)?; assert!(bp_with_patches.patches().is_some()); let cpu_result = bp_with_patches.to_canonical()?.into_array(); @@ -229,7 +229,7 @@ mod tests { ); // Last two items should be patched - let bp_with_patches = BitPackedArray::encode(&array.into_array(), 9)?; + let bp_with_patches = BitPacked::encode(&array.into_array(), 9)?; assert!(bp_with_patches.patches().is_some()); let cpu_result = bp_with_patches.to_canonical()?.into_array(); @@ -271,7 +271,7 @@ mod tests { NonNullable, ); - let bitpacked_array = BitPackedArray::encode(&primitive_array.into_array(), bit_width) + let bitpacked_array = BitPacked::encode(&primitive_array.into_array(), bit_width) .vortex_expect("operation should succeed in test"); let cpu_result = bitpacked_array.to_canonical()?; @@ -320,7 +320,7 @@ mod tests { NonNullable, ); - let bitpacked_array = BitPackedArray::encode(&primitive_array.into_array(), bit_width) + let bitpacked_array = BitPacked::encode(&primitive_array.into_array(), bit_width) .vortex_expect("operation should succeed in test"); let cpu_result = bitpacked_array.to_canonical()?; @@ -385,7 +385,7 @@ mod tests { NonNullable, ); - let bitpacked_array = BitPackedArray::encode(&primitive_array.into_array(), bit_width) + let bitpacked_array = BitPacked::encode(&primitive_array.into_array(), bit_width) .vortex_expect("operation should succeed in test"); let cpu_result = bitpacked_array.to_canonical()?; @@ -482,7 +482,7 @@ mod tests { NonNullable, ); - let bitpacked_array = BitPackedArray::encode(&primitive_array.into_array(), bit_width) + let bitpacked_array = BitPacked::encode(&primitive_array.into_array(), bit_width) .vortex_expect("operation should succeed in test"); let cpu_result = bitpacked_array.to_canonical()?; let gpu_result = block_on(async { @@ -515,7 +515,7 @@ mod tests { NonNullable, ); - let bitpacked_array = BitPackedArray::encode(&primitive_array.into_array(), bit_width) + let bitpacked_array = BitPacked::encode(&primitive_array.into_array(), bit_width) .vortex_expect("operation should succeed in test"); let sliced_array = bitpacked_array.into_array().slice(67..3969)?; assert!(sliced_array.is::()); diff --git a/vortex-cuda/src/kernel/encodings/date_time_parts.rs b/vortex-cuda/src/kernel/encodings/date_time_parts.rs index 50a74630160..da21f267d32 100644 --- a/vortex-cuda/src/kernel/encodings/date_time_parts.rs +++ b/vortex-cuda/src/kernel/encodings/date_time_parts.rs @@ -150,15 +150,15 @@ where let PrimitiveArrayParts { buffer: days_buffer, .. - } = days.into_parts(); + } = days.into_data().into_parts(); let PrimitiveArrayParts { buffer: seconds_buffer, .. - } = seconds.into_parts(); + } = seconds.into_data().into_parts(); let PrimitiveArrayParts { buffer: subseconds_buffer, .. - } = subseconds.into_parts(); + } = subseconds.into_data().into_parts(); // Move buffers to device if not already there let days_device = ctx.ensure_on_device(days_buffer).await?; @@ -208,6 +208,7 @@ mod tests { use vortex::array::validity::Validity; use vortex::buffer::Buffer; use vortex::buffer::buffer; + use vortex::encodings::datetime_parts::DateTimeParts; use vortex::encodings::datetime_parts::DateTimePartsArray; use vortex::error::VortexExpect; use vortex::error::VortexResult; @@ -237,7 +238,7 @@ mod tests { None, ); - DateTimePartsArray::try_new( + DateTimeParts::try_new( temporal.dtype().clone(), days_arr, seconds_arr, @@ -348,7 +349,7 @@ mod tests { None, ); - let dtp_array = DateTimePartsArray::try_new( + let dtp_array = DateTimeParts::try_new( temporal.dtype().clone(), days_arr, seconds_arr, diff --git a/vortex-cuda/src/kernel/encodings/decimal_byte_parts.rs b/vortex-cuda/src/kernel/encodings/decimal_byte_parts.rs index f7f381708af..134e5c99374 100644 --- a/vortex-cuda/src/kernel/encodings/decimal_byte_parts.rs +++ b/vortex-cuda/src/kernel/encodings/decimal_byte_parts.rs @@ -35,13 +35,18 @@ impl CudaExecute for DecimalBytePartsExecutor { }; let decimal_dtype = *array.decimal_dtype(); - let DecimalBytePartsArrayParts { msp, .. } = array.into_parts(); + let DecimalBytePartsArrayParts { msp, .. } = array.into_data().into_parts(); let PrimitiveArrayParts { buffer, ptype, validity, .. - } = msp.execute_cuda(ctx).await?.into_primitive().into_parts(); + } = msp + .execute_cuda(ctx) + .await? + .into_primitive() + .into_data() + .into_parts(); // SAFETY: The primitive array's buffer is already validated with correct type. // The decimal dtype matches the array's dtype, and validity is preserved. @@ -60,7 +65,7 @@ mod tests { use vortex::array::validity::Validity; use vortex::buffer::Buffer; use vortex::dtype::DecimalDType; - use vortex::encodings::decimal_byte_parts::DecimalBytePartsArray; + use vortex::encodings::decimal_byte_parts::DecimalByteParts; use vortex::error::VortexExpect; use vortex::session::VortexSession; @@ -82,7 +87,7 @@ mod tests { .vortex_expect("create execution context"); let decimal_dtype = DecimalDType::new(precision, scale); - let dbp_array = DecimalBytePartsArray::try_new( + let dbp_array = DecimalByteParts::try_new( PrimitiveArray::new(encoded, Validity::NonNullable).into_array(), decimal_dtype, ) diff --git a/vortex-cuda/src/kernel/encodings/for_.rs b/vortex-cuda/src/kernel/encodings/for_.rs index 29e00f4ec92..aac352dfd6c 100644 --- a/vortex-cuda/src/kernel/encodings/for_.rs +++ b/vortex-cuda/src/kernel/encodings/for_.rs @@ -10,6 +10,7 @@ use tracing::instrument; use vortex::array::ArrayRef; use vortex::array::Canonical; use vortex::array::DynArray; +use vortex::array::IntoArray; use vortex::array::arrays::PrimitiveArray; use vortex::array::arrays::Slice; use vortex::array::arrays::primitive::PrimitiveArrayParts; @@ -68,7 +69,11 @@ impl CudaExecute for FoRExecutor { decode_bitpacked(bitpacked.clone(), reference, ctx).await? }); - return unpacked.into_primitive().slice(slice_range)?.to_canonical(); + return unpacked + .into_primitive() + .into_array() + .slice(slice_range)? + .to_canonical(); } match_each_native_simd_ptype!(array.ptype(), |P| { decode_for::

(array, ctx).await }) @@ -94,7 +99,7 @@ where let primitive = canonical.into_primitive(); let PrimitiveArrayParts { buffer, validity, .. - } = primitive.into_parts(); + } = primitive.into_data().into_parts(); let device_buffer = ctx.ensure_on_device(buffer).await?; @@ -127,7 +132,8 @@ mod tests { use vortex::array::validity::Validity::NonNullable; use vortex::buffer::Buffer; use vortex::dtype::NativePType; - use vortex::encodings::fastlanes::BitPackedArray; + use vortex::encodings::fastlanes::BitPacked; + use vortex::encodings::fastlanes::FoR; use vortex::encodings::fastlanes::FoRArray; use vortex::error::VortexExpect; use vortex::scalar::Scalar; @@ -138,7 +144,7 @@ mod tests { use crate::session::CudaSession; fn make_for_array>(input_data: Vec, reference: T) -> FoRArray { - FoRArray::try_new( + FoR::try_new( PrimitiveArray::new(Buffer::from(input_data), NonNullable).into_array(), reference.into(), ) @@ -180,8 +186,8 @@ mod tests { .take(1024) .collect::>() .into_array(); - let packed = BitPackedArray::encode(&values, 3).unwrap().into_array(); - let for_array = FoRArray::try_new(packed, (-8i8).into()).unwrap(); + let packed = BitPacked::encode(&values, 3).unwrap().into_array(); + let for_array = FoR::try_new(packed, (-8i8).into()).unwrap(); let cpu_result = for_array.to_canonical().unwrap(); diff --git a/vortex-cuda/src/kernel/encodings/runend.rs b/vortex-cuda/src/kernel/encodings/runend.rs index 944545b3c44..6f14ec20c9c 100644 --- a/vortex-cuda/src/kernel/encodings/runend.rs +++ b/vortex-cuda/src/kernel/encodings/runend.rs @@ -9,6 +9,7 @@ use cudarc::driver::PushKernelArg; use tracing::instrument; use vortex::array::ArrayRef; use vortex::array::Canonical; +use vortex::array::IntoArray; use vortex::array::arrays::ConstantArray; use vortex::array::arrays::PrimitiveArray; use vortex::array::arrays::primitive::PrimitiveArrayParts; @@ -60,7 +61,7 @@ impl CudaExecute for RunEndExecutor { let offset = array.offset(); let output_len = array.len(); - let RunEndArrayParts { ends, values } = array.into_parts(); + let RunEndArrayParts { ends, values } = array.into_data().into_parts(); let values_ptype = PType::try_from(values.dtype())?; let ends_ptype = PType::try_from(ends.dtype())?; @@ -75,6 +76,7 @@ impl CudaExecute for RunEndExecutor { if matches!(values.validity()?, Validity::AllInvalid) { return ConstantArray::new(Scalar::null(values.dtype().clone()), output_len) + .into_array() .to_canonical(); } @@ -108,12 +110,12 @@ async fn decode_runend_typed()?; @@ -89,7 +89,7 @@ mod tests { use vortex::array::assert_arrays_eq; use vortex::dtype::NativePType; use vortex::dtype::Nullability; - use vortex::encodings::sequence::SequenceArray; + use vortex::encodings::sequence::Sequence; use vortex::scalar::PValue; use vortex::session::VortexSession; @@ -126,7 +126,7 @@ mod tests { ) { let mut cuda_ctx = CudaSession::create_execution_ctx(&VortexSession::empty()).unwrap(); - let array = SequenceArray::try_new_typed(base, multiplier, nullability, len).unwrap(); + let array = Sequence::try_new_typed(base, multiplier, nullability, len).unwrap(); let cpu_result = array.to_canonical().unwrap().into_array(); diff --git a/vortex-cuda/src/kernel/encodings/zigzag.rs b/vortex-cuda/src/kernel/encodings/zigzag.rs index 7e470299ac7..f1feac1bbf3 100644 --- a/vortex-cuda/src/kernel/encodings/zigzag.rs +++ b/vortex-cuda/src/kernel/encodings/zigzag.rs @@ -72,7 +72,7 @@ where let primitive = canonical.into_primitive(); let PrimitiveArrayParts { buffer, validity, .. - } = primitive.into_parts(); + } = primitive.into_data().into_parts(); let device_buffer = ctx.ensure_on_device(buffer).await?; @@ -102,7 +102,7 @@ mod tests { use vortex::array::assert_arrays_eq; use vortex::array::validity::Validity::NonNullable; use vortex::buffer::Buffer; - use vortex::encodings::zigzag::ZigZagArray; + use vortex::encodings::zigzag::ZigZag; use vortex::error::VortexExpect; use vortex::session::VortexSession; @@ -119,7 +119,7 @@ mod tests { // So encoded [0, 2, 4, 1, 3] should decode to [0, 1, 2, -1, -2] let encoded_data: Vec = vec![0, 2, 4, 1, 3]; - let zigzag_array = ZigZagArray::try_new( + let zigzag_array = ZigZag::try_new( PrimitiveArray::new(Buffer::from(encoded_data), NonNullable).into_array(), )?; diff --git a/vortex-cuda/src/kernel/encodings/zstd.rs b/vortex-cuda/src/kernel/encodings/zstd.rs index 06ff9094691..4aec0998fe6 100644 --- a/vortex-cuda/src/kernel/encodings/zstd.rs +++ b/vortex-cuda/src/kernel/encodings/zstd.rs @@ -199,7 +199,7 @@ impl CudaExecute for ZstdExecutor { ) -> VortexResult { let zstd = Self::try_specialize(array).ok_or_else(|| vortex_err!("Expected ZstdArray"))?; - match zstd.as_ref().dtype() { + match zstd.dtype() { DType::Binary(_) | DType::Utf8(_) => decode_zstd(zstd, ctx).await, _other => { debug!( @@ -222,7 +222,7 @@ async fn decode_zstd(array: ZstdArray, ctx: &mut CudaExecutionCtx) -> VortexResu dictionary, slice_start, slice_stop, - } = array.into_parts(); + } = array.into_data().into_parts(); // nvCOMP doesn't support ZSTD dictionaries. if dictionary.is_some() { @@ -350,7 +350,7 @@ mod tests { use vortex::array::IntoArray; use vortex::array::arrays::VarBinViewArray; use vortex::array::assert_arrays_eq; - use vortex::encodings::zstd::ZstdArray; + use vortex::encodings::zstd::Zstd; use vortex::error::VortexResult; use vortex::session::VortexSession; @@ -371,7 +371,7 @@ mod tests { "baz", ]); - let zstd_array = ZstdArray::from_var_bin_view(&strings, 3, 0)?; + let zstd_array = Zstd::from_var_bin_view(&strings, 3, 0)?; let cpu_result = zstd_array .decompress(cuda_ctx.execution_ctx())? @@ -408,7 +408,7 @@ mod tests { // Compress with ZSTD using values_per_frame=3 to create multiple frames. // 14 strings and 3 values per frame = ceil(14/3) = 5 frames. - let zstd_array = ZstdArray::from_var_bin_view(&strings, 3, 3)?; + let zstd_array = Zstd::from_var_bin_view(&strings, 3, 3)?; let cpu_result = zstd_array .decompress(cuda_ctx.execution_ctx())? @@ -439,7 +439,7 @@ mod tests { "final test string", ]); - let zstd_array = ZstdArray::from_var_bin_view(&strings, 3, 0)?; + let zstd_array = Zstd::from_var_bin_view(&strings, 3, 0)?; // Slice the array to get a subset (indices 2..7) let sliced_zstd = zstd_array.slice(2..7)?; diff --git a/vortex-cuda/src/kernel/encodings/zstd_buffers.rs b/vortex-cuda/src/kernel/encodings/zstd_buffers.rs index c2ef46458a5..1891ee2375c 100644 --- a/vortex-cuda/src/kernel/encodings/zstd_buffers.rs +++ b/vortex-cuda/src/kernel/encodings/zstd_buffers.rs @@ -223,7 +223,7 @@ mod tests { use vortex::array::arrays::PrimitiveArray; use vortex::array::arrays::VarBinViewArray; use vortex::array::assert_arrays_eq; - use vortex::encodings::zstd::ZstdBuffersArray; + use vortex::encodings::zstd::ZstdBuffersData; use vortex::error::VortexExpect; use vortex::error::VortexResult; use vortex::session::VortexSession; @@ -238,7 +238,7 @@ mod tests { .vortex_expect("failed to create execution context"); let input = PrimitiveArray::from_iter(0i64..1024).into_array(); - let compressed = ZstdBuffersArray::compress(&input, 3)?; + let compressed = ZstdBuffersData::compress(&input, 3)?; let cpu_result = compressed.clone().into_array().to_canonical()?; let gpu_result = ZstdBuffersExecutor @@ -265,7 +265,7 @@ mod tests { "baz", ]) .into_array(); - let compressed = ZstdBuffersArray::compress(&input, 3)?; + let compressed = ZstdBuffersData::compress(&input, 3)?; let cpu_result = compressed.clone().into_array().to_canonical()?; let gpu_result = ZstdBuffersExecutor diff --git a/vortex-cuda/src/kernel/filter/decimal.rs b/vortex-cuda/src/kernel/filter/decimal.rs index 00e50d50b23..88e07465968 100644 --- a/vortex-cuda/src/kernel/filter/decimal.rs +++ b/vortex-cuda/src/kernel/filter/decimal.rs @@ -23,7 +23,7 @@ pub(super) async fn filter_decimal(values, mask, ctx).await?; diff --git a/vortex-cuda/src/kernel/filter/mod.rs b/vortex-cuda/src/kernel/filter/mod.rs index 46edfe8a148..588c3e07925 100644 --- a/vortex-cuda/src/kernel/filter/mod.rs +++ b/vortex-cuda/src/kernel/filter/mod.rs @@ -53,7 +53,7 @@ impl CudaExecute for FilterExecutor { .try_into::() .map_err(|_| vortex_err!("Expected FilterArray"))?; - let FilterArrayParts { child, mask } = filter_array.into_parts(); + let FilterArrayParts { child, mask } = filter_array.into_data().into_parts(); // Early return for trivial cases. match mask { diff --git a/vortex-cuda/src/kernel/filter/primitive.rs b/vortex-cuda/src/kernel/filter/primitive.rs index 72929e5190d..68e39edd60f 100644 --- a/vortex-cuda/src/kernel/filter/primitive.rs +++ b/vortex-cuda/src/kernel/filter/primitive.rs @@ -24,7 +24,7 @@ where { let PrimitiveArrayParts { buffer, validity, .. - } = array.into_parts(); + } = array.into_data().into_parts(); let filtered_validity = validity.filter(&mask)?; let filtered_values = filter_sized::(buffer, mask, ctx).await?; diff --git a/vortex-cuda/src/kernel/filter/varbinview.rs b/vortex-cuda/src/kernel/filter/varbinview.rs index 73d861116ce..143e3f26ce7 100644 --- a/vortex-cuda/src/kernel/filter/varbinview.rs +++ b/vortex-cuda/src/kernel/filter/varbinview.rs @@ -20,7 +20,7 @@ pub(super) async fn filter_varbinview( buffers, validity, dtype, - } = array.into_parts(); + } = array.into_data().into_parts(); let filtered_validity = validity.filter(&mask)?; diff --git a/vortex-cuda/src/kernel/patches/mod.rs b/vortex-cuda/src/kernel/patches/mod.rs index 663ca621860..9da4ddf8f51 100644 --- a/vortex-cuda/src/kernel/patches/mod.rs +++ b/vortex-cuda/src/kernel/patches/mod.rs @@ -15,7 +15,6 @@ use tracing::instrument; use vortex::array::arrays::primitive::PrimitiveArrayParts; use vortex::array::patches::Patches; use vortex::array::validity::Validity; -use vortex::array::vtable::ValidityHelper; use vortex::dtype::NativePType; use vortex::error::VortexResult; use vortex::error::vortex_ensure; @@ -71,12 +70,12 @@ pub(crate) async fn execute_patches< let PrimitiveArrayParts { buffer: indices_buffer, .. - } = indices.into_parts(); + } = indices.into_data().into_parts(); let PrimitiveArrayParts { buffer: values_buffer, .. - } = values.into_parts(); + } = values.into_data().into_parts(); let d_patch_indices = ctx.ensure_on_device(indices_buffer).await?; let d_patch_values = ctx.ensure_on_device(values_buffer).await?; @@ -171,7 +170,7 @@ mod tests { let PrimitiveArrayParts { buffer: cuda_buffer, .. - } = values.into_parts(); + } = values.into_data().into_parts(); let handle = ctx.ensure_on_device(cuda_buffer).await.unwrap(); let device_buf = handle diff --git a/vortex-cuda/src/kernel/slice/mod.rs b/vortex-cuda/src/kernel/slice/mod.rs index 15b91ec0f21..0bcd7590146 100644 --- a/vortex-cuda/src/kernel/slice/mod.rs +++ b/vortex-cuda/src/kernel/slice/mod.rs @@ -6,6 +6,7 @@ use tracing::instrument; use vortex::array::ArrayRef; use vortex::array::Canonical; use vortex::array::DynArray; +use vortex::array::IntoArray; use vortex::array::arrays::Slice; use vortex::array::arrays::slice::SliceArrayParts; use vortex::error::VortexResult; @@ -33,16 +34,24 @@ impl CudaExecute for SliceExecutor { ) })?; - let SliceArrayParts { child, range } = slice_array.into_parts(); + let SliceArrayParts { child, range } = slice_array.into_data().into_parts(); let child = child.execute_cuda(ctx).await?; match child { - Canonical::Null(null_array) => null_array.slice(range)?.to_canonical(), - Canonical::Bool(bool_array) => bool_array.slice(range)?.to_canonical(), - Canonical::Primitive(prim_array) => prim_array.slice(range)?.to_canonical(), - Canonical::Decimal(decimal_array) => decimal_array.slice(range)?.to_canonical(), - Canonical::VarBinView(varbinview) => varbinview.slice(range)?.to_canonical(), - Canonical::Extension(extension_array) => extension_array.slice(range)?.to_canonical(), + Canonical::Null(null_array) => null_array.into_array().slice(range)?.to_canonical(), + Canonical::Bool(bool_array) => bool_array.into_array().slice(range)?.to_canonical(), + Canonical::Primitive(prim_array) => { + prim_array.into_array().slice(range)?.to_canonical() + } + Canonical::Decimal(decimal_array) => { + decimal_array.into_array().slice(range)?.to_canonical() + } + Canonical::VarBinView(varbinview) => { + varbinview.into_array().slice(range)?.to_canonical() + } + Canonical::Extension(extension_array) => { + extension_array.into_array().slice(range)?.to_canonical() + } c => todo!("Slice kernel not implemented for {}", c.dtype()), } } diff --git a/vortex-datafusion/examples/vortex_table.rs b/vortex-datafusion/examples/vortex_table.rs index cbd138baa0a..2570fc47afd 100644 --- a/vortex-datafusion/examples/vortex_table.rs +++ b/vortex-datafusion/examples/vortex_table.rs @@ -58,7 +58,7 @@ async fn main() -> anyhow::Result<()> { session .write_options() - .write(&mut f, st.to_array_stream()) + .write(&mut f, st.into_array().to_array_stream()) .await?; // [register] diff --git a/vortex-datafusion/src/persistent/mod.rs b/vortex-datafusion/src/persistent/mod.rs index 558032ebd01..c2d83532fe3 100644 --- a/vortex-datafusion/src/persistent/mod.rs +++ b/vortex-datafusion/src/persistent/mod.rs @@ -69,7 +69,7 @@ mod tests { let summary = session .write_options() - .write(&mut writer, st.to_array_stream()) + .write(&mut writer, st.into_array().to_array_stream()) .await?; writer.shutdown().await?; diff --git a/vortex-duckdb/src/e2e_test/vortex_scan_test.rs b/vortex-duckdb/src/e2e_test/vortex_scan_test.rs index 75db1ac3cd6..4e03cd07cd7 100644 --- a/vortex-duckdb/src/e2e_test/vortex_scan_test.rs +++ b/vortex-duckdb/src/e2e_test/vortex_scan_test.rs @@ -36,8 +36,8 @@ use vortex::file::WriteOptionsSessionExt; use vortex::io::runtime::BlockingRuntime; use vortex::scalar::PValue; use vortex::scalar::Scalar; -use vortex_runend::RunEndArray; -use vortex_sequence::SequenceArray; +use vortex_runend::RunEnd; +use vortex_sequence::Sequence; use crate::RUNTIME; use crate::SESSION; @@ -71,7 +71,7 @@ async fn write_vortex_file( let mut file = async_fs::File::create(&temp_file_path).await.unwrap(); SESSION .write_options() - .write(&mut file, struct_array.to_array_stream()) + .write(&mut file, struct_array.into_array().to_array_stream()) .await .unwrap(); @@ -167,7 +167,7 @@ async fn write_vortex_file_to_dir( let mut file = async_fs::File::create(&temp_file_path).await.unwrap(); SESSION .write_options() - .write(&mut file, struct_array.to_array_stream()) + .write(&mut file, struct_array.into_array().to_array_stream()) .await .unwrap(); @@ -789,10 +789,10 @@ async fn write_vortex_file_with_encodings() -> NamedTempFile { // 4. Run-End let run_ends = buffer![3u32, 5]; let run_values = buffer![100i32, 200]; - let rle_array = RunEndArray::try_new(run_ends.into_array(), run_values.into_array()).unwrap(); + let rle_array = RunEnd::try_new(run_ends.into_array(), run_values.into_array()).unwrap(); // 5. Sequence array - let sequence_array = SequenceArray::try_new( + let sequence_array = Sequence::try_new( PValue::I64(0), PValue::I64(10), PType::I64, @@ -844,7 +844,7 @@ async fn write_vortex_file_with_encodings() -> NamedTempFile { let mut file = async_fs::File::create(&temp_file_path).await.unwrap(); SESSION .write_options() - .write(&mut file, struct_array.to_array_stream()) + .write(&mut file, struct_array.into_array().to_array_stream()) .await .unwrap(); diff --git a/vortex-duckdb/src/exporter/bool.rs b/vortex-duckdb/src/exporter/bool.rs index 75dfa195bc9..4df5701bd60 100644 --- a/vortex-duckdb/src/exporter/bool.rs +++ b/vortex-duckdb/src/exporter/bool.rs @@ -23,7 +23,11 @@ pub(crate) fn new_exporter( ) -> VortexResult> { let len = array.len(); let bits = array.to_bit_buffer(); - let validity = array.validity()?.to_array(len).execute::(ctx)?; + let validity = array + .validity() + .clone() + .to_array(len) + .execute::(ctx)?; if validity.all_false() { return Ok(all_invalid::new_exporter(len, &LogicalType::bool())); diff --git a/vortex-duckdb/src/exporter/decimal.rs b/vortex-duckdb/src/exporter/decimal.rs index c099512cf94..b61754ab64e 100644 --- a/vortex-duckdb/src/exporter/decimal.rs +++ b/vortex-duckdb/src/exporter/decimal.rs @@ -47,7 +47,7 @@ pub(crate) fn new_exporter( decimal_dtype, values_type, values, - } = array.into_parts(); + } = array.into_data().into_parts(); let dest_values_type = precision_to_duckdb_storage_size(&decimal_dtype)?; let nullability = validity.nullability(); let validity = validity.to_array(len).execute::(ctx)?; diff --git a/vortex-duckdb/src/exporter/fixed_size_list.rs b/vortex-duckdb/src/exporter/fixed_size_list.rs index bfea0df2034..8aaaa1cce1c 100644 --- a/vortex-duckdb/src/exporter/fixed_size_list.rs +++ b/vortex-duckdb/src/exporter/fixed_size_list.rs @@ -38,7 +38,7 @@ pub(crate) fn new_exporter( ) -> VortexResult> { let list_size = array.list_size(); let len = array.len(); - let (elements, validity, dtype) = array.into_parts(); + let (elements, validity, dtype) = array.into_data().into_parts(); let mask = validity.to_array(len).execute::(ctx)?; let elements_exporter = new_array_exporter_with_flatten(elements, cache, ctx, true)?; diff --git a/vortex-duckdb/src/exporter/list.rs b/vortex-duckdb/src/exporter/list.rs index 9020bcf1659..7bf4773d2ac 100644 --- a/vortex-duckdb/src/exporter/list.rs +++ b/vortex-duckdb/src/exporter/list.rs @@ -51,7 +51,7 @@ pub(crate) fn new_exporter( offsets, validity, dtype, - } = array.into_parts(); + } = array.into_data().into_parts(); let num_elements = elements.len(); let validity = validity.to_array(array_len).execute::(ctx)?; diff --git a/vortex-duckdb/src/exporter/list_view.rs b/vortex-duckdb/src/exporter/list_view.rs index 2db8229f764..880047f21c2 100644 --- a/vortex-duckdb/src/exporter/list_view.rs +++ b/vortex-duckdb/src/exporter/list_view.rs @@ -54,7 +54,7 @@ pub(crate) fn new_exporter( offsets, sizes, validity, - } = array.into_parts(); + } = array.into_data().into_parts(); // Cache an `elements` vector up front so that future exports can reference it. let num_elements = elements.len(); let nullability = validity.nullability(); diff --git a/vortex-duckdb/src/exporter/mod.rs b/vortex-duckdb/src/exporter/mod.rs index db147361065..d69b0275f1d 100644 --- a/vortex-duckdb/src/exporter/mod.rs +++ b/vortex-duckdb/src/exporter/mod.rs @@ -31,7 +31,6 @@ use vortex::array::arrays::Dict; use vortex::array::arrays::List; use vortex::array::arrays::StructArray; use vortex::array::arrays::TemporalArray; -use vortex::array::vtable::ValidityHelper; use vortex::encodings::runend::RunEnd; use vortex::encodings::sequence::Sequence; use vortex::error::VortexResult; diff --git a/vortex-duckdb/src/exporter/primitive.rs b/vortex-duckdb/src/exporter/primitive.rs index 5e4a3f7e121..c5167880b59 100644 --- a/vortex-duckdb/src/exporter/primitive.rs +++ b/vortex-duckdb/src/exporter/primitive.rs @@ -6,7 +6,6 @@ use std::marker::PhantomData; use vortex::array::ExecutionCtx; use vortex::array::arrays::PrimitiveArray; use vortex::array::match_each_native_ptype; -use vortex::array::vtable::ValidityHelper; use vortex::dtype::NativePType; use vortex::error::VortexResult; use vortex::mask::Mask; diff --git a/vortex-duckdb/src/exporter/run_end.rs b/vortex-duckdb/src/exporter/run_end.rs index 2a27af64940..0d05cf67a30 100644 --- a/vortex-duckdb/src/exporter/run_end.rs +++ b/vortex-duckdb/src/exporter/run_end.rs @@ -38,7 +38,7 @@ pub(crate) fn new_exporter( ctx: &mut ExecutionCtx, ) -> VortexResult> { let offset = array.offset(); - let RunEndArrayParts { ends, values } = array.into_parts(); + let RunEndArrayParts { ends, values } = array.into_data().into_parts(); let ends = ends.execute::(ctx)?; let values_exporter = new_array_exporter(values.clone(), cache, ctx)?; diff --git a/vortex-duckdb/src/exporter/sequence.rs b/vortex-duckdb/src/exporter/sequence.rs index 380f57c95bf..e5dd29cbf76 100644 --- a/vortex-duckdb/src/exporter/sequence.rs +++ b/vortex-duckdb/src/exporter/sequence.rs @@ -44,6 +44,7 @@ impl ColumnExporter for SequenceExporter { #[cfg(test)] mod tests { use vortex::dtype::Nullability; + use vortex::encodings::sequence::Sequence; use vortex_array::VortexSessionExecute; use super::*; @@ -54,7 +55,7 @@ mod tests { #[test] fn test_sequence() { - let arr = SequenceArray::try_new_typed(2, 5, Nullability::NonNullable, 100).unwrap(); + let arr = Sequence::try_new_typed(2, 5, Nullability::NonNullable, 100).unwrap(); let mut chunk = DataChunk::new([LogicalType::new(cpp::duckdb_type::DUCKDB_TYPE_INTEGER)]); new_exporter(&arr) diff --git a/vortex-duckdb/src/exporter/varbinview.rs b/vortex-duckdb/src/exporter/varbinview.rs index 13a59d242ef..50c5cafc980 100644 --- a/vortex-duckdb/src/exporter/varbinview.rs +++ b/vortex-duckdb/src/exporter/varbinview.rs @@ -37,7 +37,7 @@ pub(crate) fn new_exporter( dtype, views, buffers, - } = array.into_parts(); + } = array.into_data().into_parts(); let validity = validity.to_array(len).execute::(ctx)?; if validity.all_false() { let ltype = LogicalType::try_from(dtype)?; diff --git a/vortex-ffi/examples/hello_vortex.rs b/vortex-ffi/examples/hello_vortex.rs index fa458ce483a..dc7ef690ca9 100644 --- a/vortex-ffi/examples/hello_vortex.rs +++ b/vortex-ffi/examples/hello_vortex.rs @@ -156,7 +156,7 @@ async fn write_vortex_file(path: impl AsRef) -> VortexResult<()> { SESSION .write_options() - .write(&mut file, test_data.to_array_stream()) + .write(&mut file, test_data.into_array().to_array_stream()) .await?; file.shutdown().await?; diff --git a/vortex-file/src/tests.rs b/vortex-file/src/tests.rs index 51b3b97383a..074d33cf0b0 100644 --- a/vortex-file/src/tests.rs +++ b/vortex-file/src/tests.rs @@ -111,7 +111,7 @@ async fn test_read_simple() { let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, st.to_array_stream()) + .write(&mut buf, st.into_array().to_array_stream()) .await .unwrap(); @@ -187,11 +187,12 @@ async fn test_round_trip_many_types() { ("decimal_35", decimal_35), ]) .unwrap(); + let dtype = st.dtype().clone(); let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, st.to_array_stream()) + .write(&mut buf, st.into_array().to_array_stream()) .await .unwrap(); @@ -207,7 +208,7 @@ async fn test_round_trip_many_types() { .await .unwrap(); - let read = ChunkedArray::try_new(chunks, st.dtype().clone()).unwrap(); + let read = ChunkedArray::try_new(chunks, dtype).unwrap(); assert_eq!(read.len(), 3); } @@ -248,7 +249,7 @@ async fn test_read_simple_with_spawn() { let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, st.to_array_stream()) + .write(&mut buf, st.into_array().to_array_stream()) .await .unwrap(); @@ -279,7 +280,7 @@ async fn test_read_projection() { let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, st.to_array_stream()) + .write(&mut buf, st.into_array().to_array_stream()) .await .unwrap(); @@ -304,7 +305,7 @@ async fn test_read_projection() { let actual = array.to_struct().unmasked_fields()[0].clone(); let expected = VarBinArray::from(strings_expected.to_vec()).into_array(); - assert_arrays_eq!(actual.as_ref(), expected.as_ref()); + assert_arrays_eq!(actual, expected); let array = file .scan() @@ -326,7 +327,7 @@ async fn test_read_projection() { let actual = array.to_struct().unmasked_fields()[0].clone(); let expected = Buffer::copy_from(numbers_expected).into_array(); - assert_arrays_eq!(actual.as_ref(), expected.as_ref()); + assert_arrays_eq!(actual, expected); } #[tokio::test] @@ -348,7 +349,7 @@ async fn unequal_batches() { let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, st.to_array_stream()) + .write(&mut buf, st.into_array().to_array_stream()) .await .unwrap(); @@ -408,7 +409,7 @@ async fn write_chunked() { let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, chunked_st.to_array_stream()) + .write(&mut buf, chunked_st.into_array().to_array_stream()) .await .unwrap(); @@ -435,11 +436,12 @@ async fn test_empty_varbin_array_roundtrip() { let empty = VarBinArray::from(Vec::<&str>::new()).into_array(); let st = StructArray::from_fields(&[("a", empty)]).unwrap(); + let dtype = st.dtype().clone(); let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, st.to_array_stream()) + .write(&mut buf, st.into_array().to_array_stream()) .await .unwrap(); @@ -455,7 +457,7 @@ async fn test_empty_varbin_array_roundtrip() { .unwrap(); assert_eq!(result.len(), 0); - assert_eq!(result.dtype(), st.dtype()); + assert_eq!(result.dtype(), &dtype); } #[tokio::test] @@ -518,7 +520,7 @@ async fn filter_string() { let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, st.to_array_stream()) + .write(&mut buf, st.into_array().to_array_stream()) .await .unwrap(); @@ -540,11 +542,11 @@ async fn filter_string() { let names_expected = VarBinArray::from_iter(vec![Some("Joseph")], DType::Utf8(Nullability::Nullable)) .into_array(); - assert_arrays_eq!(names_actual.as_ref(), names_expected.as_ref()); + assert_arrays_eq!(names_actual, names_expected); let ages_actual = result[0].to_struct().unmasked_fields()[1].clone(); let ages_expected = PrimitiveArray::from_option_iter([Some(25i32)]).into_array(); - assert_arrays_eq!(ages_actual.as_ref(), ages_expected.as_ref()); + assert_arrays_eq!(ages_actual, ages_expected); } #[tokio::test] @@ -567,7 +569,7 @@ async fn filter_or() { let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, st.to_array_stream()) + .write(&mut buf, st.into_array().to_array_stream()) .await .unwrap(); @@ -597,11 +599,11 @@ async fn filter_or() { DType::Utf8(Nullability::Nullable), ) .into_array(); - assert_arrays_eq!(names_actual.as_ref(), names_expected.as_ref()); + assert_arrays_eq!(names_actual, names_expected); let ages_actual = result[0].to_struct().unmasked_fields()[1].clone(); let ages_expected = PrimitiveArray::from_option_iter([Some(25i32), None]).into_array(); - assert_arrays_eq!(ages_actual.as_ref(), ages_expected.as_ref()); + assert_arrays_eq!(ages_actual, ages_expected); } #[tokio::test] @@ -624,7 +626,7 @@ async fn filter_and() { let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, st.to_array_stream()) + .write(&mut buf, st.into_array().to_array_stream()) .await .unwrap(); @@ -651,11 +653,11 @@ async fn filter_and() { DType::Utf8(Nullability::Nullable), ) .into_array(); - assert_arrays_eq!(names_actual.as_ref(), names_expected.as_ref()); + assert_arrays_eq!(names_actual, names_expected); let ages_actual = result[0].to_struct().unmasked_fields()[1].clone(); let ages_expected = PrimitiveArray::from_option_iter([Some(25i32), Some(31i32)]).into_array(); - assert_arrays_eq!(ages_actual.as_ref(), ages_expected.as_ref()); + assert_arrays_eq!(ages_actual, ages_expected); } #[tokio::test] @@ -678,7 +680,7 @@ async fn test_with_indices_simple() { let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, expected_array.to_array_stream()) + .write(&mut buf, expected_array.into_array().to_array_stream()) .await .unwrap(); @@ -718,7 +720,7 @@ async fn test_with_indices_simple() { .map(|&x| expected_numbers[x as usize]) .collect(); let expected_array = Buffer::copy_from(&expected_kept_numbers).into_array(); - assert_arrays_eq!(actual_kept_numbers_array.as_ref(), expected_array.as_ref()); + assert_arrays_eq!(actual_kept_numbers_array, expected_array); // test all indices let actual_array = file @@ -733,7 +735,7 @@ async fn test_with_indices_simple() { .to_struct(); let actual_numbers_array = actual_array.unmasked_fields()[0].clone(); let expected_array = Buffer::copy_from(&expected_numbers).into_array(); - assert_arrays_eq!(actual_numbers_array.as_ref(), expected_array.as_ref()); + assert_arrays_eq!(actual_numbers_array, expected_array); } #[tokio::test] @@ -757,7 +759,7 @@ async fn test_with_indices_on_two_columns() { let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, st.to_array_stream()) + .write(&mut buf, st.into_array().to_array_stream()) .await .unwrap(); @@ -782,7 +784,7 @@ async fn test_with_indices_on_two_columns() { .map(|&x| strings_expected[x as usize]) .collect(); let strings_expected_array = VarBinArray::from(strings_expected_vec).into_array(); - assert_arrays_eq!(strings_actual.as_ref(), strings_expected_array.as_ref()); + assert_arrays_eq!(strings_actual, strings_expected_array); let numbers_actual = array.unmasked_fields()[1].clone(); let numbers_expected_vec: Vec = kept_indices @@ -790,7 +792,7 @@ async fn test_with_indices_on_two_columns() { .map(|&x| numbers_expected[x as usize]) .collect(); let numbers_expected_array = Buffer::copy_from(&numbers_expected_vec).into_array(); - assert_arrays_eq!(numbers_actual.as_ref(), numbers_expected_array.as_ref()); + assert_arrays_eq!(numbers_actual, numbers_expected_array); } #[tokio::test] @@ -813,7 +815,7 @@ async fn test_with_indices_and_with_row_filter_simple() { let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, expected_array.to_array_stream()) + .write(&mut buf, expected_array.into_array().to_array_stream()) .await .unwrap(); @@ -856,7 +858,7 @@ async fn test_with_indices_and_with_row_filter_simple() { .filter(|&x| x > 50) .collect(); let expected_array = expected_kept_numbers.into_array(); - assert_arrays_eq!(actual_kept_numbers_array.as_ref(), expected_array.as_ref()); + assert_arrays_eq!(actual_kept_numbers_array, expected_array); // test all indices let actual_array = file @@ -878,10 +880,7 @@ async fn test_with_indices_and_with_row_filter_simple() { .cloned() .collect(); let expected_numbers_array = expected_filtered.into_array(); - assert_arrays_eq!( - actual_numbers_array.as_ref(), - expected_numbers_array.as_ref() - ); + assert_arrays_eq!(actual_numbers_array, expected_numbers_array); } #[tokio::test] @@ -938,11 +937,11 @@ async fn filter_string_chunked() { let names_expected = VarBinArray::from_iter(vec![Some("Joseph")], DType::Utf8(Nullability::Nullable)) .into_array(); - assert_arrays_eq!(names_actual.as_ref(), names_expected.as_ref()); + assert_arrays_eq!(names_actual, names_expected); let ages_actual = actual_array.unmasked_fields()[1].clone(); let ages_expected = PrimitiveArray::from_option_iter([Some(25i32)]).into_array(); - assert_arrays_eq!(ages_actual.as_ref(), ages_expected.as_ref()); + assert_arrays_eq!(ages_actual, ages_expected); } #[tokio::test] @@ -1039,7 +1038,7 @@ async fn test_pruning_with_or() { Some("P".to_owned()), ]) .into_array(); - assert_arrays_eq!(letters_actual.as_ref(), letters_expected.as_ref()); + assert_arrays_eq!(letters_actual, letters_expected); let numbers_actual = actual_array.unmasked_fields()[1].clone(); let numbers_expected = PrimitiveArray::from_option_iter([ @@ -1055,7 +1054,7 @@ async fn test_pruning_with_or() { Some(22), ]) .into_array(); - assert_arrays_eq!(numbers_actual.as_ref(), numbers_expected.as_ref()); + assert_arrays_eq!(numbers_actual, numbers_expected); } #[tokio::test] @@ -1077,7 +1076,7 @@ async fn test_repeated_projection() { let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, single_column_array.to_array_stream()) + .write(&mut buf, single_column_array.into_array().to_array_stream()) .await .unwrap(); @@ -1120,7 +1119,7 @@ async fn basic_file_roundtrip() -> VortexResult<()> { let result = vxf.scan()?.into_array_stream()?.read_all().await?; let expected = buffer![0i32, 1, 2, 3, 4, 5, 6, 7, 8].into_array(); - assert_arrays_eq!(result.as_ref(), expected.as_ref()); + assert_arrays_eq!(result, expected); Ok(()) } @@ -1168,7 +1167,7 @@ async fn file_take() -> VortexResult<()> { .await?; let expected = buffer![0i32, 1, 8].into_array(); - assert_arrays_eq!(result.as_ref(), expected.as_ref()); + assert_arrays_eq!(result, expected); Ok(()) } @@ -1291,7 +1290,7 @@ async fn test_into_tokio_array_stream() -> VortexResult<()> { let mut buf = ByteBufferMut::empty(); SESSION .write_options() - .write(&mut buf, st.to_array_stream()) + .write(&mut buf, st.into_array().to_array_stream()) .await?; let file = SESSION.open_options().open_buffer(buf)?; @@ -1383,7 +1382,7 @@ async fn test_writer_multiple_pushes() -> VortexResult<()> { .unmasked_field_by_name("numbers")? .clone(); let expected = buffer![1u32, 2, 3, 4, 5, 6, 7, 8, 9].into_array(); - assert_arrays_eq!(numbers.as_ref(), expected.as_ref()); + assert_arrays_eq!(numbers, expected); Ok(()) } @@ -1417,7 +1416,7 @@ async fn test_writer_push_stream() -> VortexResult<()> { .unmasked_field_by_name("numbers")? .clone(); let expected = buffer![1u32, 2, 3, 4, 5, 6].into_array(); - assert_arrays_eq!(numbers.as_ref(), expected.as_ref()); + assert_arrays_eq!(numbers, expected); Ok(()) } @@ -1481,7 +1480,7 @@ async fn test_writer_empty_chunks() -> VortexResult<()> { .unmasked_field_by_name("numbers")? .clone(); let expected = buffer![1u32, 2].into_array(); - assert_arrays_eq!(numbers.as_ref(), expected.as_ref()); + assert_arrays_eq!(numbers, expected); Ok(()) } @@ -1519,7 +1518,7 @@ async fn test_writer_mixed_push_and_stream() -> VortexResult<()> { .unmasked_field_by_name("numbers")? .clone(); let expected = buffer![1u32, 2, 3, 4, 5, 6].into_array(); - assert_arrays_eq!(numbers.as_ref(), expected.as_ref()); + assert_arrays_eq!(numbers, expected); Ok(()) } diff --git a/vortex-file/src/v2/file_stats_reader.rs b/vortex-file/src/v2/file_stats_reader.rs index f8de172fea9..ab3fe42ffca 100644 --- a/vortex-file/src/v2/file_stats_reader.rs +++ b/vortex-file/src/v2/file_stats_reader.rs @@ -101,6 +101,7 @@ impl FileStatsLayoutReader { let result = pruning .execute::(&mut ctx)? .into_bool() + .into_array() .scalar_at(0)?; Ok(result.as_bool().value() == Some(true)) diff --git a/vortex-layout/public-api.lock b/vortex-layout/public-api.lock index 7db679cfec4..15e3e91cf4a 100644 --- a/vortex-layout/public-api.lock +++ b/vortex-layout/public-api.lock @@ -824,13 +824,13 @@ pub struct vortex_layout::layouts::zoned::zone_map::ZoneMap impl vortex_layout::layouts::zoned::zone_map::ZoneMap -pub fn vortex_layout::layouts::zoned::zone_map::ZoneMap::array(&self) -> &vortex_array::arrays::struct_::array::StructArray +pub fn vortex_layout::layouts::zoned::zone_map::ZoneMap::array(&self) -> &vortex_array::arrays::struct_::vtable::StructArray pub fn vortex_layout::layouts::zoned::zone_map::ZoneMap::dtype_for_stats_table(column_dtype: &vortex_array::dtype::DType, present_stats: &[vortex_array::expr::stats::Stat]) -> vortex_array::dtype::DType pub fn vortex_layout::layouts::zoned::zone_map::ZoneMap::get_stat(&self, stat: vortex_array::expr::stats::Stat) -> vortex_error::VortexResult> -pub unsafe fn vortex_layout::layouts::zoned::zone_map::ZoneMap::new_unchecked(array: vortex_array::arrays::struct_::array::StructArray, stats: alloc::sync::Arc<[vortex_array::expr::stats::Stat]>) -> Self +pub unsafe fn vortex_layout::layouts::zoned::zone_map::ZoneMap::new_unchecked(array: vortex_array::arrays::struct_::vtable::StructArray, stats: alloc::sync::Arc<[vortex_array::expr::stats::Stat]>) -> Self pub fn vortex_layout::layouts::zoned::zone_map::ZoneMap::present_stats(&self) -> &alloc::sync::Arc<[vortex_array::expr::stats::Stat]> @@ -838,7 +838,7 @@ pub fn vortex_layout::layouts::zoned::zone_map::ZoneMap::prune(&self, predicate: pub fn vortex_layout::layouts::zoned::zone_map::ZoneMap::to_stats_set(&self, stats: &[vortex_array::expr::stats::Stat], ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult -pub fn vortex_layout::layouts::zoned::zone_map::ZoneMap::try_new(column_dtype: vortex_array::dtype::DType, array: vortex_array::arrays::struct_::array::StructArray, stats: alloc::sync::Arc<[vortex_array::expr::stats::Stat]>) -> vortex_error::VortexResult +pub fn vortex_layout::layouts::zoned::zone_map::ZoneMap::try_new(column_dtype: vortex_array::dtype::DType, array: vortex_array::arrays::struct_::vtable::StructArray, stats: alloc::sync::Arc<[vortex_array::expr::stats::Stat]>) -> vortex_error::VortexResult impl core::clone::Clone for vortex_layout::layouts::zoned::zone_map::ZoneMap diff --git a/vortex-layout/src/display.rs b/vortex-layout/src/display.rs index 75d1b61d55e..c3c36a06de1 100644 --- a/vortex-layout/src/display.rs +++ b/vortex-layout/src/display.rs @@ -265,7 +265,7 @@ mod tests { .write_stream( ctx.clone(), segments.clone(), - array1.to_array_stream().sequenced(ptr1), + array1.into_array().to_array_stream().sequenced(ptr1), eof1, handle.clone(), ) @@ -288,7 +288,11 @@ mod tests { .write_stream( ctx.clone(), segments.clone(), - builder.finish().to_array_stream().sequenced(ptr2), + builder + .finish() + .into_array() + .to_array_stream() + .sequenced(ptr2), eof2, handle.clone(), ) @@ -348,7 +352,7 @@ vortex.struct, dtype: {numbers=i64?, strings=utf8}, children: 2, rows: 5 .write_stream( ctx.clone(), segments.clone(), - array1.to_array_stream().sequenced(ptr1), + array1.into_array().to_array_stream().sequenced(ptr1), eof1, handle.clone(), ) @@ -362,7 +366,7 @@ vortex.struct, dtype: {numbers=i64?, strings=utf8}, children: 2, rows: 5 .write_stream( ctx.clone(), segments.clone(), - array2.to_array_stream().sequenced(ptr2), + array2.into_array().to_array_stream().sequenced(ptr2), eof2, handle.clone(), ) @@ -407,7 +411,7 @@ vortex.chunked, dtype: i32, children: 2, rows: 10 .write_stream( ctx.clone(), segments.clone(), - array.to_array_stream().sequenced(ptr), + array.into_array().to_array_stream().sequenced(ptr), eof, handle, ) @@ -449,7 +453,7 @@ vortex.flat, dtype: i32?, segment 0, buffers=[20B], total=20B .write_stream( ctx, segments.clone(), - array.to_array_stream().sequenced(ptr), + array.into_array().to_array_stream().sequenced(ptr), eof, handle, ) diff --git a/vortex-layout/src/layouts/chunked/reader.rs b/vortex-layout/src/layouts/chunked/reader.rs index 6a0c63b6eb5..63e22e4a394 100644 --- a/vortex-layout/src/layouts/chunked/reader.rs +++ b/vortex-layout/src/layouts/chunked/reader.rs @@ -403,7 +403,7 @@ mod test { .unwrap(); let expected = buffer![1i32, 2, 3, 4, 5, 6, 7, 8, 9].into_array(); - assert_arrays_eq!(result.as_ref(), expected.as_ref()); + assert_arrays_eq!(result, expected); }) } } diff --git a/vortex-layout/src/layouts/flat/reader.rs b/vortex-layout/src/layouts/flat/reader.rs index 727566d3db8..b1c7c575fc0 100644 --- a/vortex-layout/src/layouts/flat/reader.rs +++ b/vortex-layout/src/layouts/flat/reader.rs @@ -348,7 +348,7 @@ mod test { .unwrap(); let expected = PrimitiveArray::new(buffer![3i32, 4], Validity::AllValid).into_array(); - assert_arrays_eq!(result.as_ref(), expected.as_ref()); + assert_arrays_eq!(result, expected); }) } } diff --git a/vortex-layout/src/layouts/flat/writer.rs b/vortex-layout/src/layouts/flat/writer.rs index 8f01669638e..a331fe19aad 100644 --- a/vortex-layout/src/layouts/flat/writer.rs +++ b/vortex-layout/src/layouts/flat/writer.rs @@ -250,7 +250,7 @@ mod tests { .write_stream( ctx, segments.clone(), - array.to_array_stream().sequenced(ptr), + array.into_array().to_array_stream().sequenced(ptr), eof, handle, ) @@ -299,7 +299,7 @@ mod tests { .write_stream( ctx, segments.clone(), - array.to_array_stream().sequenced(ptr), + array.into_array().to_array_stream().sequenced(ptr), eof, handle, ) @@ -366,7 +366,7 @@ mod tests { .write_stream( ctx, segments.clone(), - array.to_array_stream().sequenced(ptr), + array.into_array().to_array_stream().sequenced(ptr), eof, handle, ) @@ -434,7 +434,7 @@ mod tests { .write_stream( ctx, segments.clone(), - filter.to_array_stream().sequenced(ptr), + filter.into_array().to_array_stream().sequenced(ptr), eof, handle, ) @@ -476,7 +476,7 @@ mod tests { .write_stream( ctx, segments.clone(), - dict.to_array_stream().sequenced(ptr), + dict.into_array().to_array_stream().sequenced(ptr), eof, handle, ) diff --git a/vortex-layout/src/layouts/repartition.rs b/vortex-layout/src/layouts/repartition.rs index a022abd27cb..ee106303045 100644 --- a/vortex-layout/src/layouts/repartition.rs +++ b/vortex-layout/src/layouts/repartition.rs @@ -148,7 +148,7 @@ impl LayoutStrategy for RepartitionStrategy { if !chunked.is_empty() { yield ( sequence_pointer.advance(), - chunked.to_canonical()?.into_array(), + chunked.into_array().to_canonical()?.into_array(), ) } } @@ -161,7 +161,7 @@ impl LayoutStrategy for RepartitionStrategy { if !to_flush.is_empty() { yield ( sequence_pointer.advance(), - to_flush.to_canonical()?.into_array(), + to_flush.into_array().to_canonical()?.into_array(), ) } } diff --git a/vortex-layout/src/layouts/row_idx/mod.rs b/vortex-layout/src/layouts/row_idx/mod.rs index 8ce4a2f5f4b..c3c1138f4b5 100644 --- a/vortex-layout/src/layouts/row_idx/mod.rs +++ b/vortex-layout/src/layouts/row_idx/mod.rs @@ -36,6 +36,7 @@ use vortex_array::scalar::PValue; use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_mask::Mask; +use vortex_sequence::Sequence; use vortex_sequence::SequenceArray; use vortex_session::VortexSession; use vortex_utils::aliases::dash_map::DashMap; @@ -254,7 +255,7 @@ impl LayoutReader for RowIdxLayoutReader { // Returns a SequenceArray representing the row indices for the given row range, fn idx_array(row_offset: u64, row_range: &Range) -> SequenceArray { - SequenceArray::try_new( + Sequence::try_new( PValue::U64(row_offset + row_range.start), PValue::U64(1), PType::U64, diff --git a/vortex-layout/src/layouts/struct_/reader.rs b/vortex-layout/src/layouts/struct_/reader.rs index bb069df9723..16a3841f1d1 100644 --- a/vortex-layout/src/layouts/struct_/reader.rs +++ b/vortex-layout/src/layouts/struct_/reader.rs @@ -30,7 +30,6 @@ use vortex_array::expr::transform::replace; use vortex_array::expr::transform::replace_root_fields; use vortex_array::scalar_fn::fns::merge::Merge; use vortex_array::scalar_fn::fns::pack::Pack; -use vortex_array::vtable::ValidityHelper; use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_error::vortex_err; diff --git a/vortex-layout/src/layouts/zoned/reader.rs b/vortex-layout/src/layouts/zoned/reader.rs index b4c30610467..02bff672eeb 100644 --- a/vortex-layout/src/layouts/zoned/reader.rs +++ b/vortex-layout/src/layouts/zoned/reader.rs @@ -468,7 +468,7 @@ mod test { .unwrap(); let expected = buffer![1i32, 2, 3, 4, 5, 6, 7, 8, 9].into_array(); - assert_arrays_eq!(result.as_ref(), expected.as_ref()); + assert_arrays_eq!(result, expected); }) } diff --git a/vortex-layout/src/layouts/zoned/writer.rs b/vortex-layout/src/layouts/zoned/writer.rs index 1800532b1ee..f6850826339 100644 --- a/vortex-layout/src/layouts/zoned/writer.rs +++ b/vortex-layout/src/layouts/zoned/writer.rs @@ -7,6 +7,7 @@ use async_trait::async_trait; use futures::StreamExt as _; use parking_lot::Mutex; use vortex_array::ArrayContext; +use vortex_array::IntoArray; use vortex_array::expr::stats::Stat; use vortex_array::stats::PRUNING_STATS; use vortex_error::VortexResult; @@ -144,6 +145,8 @@ impl LayoutStrategy for ZonedStrategy { // the table depends on which stats were successfully computed. let stats_stream = stats_table .array() + .clone() + .into_array() .to_array_stream() .sequenced(eof.split_off()); let zones_layout = self diff --git a/vortex-python/src/arrays/native.rs b/vortex-python/src/arrays/native.rs index 34e7cae3594..1229507a0de 100644 --- a/vortex-python/src/arrays/native.rs +++ b/vortex-python/src/arrays/native.rs @@ -5,7 +5,6 @@ use std::ops::Deref; use pyo3::PyClass; use pyo3::prelude::*; -use vortex::array::ArrayAdapter; use vortex::array::ArrayRef; use vortex::array::DynArray; use vortex::array::arrays::Bool; @@ -250,15 +249,13 @@ pub trait AsArrayRef { fn as_array_ref(&self) -> &T; } -impl AsArrayRef<::Array> for PyRef<'_, V> { - fn as_array_ref(&self) -> &::Array { - let any = self.as_super().inner().as_any(); - // Try new Array path first, then fall back to legacy ArrayAdapter. - if let Some(typed) = any.downcast_ref::>() { - return typed.inner(); - } - any.downcast_ref::>() +impl AsArrayRef<::ArrayData> for PyRef<'_, V> { + fn as_array_ref(&self) -> &::ArrayData { + self.as_super() + .inner() + .as_any() + .downcast_ref::>() .vortex_expect("Failed to downcast array") - .as_inner() + .data() } } diff --git a/vortex-python/src/arrays/py/vtable.rs b/vortex-python/src/arrays/py/vtable.rs index 481293fab03..3e7b51856ea 100644 --- a/vortex-python/src/arrays/py/vtable.rs +++ b/vortex-python/src/arrays/py/vtable.rs @@ -15,7 +15,7 @@ use vortex::array::RawMetadata; use vortex::array::SerializeMetadata; use vortex::array::buffer::BufferHandle; use vortex::array::serde::ArrayChildren; -use vortex::array::stats::StatsSetRef; +use vortex::array::stats::ArrayStats; use vortex::array::validity::Validity; use vortex::array::vtable; use vortex::array::vtable::Array; @@ -42,13 +42,13 @@ pub struct PythonVTable { } impl VTable for PythonVTable { - type Array = PythonArray; + type ArrayData = PythonArray; type Metadata = RawMetadata; type OperationsVTable = Self; type ValidityVTable = Self; - fn vtable(array: &Self::Array) -> &Self { + fn vtable(array: &Self::ArrayData) -> &Self { &array.vtable } @@ -64,49 +64,49 @@ impl VTable for PythonVTable { &array.dtype } - fn stats(array: &PythonArray) -> StatsSetRef<'_> { - array.stats.to_ref(array.as_ref()) + fn stats(array: &PythonArray) -> &ArrayStats { + &array.stats } - fn array_hash(array: &PythonArray, state: &mut H, _precision: Precision) { + fn array_hash(array: &Array, state: &mut H, _precision: Precision) { Arc::as_ptr(&array.object).hash(state); array.vtable.id.hash(state); array.len.hash(state); array.dtype.hash(state); } - fn array_eq(array: &PythonArray, other: &PythonArray, _precision: Precision) -> bool { + fn array_eq(array: &Array, other: &Array, _precision: Precision) -> bool { Arc::ptr_eq(&array.object, &other.object) && array.vtable.id == other.vtable.id // TODO(ngates): in the future this check is already done && array.len == other.len && array.dtype == other.dtype } - fn nbuffers(_array: &PythonArray) -> usize { + fn nbuffers(_array: &Array) -> usize { 0 } - fn buffer(_array: &PythonArray, idx: usize) -> BufferHandle { + fn buffer(_array: &Array, idx: usize) -> BufferHandle { vortex_panic!("PythonArray buffer index {idx} out of bounds") } - fn buffer_name(_array: &PythonArray, _idx: usize) -> Option { + fn buffer_name(_array: &Array, _idx: usize) -> Option { None } - fn nchildren(_array: &PythonArray) -> usize { + fn nchildren(_array: &Array) -> usize { 0 } - fn child(_array: &PythonArray, idx: usize) -> ArrayRef { + fn child(_array: &Array, idx: usize) -> ArrayRef { vortex_panic!("PythonArray child index {idx} out of bounds") } - fn child_name(_array: &PythonArray, idx: usize) -> String { + fn child_name(_array: &Array, idx: usize) -> String { vortex_panic!("PythonArray child_name index {idx} out of bounds") } - fn metadata(array: &PythonArray) -> VortexResult { + fn metadata(array: &Array) -> VortexResult { Python::attach(|py| { let obj = array.object.bind(py); if !obj @@ -153,7 +153,7 @@ impl VTable for PythonVTable { todo!() } - fn with_children(_array: &mut Self::Array, children: Vec) -> VortexResult<()> { + fn with_children(_array: &mut Self::ArrayData, children: Vec) -> VortexResult<()> { vortex_ensure!( children.is_empty(), "PythonArray has no children, got {}", @@ -169,7 +169,7 @@ impl VTable for PythonVTable { impl OperationsVTable for PythonVTable { fn scalar_at( - _array: &PythonArray, + _array: &Array, _index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult { @@ -178,7 +178,7 @@ impl OperationsVTable for PythonVTable { } impl ValidityVTable for PythonVTable { - fn validity(_array: &PythonArray) -> VortexResult { + fn validity(_array: &Array) -> VortexResult { todo!() } } diff --git a/vortex-python/src/arrays/range_to_sequence.rs b/vortex-python/src/arrays/range_to_sequence.rs index 450d2fa65a3..cfd07168b8b 100644 --- a/vortex-python/src/arrays/range_to_sequence.rs +++ b/vortex-python/src/arrays/range_to_sequence.rs @@ -9,7 +9,7 @@ use vortex::buffer::Buffer; use vortex::dtype::DType; use vortex::dtype::NativePType; use vortex::dtype::Nullability; -use vortex::encodings::sequence::SequenceArray; +use vortex::encodings::sequence::Sequence; use vortex::error::VortexExpect; use vortex::error::VortexResult; use vortex::error::vortex_bail; @@ -43,7 +43,7 @@ pub fn sequence_array_from_range + Into> vortex_bail!("Step, {}, does not fit in requested dtype: {}", step, dtype); }; - Ok(SequenceArray::try_new_typed::(start, step, dtype.nullability(), len)?.into_array()) + Ok(Sequence::try_new_typed::(start, step, dtype.nullability(), len)?.into_array()) } fn range_len(start: isize, stop: isize, step: isize) -> Option { diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/list.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/list.rs index 81845bb2a86..30548704ad5 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/list.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/list.rs @@ -45,7 +45,7 @@ impl FlatLayoutFixture for ListFixture { )?; // List of strings: [["a","b"], ["hello"], [], ["x","y","z"]] - let str_elements = VarBinArray::from(vec!["a", "b", "hello", "x", "y", "z"]); + let str_elements = VarBinArray::from_strs(vec!["a", "b", "hello", "x", "y", "z"]); let str_offsets = PrimitiveArray::new(buffer![0i64, 2, 3, 3, 6], Validity::NonNullable); let str_list = ListArray::try_new( str_elements.into_array(), diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/listview.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/listview.rs index f65abdd6cc4..e20a7572d4b 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/listview.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/listview.rs @@ -47,7 +47,7 @@ impl FlatLayoutFixture for ListViewFixture { )?; // ListView of strings: [["a","b"], ["hello"], [], ["x","y","z"]] - let str_elements = VarBinArray::from(vec!["a", "b", "hello", "x", "y", "z"]); + let str_elements = VarBinArray::from_strs(vec!["a", "b", "hello", "x", "y", "z"]); let str_offsets = PrimitiveArray::new(buffer![0u32, 2, 3, 3], Validity::NonNullable); let str_sizes = PrimitiveArray::new(buffer![2u32, 1, 0, 3], Validity::NonNullable); let str_listview = ListViewArray::try_new( diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/struct_nested.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/struct_nested.rs index 546414a49fa..db80bbcf4df 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/struct_nested.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/struct_nested.rs @@ -35,7 +35,7 @@ impl FlatLayoutFixture for StructNestedFixture { FieldNames::from(["a", "b"]), vec![ PrimitiveArray::new(buffer![10i32, 20, 30], Validity::NonNullable).into_array(), - VarBinArray::from(vec!["x", "y", "z"]).into_array(), + VarBinArray::from_strs(vec!["x", "y", "z"]).into_array(), ], 3, Validity::NonNullable, diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/varbin.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/varbin.rs index ad4588ccc62..4ff469f366d 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/varbin.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/arrays/varbin.rs @@ -29,9 +29,9 @@ impl FlatLayoutFixture for VarBinFixture { } fn build(&self) -> VortexResult { - let strings = VarBinArray::from(vec!["", "hello", "こんにちは", "\u{1f980}"]); + let strings = VarBinArray::from_strs(vec!["", "hello", "こんにちは", "\u{1f980}"]); let nullable_strings = - VarBinArray::from(vec![Some("hello"), None, Some("world"), Some("")]); + VarBinArray::from_nullable_strs(vec![Some("hello"), None, Some("world"), Some("")]); let arr = StructArray::try_new( FieldNames::from(["text", "nullable_text"]), vec![strings.into_array(), nullable_strings.into_array()], diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/bytebool.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/bytebool.rs index 14838e13939..d57fbaffa4a 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/bytebool.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/bytebool.rs @@ -9,7 +9,6 @@ use vortex::array::dtype::FieldNames; use vortex::array::validity::Validity; use vortex::array::vtable::ArrayId; use vortex::encodings::bytebool::ByteBool; -use vortex::encodings::bytebool::ByteBoolArray; use vortex::error::VortexResult; use super::N; @@ -61,16 +60,16 @@ impl FlatLayoutFixture for ByteBoolFixture { "edge_nulls", ]), vec![ - ByteBoolArray::from_vec(alternating, Validity::NonNullable).into_array(), - ByteBoolArray::from_vec(mostly_true, Validity::NonNullable).into_array(), - ByteBoolArray::from_vec(mixed, Validity::NonNullable).into_array(), - ByteBoolArray::from_vec(nullable_vals, nullable_validity).into_array(), - ByteBoolArray::from_vec(all_false, Validity::NonNullable).into_array(), - ByteBoolArray::from_vec(all_true, Validity::NonNullable).into_array(), - ByteBoolArray::from_vec(all_null_vals, Validity::AllInvalid).into_array(), - ByteBoolArray::from_vec(single_flip, Validity::NonNullable).into_array(), - ByteBoolArray::from_vec(sparse_true, Validity::NonNullable).into_array(), - ByteBoolArray::from_vec(edge_null_vals, edge_null_validity).into_array(), + ByteBool::from_vec(alternating, Validity::NonNullable).into_array(), + ByteBool::from_vec(mostly_true, Validity::NonNullable).into_array(), + ByteBool::from_vec(mixed, Validity::NonNullable).into_array(), + ByteBool::from_vec(nullable_vals, nullable_validity).into_array(), + ByteBool::from_vec(all_false, Validity::NonNullable).into_array(), + ByteBool::from_vec(all_true, Validity::NonNullable).into_array(), + ByteBool::from_vec(all_null_vals, Validity::AllInvalid).into_array(), + ByteBool::from_vec(single_flip, Validity::NonNullable).into_array(), + ByteBool::from_vec(sparse_true, Validity::NonNullable).into_array(), + ByteBool::from_vec(edge_null_vals, edge_null_validity).into_array(), ], N, Validity::NonNullable, diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/datetimeparts.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/datetimeparts.rs index 4ef369badca..e8d1543300e 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/datetimeparts.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/datetimeparts.rs @@ -11,7 +11,6 @@ use vortex::array::extension::datetime::TimeUnit; use vortex::array::validity::Validity; use vortex::array::vtable::ArrayId; use vortex::encodings::datetime_parts::DateTimeParts; -use vortex::encodings::datetime_parts::DateTimePartsArray; use vortex::encodings::datetime_parts::split_temporal; use vortex::error::VortexResult; @@ -23,10 +22,7 @@ pub struct DateTimePartsFixture; fn encode_temporal(temporal: TemporalArray) -> VortexResult { let dtype = temporal.dtype().clone(); let parts = split_temporal(temporal)?; - Ok( - DateTimePartsArray::try_new(dtype, parts.days, parts.seconds, parts.subseconds)? - .into_array(), - ) + Ok(DateTimeParts::try_new(dtype, parts.days, parts.seconds, parts.subseconds)?.into_array()) } impl FlatLayoutFixture for DateTimePartsFixture { diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/decimal_byte_parts.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/decimal_byte_parts.rs index 1b0c9ded30c..7508ed13a2a 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/decimal_byte_parts.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/decimal_byte_parts.rs @@ -10,7 +10,6 @@ use vortex::array::dtype::FieldNames; use vortex::array::validity::Validity; use vortex::array::vtable::ArrayId; use vortex::encodings::decimal_byte_parts::DecimalByteParts; -use vortex::encodings::decimal_byte_parts::DecimalBytePartsArray; use vortex::error::VortexResult; use super::N; @@ -35,19 +34,19 @@ impl FlatLayoutFixture for DecimalBytePartsFixture { let decimal_dtype = DecimalDType::new(10, 2); let values: PrimitiveArray = (0..N as i64).map(|i| i * 100 + (i % 100)).collect(); let msp_arr = values.into_array(); - let decimal_arr = DecimalBytePartsArray::try_new(msp_arr, decimal_dtype)?; + let decimal_arr = DecimalByteParts::try_new(msp_arr, decimal_dtype)?; let hi_prec_dtype = DecimalDType::new(18, 6); let hi_prec_values: PrimitiveArray = (0..N as i64) .map(|i| i * 1_000_000 + (i * 7 % 999_999)) .collect(); let hi_prec_msp = hi_prec_values.into_array(); - let hi_prec_arr = DecimalBytePartsArray::try_new(hi_prec_msp, hi_prec_dtype)?; + let hi_prec_arr = DecimalByteParts::try_new(hi_prec_msp, hi_prec_dtype)?; let neg_dtype = DecimalDType::new(10, 2); let neg_values: PrimitiveArray = (0..N as i64).map(|i| -5000 + (i * 3 % 10000)).collect(); let neg_msp = neg_values.into_array(); - let neg_arr = DecimalBytePartsArray::try_new(neg_msp, neg_dtype)?; + let neg_arr = DecimalByteParts::try_new(neg_msp, neg_dtype)?; let nullable_dtype = DecimalDType::new(12, 4); let nullable_values = PrimitiveArray::from_option_iter((0..N as i64).map(|i| { if i % 11 == 0 { @@ -57,9 +56,9 @@ impl FlatLayoutFixture for DecimalBytePartsFixture { } })) .into_array(); - let nullable_arr = DecimalBytePartsArray::try_new(nullable_values, nullable_dtype)?; + let nullable_arr = DecimalByteParts::try_new(nullable_values, nullable_dtype)?; let zero_dtype = DecimalDType::new(10, 2); - let zero_arr = DecimalBytePartsArray::try_new( + let zero_arr = DecimalByteParts::try_new( std::iter::repeat_n(0i64, N) .collect::() .into_array(), @@ -67,18 +66,17 @@ impl FlatLayoutFixture for DecimalBytePartsFixture { )?; let crossing_dtype = DecimalDType::new(12, 3); let crossing_values: PrimitiveArray = (0..N as i64).map(|i| (i % 200) - 100).collect(); - let crossing_arr = - DecimalBytePartsArray::try_new(crossing_values.into_array(), crossing_dtype)?; + let crossing_arr = DecimalByteParts::try_new(crossing_values.into_array(), crossing_dtype)?; let trailing_zero_dtype = DecimalDType::new(18, 4); let trailing_zero_values: PrimitiveArray = (0..N as i64).map(|i| (i % 1000) * 10_000).collect(); let trailing_zero_arr = - DecimalBytePartsArray::try_new(trailing_zero_values.into_array(), trailing_zero_dtype)?; + DecimalByteParts::try_new(trailing_zero_values.into_array(), trailing_zero_dtype)?; let near_limit_dtype = DecimalDType::new(18, 0); let near_limit_values: PrimitiveArray = (0..N as i64).map(|i| 900_000_000_000_000_000 - i).collect(); let near_limit_arr = - DecimalBytePartsArray::try_new(near_limit_values.into_array(), near_limit_dtype)?; + DecimalByteParts::try_new(near_limit_values.into_array(), near_limit_dtype)?; let arr = StructArray::try_new( FieldNames::from([ diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/delta.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/delta.rs index 2c83df575ef..1f671ccff75 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/delta.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/delta.rs @@ -11,7 +11,6 @@ use vortex::array::dtype::FieldNames; use vortex::array::validity::Validity; use vortex::array::vtable::ArrayId; use vortex::encodings::fastlanes::Delta; -use vortex::encodings::fastlanes::DeltaArray; use vortex::error::VortexResult; use vortex_session::VortexSession; @@ -77,16 +76,16 @@ impl FlatLayoutFixture for DeltaFixture { "nullable_monotone", ]), vec![ - DeltaArray::try_from_primitive_array(&monotonic_u64, &mut ctx)?.into_array(), - DeltaArray::try_from_primitive_array(&constant_delta_u32, &mut ctx)?.into_array(), - DeltaArray::try_from_primitive_array(&large_stride_u64, &mut ctx)?.into_array(), - DeltaArray::try_from_primitive_array(&monotonic_u16, &mut ctx)?.into_array(), - DeltaArray::try_from_primitive_array(&monotonic_u8, &mut ctx)?.into_array(), - DeltaArray::try_from_primitive_array(&large_base_u64, &mut ctx)?.into_array(), - DeltaArray::try_from_primitive_array(&all_zero_deltas, &mut ctx)?.into_array(), - DeltaArray::try_from_primitive_array(&irregular_monotone, &mut ctx)?.into_array(), - DeltaArray::try_from_primitive_array(&near_overflow_base, &mut ctx)?.into_array(), - DeltaArray::try_from_primitive_array(&nullable_monotone, &mut ctx)?.into_array(), + Delta::try_from_primitive_array(&monotonic_u64, &mut ctx)?.into_array(), + Delta::try_from_primitive_array(&constant_delta_u32, &mut ctx)?.into_array(), + Delta::try_from_primitive_array(&large_stride_u64, &mut ctx)?.into_array(), + Delta::try_from_primitive_array(&monotonic_u16, &mut ctx)?.into_array(), + Delta::try_from_primitive_array(&monotonic_u8, &mut ctx)?.into_array(), + Delta::try_from_primitive_array(&large_base_u64, &mut ctx)?.into_array(), + Delta::try_from_primitive_array(&all_zero_deltas, &mut ctx)?.into_array(), + Delta::try_from_primitive_array(&irregular_monotone, &mut ctx)?.into_array(), + Delta::try_from_primitive_array(&near_overflow_base, &mut ctx)?.into_array(), + Delta::try_from_primitive_array(&nullable_monotone, &mut ctx)?.into_array(), ], N, Validity::NonNullable, diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/dict.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/dict.rs index 80cb794a418..ffbf3d99d19 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/dict.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/dict.rs @@ -34,24 +34,25 @@ impl FlatLayoutFixture for DictFixture { fn build(&self) -> VortexResult { let categories = ["red", "green", "blue", "yellow", "purple"]; let str_values: Vec<&str> = (0..N).map(|i| categories[i % categories.len()]).collect(); - let str_col = VarBinArray::from(str_values); + let str_col = VarBinArray::from_strs(str_values); let int_col: PrimitiveArray = (0..N as i32).map(|i| (i % 10) * 100).collect(); let nullable_values: Vec> = (0..N) .map(|i| (i % 7 != 0).then_some(categories[i % categories.len()])) .collect(); - let nullable_col = VarBinArray::from(nullable_values); + let nullable_col = VarBinArray::from_nullable_strs(nullable_values); let single_val: Vec<&str> = (0..N).map(|_| "only_value").collect(); - let single_col = VarBinArray::from(single_val); + let single_col = VarBinArray::from_strs(single_val); let bool_cat: Vec<&str> = (0..N) .map(|i| if i % 3 == 0 { "yes" } else { "no" }) .collect(); - let bool_cat_col = VarBinArray::from(bool_cat); - let all_null_col = VarBinArray::from((0..N).map(|_| None::<&str>).collect::>()); - let single_non_null_col = VarBinArray::from( + let bool_cat_col = VarBinArray::from_strs(bool_cat); + let all_null_col = + VarBinArray::from_nullable_strs((0..N).map(|_| None::<&str>).collect::>()); + let single_non_null_col = VarBinArray::from_nullable_strs( (0..N) .map(|i| (i == N / 2).then_some("lonely")) .collect::>(), @@ -60,27 +61,27 @@ impl FlatLayoutFixture for DictFixture { (0..N).map(|i| format!("u255-{}", i % 255)).collect(); let threshold_255_refs: Vec<&str> = threshold_255_values.iter().map(String::as_str).collect(); - let threshold_255_col = VarBinArray::from(threshold_255_refs); + let threshold_255_col = VarBinArray::from_strs(threshold_255_refs); let threshold_256_values: Vec = (0..N).map(|i| format!("u256-{}", i % 256)).collect(); let threshold_256_refs: Vec<&str> = threshold_256_values.iter().map(String::as_str).collect(); - let threshold_256_col = VarBinArray::from(threshold_256_refs); + let threshold_256_col = VarBinArray::from_strs(threshold_256_refs); let threshold_257_values: Vec = (0..N).map(|i| format!("u257-{}", i % 257)).collect(); let threshold_257_refs: Vec<&str> = threshold_257_values.iter().map(String::as_str).collect(); - let threshold_257_col = VarBinArray::from(threshold_257_refs); + let threshold_257_col = VarBinArray::from_strs(threshold_257_refs); let long_values: Vec = (0..N) .map(|i| format!("long-dict-value-{i:04}-{:08x}-suffix", i * 17)) .collect(); let long_refs: Vec<&str> = long_values.iter().map(String::as_str).collect(); - let long_col = VarBinArray::from(long_refs); + let long_col = VarBinArray::from_strs(long_refs); let insertion_values = ["late", "first", "middle", "early", "last"]; let insertion_ordered: Vec<&str> = (0..N) .map(|i| insertion_values[(i * 7 + 3) % insertion_values.len()]) .collect(); - let insertion_ordered_col = VarBinArray::from(insertion_ordered); + let insertion_ordered_col = VarBinArray::from_strs(insertion_ordered); let arr = StructArray::try_new( FieldNames::from([ diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/for_.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/for_.rs index 60054dc4948..995e906c6de 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/for_.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/for_.rs @@ -9,7 +9,6 @@ use vortex::array::dtype::FieldNames; use vortex::array::validity::Validity; use vortex::array::vtable::ArrayId; use vortex::encodings::fastlanes::FoR; -use vortex::encodings::fastlanes::FoRArray; use vortex::error::VortexResult; use super::N; @@ -69,16 +68,16 @@ impl FlatLayoutFixture for FoRFixture { "near_max_u64", ]), vec![ - FoRArray::encode(clustered_i32)?.into_array(), - FoRArray::encode(clustered_u64)?.into_array(), - FoRArray::encode(clustered_i64)?.into_array(), - FoRArray::encode(negative_i32)?.into_array(), - FoRArray::encode(nullable_i32)?.into_array(), - FoRArray::encode(clustered_i16)?.into_array(), - FoRArray::encode(constant_offsets)?.into_array(), - FoRArray::encode(zero_crossing_i32)?.into_array(), - FoRArray::encode(far_outlier_i64)?.into_array(), - FoRArray::encode(near_max_u64)?.into_array(), + FoR::encode(clustered_i32)?.into_array(), + FoR::encode(clustered_u64)?.into_array(), + FoR::encode(clustered_i64)?.into_array(), + FoR::encode(negative_i32)?.into_array(), + FoR::encode(nullable_i32)?.into_array(), + FoR::encode(clustered_i16)?.into_array(), + FoR::encode(constant_offsets)?.into_array(), + FoR::encode(zero_crossing_i32)?.into_array(), + FoR::encode(far_outlier_i64)?.into_array(), + FoR::encode(near_max_u64)?.into_array(), ], N, Validity::NonNullable, diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/fsst.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/fsst.rs index ad1706e629d..11c2c4505df 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/fsst.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/fsst.rs @@ -42,7 +42,7 @@ impl FlatLayoutFixture for FsstFixture { .map(|i| format!("{}{}", prefixes[i % prefixes.len()], i)) .collect(); let url_refs: Vec<&str> = urls.iter().map(|s| s.as_str()).collect(); - let url_col = VarBinArray::from(url_refs); + let url_col = VarBinArray::from_strs(url_refs); let severities = ["INFO", "WARN", "ERROR", "DEBUG"]; let components = ["auth", "db", "cache", "api"]; @@ -57,37 +57,37 @@ impl FlatLayoutFixture for FsstFixture { }) .collect(); let log_refs: Vec<&str> = logs.iter().map(|s| s.as_str()).collect(); - let log_col = VarBinArray::from(log_refs); + let log_col = VarBinArray::from_strs(log_refs); let nullable_urls: Vec> = (0..N) .map(|i| (i % 7 != 0).then(|| format!("{}{}", prefixes[i % prefixes.len()], i * 3))) .collect(); let nullable_refs: Vec> = nullable_urls.iter().map(|s| s.as_deref()).collect(); - let nullable_col = VarBinArray::from(nullable_refs); + let nullable_col = VarBinArray::from_nullable_strs(nullable_refs); let short_tokens = ["a", "bb", "ccc", "dd", "e"]; let short_strs: Vec<&str> = (0..N) .map(|i| short_tokens[i % short_tokens.len()]) .collect(); - let short_col = VarBinArray::from(short_strs); + let short_col = VarBinArray::from_strs(short_strs); let empty_and_unicode_values = ["", "こんにちは", "😀", "naive", "façade", "résumé", "مرحبا"]; let empty_and_unicode: Vec<&str> = (0..N) .map(|i| empty_and_unicode_values[i % empty_and_unicode_values.len()]) .collect(); - let empty_and_unicode_col = VarBinArray::from(empty_and_unicode); + let empty_and_unicode_col = VarBinArray::from_strs(empty_and_unicode); let suffix_shared_values: Vec = (0..N) .map(|i| format!("prefix-{:04}-common-suffix", i % 64)) .collect(); let suffix_shared_refs: Vec<&str> = suffix_shared_values.iter().map(String::as_str).collect(); - let suffix_shared_col = VarBinArray::from(suffix_shared_refs); + let suffix_shared_col = VarBinArray::from_strs(suffix_shared_refs); let high_entropy_values: Vec = (0..N) .map(|i| format!("{:016x}{:016x}", i.wrapping_mul(97), i.wrapping_mul(13_579))) .collect(); let high_entropy_refs: Vec<&str> = high_entropy_values.iter().map(String::as_str).collect(); - let high_entropy_col = VarBinArray::from(high_entropy_refs); - let all_null_clustered = VarBinArray::from( + let high_entropy_col = VarBinArray::from_strs(high_entropy_refs); + let all_null_clustered = VarBinArray::from_nullable_strs( (0..N) .map(|i| { if !(16..N - 16).contains(&i) { @@ -120,14 +120,45 @@ impl FlatLayoutFixture for FsstFixture { "all_null_clustered", ]), vec![ - fsst_compress(url_col, &url_comp).into_array(), - fsst_compress(log_col, &log_comp).into_array(), - fsst_compress(nullable_col, &nullable_comp).into_array(), - fsst_compress(short_col, &short_comp).into_array(), - fsst_compress(empty_and_unicode_col, &empty_and_unicode_comp).into_array(), - fsst_compress(suffix_shared_col, &suffix_shared_comp).into_array(), - fsst_compress(high_entropy_col, &high_entropy_comp).into_array(), - fsst_compress(all_null_clustered, &all_null_clustered_comp).into_array(), + fsst_compress(&url_col, url_col.len(), url_col.dtype(), &url_comp).into_array(), + fsst_compress(&log_col, log_col.len(), log_col.dtype(), &log_comp).into_array(), + fsst_compress( + &nullable_col, + nullable_col.len(), + nullable_col.dtype(), + &nullable_comp, + ) + .into_array(), + fsst_compress(&short_col, short_col.len(), short_col.dtype(), &short_comp) + .into_array(), + fsst_compress( + &empty_and_unicode_col, + empty_and_unicode_col.len(), + empty_and_unicode_col.dtype(), + &empty_and_unicode_comp, + ) + .into_array(), + fsst_compress( + &suffix_shared_col, + suffix_shared_col.len(), + suffix_shared_col.dtype(), + &suffix_shared_comp, + ) + .into_array(), + fsst_compress( + &high_entropy_col, + high_entropy_col.len(), + high_entropy_col.dtype(), + &high_entropy_comp, + ) + .into_array(), + fsst_compress( + &all_null_clustered, + all_null_clustered.len(), + all_null_clustered.dtype(), + &all_null_clustered_comp, + ) + .into_array(), ], N, Validity::NonNullable, diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/pco.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/pco.rs index 8a29c7dd161..d4d9fec3ef6 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/pco.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/pco.rs @@ -9,7 +9,6 @@ use vortex::array::dtype::FieldNames; use vortex::array::validity::Validity; use vortex::array::vtable::ArrayId; use vortex::encodings::pco::Pco; -use vortex::encodings::pco::PcoArray; use vortex::error::VortexResult; use super::N; @@ -70,14 +69,14 @@ impl FlatLayoutFixture for PcoFixture { "narrow_i16", ]), vec![ - PcoArray::from_primitive(&irregular_i64, 8, 0)?.into_array(), - PcoArray::from_primitive(&smooth_f64, 8, 0)?.into_array(), - PcoArray::from_primitive(&pattern_u32, 8, 0)?.into_array(), - PcoArray::from_primitive(&nullable_f32, 8, 0)?.into_array(), - PcoArray::from_primitive(&negative_i32, 8, 0)?.into_array(), - PcoArray::from_primitive(&constant_u16, 8, 0)?.into_array(), - PcoArray::from_primitive(&spike_outliers, 8, 0)?.into_array(), - PcoArray::from_primitive(&narrow_i16, 8, 0)?.into_array(), + Pco::from_primitive(&irregular_i64, 8, 0)?.into_array(), + Pco::from_primitive(&smooth_f64, 8, 0)?.into_array(), + Pco::from_primitive(&pattern_u32, 8, 0)?.into_array(), + Pco::from_primitive(&nullable_f32, 8, 0)?.into_array(), + Pco::from_primitive(&negative_i32, 8, 0)?.into_array(), + Pco::from_primitive(&constant_u16, 8, 0)?.into_array(), + Pco::from_primitive(&spike_outliers, 8, 0)?.into_array(), + Pco::from_primitive(&narrow_i16, 8, 0)?.into_array(), ], N, Validity::NonNullable, diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/rle.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/rle.rs index d635aea5d2b..71056ec1e7a 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/rle.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/rle.rs @@ -9,7 +9,6 @@ use vortex::array::dtype::FieldNames; use vortex::array::validity::Validity; use vortex::array::vtable::ArrayId; use vortex::encodings::fastlanes::RLE; -use vortex::encodings::fastlanes::RLEArray; use vortex::error::VortexResult; use super::N; @@ -69,14 +68,14 @@ impl FlatLayoutFixture for RleFixture { "short_runs_u8", ]), vec![ - RLEArray::encode(&runs_i32)?.into_array(), - RLEArray::encode(&single_run)?.into_array(), - RLEArray::encode(&nullable_runs)?.into_array(), - RLEArray::encode(&alternating_singletons)?.into_array(), - RLEArray::encode(&exact_boundary_runs)?.into_array(), - RLEArray::encode(&giant_final_run)?.into_array(), - RLEArray::encode(&all_null_i32)?.into_array(), - RLEArray::encode(&short_runs_u8)?.into_array(), + RLE::encode(&runs_i32)?.into_array(), + RLE::encode(&single_run)?.into_array(), + RLE::encode(&nullable_runs)?.into_array(), + RLE::encode(&alternating_singletons)?.into_array(), + RLE::encode(&exact_boundary_runs)?.into_array(), + RLE::encode(&giant_final_run)?.into_array(), + RLE::encode(&all_null_i32)?.into_array(), + RLE::encode(&short_runs_u8)?.into_array(), ], N, Validity::NonNullable, diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/runend.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/runend.rs index be74b072edf..793ef5be942 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/runend.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/runend.rs @@ -11,7 +11,6 @@ use vortex::array::dtype::FieldNames; use vortex::array::validity::Validity; use vortex::array::vtable::ArrayId; use vortex::encodings::runend::RunEnd; -use vortex::encodings::runend::RunEndArray; use vortex::encodings::runend::compress::runend_encode; use vortex::error::VortexResult; @@ -48,7 +47,7 @@ impl FlatLayoutFixture for RunEndFixture { } let run_prim: PrimitiveArray = values.into_iter().collect(); let (run_ends, run_values) = runend_encode(&run_prim); - let run_col = RunEndArray::try_new(run_ends.into_array(), run_values)?; + let run_col = RunEnd::try_new(run_ends.into_array(), run_values)?; let statuses = ["open", "closed", "pending", "cancelled"]; let mut status_values = Vec::new(); @@ -65,19 +64,19 @@ impl FlatLayoutFixture for RunEndFixture { remaining -= run_len; } let status_ends_prim: PrimitiveArray = status_ends.into_iter().collect(); - let status_col = RunEndArray::try_new( + let status_col = RunEnd::try_new( status_ends_prim.into_array(), - VarBinArray::from(status_values).into_array(), + VarBinArray::from_strs(status_values).into_array(), )?; let uniform_prim: PrimitiveArray = (0..N as i32).map(|i| i / 64).collect(); let (uniform_ends, uniform_values) = runend_encode(&uniform_prim); - let uniform_col = RunEndArray::try_new(uniform_ends.into_array(), uniform_values)?; + let uniform_col = RunEnd::try_new(uniform_ends.into_array(), uniform_values)?; let bool_ends: PrimitiveArray = (1..=N / 32).map(|i| (i * 32) as u16).collect(); let bool_values = BoolArray::from_iter((0..bool_ends.len()).map(|i| i % 2 == 0)).into_array(); - let bool_runs = RunEndArray::try_new(bool_ends.into_array(), bool_values)?; + let bool_runs = RunEnd::try_new(bool_ends.into_array(), bool_values)?; let nullable_run_values = PrimitiveArray::from_option_iter([ Some(10i32), None, @@ -86,18 +85,18 @@ impl FlatLayoutFixture for RunEndFixture { None, Some(0), ]); - let nullable_runs = RunEndArray::try_new( + let nullable_runs = RunEnd::try_new( PrimitiveArray::from_iter([16u16, 64, 128, 256, 512, N as u16]).into_array(), nullable_run_values.into_array(), )?; - let single_run = RunEndArray::try_new( + let single_run = RunEnd::try_new( PrimitiveArray::from_iter([N as u64]).into_array(), PrimitiveArray::from_iter([1234i64]).into_array(), )?; let singleton_values: PrimitiveArray = (0..N as i16).map(|i| i - 512).collect(); let singleton_ends: PrimitiveArray = (1..=N as u16).collect(); let alternating_singletons = - RunEndArray::try_new(singleton_ends.into_array(), singleton_values.into_array())?; + RunEnd::try_new(singleton_ends.into_array(), singleton_values.into_array())?; let arr = StructArray::try_new( FieldNames::from([ diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/sequence.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/sequence.rs index 493cb9d4365..9c04c466291 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/sequence.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/sequence.rs @@ -9,7 +9,6 @@ use vortex::array::dtype::Nullability; use vortex::array::validity::Validity; use vortex::array::vtable::ArrayId; use vortex::encodings::sequence::Sequence; -use vortex::encodings::sequence::SequenceArray; use vortex::error::VortexResult; use super::N; @@ -31,25 +30,19 @@ impl FlatLayoutFixture for SequenceFixture { } fn build(&self) -> VortexResult { - let row_ids = SequenceArray::try_new_typed::(0, 1, Nullability::NonNullable, N)?; - let stepped = SequenceArray::try_new_typed::(0, 5, Nullability::NonNullable, N)?; - let offset = SequenceArray::try_new_typed::(1000, 1, Nullability::NonNullable, N)?; - let decreasing = - SequenceArray::try_new_typed::(10000, -3, Nullability::NonNullable, N)?; - let large_step = SequenceArray::try_new_typed::(0, 1000, Nullability::NonNullable, N)?; - let zero_step = SequenceArray::try_new_typed::(7, 0, Nullability::NonNullable, N)?; - let zero_crossing = - SequenceArray::try_new_typed::(-512, 1, Nullability::NonNullable, N)?; - let near_overflow = SequenceArray::try_new_typed::( - u64::MAX - N as u64, - 1, - Nullability::NonNullable, - N, - )?; + let row_ids = Sequence::try_new_typed::(0, 1, Nullability::NonNullable, N)?; + let stepped = Sequence::try_new_typed::(0, 5, Nullability::NonNullable, N)?; + let offset = Sequence::try_new_typed::(1000, 1, Nullability::NonNullable, N)?; + let decreasing = Sequence::try_new_typed::(10000, -3, Nullability::NonNullable, N)?; + let large_step = Sequence::try_new_typed::(0, 1000, Nullability::NonNullable, N)?; + let zero_step = Sequence::try_new_typed::(7, 0, Nullability::NonNullable, N)?; + let zero_crossing = Sequence::try_new_typed::(-512, 1, Nullability::NonNullable, N)?; + let near_overflow = + Sequence::try_new_typed::(u64::MAX - N as u64, 1, Nullability::NonNullable, N)?; let small_negative_i16 = - SequenceArray::try_new_typed::(1200, -2, Nullability::NonNullable, N)?; - let nullable_i64 = SequenceArray::try_new_typed::(0, 2, Nullability::Nullable, N)?; - let nullable_u32 = SequenceArray::try_new_typed::(100, 7, Nullability::Nullable, N)?; + Sequence::try_new_typed::(1200, -2, Nullability::NonNullable, N)?; + let nullable_i64 = Sequence::try_new_typed::(0, 2, Nullability::Nullable, N)?; + let nullable_u32 = Sequence::try_new_typed::(100, 7, Nullability::Nullable, N)?; let arr = StructArray::try_new( FieldNames::from([ diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/sparse.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/sparse.rs index 360f15345ce..810ad769039 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/sparse.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/sparse.rs @@ -14,7 +14,6 @@ use vortex::array::scalar::Scalar; use vortex::array::validity::Validity; use vortex::array::vtable::ArrayId; use vortex::encodings::sparse::Sparse; -use vortex::encodings::sparse::SparseArray; use vortex::error::VortexResult; use super::N; @@ -43,7 +42,7 @@ impl FlatLayoutFixture for SparseFixture { let sparse_str: Vec> = (0..N) .map(|i| (i % 20 == 0).then_some("rare_value")) .collect(); - let sparse_str_col = VarBinArray::from(sparse_str); + let sparse_str_col = VarBinArray::from_nullable_strs(sparse_str); let sparse_bool_col = BoolArray::from_iter((0..N).map(|i| (i % 100 == 0).then_some(true))); @@ -89,22 +88,22 @@ impl FlatLayoutFixture for SparseFixture { "mixed_null_and_values", ]), vec![ - SparseArray::encode(&sparse_i64_col.into_array(), None)?, - SparseArray::encode(&sparse_str_col.into_array(), None)?, - SparseArray::encode(&sparse_bool_col.into_array(), None)?, - SparseArray::encode(&sparse_f64.into_array(), None)?, - SparseArray::encode(&sparse_boundary.into_array(), None)?, - SparseArray::encode( + Sparse::encode(&sparse_i64_col.into_array(), None)?, + Sparse::encode(&sparse_str_col.into_array(), None)?, + Sparse::encode(&sparse_bool_col.into_array(), None)?, + Sparse::encode(&sparse_f64.into_array(), None)?, + Sparse::encode(&sparse_boundary.into_array(), None)?, + Sparse::encode( &explicit_fill_values.into_array(), Some(Scalar::primitive(10i32, Nullability::Nullable)), )?, - SparseArray::encode(&all_default, Some(Scalar::from(10i32)))?, - SparseArray::encode(&clustered_edges.into_array(), None)?, - SparseArray::encode( + Sparse::encode(&all_default, Some(Scalar::from(10i32)))?, + Sparse::encode(&clustered_edges.into_array(), None)?, + Sparse::encode( &almost_dense.into_array(), Some(Scalar::primitive(0i32, Nullability::Nullable)), )?, - SparseArray::encode(&mixed_null_and_values.into_array(), Some(mixed_null_fill))?, + Sparse::encode(&mixed_null_and_values.into_array(), Some(mixed_null_fill))?, ], N, Validity::NonNullable, diff --git a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/zstd.rs b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/zstd.rs index 4546c9f6dbd..d3a222a6ea5 100644 --- a/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/zstd.rs +++ b/vortex-test/compat-gen/src/fixtures/arrays/synthetic/encodings/zstd.rs @@ -10,7 +10,6 @@ use vortex::array::dtype::FieldNames; use vortex::array::validity::Validity; use vortex::array::vtable::ArrayId; use vortex::encodings::zstd::Zstd; -use vortex::encodings::zstd::ZstdArray; use vortex::error::VortexResult; use super::N; @@ -87,14 +86,14 @@ impl FlatLayoutFixture for ZstdFixture { "pseudo_random", ]), vec![ - ZstdArray::from_primitive(&ints, 3, 128)?.into_array(), - ZstdArray::from_primitive(&floats, 3, 128)?.into_array(), - ZstdArray::from_primitive(&nullable_i64, 3, 128)?.into_array(), - ZstdArray::from_var_bin_view(&utf8, 3, 128)?.into_array(), - ZstdArray::from_var_bin_view(&nullable_utf8, 3, 128)?.into_array(), - ZstdArray::from_primitive(&all_zeros, 3, 128)?.into_array(), - ZstdArray::from_primitive(&all_null_i32, 3, 128)?.into_array(), - ZstdArray::from_primitive(&pseudo_random, 3, 128)?.into_array(), + Zstd::from_primitive(&ints, 3, 128)?.into_array(), + Zstd::from_primitive(&floats, 3, 128)?.into_array(), + Zstd::from_primitive(&nullable_i64, 3, 128)?.into_array(), + Zstd::from_var_bin_view(&utf8, 3, 128)?.into_array(), + Zstd::from_var_bin_view(&nullable_utf8, 3, 128)?.into_array(), + Zstd::from_primitive(&all_zeros, 3, 128)?.into_array(), + Zstd::from_primitive(&all_null_i32, 3, 128)?.into_array(), + Zstd::from_primitive(&pseudo_random, 3, 128)?.into_array(), ], N, Validity::NonNullable, diff --git a/vortex/benches/common_encoding_tree_throughput.rs b/vortex/benches/common_encoding_tree_throughput.rs index 4d88546d2df..79b1cf5a894 100644 --- a/vortex/benches/common_encoding_tree_throughput.rs +++ b/vortex/benches/common_encoding_tree_throughput.rs @@ -23,19 +23,19 @@ use vortex::array::arrays::TemporalArray; use vortex::array::arrays::VarBinArray; use vortex::array::arrays::VarBinViewArray; use vortex::array::builtins::ArrayBuiltins; -use vortex::array::vtable::ValidityHelper; use vortex::dtype::DType; use vortex::dtype::PType; +use vortex::encodings::alp::ALP; use vortex::encodings::alp::alp_encode; -use vortex::encodings::datetime_parts::DateTimePartsArray; +use vortex::encodings::datetime_parts::DateTimeParts; use vortex::encodings::datetime_parts::split_temporal; -use vortex::encodings::fastlanes::FoRArray; -use vortex::encodings::fsst::FSSTArray; +use vortex::encodings::fastlanes::BitPacked; +use vortex::encodings::fastlanes::FoR; +use vortex::encodings::fsst::FSST; use vortex::encodings::fsst::fsst_compress; use vortex::encodings::fsst::fsst_train_compressor; -use vortex::encodings::runend::RunEndArray; +use vortex::encodings::runend::RunEnd; use vortex::extension::datetime::TimeUnit; -use vortex_fastlanes::BitPackedArray; #[global_allocator] static GLOBAL: MiMalloc = MiMalloc; @@ -86,10 +86,10 @@ mod setup { /// Create FoR <- BitPacked encoding tree for u64 pub fn for_bp_u64() -> ArrayRef { let (uint_array, ..) = setup_primitive_arrays(); - let compressed = FoRArray::encode(uint_array).unwrap(); + let compressed = FoR::encode(uint_array).unwrap(); let inner = compressed.encoded(); - let bp = BitPackedArray::encode(inner, 8).unwrap(); - FoRArray::try_new(bp.into_array(), compressed.reference_scalar().clone()) + let bp = BitPacked::encode(inner, 8).unwrap(); + FoR::try_new(bp.into_array(), compressed.reference_scalar().clone()) .unwrap() .into_array() } @@ -100,13 +100,13 @@ mod setup { let alp_compressed = alp_encode(&float_array, None).unwrap(); // Manually construct ALP <- FoR <- BitPacked tree - let for_array = FoRArray::encode(alp_compressed.encoded().to_primitive()).unwrap(); + let for_array = FoR::encode(alp_compressed.encoded().to_primitive()).unwrap(); let inner = for_array.encoded(); - let bp = BitPackedArray::encode(inner, 8).unwrap(); + let bp = BitPacked::encode(inner, 8).unwrap(); let for_with_bp = - FoRArray::try_new(bp.into_array(), for_array.reference_scalar().clone()).unwrap(); + FoR::try_new(bp.into_array(), for_array.reference_scalar().clone()).unwrap(); - vortex::encodings::alp::ALPArray::try_new( + ALP::try_new( for_with_bp.into_array(), alp_compressed.exponents(), alp_compressed.patches().cloned(), @@ -137,7 +137,7 @@ mod setup { let codes_prim = PrimitiveArray::from_iter(codes); // Compress codes with BitPacked (6 bits should be enough for ~50 unique values) - let codes_bp = BitPackedArray::encode(&codes_prim.into_array(), 6) + let codes_bp = BitPacked::encode(&codes_prim.into_array(), 6) .unwrap() .into_array(); @@ -168,25 +168,25 @@ mod setup { } let prim_array = PrimitiveArray::from_iter(values); - let runend = RunEndArray::encode(prim_array.into_array()).unwrap(); + let runend = RunEnd::encode(prim_array.into_array()).unwrap(); // Compress the ends with FoR <- BitPacked let ends_prim = runend.ends().to_primitive(); - let ends_for = FoRArray::encode(ends_prim).unwrap(); + let ends_for = FoR::encode(ends_prim).unwrap(); let ends_inner = ends_for.encoded(); - let ends_bp = BitPackedArray::encode(ends_inner, 8).unwrap(); + let ends_bp = BitPacked::encode(ends_inner, 8).unwrap(); let compressed_ends = - FoRArray::try_new(ends_bp.into_array(), ends_for.reference_scalar().clone()) + FoR::try_new(ends_bp.into_array(), ends_for.reference_scalar().clone()) .unwrap() .into_array(); // Compress the values with BitPacked let values_prim = runend.values().to_primitive(); - let compressed_values = BitPackedArray::encode(&values_prim.into_array(), 8) + let compressed_values = BitPacked::encode(&values_prim.into_array(), 8) .unwrap() .into_array(); - RunEndArray::try_new(compressed_ends, compressed_values) + RunEnd::try_new(compressed_ends, compressed_values) .unwrap() .into_array() } @@ -209,7 +209,12 @@ mod setup { // Train and compress unique values with FSST let unique_varbinview = VarBinViewArray::from_iter_str(unique_strings); let fsst_compressor = fsst_train_compressor(&unique_varbinview); - let fsst_values = fsst_compress(&unique_varbinview, &fsst_compressor); + let fsst_values = fsst_compress( + &unique_varbinview, + unique_varbinview.len(), + unique_varbinview.dtype(), + &fsst_compressor, + ); // Create codes array (random indices into unique values) let codes: Vec = (0..NUM_VALUES) @@ -241,12 +246,17 @@ mod setup { // Train and compress unique values with FSST let unique_varbinview = VarBinViewArray::from_iter_str(unique_strings); let fsst_compressor = fsst_train_compressor(&unique_varbinview); - let fsst = fsst_compress(&unique_varbinview, &fsst_compressor); + let fsst = fsst_compress( + &unique_varbinview, + unique_varbinview.len(), + unique_varbinview.dtype(), + &fsst_compressor, + ); // Compress the VarBin offsets with BitPacked let codes = fsst.codes(); let offsets_prim = codes.offsets().to_primitive(); - let offsets_bp = BitPackedArray::encode(&offsets_prim.into_array(), 20).unwrap(); + let offsets_bp = BitPacked::encode(&offsets_prim.into_array(), 20).unwrap(); // Rebuild VarBin with compressed offsets let compressed_codes = VarBinArray::try_new( @@ -258,7 +268,7 @@ mod setup { .unwrap(); // Rebuild FSST with compressed codes - let compressed_fsst = FSSTArray::try_new( + let compressed_fsst = FSST::try_new( fsst.dtype().clone(), fsst.symbols().clone(), fsst.symbol_lengths().clone(), @@ -297,20 +307,20 @@ mod setup { // Compress days with FoR <- BitPacked let days_prim = parts.days.to_primitive(); - let days_for = FoRArray::encode(days_prim).unwrap(); + let days_for = FoR::encode(days_prim).unwrap(); let days_inner = days_for.encoded(); - let days_bp = BitPackedArray::encode(days_inner, 16).unwrap(); + let days_bp = BitPacked::encode(days_inner, 16).unwrap(); let compressed_days = - FoRArray::try_new(days_bp.into_array(), days_for.reference_scalar().clone()) + FoR::try_new(days_bp.into_array(), days_for.reference_scalar().clone()) .unwrap() .into_array(); // Compress seconds with FoR <- BitPacked let seconds_prim = parts.seconds.to_primitive(); - let seconds_for = FoRArray::encode(seconds_prim).unwrap(); + let seconds_for = FoR::encode(seconds_prim).unwrap(); let seconds_inner = seconds_for.encoded(); - let seconds_bp = BitPackedArray::encode(seconds_inner, 17).unwrap(); - let compressed_seconds = FoRArray::try_new( + let seconds_bp = BitPacked::encode(seconds_inner, 17).unwrap(); + let compressed_seconds = FoR::try_new( seconds_bp.into_array(), seconds_for.reference_scalar().clone(), ) @@ -319,17 +329,17 @@ mod setup { // Compress subseconds with FoR <- BitPacked let subseconds_prim = parts.subseconds.to_primitive(); - let subseconds_for = FoRArray::encode(subseconds_prim).unwrap(); + let subseconds_for = FoR::encode(subseconds_prim).unwrap(); let subseconds_inner = subseconds_for.encoded(); - let subseconds_bp = BitPackedArray::encode(subseconds_inner, 20).unwrap(); - let compressed_subseconds = FoRArray::try_new( + let subseconds_bp = BitPacked::encode(subseconds_inner, 20).unwrap(); + let compressed_subseconds = FoR::try_new( subseconds_bp.into_array(), subseconds_for.reference_scalar().clone(), ) .unwrap() .into_array(); - DateTimePartsArray::try_new( + DateTimeParts::try_new( DType::Extension(temporal_array.ext_dtype()), compressed_days, compressed_seconds, diff --git a/vortex/benches/single_encoding_throughput.rs b/vortex/benches/single_encoding_throughput.rs index 4776afa4a52..8e19d6e7f66 100644 --- a/vortex/benches/single_encoding_throughput.rs +++ b/vortex/benches/single_encoding_throughput.rs @@ -24,20 +24,23 @@ use vortex::array::builtins::ArrayBuiltins; use vortex::dtype::PType; use vortex::encodings::alp::RDEncoder; use vortex::encodings::alp::alp_encode; -use vortex::encodings::fastlanes::DeltaArray; -use vortex::encodings::fastlanes::FoRArray; +use vortex::encodings::fastlanes::DeltaData; +use vortex::encodings::fastlanes::FoR; use vortex::encodings::fastlanes::delta_compress; +use vortex::encodings::fsst::FSSTArray; use vortex::encodings::fsst::fsst_compress; use vortex::encodings::fsst::fsst_train_compressor; -use vortex::encodings::pco::PcoArray; -use vortex::encodings::runend::RunEndArray; +use vortex::encodings::pco::Pco; +use vortex::encodings::runend::RunEnd; use vortex::encodings::sequence::sequence_encode; use vortex::encodings::zigzag::zigzag_encode; -use vortex::encodings::zstd::ZstdArray; +use vortex::encodings::zstd::ZstdData; +use vortex_array::DynArray; use vortex_array::VortexSessionExecute; use vortex_array::dtype::Nullability; use vortex_array::session::ArraySession; -use vortex_sequence::SequenceArray; +use vortex_error::VortexExpect; +use vortex_sequence::Sequence; use vortex_session::VortexSession; #[global_allocator] @@ -118,7 +121,9 @@ fn bench_bitpacked_decompress_u32(bencher: Bencher) { let (uint_array, ..) = setup_primitive_arrays(); let bit_width = 8; - let compressed = bitpack_encode(&uint_array, bit_width, None).unwrap(); + let compressed = bitpack_encode(&uint_array, bit_width, None) + .unwrap() + .into_array(); with_byte_counter(bencher, NUM_VALUES * 4) .with_inputs(|| &compressed) @@ -131,13 +136,13 @@ fn bench_runend_compress_u32(bencher: Bencher) { with_byte_counter(bencher, NUM_VALUES * 4) .with_inputs(|| uint_array.clone()) - .bench_values(|a| RunEndArray::encode(a.into_array()).unwrap()); + .bench_values(|a| RunEnd::encode(a.into_array()).unwrap()); } #[divan::bench(name = "runend_decompress_u32")] fn bench_runend_decompress_u32(bencher: Bencher) { let (uint_array, ..) = setup_primitive_arrays(); - let compressed = RunEndArray::encode(uint_array.into_array()).unwrap(); + let compressed = RunEnd::encode(uint_array.into_array()).unwrap(); with_byte_counter(bencher, NUM_VALUES * 4) .with_inputs(|| &compressed) @@ -152,7 +157,7 @@ fn bench_delta_compress_u32(bencher: Bencher) { .with_inputs(|| &uint_array) .bench_refs(|a| { let (bases, deltas) = delta_compress(a, &mut SESSION.create_execution_ctx()).unwrap(); - DeltaArray::try_new(bases.into_array(), deltas.into_array(), 0, a.len()).unwrap() + DeltaData::try_new(bases.into_array(), deltas.into_array(), 0, a.len()).unwrap() }); } @@ -161,7 +166,9 @@ fn bench_delta_decompress_u32(bencher: Bencher) { let (uint_array, ..) = setup_primitive_arrays(); let (bases, deltas) = delta_compress(&uint_array, &mut SESSION.create_execution_ctx()).unwrap(); let compressed = - DeltaArray::try_new(bases.into_array(), deltas.into_array(), 0, uint_array.len()).unwrap(); + DeltaData::try_new(bases.into_array(), deltas.into_array(), 0, uint_array.len()) + .unwrap() + .into_array(); with_byte_counter(bencher, NUM_VALUES * 4) .with_inputs(|| &compressed) @@ -174,13 +181,13 @@ fn bench_for_compress_i32(bencher: Bencher) { with_byte_counter(bencher, NUM_VALUES * 4) .with_inputs(|| int_array.clone()) - .bench_values(|a| FoRArray::encode(a).unwrap()); + .bench_values(|a| FoR::encode(a).unwrap()); } #[divan::bench(name = "for_decompress_i32")] fn bench_for_decompress_i32(bencher: Bencher) { let (_, int_array, _) = setup_primitive_arrays(); - let compressed = FoRArray::encode(int_array).unwrap(); + let compressed = FoR::encode(int_array).unwrap(); with_byte_counter(bencher, NUM_VALUES * 4) .with_inputs(|| &compressed) @@ -218,7 +225,7 @@ fn bench_zigzag_compress_i32(bencher: Bencher) { #[divan::bench(name = "zigzag_decompress_i32")] fn bench_zigzag_decompress_i32(bencher: Bencher) { let (_, int_array, _) = setup_primitive_arrays(); - let compressed = zigzag_encode(int_array).unwrap(); + let compressed = zigzag_encode(int_array).unwrap().into_array(); with_byte_counter(bencher, NUM_VALUES * 4) .with_inputs(|| &compressed) @@ -238,10 +245,9 @@ fn bench_sequence_compress_u32(bencher: Bencher) { #[expect(clippy::cast_possible_truncation)] #[divan::bench(name = "sequence_decompress_u32")] fn bench_sequence_decompress_u32(bencher: Bencher) { - let compressed = - SequenceArray::try_new_typed(0, 1, Nullability::NonNullable, NUM_VALUES as usize) - .unwrap() - .into_array(); + let compressed = Sequence::try_new_typed(0, 1, Nullability::NonNullable, NUM_VALUES as usize) + .unwrap() + .into_array(); with_byte_counter(bencher, NUM_VALUES * 4) .with_inputs(|| &compressed) @@ -296,13 +302,13 @@ fn bench_pcodec_compress_f64(bencher: Bencher) { with_byte_counter(bencher, NUM_VALUES * 8) .with_inputs(|| &float_array) - .bench_refs(|a| PcoArray::from_primitive(a, 3, 0).unwrap()); + .bench_refs(|a| Pco::from_primitive(a, 3, 0).unwrap()); } #[divan::bench(name = "pcodec_decompress_f64")] fn bench_pcodec_decompress_f64(bencher: Bencher) { let (_, _, float_array) = setup_primitive_arrays(); - let compressed = PcoArray::from_primitive(&float_array, 3, 0).unwrap(); + let compressed = Pco::from_primitive(&float_array, 3, 0).unwrap(); with_byte_counter(bencher, NUM_VALUES * 8) .with_inputs(|| &compressed) @@ -317,14 +323,16 @@ fn bench_zstd_compress_u32(bencher: Bencher) { with_byte_counter(bencher, NUM_VALUES * 4) .with_inputs(|| array.clone()) - .bench_values(|a| ZstdArray::from_array(a, 3, 8192).unwrap()); + .bench_values(|a| ZstdData::from_array(a, 3, 8192).unwrap()); } #[cfg(feature = "zstd")] #[divan::bench(name = "zstd_decompress_u32")] fn bench_zstd_decompress_u32(bencher: Bencher) { let (uint_array, ..) = setup_primitive_arrays(); - let compressed = ZstdArray::from_array(uint_array.into_array(), 3, 8192).unwrap(); + let compressed = ZstdData::from_array(uint_array.into_array(), 3, 8192) + .unwrap() + .into_array(); with_byte_counter(bencher, NUM_VALUES * 4) .with_inputs(|| &compressed) @@ -364,7 +372,7 @@ fn bench_fsst_compress_string(bencher: Bencher) { with_byte_counter(bencher, nbytes) .with_inputs(|| &varbinview_arr) - .bench_refs(|a| fsst_compress(*a, &fsst_compressor)); + .bench_refs(|a| fsst_compress(*a, a.len(), a.dtype(), &fsst_compressor)); } #[divan::bench(name = "fsst_decompress_string")] @@ -372,7 +380,13 @@ fn bench_fsst_decompress_string(bencher: Bencher) { let varbinview_arr = VarBinViewArray::from_iter_str(gen_varbin_words(NUM_VALUES as usize, 0.00005)); let fsst_compressor = fsst_train_compressor(&varbinview_arr); - let fsst_array = fsst_compress(&varbinview_arr, &fsst_compressor); + let fsst_array = FSSTArray::try_from_data(fsst_compress( + &varbinview_arr, + varbinview_arr.len(), + varbinview_arr.dtype(), + &fsst_compressor, + )) + .vortex_expect("data is always valid"); let nbytes = varbinview_arr.into_array().nbytes() as u64; with_byte_counter(bencher, nbytes) @@ -390,7 +404,7 @@ fn bench_zstd_compress_string(bencher: Bencher) { with_byte_counter(bencher, nbytes) .with_inputs(|| array.clone()) - .bench_values(|a| ZstdArray::from_array(a, 3, 8192).unwrap()); + .bench_values(|a| ZstdData::from_array(a, 3, 8192).unwrap()); } #[cfg(feature = "zstd")] @@ -398,7 +412,9 @@ fn bench_zstd_compress_string(bencher: Bencher) { fn bench_zstd_decompress_string(bencher: Bencher) { let varbinview_arr = VarBinViewArray::from_iter_str(gen_varbin_words(NUM_VALUES as usize, 0.00005)); - let compressed = ZstdArray::from_array(varbinview_arr.clone().into_array(), 3, 8192).unwrap(); + let compressed = ZstdData::from_array(varbinview_arr.clone().into_array(), 3, 8192) + .unwrap() + .into_array(); let nbytes = varbinview_arr.into_array().nbytes() as u64; with_byte_counter(bencher, nbytes) diff --git a/vortex/examples/tracing_vortex.rs b/vortex/examples/tracing_vortex.rs index aa456a44f5f..379602b3442 100644 --- a/vortex/examples/tracing_vortex.rs +++ b/vortex/examples/tracing_vortex.rs @@ -393,7 +393,7 @@ async fn write_batch_to_vortex( ); write_opts - .write(&mut file, struct_array.to_array_stream()) + .write(&mut file, struct_array.into_array().to_array_stream()) .await?; println!( diff --git a/vortex/src/lib.rs b/vortex/src/lib.rs index a532fc1adad..093ca04fd8c 100644 --- a/vortex/src/lib.rs +++ b/vortex/src/lib.rs @@ -197,7 +197,6 @@ mod test { use vortex_array::expr::select; use vortex_array::stream::ArrayStreamExt; use vortex_array::validity::Validity; - use vortex_array::vtable::ValidityHelper; use vortex_buffer::buffer; use vortex_error::VortexResult; use vortex_file::OpenOptionsSessionExt; @@ -253,7 +252,7 @@ mod test { println!( "BtrBlocks size: {} / {}", compressed.nbytes(), - array.nbytes() + array.into_array().nbytes() ); // [compress] @@ -274,7 +273,7 @@ mod test { .write_options() .write( &mut tokio::fs::File::create(&path).await?, - array.to_array_stream(), + array.into_array().to_array_stream(), ) .await?; @@ -318,7 +317,7 @@ mod test { ) .write( &mut tokio::fs::File::create(&path).await?, - array.to_array_stream(), + array.clone().into_array().to_array_stream(), ) .await?; @@ -375,7 +374,7 @@ mod test { .write_options() .write( &mut tokio::fs::File::create(&path).await?, - array.to_array_stream(), + array.into_array().to_array_stream(), ) .await?;