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
2 changes: 2 additions & 0 deletions Cargo.lock

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

15 changes: 6 additions & 9 deletions encodings/alp/src/alp/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ use vortex_array::stats::ArrayStats;
use vortex_array::stats::StatsSetRef;
use vortex_array::vtable;
use vortex_array::vtable::ArrayId;
use vortex_array::vtable::ArrayVTable;
use vortex_array::vtable::ArrayVTableExt;
use vortex_array::vtable::BaseArrayVTable;
use vortex_array::vtable::NotSupported;
use vortex_array::vtable::VTable;
Expand Down Expand Up @@ -60,12 +58,8 @@ impl VTable for ALPVTable {
type VisitorVTable = Self;
type ComputeVTable = NotSupported;

fn id(&self) -> ArrayId {
ArrayId::new_ref("vortex.alp")
}

fn encoding(_array: &Self::Array) -> ArrayVTable {
ALPVTable.as_vtable()
fn id(_array: &Self::Array) -> ArrayId {
Self::ID
}

fn metadata(array: &ALPArray) -> VortexResult<Self::Metadata> {
Expand All @@ -91,7 +85,6 @@ impl VTable for ALPVTable {
}

fn build(
&self,
dtype: &DType,
len: usize,
metadata: &Self::Metadata,
Expand Down Expand Up @@ -212,6 +205,10 @@ pub struct ALPArray {
#[derive(Debug)]
pub struct ALPVTable;

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

#[derive(Clone, prost::Message)]
pub struct ALPMetadata {
#[prost(uint32, tag = "1")]
Expand Down
15 changes: 6 additions & 9 deletions encodings/alp/src/alp_rd/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ use vortex_array::stats::StatsSetRef;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::ArrayId;
use vortex_array::vtable::ArrayVTable;
use vortex_array::vtable::ArrayVTableExt;
use vortex_array::vtable::BaseArrayVTable;
use vortex_array::vtable::NotSupported;
use vortex_array::vtable::VTable;
Expand Down Expand Up @@ -77,8 +75,8 @@ impl VTable for ALPRDVTable {
type VisitorVTable = Self;
type ComputeVTable = NotSupported;

fn id(&self) -> ArrayId {
ArrayId::new_ref("vortex.alprd")
fn id(_array: &Self::Array) -> ArrayId {
Self::ID
}

fn slice(array: &Self::Array, range: std::ops::Range<usize>) -> VortexResult<Option<ArrayRef>> {
Expand All @@ -100,10 +98,6 @@ impl VTable for ALPRDVTable {
}))
}

fn encoding(_array: &Self::Array) -> ArrayVTable {
ALPRDVTable.as_vtable()
}

fn metadata(array: &ALPRDArray) -> VortexResult<Self::Metadata> {
let dict = array
.left_parts_dictionary()
Expand Down Expand Up @@ -135,7 +129,6 @@ impl VTable for ALPRDVTable {
}

fn build(
&self,
dtype: &DType,
len: usize,
metadata: &Self::Metadata,
Expand Down Expand Up @@ -294,6 +287,10 @@ pub struct ALPRDArray {
#[derive(Debug)]
pub struct ALPRDVTable;

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

impl ALPRDArray {
/// Build a new `ALPRDArray` from components.
pub fn try_new(
Expand Down
15 changes: 6 additions & 9 deletions encodings/bytebool/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ use vortex_array::stats::StatsSetRef;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::ArrayId;
use vortex_array::vtable::ArrayVTable;
use vortex_array::vtable::ArrayVTableExt;
use vortex_array::vtable::BaseArrayVTable;
use vortex_array::vtable::NotSupported;
use vortex_array::vtable::OperationsVTable;
Expand Down Expand Up @@ -55,12 +53,8 @@ impl VTable for ByteBoolVTable {
type VisitorVTable = Self;
type ComputeVTable = NotSupported;

fn id(&self) -> ArrayId {
ArrayId::new_ref("vortex.bytebool")
}

fn encoding(_array: &Self::Array) -> ArrayVTable {
ByteBoolVTable.as_vtable()
fn id(_array: &Self::Array) -> ArrayId {
Self::ID
}

fn metadata(_array: &ByteBoolArray) -> VortexResult<Self::Metadata> {
Expand All @@ -76,7 +70,6 @@ impl VTable for ByteBoolVTable {
}

fn build(
&self,
dtype: &DType,
len: usize,
_metadata: &Self::Metadata,
Expand Down Expand Up @@ -147,6 +140,10 @@ pub struct ByteBoolArray {
#[derive(Debug)]
pub struct ByteBoolVTable;

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

impl ByteBoolArray {
pub fn new(buffer: ByteBuffer, validity: Validity) -> Self {
let length = buffer.len();
Expand Down
15 changes: 6 additions & 9 deletions encodings/datetime-parts/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ use vortex_array::stats::ArrayStats;
use vortex_array::stats::StatsSetRef;
use vortex_array::vtable;
use vortex_array::vtable::ArrayId;
use vortex_array::vtable::ArrayVTable;
use vortex_array::vtable::ArrayVTableExt;
use vortex_array::vtable::BaseArrayVTable;
use vortex_array::vtable::NotSupported;
use vortex_array::vtable::VTable;
Expand Down Expand Up @@ -87,12 +85,8 @@ impl VTable for DateTimePartsVTable {
type VisitorVTable = Self;
type ComputeVTable = NotSupported;

fn id(&self) -> ArrayId {
ArrayId::new_ref("vortex.datetimeparts")
}

fn encoding(_array: &Self::Array) -> ArrayVTable {
DateTimePartsVTable.as_vtable()
fn id(_array: &Self::Array) -> ArrayId {
Self::ID
}

fn metadata(array: &DateTimePartsArray) -> VortexResult<Self::Metadata> {
Expand All @@ -114,7 +108,6 @@ impl VTable for DateTimePartsVTable {
}

fn build(
&self,
dtype: &DType,
len: usize,
metadata: &Self::Metadata,
Expand Down Expand Up @@ -200,6 +193,10 @@ pub struct DateTimePartsArray {
#[derive(Debug)]
pub struct DateTimePartsVTable;

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

impl DateTimePartsArray {
pub fn try_new(
dtype: DType,
Expand Down
2 changes: 1 addition & 1 deletion encodings/datetime-parts/src/compute/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl ArrayParentReduceRule<DateTimePartsVTable> for DTPFilterPushDownRule {
type Parent = Exact<FilterVTable>;

fn parent(&self) -> Self::Parent {
Exact::from(&FilterVTable)
Exact::new()
}

fn reduce_parent(
Expand Down
15 changes: 6 additions & 9 deletions encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ use vortex_array::stats::ArrayStats;
use vortex_array::stats::StatsSetRef;
use vortex_array::vtable;
use vortex_array::vtable::ArrayId;
use vortex_array::vtable::ArrayVTable;
use vortex_array::vtable::ArrayVTableExt;
use vortex_array::vtable::BaseArrayVTable;
use vortex_array::vtable::NotSupported;
use vortex_array::vtable::OperationsVTable;
Expand Down Expand Up @@ -72,12 +70,8 @@ impl VTable for DecimalBytePartsVTable {
type VisitorVTable = Self;
type ComputeVTable = NotSupported;

fn id(&self) -> ArrayId {
ArrayId::new_ref("vortex.decimal_byte_parts")
}

fn encoding(_array: &Self::Array) -> ArrayVTable {
DecimalBytePartsVTable.as_vtable()
fn id(_array: &Self::Array) -> ArrayId {
Self::ID
}

fn metadata(array: &DecimalBytePartsArray) -> VortexResult<Self::Metadata> {
Expand All @@ -96,7 +90,6 @@ impl VTable for DecimalBytePartsVTable {
}

fn build(
&self,
dtype: &DType,
len: usize,
metadata: &Self::Metadata,
Expand Down Expand Up @@ -205,6 +198,10 @@ impl DecimalBytePartsArray {
#[derive(Debug)]
pub struct DecimalBytePartsVTable;

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

impl BaseArrayVTable<DecimalBytePartsVTable> for DecimalBytePartsVTable {
fn len(array: &DecimalBytePartsArray) -> usize {
array.msp.len()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl ArrayParentReduceRule<DecimalBytePartsVTable> for DecimalBytePartsFilterPus
type Parent = Exact<FilterVTable>;

fn parent(&self) -> Self::Parent {
Exact::from(&FilterVTable)
Exact::new()
}

fn reduce_parent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl ExecuteParentKernel<BitPackedVTable> for BitPackingFilterKernel {
type Parent = Exact<FilterVTable>;

fn parent(&self) -> Self::Parent {
Exact::from(&FilterVTable)
Exact::new()
}

// TODO(joe): impl execute without to_canonical and execute_parent without vector
Expand Down
15 changes: 6 additions & 9 deletions encodings/fastlanes/src/bitpacking/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ use vortex_array::serde::ArrayChildren;
use vortex_array::validity::Validity;
use vortex_array::vtable;
use vortex_array::vtable::ArrayId;
use vortex_array::vtable::ArrayVTable;
use vortex_array::vtable::ArrayVTableExt;
use vortex_array::vtable::NotSupported;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityHelper;
Expand Down Expand Up @@ -70,12 +68,8 @@ impl VTable for BitPackedVTable {
type VisitorVTable = Self;
type ComputeVTable = NotSupported;

fn id(&self) -> ArrayId {
ArrayId::new_ref("fastlanes.bitpacked")
}

fn encoding(_array: &Self::Array) -> ArrayVTable {
BitPackedVTable.as_vtable()
fn id(_array: &Self::Array) -> ArrayId {
Self::ID
}

fn with_children(array: &mut Self::Array, children: Vec<ArrayRef>) -> VortexResult<()> {
Expand Down Expand Up @@ -173,7 +167,6 @@ impl VTable for BitPackedVTable {
/// - No patches: `[validity?]`
/// - With patches: `[patch_indices, patch_values, chunk_offsets?, validity?]`
fn build(
&self,
dtype: &DType,
len: usize,
metadata: &Self::Metadata,
Expand Down Expand Up @@ -317,3 +310,7 @@ impl VTable for BitPackedVTable {

#[derive(Debug)]
pub struct BitPackedVTable;

impl BitPackedVTable {
pub const ID: ArrayId = ArrayId::new_ref("fastlanes.bitpacked");
}
15 changes: 6 additions & 9 deletions encodings/fastlanes/src/delta/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ use vortex_array::buffer::BufferHandle;
use vortex_array::serde::ArrayChildren;
use vortex_array::vtable;
use vortex_array::vtable::ArrayId;
use vortex_array::vtable::ArrayVTable;
use vortex_array::vtable::ArrayVTableExt;
use vortex_array::vtable::NotSupported;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityVTableFromChildSliceHelper;
Expand Down Expand Up @@ -57,12 +55,8 @@ impl VTable for DeltaVTable {
type VisitorVTable = Self;
type ComputeVTable = NotSupported;

fn id(&self) -> ArrayId {
ArrayId::new_ref("fastlanes.delta")
}

fn encoding(_array: &Self::Array) -> ArrayVTable {
DeltaVTable.as_vtable()
fn id(_array: &Self::Array) -> ArrayId {
Self::ID
}

fn slice(array: &Self::Array, range: Range<usize>) -> VortexResult<Option<ArrayRef>> {
Expand Down Expand Up @@ -124,7 +118,6 @@ impl VTable for DeltaVTable {
}

fn build(
&self,
dtype: &DType,
len: usize,
metadata: &Self::Metadata,
Expand Down Expand Up @@ -156,6 +149,10 @@ impl VTable for DeltaVTable {
#[derive(Debug)]
pub struct DeltaVTable;

impl DeltaVTable {
pub const ID: ArrayId = ArrayId::new_ref("fastlanes.delta");
}

#[cfg(test)]
mod tests {
use vortex_array::test_harness::check_metadata;
Expand Down
15 changes: 6 additions & 9 deletions encodings/fastlanes/src/for/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ use vortex_array::buffer::BufferHandle;
use vortex_array::serde::ArrayChildren;
use vortex_array::vtable;
use vortex_array::vtable::ArrayId;
use vortex_array::vtable::ArrayVTable;
use vortex_array::vtable::ArrayVTableExt;
use vortex_array::vtable::NotSupported;
use vortex_array::vtable::VTable;
use vortex_array::vtable::ValidityVTableFromChild;
Expand Down Expand Up @@ -50,12 +48,8 @@ impl VTable for FoRVTable {
type VisitorVTable = Self;
type ComputeVTable = NotSupported;

fn id(&self) -> ArrayId {
ArrayId::new_ref("fastlanes.for")
}

fn encoding(_array: &Self::Array) -> ArrayVTable {
FoRVTable.as_vtable()
fn id(_array: &Self::Array) -> ArrayId {
Self::ID
}

fn with_children(array: &mut Self::Array, children: Vec<ArrayRef>) -> VortexResult<()> {
Expand Down Expand Up @@ -88,7 +82,6 @@ impl VTable for FoRVTable {
}

fn build(
&self,
dtype: &DType,
len: usize,
metadata: &Self::Metadata,
Expand Down Expand Up @@ -135,6 +128,10 @@ impl VTable for FoRVTable {
#[derive(Debug)]
pub struct FoRVTable;

impl FoRVTable {
pub const ID: ArrayId = ArrayId::new_ref("fastlanes.for");
}

#[derive(Clone)]
pub struct ScalarValueMetadata(pub ScalarValue);

Expand Down
2 changes: 1 addition & 1 deletion encodings/fastlanes/src/for/vtable/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl ArrayParentReduceRule<FoRVTable> for FoRFilterPushDownRule {
type Parent = Exact<FilterVTable>;

fn parent(&self) -> Self::Parent {
Exact::from(&FilterVTable)
Exact::new()
}

fn reduce_parent(
Expand Down
Loading
Loading