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
41 changes: 26 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ itertools = "0.14.0"
jetscii = "0.5.3"
jiff = "0.2.0"
kanal = "0.1.1"
lasso = { version = "0.7", features = ["multi-threaded"] }
lending-iterator = "0.1.7"
libfuzzer-sys = "0.4"
libloading = "0.8"
Expand Down
6 changes: 0 additions & 6 deletions encodings/alp/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ pub struct vortex_alp::ALP

impl vortex_alp::ALP

pub const vortex_alp::ALP::ID: vortex_array::array::ArrayId

impl vortex_alp::ALP

pub fn vortex_alp::ALP::new(encoded: vortex_array::array::erased::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option<vortex_array::patches::Patches>) -> vortex_alp::ALPArray

pub unsafe fn vortex_alp::ALP::new_unchecked(encoded: vortex_array::array::erased::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option<vortex_array::patches::Patches>) -> vortex_alp::ALPArray
Expand Down Expand Up @@ -148,8 +144,6 @@ pub struct vortex_alp::ALPRD

impl vortex_alp::ALPRD

pub const vortex_alp::ALPRD::ID: vortex_array::array::ArrayId

pub unsafe fn vortex_alp::ALPRD::new_unchecked(dtype: vortex_array::dtype::DType, left_parts: vortex_array::array::erased::ArrayRef, left_parts_dictionary: vortex_buffer::buffer::Buffer<u16>, right_parts: vortex_array::array::erased::ArrayRef, right_bit_width: u8, left_parts_patches: core::option::Option<vortex_array::patches::Patches>) -> vortex_alp::ALPRDArray

pub fn vortex_alp::ALPRD::try_new(dtype: vortex_array::dtype::DType, left_parts: vortex_array::array::erased::ArrayRef, left_parts_dictionary: vortex_buffer::buffer::Buffer<u16>, right_parts: vortex_array::array::erased::ArrayRef, right_bit_width: u8, left_parts_patches: core::option::Option<vortex_array::patches::Patches>) -> vortex_error::VortexResult<vortex_alp::ALPRDArray>
Expand Down
8 changes: 3 additions & 5 deletions encodings/alp/src/alp/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use vortex_error::vortex_bail;
use vortex_error::vortex_ensure;
use vortex_error::vortex_panic;
use vortex_session::VortexSession;
use vortex_session::registry::CachedId;

