Skip to content
Open
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
6 changes: 6 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions encodings/alp/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ pub fn vortex_alp::ALP::nbuffers(_array: &vortex_alp::ALPArray) -> usize

pub fn vortex_alp::ALP::nchildren(array: &vortex_alp::ALPArray) -> usize

pub fn vortex_alp::ALP::plan_range_read(metadata: &vortex_array::metadata::ProstMetadata<vortex_alp::ALPMetadata>, row_range: core::ops::range::Range<usize>, row_count: usize, dtype: &vortex_array::dtype::DType) -> core::option::Option<vortex_array::vtable::range_read::EncodingRangeRead>

pub fn vortex_alp::ALP::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::ArrayRef>>

pub fn vortex_alp::ALP::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
Expand Down Expand Up @@ -246,6 +248,8 @@ pub fn vortex_alp::ALPRD::nbuffers(_array: &vortex_alp::ALPRDArray) -> usize

pub fn vortex_alp::ALPRD::nchildren(array: &vortex_alp::ALPRDArray) -> usize

pub fn vortex_alp::ALPRD::plan_range_read(metadata: &vortex_array::metadata::ProstMetadata<vortex_alp::ALPRDMetadata>, row_range: core::ops::range::Range<usize>, row_count: usize, dtype: &vortex_array::dtype::DType) -> core::option::Option<vortex_array::vtable::range_read::EncodingRangeRead>

pub fn vortex_alp::ALPRD::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::ArrayRef>>

pub fn vortex_alp::ALPRD::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
Expand Down
36 changes: 36 additions & 0 deletions encodings/alp/src/alp/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use std::fmt::Debug;
use std::hash::Hash;
use std::ops::Range;

use vortex_array::ArrayEq;
use vortex_array::ArrayHash;
Expand All @@ -25,6 +26,9 @@ use vortex_array::stats::ArrayStats;
use vortex_array::stats::StatsSetRef;
use vortex_array::vtable;
use vortex_array::vtable::ArrayId;
use vortex_array::vtable::ChildRangeRead;
use vortex_array::vtable::EncodingRangeRead;
use vortex_array::vtable::RangeDecodeInfo;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityChild;
use vortex_array::vtable::ValidityVTableFromChild;
Expand Down Expand Up @@ -258,6 +262,38 @@ impl VTable for ALP {
) -> VortexResult<Option<ArrayRef>> {
PARENT_KERNELS.execute(array, parent, child_idx, ctx)
}

fn plan_range_read(
metadata: &ProstMetadata<ALPMetadata>,
row_range: Range<usize>,
row_count: usize,
dtype: &DType,
) -> Option<EncodingRangeRead> {
// Patches cannot be safely sub-ranged (global indices).
if metadata.0.patches.is_some() {
return None;
}

// Child 0 = encoded values (f32→i32 or f64→i64).
let child_dtype = match dtype {
DType::Primitive(PType::F32, n) => DType::Primitive(PType::I32, *n),
DType::Primitive(PType::F64, n) => DType::Primitive(PType::I64, *n),
_ => return None,
};

Some(EncodingRangeRead {
buffer_sub_ranges: vec![],
children: vec![ChildRangeRead::Recurse {
row_range,
row_count,
dtype: child_dtype,
}],
decode_info: RangeDecodeInfo::FromChild {
child_idx: 0,
divisor: 1,
},
})
}
}

#[derive(Clone, Debug)]
Expand Down
51 changes: 51 additions & 0 deletions encodings/alp/src/alp_rd/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use std::fmt::Debug;
use std::hash::Hash;
use std::ops::Range;

use itertools::Itertools;
use vortex_array::ArrayEq;
Expand All @@ -29,6 +30,9 @@ use vortex_array::stats::StatsSetRef;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::ArrayId;
use vortex_array::vtable::ChildRangeRead;
use vortex_array::vtable::EncodingRangeRead;
use vortex_array::vtable::RangeDecodeInfo;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityChild;
use vortex_array::vtable::ValidityVTableFromChild;
Expand Down Expand Up @@ -354,6 +358,53 @@ impl VTable for ALPRD {
) -> VortexResult<Option<ArrayRef>> {
PARENT_KERNELS.execute(array, parent, child_idx, ctx)
}

