Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 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
4 changes: 2 additions & 2 deletions encodings/alp/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub struct vortex_alp::ALP

impl vortex_alp::ALP

pub const vortex_alp::ALP::ID: vortex_array::array::ArrayId
pub fn vortex_alp::ALP::array_id() -> vortex_array::array::ArrayId

impl vortex_alp::ALP

Expand Down Expand Up @@ -148,7 +148,7 @@ pub struct vortex_alp::ALPRD

impl vortex_alp::ALPRD

pub const vortex_alp::ALPRD::ID: vortex_array::array::ArrayId
pub fn vortex_alp::ALPRD::array_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

Expand Down
9 changes: 7 additions & 2 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,7 @@ impl VTable for ALP {
type ValidityVTable = ValidityVTableFromChild;

fn id(&self) -> ArrayId {
Self::ID
Self::array_id()
}

fn validate(
Expand Down Expand Up @@ -238,7 +239,11 @@ impl Display for ALPData {
pub struct ALP;

impl ALP {
pub const ID: ArrayId = ArrayId::new_ref("vortex.alp");
/// Returns the cached [`ArrayId`] for this encoding.
pub fn array_id() -> ArrayId {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we need the wrapping function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where else do we put the static either here or it global, (you cannot have in an impl block)

static ID: CachedId = CachedId::new("vortex.alp");
*ID
}
}

#[derive(Clone, prost::Message)]
Expand Down
2 changes: 1 addition & 1 deletion encodings/alp/src/alp/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ 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
ALP::array_id()
}

fn serialize(
Expand Down
9 changes: 7 additions & 2 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,7 @@ impl VTable for ALPRD {
type ValidityVTable = ValidityVTableFromChild;

fn id(&self) -> ArrayId {
Self::ID
Self::array_id()
}

fn validate(
Expand Down Expand Up @@ -357,7 +358,11 @@ pub struct ALPRDDataParts {
pub struct ALPRD;

impl ALPRD {
pub const ID: ArrayId = ArrayId::new_ref("vortex.alprd");
/// Returns the cached [`ArrayId`] for this encoding.
pub fn array_id() -> ArrayId {
static ID: CachedId = CachedId::new("vortex.alprd");
*ID
}

pub fn try_new(
dtype: DType,
Expand Down
2 changes: 1 addition & 1 deletion encodings/alp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub fn initialize(session: &VortexSession) {

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

impl vortex_bytebool::ByteBool

pub const vortex_bytebool::ByteBool::ID: vortex_array::array::ArrayId
pub fn vortex_bytebool::ByteBool::array_id() -> vortex_array::array::ArrayId

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

Expand Down
10 changes: 7 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,7 @@ impl VTable for ByteBool {
type ValidityVTable = Self;

fn id(&self) -> ArrayId {
Self::ID
Self::array_id()
}

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

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

/// Returns the cached [`ArrayId`] for this encoding.
pub fn array_id() -> ArrayId {
static ID: CachedId = CachedId::new("vortex.bytebool");
*ID
}
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: 1 addition & 1 deletion encodings/datetime-parts/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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::array_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>

Expand Down
9 changes: 7 additions & 2 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,7 @@ impl VTable for DateTimeParts {
type ValidityVTable = ValidityVTableFromChild;

fn id(&self) -> ArrayId {
Self::ID
Self::array_id()
}

fn validate(
Expand Down Expand Up @@ -250,7 +251,11 @@ impl<T: TypedArrayRef<DateTimeParts>> DateTimePartsArrayExt for T {}
pub struct DateTimeParts;

impl DateTimeParts {
pub const ID: ArrayId = ArrayId::new_ref("vortex.datetimeparts");
/// Returns the cached [`ArrayId`] for this encoding.
pub fn array_id() -> ArrayId {
static ID: CachedId = CachedId::new("vortex.datetimeparts");
*ID
}

/// Construct a new [`DateTimePartsArray`] from its components.
pub fn try_new(
Expand Down
2 changes: 1 addition & 1 deletion encodings/datetime-parts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn initialize(session: &VortexSession) {
session.arrays().register(DateTimeParts);

session.aggregate_fns().register_aggregate_kernel(
DateTimeParts::ID,
DateTimeParts::array_id(),
Some(IsConstant.id()),
&compute::is_constant::DateTimePartsIsConstantKernel,
);
Expand Down
2 changes: 1 addition & 1 deletion encodings/decimal-byte-parts/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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::array_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>

Expand Down
10 changes: 7 additions & 3 deletions encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,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::decimal_byte_parts::compute::kernel::PARENT_KERNELS;
use crate::decimal_byte_parts::rules::PARENT_RULES;
Expand Down Expand Up @@ -75,7 +76,7 @@ impl VTable for DecimalByteParts {
type ValidityVTable = ValidityVTableFromChild;

fn id(&self) -> ArrayId {
Self::ID
Self::array_id()
}

fn validate(
Expand Down Expand Up @@ -253,8 +254,11 @@ impl DecimalBytePartsData {
pub struct DecimalByteParts;

impl DecimalByteParts {
pub const ID: ArrayId = ArrayId::new_ref("vortex.decimal_byte_parts");

/// Returns the cached [`ArrayId`] for this encoding.
pub fn array_id() -> ArrayId {
static ID: CachedId = CachedId::new("vortex.decimal_byte_parts");
*ID
}
/// Construct a new [`DecimalBytePartsArray`] from an MSP array and decimal dtype.
pub fn try_new(
msp: ArrayRef,
Expand Down
2 changes: 1 addition & 1 deletion encodings/decimal-byte-parts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub fn initialize(session: &VortexSession) {
session.arrays().register(DecimalByteParts);

session.aggregate_fns().register_aggregate_kernel(
DecimalByteParts::ID,
DecimalByteParts::array_id(),
Some(IsConstant.id()),
&DecimalBytePartsIsConstantKernel,
);
Expand Down
Loading
Loading