Skip to content

Commit b1574cf

Browse files
authored
Merge branch 'develop' into scanner_property_addition
2 parents 3820507 + 8eedfe5 commit b1574cf

File tree

253 files changed

+2581
-1483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+2581
-1483
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bench-vortex/rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
imports_granularity = "Module"

encodings/alp/rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
imports_granularity = "Module"

encodings/alp/src/alp/array.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ use vortex_array::patches::{Patches, PatchesMetadata};
88
use vortex_array::serde::ArrayChildren;
99
use vortex_array::stats::{ArrayStats, StatsSetRef};
1010
use vortex_array::vtable::{
11-
ArrayVTable, CanonicalVTable, EncodeVTable, NotSupported, VTable, ValidityChild,
12-
ValidityVTableFromChild, VisitorVTable,
11+
ArrayId, ArrayVTable, ArrayVTableExt, BaseArrayVTable, CanonicalVTable, EncodeVTable,
12+
NotSupported, VTable, ValidityChild, ValidityVTableFromChild, VisitorVTable,
1313
};
1414
use vortex_array::{
1515
Array, ArrayBufferVisitor, ArrayChildVisitor, ArrayEq, ArrayHash, ArrayRef, Canonical,
16-
DeserializeMetadata, EncodingId, EncodingRef, Precision, ProstMetadata, SerializeMetadata,
17-
vtable,
16+
DeserializeMetadata, Precision, ProstMetadata, SerializeMetadata, vtable,
1817
};
1918
use vortex_buffer::ByteBuffer;
2019
use vortex_dtype::{DType, PType};
@@ -27,7 +26,7 @@ vtable!(ALP);
2726

