Skip to content

Commit afea5e8

Browse files
perf[array]: outline the array parts data from the DynArray (#7750)
Change the internals of `ArrayRef` to allow access to common fields without dyn dispatch. ```rust + pub struct ArrayRef(Arc<ArrayInner<dyn DynArrayData>>); - pub struct ArrayRef(Arc<dyn DynArray>); ``` ```rust pub(crate) struct ArrayInner<D: ?Sized> { pub(crate) len: usize, pub(crate) encoding_id: ArrayId, pub(crate) dtype: DType, pub(crate) slots: Vec<Option<ArrayRef>>, pub(crate) stats: ArrayStats, pub(crate) data: D, // must be last for unsized coercion } ``` Applied the following renames: - `ArrayInner` -> `ArrayData` - `<V as VTable>::ArrayData` -> `<V as VTable>::TypedArrayData` - `DynArray` -> `DynArrayData` --------- Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk> Signed-off-by: Robert Kruszewski <github@robertk.io> Co-authored-by: Robert Kruszewski <github@robertk.io>
1 parent fb0f605 commit afea5e8

71 files changed

Lines changed: 693 additions & 708 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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ pub fn vortex_alp::ALP::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt::
2222

2323
impl vortex_array::array::vtable::VTable for vortex_alp::ALP
2424

25-
pub type vortex_alp::ALP::ArrayData = vortex_alp::ALPData
26-
2725
pub type vortex_alp::ALP::OperationsVTable = vortex_alp::ALP
2826

27+
pub type vortex_alp::ALP::TypedArrayData = vortex_alp::ALPData
28+
2929
pub type vortex_alp::ALP::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild
3030

3131
pub fn vortex_alp::ALP::buffer(vortex_array::array::view::ArrayView<'_, Self>, usize) -> vortex_array::buffer::BufferHandle
@@ -158,10 +158,10 @@ pub fn vortex_alp::ALPRD::fmt(&self, &mut core::fmt::Formatter<'_>) -> core::fmt
158158

159159
impl vortex_array::array::vtable::VTable for vortex_alp::ALPRD
160160

161-
pub type vortex_alp::ALPRD::ArrayData = vortex_alp::ALPRDData
162-
163161
pub type vortex_alp::ALPRD::OperationsVTable = vortex_alp::ALPRD
164162

163+
pub type vortex_alp::ALPRD::TypedArrayData = vortex_alp::ALPRDData
164+
165165
pub type vortex_alp::ALPRD::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild
166166

167167
pub fn vortex_alp::ALPRD::buffer(vortex_array::array::view::ArrayView<'_, Self>, usize) -> vortex_array::buffer::BufferHandle

encodings/alp/src/alp/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl ArrayEq for ALPData {
6767
}
6868

6969
impl VTable for ALP {
70-
type ArrayData = ALPData;
70+
type TypedArrayData = ALPData;
7171

7272
type OperationsVTable = Self;
7373
type ValidityVTable = ValidityVTableFromChild;

encodings/alp/src/alp_rd/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl ArrayEq for ALPRDData {
9090
}
9191

9292
impl VTable for ALPRD {
93-
type ArrayData = ALPRDData;
93+
type TypedArrayData = ALPRDData;
9494

9595
type OperationsVTable = Self;
9696
type ValidityVTable = ValidityVTableFromChild;

encodings/bytebool/public-api.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ pub fn vortex_bytebool::ByteBool::fmt(&self, &mut core::fmt::Formatter<'_>) -> c
2020

2121
impl vortex_array::array::vtable::VTable for vortex_bytebool::ByteBool
2222

23-
pub type vortex_bytebool::ByteBool::ArrayData = vortex_bytebool::ByteBoolData
24-
2523
pub type vortex_bytebool::ByteBool::OperationsVTable = vortex_bytebool::ByteBool
2624

25+
pub type vortex_bytebool::ByteBool::TypedArrayData = vortex_bytebool::ByteBoolData
26+
2727
pub type vortex_bytebool::ByteBool::ValidityVTable = vortex_bytebool::ByteBool
2828

2929
pub fn vortex_bytebool::ByteBool::buffer(vortex_array::array::view::ArrayView<'_, Self>, usize) -> vortex_array::buffer::BufferHandle
@@ -46,7 +46,7 @@ pub fn vortex_bytebool::ByteBool::serialize(vortex_array::array::view::ArrayView
4646

4747
pub fn vortex_bytebool::ByteBool::slot_name(vortex_array::array::view::ArrayView<'_, Self>, usize) -> alloc::string::String
4848

49-
pub fn vortex_bytebool::ByteBool::validate(&self, &Self::ArrayData, &vortex_array::dtype::DType, usize, &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
49+
pub fn vortex_bytebool::ByteBool::validate(&self, &Self::TypedArrayData, &vortex_array::dtype::DType, usize, &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
5050

5151
impl vortex_array::array::vtable::operations::OperationsVTable<vortex_bytebool::ByteBool> for vortex_bytebool::ByteBool
5252

encodings/bytebool/src/array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl ArrayEq for ByteBoolData {
5656
}
5757

5858
impl VTable for ByteBool {
59-
type ArrayData = ByteBoolData;
59+
type TypedArrayData = ByteBoolData;
6060

6161
type OperationsVTable = Self;
6262
type ValidityVTable = Self;
@@ -68,7 +68,7 @@ impl VTable for ByteBool {
6868

6969
fn validate(
7070
&self,
71-
data: &Self::ArrayData,
71+
data: &Self::TypedArrayData,
7272
dtype: &DType,
7373
len: usize,
7474
slots: &[Option<ArrayRef>],

encodings/datetime-parts/public-api.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ pub fn vortex_datetime_parts::DateTimeParts::fmt(&self, &mut core::fmt::Formatte
1818

1919
impl vortex_array::array::vtable::VTable for vortex_datetime_parts::DateTimeParts
2020

21-
pub type vortex_datetime_parts::DateTimeParts::ArrayData = vortex_datetime_parts::DateTimePartsData
22-
2321
pub type vortex_datetime_parts::DateTimeParts::OperationsVTable = vortex_datetime_parts::DateTimeParts
2422

23+
pub type vortex_datetime_parts::DateTimeParts::TypedArrayData = vortex_datetime_parts::DateTimePartsData
24+
2525
pub type vortex_datetime_parts::DateTimeParts::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild
2626

2727
pub fn vortex_datetime_parts::DateTimeParts::buffer(vortex_array::array::view::ArrayView<'_, Self>, usize) -> vortex_array::buffer::BufferHandle
@@ -44,7 +44,7 @@ pub fn vortex_datetime_parts::DateTimeParts::serialize(vortex_array::array::view
4444

4545
pub fn vortex_datetime_parts::DateTimeParts::slot_name(vortex_array::array::view::ArrayView<'_, Self>, usize) -> alloc::string::String
4646

47-
pub fn vortex_datetime_parts::DateTimeParts::validate(&self, &Self::ArrayData, &vortex_array::dtype::DType, usize, &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
47+
pub fn vortex_datetime_parts::DateTimeParts::validate(&self, &Self::TypedArrayData, &vortex_array::dtype::DType, usize, &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
4848

4949
impl vortex_array::array::vtable::operations::OperationsVTable<vortex_datetime_parts::DateTimeParts> for vortex_datetime_parts::DateTimeParts
5050

encodings/datetime-parts/src/array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl DateTimePartsMetadata {
8989
}
9090

9191
impl VTable for DateTimeParts {
92-
type ArrayData = DateTimePartsData;
92+
type TypedArrayData = DateTimePartsData;
9393

9494
type OperationsVTable = Self;
9595
type ValidityVTable = ValidityVTableFromChild;
@@ -101,7 +101,7 @@ impl VTable for DateTimeParts {
101101

102102
fn validate(
103103
&self,
104-
_data: &Self::ArrayData,
104+
_data: &Self::TypedArrayData,
105105
dtype: &DType,
106106
len: usize,
107107
slots: &[Option<ArrayRef>],

encodings/decimal-byte-parts/public-api.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ pub fn vortex_decimal_byte_parts::DecimalByteParts::fmt(&self, &mut core::fmt::F
1616

1717
impl vortex_array::array::vtable::VTable for vortex_decimal_byte_parts::DecimalByteParts
1818

19-
pub type vortex_decimal_byte_parts::DecimalByteParts::ArrayData = vortex_decimal_byte_parts::DecimalBytePartsData
20-
2119
pub type vortex_decimal_byte_parts::DecimalByteParts::OperationsVTable = vortex_decimal_byte_parts::DecimalByteParts
2220

21+
pub type vortex_decimal_byte_parts::DecimalByteParts::TypedArrayData = vortex_decimal_byte_parts::DecimalBytePartsData
22+
2323
pub type vortex_decimal_byte_parts::DecimalByteParts::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild
2424

2525
pub fn vortex_decimal_byte_parts::DecimalByteParts::buffer(vortex_array::array::view::ArrayView<'_, Self>, usize) -> vortex_array::buffer::BufferHandle
@@ -42,7 +42,7 @@ pub fn vortex_decimal_byte_parts::DecimalByteParts::serialize(vortex_array::arra
4242

4343
pub fn vortex_decimal_byte_parts::DecimalByteParts::slot_name(vortex_array::array::view::ArrayView<'_, Self>, usize) -> alloc::string::String
4444

45-
pub fn vortex_decimal_byte_parts::DecimalByteParts::validate(&self, &Self::ArrayData, &vortex_array::dtype::DType, usize, &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
45+
pub fn vortex_decimal_byte_parts::DecimalByteParts::validate(&self, &Self::TypedArrayData, &vortex_array::dtype::DType, usize, &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
4646

4747
impl vortex_array::array::vtable::operations::OperationsVTable<vortex_decimal_byte_parts::DecimalByteParts> for vortex_decimal_byte_parts::DecimalByteParts
4848

encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub struct DecimalBytesPartsMetadata {
7070
}
7171

7272
impl VTable for DecimalByteParts {
73-
type ArrayData = DecimalBytePartsData;
73+
type TypedArrayData = DecimalBytePartsData;
7474

7575
type OperationsVTable = Self;
7676
type ValidityVTable = ValidityVTableFromChild;
@@ -82,7 +82,7 @@ impl VTable for DecimalByteParts {
8282

8383
fn validate(
8484
&self,
85-
_data: &Self::ArrayData,
85+
_data: &Self::TypedArrayData,
8686
dtype: &DType,
8787
len: usize,
8888
slots: &[Option<ArrayRef>],

encodings/fastlanes/public-api.lock

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ pub fn vortex_fastlanes::BitPacked::fmt(&self, &mut core::fmt::Formatter<'_>) ->
136136

137137
impl vortex_array::array::vtable::VTable for vortex_fastlanes::BitPacked
138138

139-
pub type vortex_fastlanes::BitPacked::ArrayData = vortex_fastlanes::BitPackedData
140-
141139
pub type vortex_fastlanes::BitPacked::OperationsVTable = vortex_fastlanes::BitPacked
142140

141+
pub type vortex_fastlanes::BitPacked::TypedArrayData = vortex_fastlanes::BitPackedData
142+
143143
pub type vortex_fastlanes::BitPacked::ValidityVTable = vortex_fastlanes::BitPacked
144144

145145
pub fn vortex_fastlanes::BitPacked::append_to_builder(vortex_array::array::view::ArrayView<'_, Self>, &mut dyn vortex_array::builders::ArrayBuilder, &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<()>
@@ -164,7 +164,7 @@ pub fn vortex_fastlanes::BitPacked::serialize(vortex_array::array::view::ArrayVi
164164

165165
pub fn vortex_fastlanes::BitPacked::slot_name(vortex_array::array::view::ArrayView<'_, Self>, usize) -> alloc::string::String
166166

167-
pub fn vortex_fastlanes::BitPacked::validate(&self, &Self::ArrayData, &vortex_array::dtype::DType, usize, &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
167+
pub fn vortex_fastlanes::BitPacked::validate(&self, &Self::TypedArrayData, &vortex_array::dtype::DType, usize, &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
168168

169169
impl vortex_array::array::vtable::operations::OperationsVTable<vortex_fastlanes::BitPacked> for vortex_fastlanes::BitPacked
170170

@@ -296,10 +296,10 @@ pub fn vortex_fastlanes::Delta::fmt(&self, &mut core::fmt::Formatter<'_>) -> cor
296296

297297
impl vortex_array::array::vtable::VTable for vortex_fastlanes::Delta
298298

299-
pub type vortex_fastlanes::Delta::ArrayData = vortex_fastlanes::DeltaData
300-
301299
pub type vortex_fastlanes::Delta::OperationsVTable = vortex_fastlanes::Delta
302300

301+
pub type vortex_fastlanes::Delta::TypedArrayData = vortex_fastlanes::DeltaData
302+
303303
pub type vortex_fastlanes::Delta::ValidityVTable = vortex_fastlanes::Delta
304304

305305
pub fn vortex_fastlanes::Delta::buffer(vortex_array::array::view::ArrayView<'_, Self>, usize) -> vortex_array::buffer::BufferHandle
@@ -320,7 +320,7 @@ pub fn vortex_fastlanes::Delta::serialize(vortex_array::array::view::ArrayView<'
320320

321321
pub fn vortex_fastlanes::Delta::slot_name(vortex_array::array::view::ArrayView<'_, Self>, usize) -> alloc::string::String
322322

323-
pub fn vortex_fastlanes::Delta::validate(&self, &Self::ArrayData, &vortex_array::dtype::DType, usize, &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
323+
pub fn vortex_fastlanes::Delta::validate(&self, &Self::TypedArrayData, &vortex_array::dtype::DType, usize, &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
324324

325325
impl vortex_array::array::vtable::operations::OperationsVTable<vortex_fastlanes::Delta> for vortex_fastlanes::Delta
326326

@@ -382,10 +382,10 @@ pub fn vortex_fastlanes::FoR::fmt(&self, &mut core::fmt::Formatter<'_>) -> core:
382382

383383
impl vortex_array::array::vtable::VTable for vortex_fastlanes::FoR
384384

385-
pub type vortex_fastlanes::FoR::ArrayData = vortex_fastlanes::FoRData
386-
387385
pub type vortex_fastlanes::FoR::OperationsVTable = vortex_fastlanes::FoR
388386

387+
pub type vortex_fastlanes::FoR::TypedArrayData = vortex_fastlanes::FoRData
388+
389389
pub type vortex_fastlanes::FoR::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild
390390

391391
pub fn vortex_fastlanes::FoR::buffer(vortex_array::array::view::ArrayView<'_, Self>, usize) -> vortex_array::buffer::BufferHandle
@@ -408,7 +408,7 @@ pub fn vortex_fastlanes::FoR::serialize(vortex_array::array::view::ArrayView<'_,
408408

409409
pub fn vortex_fastlanes::FoR::slot_name(vortex_array::array::view::ArrayView<'_, Self>, usize) -> alloc::string::String
410410

411-
pub fn vortex_fastlanes::FoR::validate(&self, &Self::ArrayData, &vortex_array::dtype::DType, usize, &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
411+
pub fn vortex_fastlanes::FoR::validate(&self, &Self::TypedArrayData, &vortex_array::dtype::DType, usize, &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
412412

413413
impl vortex_array::array::vtable::operations::OperationsVTable<vortex_fastlanes::FoR> for vortex_fastlanes::FoR
414414

@@ -488,10 +488,10 @@ pub fn vortex_fastlanes::RLE::fmt(&self, &mut core::fmt::Formatter<'_>) -> core:
488488

489489
impl vortex_array::array::vtable::VTable for vortex_fastlanes::RLE
490490

491-
pub type vortex_fastlanes::RLE::ArrayData = vortex_fastlanes::RLEData
492-
493491
pub type vortex_fastlanes::RLE::OperationsVTable = vortex_fastlanes::RLE
494492

493+
pub type vortex_fastlanes::RLE::TypedArrayData = vortex_fastlanes::RLEData
494+
495495
pub type vortex_fastlanes::RLE::ValidityVTable = vortex_fastlanes::RLE
496496

497497
pub fn vortex_fastlanes::RLE::buffer(vortex_array::array::view::ArrayView<'_, Self>, usize) -> vortex_array::buffer::BufferHandle
@@ -514,7 +514,7 @@ pub fn vortex_fastlanes::RLE::serialize(vortex_array::array::view::ArrayView<'_,
514514

515515
pub fn vortex_fastlanes::RLE::slot_name(vortex_array::array::view::ArrayView<'_, Self>, usize) -> alloc::string::String
516516

517-
pub fn vortex_fastlanes::RLE::validate(&self, &Self::ArrayData, &vortex_array::dtype::DType, usize, &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
517+
pub fn vortex_fastlanes::RLE::validate(&self, &Self::TypedArrayData, &vortex_array::dtype::DType, usize, &[core::option::Option<vortex_array::array::erased::ArrayRef>]) -> vortex_error::VortexResult<()>
518518

519519
impl vortex_array::array::vtable::operations::OperationsVTable<vortex_fastlanes::RLE> for vortex_fastlanes::RLE
520520

0 commit comments

Comments
 (0)