fn plan_range_read(
metadata: &ProstMetadata<ALPRDMetadata>,
row_range: Range<usize>,
row_count: usize,
dtype: &DType,
) -> Option<EncodingRangeRead> {
// Patches cannot be safely sub-ranged (global indices).
if metadata.0.patches.is_some() {
return None;
}

let left_parts_ptype = PType::try_from(metadata.0.left_parts_ptype).ok()?;
let left_parts_dtype = DType::Primitive(left_parts_ptype, dtype.nullability());

let right_parts_dtype = match dtype {
DType::Primitive(PType::F32, _) => {
DType::Primitive(PType::U32, Nullability::NonNullable)
}
DType::Primitive(PType::F64, _) => {
DType::Primitive(PType::U64, Nullability::NonNullable)
}
_ => return None,
};

Some(EncodingRangeRead {
buffer_sub_ranges: vec![],
children: vec![
// Child 0 = left_parts.
ChildRangeRead::Recurse {
row_range: row_range.clone(),
row_count,
dtype: left_parts_dtype,
},
// Child 1 = right_parts.
ChildRangeRead::Recurse {
row_range,
row_count,
dtype: right_parts_dtype,
},
],
decode_info: RangeDecodeInfo::FromChild {
child_idx: 0,
divisor: 1,
},
})
}
}

#[derive(Clone, Debug)]
Expand Down
2 changes: 2 additions & 0 deletions encodings/bytebool/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ pub fn vortex_bytebool::ByteBool::nbuffers(_array: &vortex_bytebool::ByteBoolArr

pub fn vortex_bytebool::ByteBool::nchildren(array: &vortex_bytebool::ByteBoolArray) -> usize

pub fn vortex_bytebool::ByteBool::plan_range_read(_metadata: &vortex_array::metadata::EmptyMetadata, row_range: core::ops::range::Range<usize>, _row_count: usize, _dtype: &vortex_array::dtype::DType) -> core::option::Option<vortex_array::vtable::range_read::EncodingRangeRead>

pub fn vortex_bytebool::ByteBool::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::ArrayRef>>

pub fn vortex_bytebool::ByteBool::serialize(_metadata: Self::Metadata) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
Expand Down
21 changes: 21 additions & 0 deletions encodings/bytebool/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use std::fmt::Debug;
use std::hash::Hash;
use std::ops::Range;

use vortex_array::ArrayEq;
use vortex_array::ArrayHash;
Expand All @@ -22,7 +23,10 @@ use vortex_array::stats::StatsSetRef;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::ArrayId;
use vortex_array::vtable::BufferSubRange;
use vortex_array::vtable::EncodingRangeRead;
use vortex_array::vtable::OperationsVTable;
use vortex_array::vtable::RangeDecodeInfo;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityHelper;
use vortex_array::vtable::ValidityVTableFromValidityHelper;
Expand Down Expand Up @@ -199,6 +203,23 @@ impl VTable for ByteBool {
) -> VortexResult<Option<ArrayRef>> {
PARENT_KERNELS.execute(array, parent, child_idx, ctx)
}

fn plan_range_read(
_metadata: &EmptyMetadata,
row_range: Range<usize>,
_row_count: usize,
_dtype: &DType,
) -> Option<EncodingRangeRead> {
// 1 byte per boolean value
Some(EncodingRangeRead {
buffer_sub_ranges: vec![BufferSubRange::Range(row_range.start..row_range.end)],
children: vec![],
decode_info: RangeDecodeInfo::Leaf {
decode_len: row_range.len(),
post_slice: None,
},
})
}
}