2827
impl VTable for ALPVTable {
2928
type Array = ALPArray;
30-
type Encoding = ALPEncoding;
29+
3130
type Metadata = ProstMetadata<ALPMetadata>;
3231

3332
type ArrayVTable = Self;
@@ -39,12 +38,12 @@ impl VTable for ALPVTable {
3938
type EncodeVTable = Self;
4039
type OperatorVTable = NotSupported;
4140

42-
fn id(_encoding: &Self::Encoding) -> EncodingId {
43-
EncodingId::new_ref("vortex.alp")
41+
fn id(&self) -> ArrayId {
42+
ArrayId::new_ref("vortex.alp")
4443
}
4544

46-
fn encoding(_array: &Self::Array) -> EncodingRef {
47-
EncodingRef::new_ref(ALPEncoding.as_ref())
45+
fn encoding(_array: &Self::Array) -> ArrayVTable {
46+
ALPVTable.as_vtable()
4847
}
4948

5049
fn metadata(array: &ALPArray) -> VortexResult<Self::Metadata> {
@@ -70,7 +69,7 @@ impl VTable for ALPVTable {
7069
}
7170

7271
fn build(
73-
_encoding: &ALPEncoding,
72+
&self,
7473
dtype: &DType,
7574
len: usize,
7675
metadata: &Self::Metadata,
@@ -125,7 +124,7 @@ pub struct ALPArray {
125124
}
126125

127126
#[derive(Clone, Debug)]
128-
pub struct ALPEncoding;
127+
pub struct ALPVTable;
129128

130129
#[derive(Clone, prost::Message)]
131130
pub struct ALPMetadata {
@@ -334,7 +333,7 @@ impl ValidityChild<ALPVTable> for ALPVTable {
334333
}
335334
}
336335

337-
impl ArrayVTable<ALPVTable> for ALPVTable {
336+
impl BaseArrayVTable<ALPVTable> for ALPVTable {
338337
fn len(array: &ALPArray) -> usize {
339338
array.encoded.len()
340339
}
@@ -370,7 +369,7 @@ impl CanonicalVTable<ALPVTable> for ALPVTable {
370369

371370
impl EncodeVTable<ALPVTable> for ALPVTable {
372371
fn encode(
373-
_encoding: &ALPEncoding,
372+
_vtable: &ALPVTable,
374373
canonical: &Canonical,
375374
like: Option<&ALPArray>,
376375
) -> VortexResult<Option<ALPArray>> {

encodings/alp/src/alp/compute/cast.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,18 @@ mod tests {
4848
use vortex_array::arrays::PrimitiveArray;
4949
use vortex_array::compute::cast;
5050
use vortex_array::compute::conformance::cast::test_cast_conformance;
51+
use vortex_array::vtable::ArrayVTableExt;
5152
use vortex_array::{IntoArray, assert_arrays_eq};
5253
use vortex_buffer::buffer;
5354
use vortex_dtype::{DType, Nullability, PType};
5455

55-
use crate::ALPEncoding;
56+
use crate::ALPVTable;
5657

5758
#[test]
5859
fn test_cast_alp_f32_to_f64() {
5960
let values = buffer![1.5f32, 2.5, 3.5, 4.5].into_array();
60-
let alp = ALPEncoding
61+
let alp = ALPVTable
62+
.as_vtable()
6163
.encode(&values.to_canonical(), None)
6264
.unwrap()
6365
.unwrap();
@@ -82,7 +84,8 @@ mod tests {
8284
#[test]
8385
fn test_cast_alp_to_int() {
8486
let values = buffer![1.0f32, 2.0, 3.0, 4.0].into_array();
85-
let alp = ALPEncoding
87+
let alp = ALPVTable
88+
.as_vtable()
8689
.encode(&values.to_canonical(), None)
8790
.unwrap()
8891
.unwrap();
@@ -108,7 +111,8 @@ mod tests {
108111
#[case(buffer![42.42f64].into_array())]
109112
#[case(buffer![0.0f32, -1.5, 2.5, -3.5, 4.5].into_array())]
110113
fn test_cast_alp_conformance(#[case] array: vortex_array::ArrayRef) {
111-
let alp = ALPEncoding
114+
let alp = ALPVTable
115+
.as_vtable()
112116
.encode(&array.to_canonical(), None)
113117
.unwrap()
114118
.unwrap();

encodings/alp/src/alp/compute/filter.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ mod test {
3636
use rstest::rstest;
3737
use vortex_array::arrays::PrimitiveArray;
3838
use vortex_array::compute::conformance::filter::test_filter_conformance;
39+
use vortex_array::vtable::ArrayVTableExt;
3940
use vortex_array::{ArrayRef, IntoArray};
4041
use vortex_buffer::buffer;
4142

42-
use crate::ALPEncoding;
43+
use crate::ALPVTable;
4344

4445
#[rstest]
4546
#[case(buffer![1.23f32, 4.56, 7.89, 10.11, 12.13].into_array())]
@@ -51,7 +52,8 @@ mod test {
5152
11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0
5253
].into_array())]
5354
fn test_filter_alp_conformance(#[case] array: ArrayRef) {
54-
let alp = ALPEncoding
55+
let alp = ALPVTable
56+
.as_vtable()
5557
.encode(&array.to_canonical(), None)
5658
.unwrap()
5759
.unwrap();

encodings/alp/src/alp/compute/mask.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ mod test {
3636
use vortex_array::IntoArray;
3737
use vortex_array::arrays::PrimitiveArray;
3838
use vortex_array::compute::conformance::mask::test_mask_conformance;
39+
use vortex_array::vtable::ArrayVTableExt;
3940
use vortex_buffer::buffer;
4041

41-
use crate::ALPEncoding;
42+
use crate::ALPVTable;
4243

4344
#[rstest]
4445
#[case(buffer![10.5f32, 20.5, 30.5, 40.5, 50.5].into_array())]
@@ -50,7 +51,8 @@ mod test {
5051
1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0
5152
].into_array())]
5253
fn test_mask_alp_conformance(#[case] array: vortex_array::ArrayRef) {
53-
let alp = ALPEncoding
54+
let alp = ALPVTable
55+
.as_vtable()
5456
.encode(&array.to_canonical(), None)
5557
.unwrap()
5658
.unwrap();

encodings/alp/src/alp/compute/take.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,19 @@ mod test {
3535
use vortex_array::IntoArray;
3636
use vortex_array::arrays::PrimitiveArray;
3737
use vortex_array::compute::conformance::take::test_take_conformance;
38+
use vortex_array::vtable::ArrayVTableExt;
3839
use vortex_buffer::buffer;
3940

40-
use crate::ALPEncoding;
41+
use crate::ALPVTable;
4142

4243
#[rstest]
4344
#[case(buffer![1.23f32, 4.56, 7.89, 10.11, 12.13].into_array())]
4445
#[case(buffer![100.1f64, 200.2, 300.3, 400.4, 500.5].into_array())]
4546
#[case(PrimitiveArray::from_option_iter([Some(1.1f32), None, Some(2.2), Some(3.3), None]).into_array())]
4647
#[case(buffer![42.42f64].into_array())]
4748
fn test_take_alp_conformance(#[case] array: vortex_array::ArrayRef) {
48-
let alp = ALPEncoding
49+
let alp = ALPVTable
50+
.as_vtable()
4951
.encode(&array.to_canonical(), None)
5052
.unwrap()
5153
.unwrap();

encodings/alp/src/alp_rd/array.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ use vortex_array::serde::ArrayChildren;
1111
use vortex_array::stats::{ArrayStats, StatsSetRef};
1212
use vortex_array::validity::Validity;
1313
use vortex_array::vtable::{
14-
ArrayVTable, CanonicalVTable, EncodeVTable, NotSupported, VTable, ValidityChild,
15-
ValidityVTableFromChild, VisitorVTable,
14+
ArrayId, ArrayVTable, ArrayVTableExt, BaseArrayVTable, CanonicalVTable, EncodeVTable,
15+
NotSupported, VTable, ValidityChild, ValidityVTableFromChild, VisitorVTable,
1616
};
1717
use vortex_array::{
1818
Array, ArrayBufferVisitor, ArrayChildVisitor, ArrayEq, ArrayHash, ArrayRef, Canonical,
19-
DeserializeMetadata, EncodingId, EncodingRef, Precision, ProstMetadata, SerializeMetadata,
20-
ToCanonical, vtable,
19+
DeserializeMetadata, Precision, ProstMetadata, SerializeMetadata, ToCanonical, vtable,
2120
};
2221
use vortex_buffer::{Buffer, ByteBuffer};
2322
use vortex_dtype::{DType, Nullability, PType};
@@ -43,7 +42,7 @@ pub struct ALPRDMetadata {
4342

4443
impl VTable for ALPRDVTable {
4544
type Array = ALPRDArray;
46-
type Encoding = ALPRDEncoding;
45+
4746
type Metadata = ProstMetadata<ALPRDMetadata>;
4847

4948
type ArrayVTable = Self;
@@ -55,12 +54,12 @@ impl VTable for ALPRDVTable {
5554
type EncodeVTable = Self;
5655
type OperatorVTable = NotSupported;
5756

58-
fn id(_encoding: &Self::Encoding) -> EncodingId {
59-
EncodingId::new_ref("vortex.alprd")
57+
fn id(&self) -> ArrayId {
58+
ArrayId::new_ref("vortex.alprd")
6059
}
6160

62-
fn encoding(_array: &Self::Array) -> EncodingRef {
63-
EncodingRef::new_ref(ALPRDEncoding.as_ref())
61+
fn encoding(_array: &Self::Array) -> ArrayVTable {
62+
ALPRDVTable.as_vtable()
6463
}
6564

6665
fn metadata(array: &ALPRDArray) -> VortexResult<Self::Metadata> {
@@ -94,7 +93,7 @@ impl VTable for ALPRDVTable {
9493
}
9594

9695
fn build(
97-
_encoding: &ALPRDEncoding,
96+
&self,
9897
dtype: &DType,
9998
len: usize,
10099
metadata: &Self::Metadata,
@@ -176,7 +175,7 @@ pub struct ALPRDArray {
176175
}
177176

178177
#[derive(Clone, Debug)]
179-
pub struct ALPRDEncoding;
178+
pub struct ALPRDVTable;
180179

181180
impl ALPRDArray {
182181
/// Build a new `ALPRDArray` from components.
@@ -308,7 +307,7 @@ impl ValidityChild<ALPRDVTable> for ALPRDVTable {
308307
}
309308
}
310309

311-
impl ArrayVTable<ALPRDVTable> for ALPRDVTable {
310+
impl BaseArrayVTable<ALPRDVTable> for ALPRDVTable {
312311
fn len(array: &ALPRDArray) -> usize {
313312
array.left_parts.len()
314313
}
@@ -382,7 +381,7 @@ impl CanonicalVTable<ALPRDVTable> for ALPRDVTable {
382381

383382
impl EncodeVTable<ALPRDVTable> for ALPRDVTable {
384383
fn encode(
385-
_encoding: &ALPRDEncoding,
384+
_vtable: &ALPRDVTable,
386385
canonical: &Canonical,
387386
like: Option<&ALPRDArray>,
388387
) -> VortexResult<Option<ALPRDArray>> {

encodings/bytebool/rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
imports_granularity = "Module"

0 commit comments

Comments
 (0)