Skip to content

Commit 6982389

Browse files
authored
Rename Array VTables (#6907)
We are about to move more functions onto the VTable struct. To make this API nicer for users we're renaming FooVTable to Foo. Since users don't really interact with these structs at the moment, it should have a relatively small blast radius. That said, anyone who has code like this should update it ```diff - if let Some(foo) = array.as_opt::<FooVTable>() { ... } + if let Some(foo) = array.as_opt::<Foo>() { ... } ``` Signed-off-by: Nicholas Gates <[email protected]>
1 parent 1e30897 commit 6982389

476 files changed

Lines changed: 6616 additions & 6655 deletions

File tree

Some content is hidden

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

‎encodings/alp/public-api.lock‎

Lines changed: 168 additions & 168 deletions
Large diffs are not rendered by default.

‎encodings/alp/src/alp/array.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use crate::alp::rules::RULES;
4747

4848
vtable!(ALP);
4949

50-
impl VTable for ALPVTable {
50+
impl VTable for ALP {
5151
type Array = ALPArray;
5252

5353
type Metadata = ProstMetadata<ALPMetadata>;
@@ -270,9 +270,9 @@ pub struct ALPArray {
270270
}
271271

272272
#[derive(Debug)]
273-
pub struct ALPVTable;
273+
pub struct ALP;
274274

275-
impl ALPVTable {
275+
impl ALP {
276276
pub const ID: ArrayId = ArrayId::new_ref("vortex.alp");
277277
}
278278

@@ -483,7 +483,7 @@ impl ALPArray {
483483
}
484484
}
485485

486-
impl ValidityChild<ALPVTable> for ALPVTable {
486+
impl ValidityChild<ALP> for ALP {
487487
fn validity_child(array: &ALPArray) -> &ArrayRef {
488488
array.encoded()
489489
}

‎encodings/alp/src/alp/compute/between.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ use vortex_array::scalar_fn::fns::between::BetweenReduce;
1616
use vortex_array::scalar_fn::fns::between::StrictComparison;
1717
use vortex_error::VortexResult;
1818

19+
use crate::ALP;
1920
use crate::ALPArray;
2021
use crate::ALPFloat;
21-
use crate::ALPVTable;
2222
use crate::match_each_alp_float_ptype;
2323

24-
impl BetweenReduce for ALPVTable {
24+
impl BetweenReduce for ALP {
2525
fn between(
2626
array: &ALPArray,
2727
lower: &ArrayRef,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use vortex_array::patches::Patches;
99
use vortex_array::scalar_fn::fns::cast::CastReduce;
1010
use vortex_error::VortexResult;
1111

12+
use crate::alp::ALP;
1213
use crate::alp::ALPArray;
13-
use crate::alp::ALPVTable;
1414

15-
impl CastReduce for ALPVTable {
15+
impl CastReduce for ALP {
1616
fn cast(array: &ALPArray, dtype: &DType) -> VortexResult<Option<ArrayRef>> {
1717
// Check if this is just a nullability change
1818
if array.dtype().eq_ignore_nullability(dtype) {

‎encodings/alp/src/alp/compute/compare.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ use vortex_error::VortexResult;
1818
use vortex_error::vortex_bail;
1919
use vortex_error::vortex_err;
2020

21+
use crate::ALP;
2122
use crate::ALPArray;
2223
use crate::ALPFloat;
23-
use crate::ALPVTable;
2424
use crate::match_each_alp_float_ptype;
2525

2626
// TODO(joe): add fuzzing.
2727

28-
impl CompareKernel for ALPVTable {
28+
impl CompareKernel for ALP {
2929
fn compare(
3030
lhs: &ALPArray,
3131
rhs: &ArrayRef,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use vortex_array::arrays::filter::FilterKernel;
88
use vortex_error::VortexResult;
99
use vortex_mask::Mask;
1010

11+
use crate::ALP;
1112
use crate::ALPArray;
12-
use crate::ALPVTable;
1313

14-
impl FilterKernel for ALPVTable {
14+
impl FilterKernel for ALP {
1515
fn filter(
1616
array: &ALPArray,
1717
mask: &Mask,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ use vortex_array::scalar_fn::fns::mask::MaskReduce;
1010
use vortex_array::validity::Validity;
1111
use vortex_error::VortexResult;
1212

13+
use crate::ALP;
1314
use crate::ALPArray;
14-
use crate::ALPVTable;
1515

16-
impl MaskReduce for ALPVTable {
16+
impl MaskReduce for ALP {
1717
fn mask(array: &ALPArray, mask: &ArrayRef) -> VortexResult<Option<ArrayRef>> {
1818
// Masking sparse patches requires reading indices, fall back to kernel.
1919
if array.patches().is_some() {
@@ -26,7 +26,7 @@ impl MaskReduce for ALPVTable {
2626
}
2727
}
2828

29-
impl MaskKernel for ALPVTable {
29+
impl MaskKernel for ALP {
3030
fn mask(
3131
array: &ALPArray,
3232
mask: &ArrayRef,

‎encodings/alp/src/alp/compute/nan_count.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use vortex_array::compute::nan_count;
77
use vortex_array::register_kernel;
88
use vortex_error::VortexResult;
99

10+
use crate::ALP;
1011
use crate::ALPArray;
11-
use crate::ALPVTable;
1212

13-
impl NaNCountKernel for ALPVTable {
13+
impl NaNCountKernel for ALP {
1414
fn nan_count(&self, array: &ALPArray) -> VortexResult<usize> {
1515
// NANs can only be in patches
1616
if let Some(patches) = array.patches() {
@@ -21,4 +21,4 @@ impl NaNCountKernel for ALPVTable {
2121
}
2222
}
2323

24-
register_kernel!(NaNCountKernelAdapter(ALPVTable).lift());
24+
register_kernel!(NaNCountKernelAdapter(ALP).lift());

‎encodings/alp/src/alp/compute/slice.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use vortex_array::IntoArray;
99
use vortex_array::arrays::slice::SliceKernel;
1010
use vortex_error::VortexResult;
1111

12+
use crate::ALP;
1213
use crate::ALPArray;
13-
use crate::ALPVTable;
1414

15-
impl SliceKernel for ALPVTable {
15+
impl SliceKernel for ALP {
1616
fn slice(
1717
array: &Self::Array,
1818
range: Range<usize>,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use vortex_array::IntoArray;
88
use vortex_array::arrays::dict::TakeExecute;
99
use vortex_error::VortexResult;
1010

11+
use crate::ALP;
1112
use crate::ALPArray;
12-
use crate::ALPVTable;
1313

14-
impl TakeExecute for ALPVTable {
14+
impl TakeExecute for ALP {
1515
fn take(
1616
array: &ALPArray,
1717
indices: &ArrayRef,

0 commit comments

Comments
 (0)