#[derive(Clone, Debug)]
Expand Down
2 changes: 2 additions & 0 deletions encodings/datetime-parts/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ pub fn vortex_datetime_parts::DateTimeParts::nbuffers(_array: &vortex_datetime_p

pub fn vortex_datetime_parts::DateTimeParts::nchildren(_array: &vortex_datetime_parts::DateTimePartsArray) -> usize

pub fn vortex_datetime_parts::DateTimeParts::plan_range_read(metadata: &vortex_array::metadata::ProstMetadata<vortex_datetime_parts::DateTimePartsMetadata>, row_range: core::ops::range::Range<usize>, row_count: usize, dtype: &vortex_array::dtype::DType) -> core::option::Option<vortex_array::vtable::range_read::EncodingRangeRead>

pub fn vortex_datetime_parts::DateTimeParts::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::ArrayRef>>

pub fn vortex_datetime_parts::DateTimeParts::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
Expand Down
43 changes: 43 additions & 0 deletions encodings/datetime-parts/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use std::fmt::Debug;
use std::hash::Hash;
use std::ops::Range;

use vortex_array::ArrayEq;
use vortex_array::ArrayHash;
Expand All @@ -24,6 +25,9 @@ use vortex_array::stats::ArrayStats;
use vortex_array::stats::StatsSetRef;
use vortex_array::vtable;
use vortex_array::vtable::ArrayId;
use vortex_array::vtable::ChildRangeRead;
use vortex_array::vtable::EncodingRangeRead;
use vortex_array::vtable::RangeDecodeInfo;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityChild;
use vortex_array::vtable::ValidityVTableFromChild;
Expand Down Expand Up @@ -244,6 +248,45 @@ impl VTable for DateTimeParts {
) -> VortexResult<Option<ArrayRef>> {
PARENT_KERNELS.execute(array, parent, child_idx, ctx)
}

fn plan_range_read(
metadata: &ProstMetadata<DateTimePartsMetadata>,
row_range: Range<usize>,
row_count: usize,
dtype: &DType,
) -> Option<EncodingRangeRead> {
let days_ptype = metadata.0.get_days_ptype().ok()?;
let seconds_ptype = metadata.0.get_seconds_ptype().ok()?;
let subseconds_ptype = metadata.0.get_subseconds_ptype().ok()?;

Some(EncodingRangeRead {
buffer_sub_ranges: vec![],
children: vec![
// Child 0 = days (carries validity from parent dtype).
ChildRangeRead::Recurse {
row_range: row_range.clone(),
row_count,
dtype: DType::Primitive(days_ptype, dtype.nullability()),
},
// Child 1 = seconds (always non-nullable).
ChildRangeRead::Recurse {
row_range: row_range.clone(),
row_count,
dtype: DType::Primitive(seconds_ptype, Nullability::NonNullable),
},
// Child 2 = subseconds (always non-nullable).
ChildRangeRead::Recurse {
row_range,
row_count,
dtype: DType::Primitive(subseconds_ptype, Nullability::NonNullable),
},
],
decode_info: RangeDecodeInfo::FromChild {
child_idx: 0,
divisor: 1,
},
})
}
}

