Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions encodings/alp/src/alp/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use vortex_array::patches::PatchesMetadata;
use vortex_array::require_child;
use vortex_array::require_patches;
use vortex_array::serde::ArrayChildren;
use vortex_array::vtable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityChild;
use vortex_array::vtable::ValidityVTableFromChild;
Expand All @@ -44,7 +43,8 @@ use crate::alp::decompress::execute_decompress;
use crate::alp::rules::PARENT_KERNELS;
use crate::alp::rules::RULES;

vtable!(ALP, ALP, ALPData);
/// A [`ALP`]-encoded Vortex array.
pub type ALPArray = Array<ALP>;

impl ArrayHash for ALPData {
fn array_hash<H: Hasher>(&self, state: &mut H, _precision: Precision) {
Expand Down
4 changes: 2 additions & 2 deletions encodings/alp/src/alp_rd/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use vortex_array::require_child;
use vortex_array::require_patches;
use vortex_array::serde::ArrayChildren;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityChild;
use vortex_array::vtable::ValidityVTableFromChild;
Expand All @@ -48,7 +47,8 @@ use crate::alp_rd::kernel::PARENT_KERNELS;
use crate::alp_rd::rules::RULES;
use crate::alp_rd_decode;

vtable!(ALPRD, ALPRD, ALPRDData);
/// A [`ALPRD`]-encoded Vortex array.
pub type ALPRDArray = Array<ALPRD>;

#[derive(Clone, prost::Message)]
pub struct ALPRDMetadata {
Expand Down
4 changes: 2 additions & 2 deletions encodings/bytebool/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use vortex_array::dtype::DType;
use vortex_array::scalar::Scalar;
use vortex_array::serde::ArrayChildren;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::OperationsVTable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityVTable;
Expand All @@ -39,7 +38,8 @@ use vortex_session::VortexSession;

use crate::kernel::PARENT_KERNELS;

vtable!(ByteBool, ByteBool, ByteBoolData);
/// A [`ByteBool`]-encoded Vortex array.
pub type ByteBoolArray = Array<ByteBool>;

impl ArrayHash for ByteBoolData {
fn array_hash<H: Hasher>(&self, state: &mut H, precision: Precision) {
Expand Down
4 changes: 2 additions & 2 deletions encodings/datetime-parts/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use vortex_array::dtype::DType;
use vortex_array::dtype::Nullability;
use vortex_array::dtype::PType;
use vortex_array::serde::ArrayChildren;
use vortex_array::vtable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityChild;
use vortex_array::vtable::ValidityVTableFromChild;
Expand All @@ -41,7 +40,8 @@ use crate::compute::kernel::PARENT_KERNELS;
use crate::compute::rules::PARENT_RULES;
use crate::split_temporal;

vtable!(DateTimeParts, DateTimeParts, DateTimePartsData);
/// A [`DateTimeParts`]-encoded Vortex array.
pub type DateTimePartsArray = Array<DateTimeParts>;

impl ArrayHash for DateTimePartsData {
fn array_hash<H: Hasher>(&self, _state: &mut H, _precision: Precision) {}
Expand Down
4 changes: 2 additions & 2 deletions encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use vortex_array::scalar::DecimalValue;
use vortex_array::scalar::Scalar;
use vortex_array::scalar::ScalarValue;
use vortex_array::serde::ArrayChildren;
use vortex_array::vtable;
use vortex_array::vtable::OperationsVTable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityChild;
Expand All @@ -46,7 +45,8 @@ use vortex_session::VortexSession;
use crate::decimal_byte_parts::compute::kernel::PARENT_KERNELS;
use crate::decimal_byte_parts::rules::PARENT_RULES;

vtable!(DecimalByteParts, DecimalByteParts, DecimalBytePartsData);
/// A [`DecimalByteParts`]-encoded Vortex array.
pub type DecimalBytePartsArray = Array<DecimalByteParts>;

impl ArrayHash for DecimalBytePartsData {
fn array_hash<H: Hasher>(&self, _state: &mut H, _precision: Precision) {}
Expand Down
4 changes: 2 additions & 2 deletions encodings/fastlanes/src/bitpacking/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ use vortex_array::require_patches;
use vortex_array::require_validity;
use vortex_array::serde::ArrayChildren;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::child_to_validity;
use vortex_array::vtable::validity_to_child;
Expand Down Expand Up @@ -56,7 +55,8 @@ mod operations;
mod rules;
mod validity;

vtable!(BitPacked, BitPacked, BitPackedData);
/// A [`BitPacked`]-encoded Vortex array.
pub type BitPackedArray = Array<BitPacked>;

#[derive(Clone, prost::Message)]
pub struct BitPackedMetadata {
Expand Down
4 changes: 2 additions & 2 deletions encodings/fastlanes/src/delta/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ 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::vtable;
use vortex_array::vtable::VTable;
use vortex_error::VortexExpect;
use vortex_error::VortexResult;
Expand All @@ -45,7 +44,8 @@ mod rules;
mod slice;
mod validity;

vtable!(Delta, Delta, DeltaData);
/// A [`Delta`]-encoded Vortex array.
pub type DeltaArray = Array<Delta>;

#[derive(Clone, prost::Message)]
#[repr(C)]
Expand Down
4 changes: 2 additions & 2 deletions encodings/fastlanes/src/for/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use vortex_array::dtype::DType;
use vortex_array::scalar::Scalar;
use vortex_array::scalar::ScalarValue;
use vortex_array::serde::ArrayChildren;
use vortex_array::vtable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityVTableFromChild;
use vortex_error::VortexExpect;
Expand All @@ -45,7 +44,8 @@ mod rules;
mod slice;
mod validity;

vtable!(FoR, FoR, FoRData);
/// A [`FoR`]-encoded Vortex array.
pub type FoRArray = Array<FoR>;

impl ArrayHash for FoRData {
fn array_hash<H: Hasher>(&self, state: &mut H, _precision: Precision) {
Expand Down
4 changes: 2 additions & 2 deletions encodings/fastlanes/src/rle/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use vortex_array::dtype::DType;
use vortex_array::dtype::Nullability;
use vortex_array::dtype::PType;
use vortex_array::serde::ArrayChildren;
use vortex_array::vtable;
use vortex_array::vtable::VTable;
use vortex_error::VortexExpect;
use vortex_error::VortexResult;
Expand All @@ -43,7 +42,8 @@ mod operations;
mod rules;
mod validity;

vtable!(RLE, RLE, RLEData);
/// A [`RLE`]-encoded Vortex array.
pub type RLEArray = Array<RLE>;

#[derive(Clone, prost::Message)]
pub struct RLEMetadata {
Expand Down
4 changes: 2 additions & 2 deletions encodings/fsst/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ use vortex_array::dtype::Nullability;
use vortex_array::dtype::PType;
use vortex_array::serde::ArrayChildren;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityVTable;
use vortex_array::vtable::child_to_validity;
Expand All @@ -55,7 +54,8 @@ use crate::canonical::fsst_decode_views;
use crate::kernel::PARENT_KERNELS;
use crate::rules::RULES;

vtable!(FSST, FSST, FSSTData);
/// A [`FSST`]-encoded Vortex array.
pub type FSSTArray = Array<FSST>;

#[derive(Clone, prost::Message)]
pub struct FSSTMetadata {
Expand Down
4 changes: 2 additions & 2 deletions encodings/parquet-variant/src/vtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use vortex_array::dtype::DType;
use vortex_array::dtype::Nullability;
use vortex_array::serde::ArrayChildren;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::child_to_validity;
use vortex_array::vtable::validity_to_child;
Expand Down Expand Up @@ -63,7 +62,8 @@ struct ParquetVariantMetadataProto {
pub value_nullable: bool,
}

vtable!(ParquetVariant, ParquetVariant, ParquetVariantData);
/// A [`ParquetVariant`]-encoded Vortex array.
pub type ParquetVariantArray = Array<ParquetVariant>;

impl VTable for ParquetVariant {
type ArrayData = ParquetVariantData;
Expand Down
4 changes: 2 additions & 2 deletions encodings/pco/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ use vortex_array::dtype::half;
use vortex_array::scalar::Scalar;
use vortex_array::serde::ArrayChildren;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::OperationsVTable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityVTable;
Expand Down Expand Up @@ -79,7 +78,8 @@ use crate::PcoPageInfo;

const VALUES_PER_CHUNK: usize = pco::DEFAULT_MAX_PAGE_N;

vtable!(Pco, Pco, PcoData);
/// A [`Pco`]-encoded Vortex array.
pub type PcoArray = Array<Pco>;

impl ArrayHash for PcoData {
fn array_hash<H: Hasher>(&self, state: &mut H, precision: Precision) {
Expand Down
4 changes: 2 additions & 2 deletions encodings/runend/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ use vortex_array::search_sorted::SearchSorted;
use vortex_array::search_sorted::SearchSortedSide;
use vortex_array::serde::ArrayChildren;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityVTable;
use vortex_error::VortexExpect as _;
Expand All @@ -46,7 +45,8 @@ use crate::decompress_bool::runend_decode_bools;
use crate::kernel::PARENT_KERNELS;
use crate::rules::RULES;

vtable!(RunEnd, RunEnd, RunEndData);
/// A [`RunEnd`]-encoded Vortex array.
pub type RunEndArray = Array<RunEnd>;

#[derive(Clone, prost::Message)]
pub struct RunEndMetadata {
Expand Down
4 changes: 2 additions & 2 deletions encodings/sequence/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ use vortex_array::scalar::ScalarValue;
use vortex_array::serde::ArrayChildren;
use vortex_array::stats::StatsSet;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::OperationsVTable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityVTable;
Expand All @@ -49,7 +48,8 @@ use crate::compress::sequence_decompress;
use crate::kernel::PARENT_KERNELS;
use crate::rules::RULES;

vtable!(Sequence, Sequence, SequenceData);
/// A [`Sequence`]-encoded Vortex array.
pub type SequenceArray = Array<Sequence>;

#[derive(Clone, prost::Message)]
pub struct SequenceMetadata {
Expand Down
4 changes: 2 additions & 2 deletions encodings/sparse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ use vortex_array::scalar::ScalarValue;
use vortex_array::scalar_fn::fns::operators::Operator;
use vortex_array::serde::ArrayChildren;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityVTable;
use vortex_buffer::Buffer;
Expand All @@ -57,7 +56,8 @@ mod ops;
mod rules;
mod slice;

vtable!(Sparse, Sparse, SparseData);
/// A [`Sparse`]-encoded Vortex array.
pub type SparseArray = Array<Sparse>;

#[derive(Clone, prost::Message)]
#[repr(C)]
Expand Down
4 changes: 2 additions & 2 deletions encodings/zigzag/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use vortex_array::dtype::PType;
use vortex_array::match_each_unsigned_integer_ptype;
use vortex_array::scalar::Scalar;
use vortex_array::serde::ArrayChildren;
use vortex_array::vtable;
use vortex_array::vtable::OperationsVTable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityChild;
Expand All @@ -39,7 +38,8 @@ use crate::kernel::PARENT_KERNELS;
use crate::rules::RULES;
use crate::zigzag_decode;

vtable!(ZigZag, ZigZag, ZigZagData);
/// A [`ZigZag`]-encoded Vortex array.
pub type ZigZagArray = Array<ZigZag>;

impl VTable for ZigZag {
type ArrayData = ZigZagData;
Expand Down
4 changes: 2 additions & 2 deletions encodings/zstd/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use vortex_array::dtype::DType;
use vortex_array::scalar::Scalar;
use vortex_array::serde::ArrayChildren;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::OperationsVTable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityVTable;
Expand Down Expand Up @@ -80,7 +79,8 @@ type ViewLen = u32;
// We then insert these values to the correct position using a primitive array
// constructor.

vtable!(Zstd, Zstd, ZstdData);
/// A [`Zstd`]-encoded Vortex array.
pub type ZstdArray = Array<Zstd>;

impl ArrayHash for ZstdData {
fn array_hash<H: Hasher>(&self, state: &mut H, precision: Precision) {
Expand Down
4 changes: 2 additions & 2 deletions encodings/zstd/src/zstd_buffers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use vortex_array::dtype::DType;
use vortex_array::scalar::Scalar;
use vortex_array::serde::ArrayChildren;
use vortex_array::session::ArraySessionExt;
use vortex_array::vtable;
use vortex_array::vtable::OperationsVTable;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityVTable;
Expand All @@ -36,7 +35,8 @@ use vortex_session::VortexSession;

use crate::ZstdBuffersMetadata;

vtable!(ZstdBuffers, ZstdBuffers, ZstdBuffersData);
/// A [`ZstdBuffers`]-encoded Vortex array.
pub type ZstdBuffersArray = Array<ZstdBuffers>;

#[derive(Clone, Debug)]
pub struct ZstdBuffers;
Expand Down
2 changes: 0 additions & 2 deletions vortex-array/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20948,8 +20948,6 @@ pub macro vortex_array::require_patches!

pub macro vortex_array::require_validity!

pub macro vortex_array::vtable!

pub enum vortex_array::Canonical

pub vortex_array::Canonical::Bool(vortex_array::arrays::BoolArray)
Expand Down
36 changes: 0 additions & 36 deletions vortex-array/src/array/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,39 +290,3 @@ pub fn patches_child_name(idx: usize) -> &'static str {
_ => vortex_panic!("patches child name index {idx} out of bounds"),
}
}

/// vtable! macro — generates IntoArray, From, and type alias for array types.
///
/// 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<FooVT>`
#[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 [<$Base Array>] {
#[deprecated(note = "use `.into_array()` (owned) or `.clone().into_array()` (ref) to make clones explicit")]
pub fn to_array(&self) -> $crate::ArrayRef
where
Self: Clone + $crate::IntoArray,
{
use $crate::IntoArray;
self.clone().into_array()
}
}
}
};
// New form: Data is the inner struct, FooArray is a type alias for Array<VT>.
($Base:ident, $VT:ident, $Data:ident) => {
$crate::aliases::paste::paste! {
/// Type alias: `FooArray = Array<Foo>`.
pub type [<$Base Array>] = $crate::Array<$VT>;
}
};
}
4 changes: 2 additions & 2 deletions vortex-array/src/arrays/bool/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use crate::buffer::BufferHandle;
use crate::dtype::DType;
use crate::serde::ArrayChildren;
use crate::validity::Validity;
use crate::vtable;
mod canonical;
mod kernel;
mod operations;
Expand All @@ -38,7 +37,8 @@ use crate::arrays::bool::compute::rules::RULES;
use crate::hash::ArrayEq;
use crate::hash::ArrayHash;

vtable!(Bool, Bool, BoolData);
/// A [`Bool`]-encoded Vortex array.
pub type BoolArray = Array<Bool>;

#[derive(prost::Message)]
pub struct BoolMetadata {
Expand Down
Loading
Loading