use crate::ALPFloat;
use crate::alp::Exponents;
Expand Down Expand Up @@ -72,7 +73,8 @@ impl VTable for ALP {
type ValidityVTable = ValidityVTableFromChild;

fn id(&self) -> ArrayId {
Self::ID
static ID: CachedId = CachedId::new("vortex.alp");
*ID
}

fn validate(
Expand Down Expand Up @@ -237,10 +239,6 @@ impl Display for ALPData {
#[derive(Clone, Debug)]
pub struct ALP;

impl ALP {
pub const ID: ArrayId = ArrayId::new_ref("vortex.alp");
}

#[derive(Clone, prost::Message)]
pub struct ALPMetadata {
#[prost(uint32, tag = "1")]
Expand Down
16 changes: 10 additions & 6 deletions encodings/alp/src/alp/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
//!
//! This enables zero-cost backward compatibility with previously written datasets.

use vortex_array::Array;
use vortex_array::ArrayId;
use vortex_array::ArrayPlugin;
use vortex_array::ArrayRef;
use vortex_array::ArrayVTable;
use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::Patched;
Expand All @@ -32,7 +34,8 @@ impl ArrayPlugin for ALPPatchedPlugin {
fn id(&self) -> ArrayId {
// We reuse the existing `ALP` ID so that we can take over its
// deserialization pathway.
ALP::ID
// TODO(joe): dedup method name
ArrayVTable::id(&ALP)
}

fn serialize(
Expand All @@ -53,10 +56,10 @@ impl ArrayPlugin for ALPPatchedPlugin {
children: &dyn ArrayChildren,
session: &VortexSession,
) -> VortexResult<ArrayRef> {
let alp_array = ALP
.deserialize(dtype, len, metadata, buffers, children, session)?
.try_downcast::<ALP>()
.map_err(|_| vortex_err!("ALP plugin should only deserialize vortex.alp"))?;
let alp_array = Array::<ALP>::try_from_parts(ArrayVTable::deserialize(
&ALP, dtype, len, metadata, buffers, children, session,
)?)
.map_err(|_| vortex_err!("ALP plugin should only deserialize vortex.alp"))?;

// Check if there are interior patches to externalize.
let Some(patches) = alp_array.patches() else {
Expand All @@ -78,7 +81,8 @@ impl ArrayPlugin for ALPPatchedPlugin {
}

fn is_supported_encoding(&self, id: &ArrayId) -> bool {
id == &Patched.id() || id == &ALP.id()
// TODO(joe): dedup method name
id == ArrayVTable::id(&Patched) || id == ArrayVTable::id(&ALP)
}
}

Expand Down
6 changes: 3 additions & 3 deletions encodings/alp/src/alp_rd/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ use vortex_error::vortex_ensure;
use vortex_error::vortex_err;
use vortex_error::vortex_panic;
use vortex_session::VortexSession;
use vortex_session::registry::CachedId;

use crate::alp_rd::kernel::PARENT_KERNELS;
use crate::alp_rd::rules::RULES;
Expand Down Expand Up @@ -92,7 +93,8 @@ impl VTable for ALPRD {
type ValidityVTable = ValidityVTableFromChild;

fn id(&self) -> ArrayId {
Self::ID
static ID: CachedId = CachedId::new("vortex.alprd");
*ID
}

fn validate(
Expand Down Expand Up @@ -357,8 +359,6 @@ pub struct ALPRDDataParts {
pub struct ALPRD;

impl ALPRD {
pub const ID: ArrayId = ArrayId::new_ref("vortex.alprd");

pub fn try_new(
dtype: DType,
left_parts: ArrayRef,
Expand Down
3 changes: 2 additions & 1 deletion encodings/alp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

pub use alp::*;
pub use alp_rd::*;
use vortex_array::ArrayVTable;
use vortex_array::aggregate_fn::AggregateFnVTable;
use vortex_array::aggregate_fn::fns::nan_count::NanCount;
use vortex_array::aggregate_fn::session::AggregateFnSessionExt;
Expand All @@ -41,7 +42,7 @@ pub fn initialize(session: &VortexSession) {

// Register the ALP-specific NaN count aggregate kernel.
session.aggregate_fns().register_aggregate_kernel(
ALP::ID,
ALP.id(),
Some(NanCount.id()),
&compute::nan_count::ALPNanCountKernel,
);
Expand Down
2 changes: 0 additions & 2 deletions encodings/bytebool/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ pub struct vortex_bytebool::ByteBool

impl vortex_bytebool::ByteBool

pub const vortex_bytebool::ByteBool::ID: vortex_array::array::ArrayId

pub fn vortex_bytebool::ByteBool::from_option_vec(data: alloc::vec::Vec<core::option::Option<bool>>) -> vortex_bytebool::ByteBoolArray

pub fn vortex_bytebool::ByteBool::from_vec<V: core::convert::Into<vortex_array::validity::Validity>>(data: alloc::vec::Vec<bool>, validity: V) -> vortex_bytebool::ByteBoolArray
Expand Down
6 changes: 3 additions & 3 deletions encodings/bytebool/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use vortex_error::vortex_ensure;
use vortex_error::vortex_panic;
use vortex_mask::Mask;
use vortex_session::VortexSession;
use vortex_session::registry::CachedId;

use crate::kernel::PARENT_KERNELS;

Expand All @@ -62,7 +63,8 @@ impl VTable for ByteBool {
type ValidityVTable = Self;

fn id(&self) -> ArrayId {
Self::ID
static ID: CachedId = CachedId::new("vortex.bytebool");
*ID
}

fn validate(
Expand Down Expand Up @@ -200,8 +202,6 @@ impl<T: TypedArrayRef<ByteBool>> ByteBoolArrayExt for T {}
pub struct ByteBool;

impl ByteBool {
pub const ID: ArrayId = ArrayId::new_ref("vortex.bytebool");

pub fn new(buffer: BufferHandle, validity: Validity) -> ByteBoolArray {
let dtype = DType::Bool(validity.nullability());
let slots = ByteBoolData::make_slots(&validity, buffer.len());
Expand Down
2 changes: 0 additions & 2 deletions encodings/datetime-parts/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ pub struct vortex_datetime_parts::DateTimeParts

impl vortex_datetime_parts::DateTimeParts

pub const vortex_datetime_parts::DateTimeParts::ID: vortex_array::array::ArrayId

pub fn vortex_datetime_parts::DateTimeParts::try_from_temporal(temporal: vortex_array::arrays::datetime::TemporalArray) -> vortex_error::VortexResult<vortex_datetime_parts::DateTimePartsArray>

pub fn vortex_datetime_parts::DateTimeParts::try_new(dtype: vortex_array::dtype::DType, days: vortex_array::array::erased::ArrayRef, seconds: vortex_array::array::erased::ArrayRef, subseconds: vortex_array::array::erased::ArrayRef) -> vortex_error::VortexResult<vortex_datetime_parts::DateTimePartsArray>
Expand Down
6 changes: 3 additions & 3 deletions encodings/datetime-parts/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use vortex_error::vortex_ensure;
use vortex_error::vortex_err;
use vortex_error::vortex_panic;
use vortex_session::VortexSession;
use vortex_session::registry::CachedId;

use crate::TemporalParts;
use crate::canonical::decode_to_temporal;
Expand Down Expand Up @@ -92,7 +93,8 @@ impl VTable for DateTimeParts {
type ValidityVTable = ValidityVTableFromChild;

fn id(&self) -> ArrayId {
Self::ID
static ID: CachedId = CachedId::new("vortex.datetimeparts");
*ID
}

fn validate(
Expand Down Expand Up @@ -250,8 +252,6 @@ impl<T: TypedArrayRef<DateTimeParts>> DateTimePartsArrayExt for T {}
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,
Expand Down
3 changes: 2 additions & 1 deletion encodings/datetime-parts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mod compute;
mod ops;
mod timestamp;

use vortex_array::ArrayVTable;
use vortex_array::aggregate_fn::AggregateFnVTable;
use vortex_array::aggregate_fn::fns::is_constant::IsConstant;
use vortex_array::aggregate_fn::session::AggregateFnSessionExt;
Expand All @@ -22,7 +23,7 @@ pub fn initialize(session: &VortexSession) {
session.arrays().register(DateTimeParts);

session.aggregate_fns().register_aggregate_kernel(
DateTimeParts::ID,
DateTimeParts.id(),
Some(IsConstant.id()),
&compute::is_constant::DateTimePartsIsConstantKernel,
);
Expand Down
2 changes: 0 additions & 2 deletions encodings/decimal-byte-parts/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ pub struct vortex_decimal_byte_parts::DecimalByteParts

impl vortex_decimal_byte_parts::DecimalByteParts

pub const vortex_decimal_byte_parts::DecimalByteParts::ID: vortex_array::array::ArrayId

pub fn vortex_decimal_byte_parts::DecimalByteParts::try_new(msp: vortex_array::array::erased::ArrayRef, decimal_dtype: vortex_array::dtype::decimal::DecimalDType) -> vortex_error::VortexResult<vortex_decimal_byte_parts::DecimalBytePartsArray>

impl core::clone::Clone for vortex_decimal_byte_parts::DecimalByteParts
Expand Down
Loading
Loading