#[derive(Clone, Debug)]
Expand Down
2 changes: 2 additions & 0 deletions encodings/decimal-byte-parts/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ pub fn vortex_decimal_byte_parts::DecimalByteParts::nbuffers(_array: &vortex_dec

pub fn vortex_decimal_byte_parts::DecimalByteParts::nchildren(_array: &vortex_decimal_byte_parts::DecimalBytePartsArray) -> usize

pub fn vortex_decimal_byte_parts::DecimalByteParts::plan_range_read(metadata: &vortex_array::metadata::ProstMetadata<vortex_decimal_byte_parts::DecimalBytesPartsMetadata>, row_range: core::ops::range::Range<usize>, row_count: usize, dtype: &vortex_array::dtype::DType) -> core::option::Option<vortex_array::vtable::range_read::EncodingRangeRead>

pub fn vortex_decimal_byte_parts::DecimalByteParts::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::ArrayRef>>

pub fn vortex_decimal_byte_parts::DecimalByteParts::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
Expand Down
25 changes: 25 additions & 0 deletions encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mod rules;
mod slice;

use std::hash::Hash;
use std::ops::Range;

use prost::Message as _;
use vortex_array::ArrayEq;
Expand Down Expand Up @@ -33,7 +34,10 @@ use vortex_array::stats::ArrayStats;
use vortex_array::stats::StatsSetRef;
use vortex_array::vtable;
use vortex_array::vtable::ArrayId;
use vortex_array::vtable::ChildRangeRead;
use vortex_array::vtable::EncodingRangeRead;
use vortex_array::vtable::OperationsVTable;
use vortex_array::vtable::RangeDecodeInfo;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityChild;
use vortex_array::vtable::ValidityHelper;
Expand Down Expand Up @@ -202,6 +206,27 @@ impl VTable for DecimalByteParts {
) -> VortexResult<Option<ArrayRef>> {
PARENT_KERNELS.execute(array, parent, child_idx, ctx)
}

fn plan_range_read(
metadata: &ProstMetadata<DecimalBytesPartsMetadata>,
row_range: Range<usize>,
row_count: usize,
dtype: &DType,
) -> Option<EncodingRangeRead> {
let child_dtype = DType::Primitive(metadata.zeroth_child_ptype(), dtype.nullability());
Some(EncodingRangeRead {
buffer_sub_ranges: vec![],
children: vec![ChildRangeRead::Recurse {
row_range,
row_count,
dtype: child_dtype,
}],
decode_info: RangeDecodeInfo::FromChild {
child_idx: 0,
divisor: 1,
},
})
}
}

/// This array encodes decimals as between 1-4 columns of primitive typed children.
Expand Down
6 changes: 6 additions & 0 deletions encodings/fastlanes/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ pub fn vortex_fastlanes::BitPacked::nbuffers(_array: &vortex_fastlanes::BitPacke

pub fn vortex_fastlanes::BitPacked::nchildren(array: &vortex_fastlanes::BitPackedArray) -> usize

pub fn vortex_fastlanes::BitPacked::plan_range_read(metadata: &vortex_array::metadata::ProstMetadata<vortex_fastlanes::bitpacking::vtable::BitPackedMetadata>, row_range: core::ops::range::Range<usize>, _row_count: usize, _dtype: &vortex_array::dtype::DType) -> core::option::Option<vortex_array::vtable::range_read::EncodingRangeRead>

pub fn vortex_fastlanes::BitPacked::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::ArrayRef>>

pub fn vortex_fastlanes::BitPacked::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
Expand Down Expand Up @@ -332,6 +334,8 @@ pub fn vortex_fastlanes::Delta::nbuffers(_array: &vortex_fastlanes::DeltaArray)

pub fn vortex_fastlanes::Delta::nchildren(_array: &vortex_fastlanes::DeltaArray) -> usize

pub fn vortex_fastlanes::Delta::plan_range_read(metadata: &vortex_array::metadata::ProstMetadata<vortex_fastlanes::delta::vtable::DeltaMetadata>, row_range: core::ops::range::Range<usize>, _row_count: usize, dtype: &vortex_array::dtype::DType) -> core::option::Option<vortex_array::vtable::range_read::EncodingRangeRead>

pub fn vortex_fastlanes::Delta::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::ArrayRef>>

pub fn vortex_fastlanes::Delta::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
Expand Down Expand Up @@ -484,6 +488,8 @@ pub fn vortex_fastlanes::FoR::nbuffers(_array: &vortex_fastlanes::FoRArray) -> u

pub fn vortex_fastlanes::FoR::nchildren(_array: &vortex_fastlanes::FoRArray) -> usize

pub fn vortex_fastlanes::FoR::plan_range_read(_metadata: &vortex_array::scalar::Scalar, row_range: core::ops::range::Range<usize>, row_count: usize, dtype: &vortex_array::dtype::DType) -> core::option::Option<vortex_array::vtable::range_read::EncodingRangeRead>

pub fn vortex_fastlanes::FoR::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::ArrayRef>>

pub fn vortex_fastlanes::FoR::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
Expand Down
Loading
Loading