@@ -7,7 +7,6 @@ use vortex_array::ArrayRef;
77use vortex_array:: dtype:: DType ;
88use vortex_array:: dtype:: Nullability ;
99use vortex_array:: dtype:: PType ;
10- use vortex_array:: stats:: ArrayStats ;
1110use vortex_error:: VortexExpect ;
1211use vortex_error:: VortexResult ;
1312use vortex_error:: vortex_ensure;
@@ -29,12 +28,6 @@ use crate::utils::extension_list_size;
2928/// A degenerate TurboQuant array has zero rows and `bit_width == 0`, with all slots empty.
3029#[ derive( Clone , Debug ) ]
3130pub struct TurboQuantData {
32- /// The [`Vector`](crate::vector::Vector) extension dtype that this array encodes.
33- ///
34- /// The storage dtype within the extension determines the element type (f16, f32, or f64) and
35- /// the list size (dimension).
36- pub ( crate ) dtype : DType ,
37-
3831 /// Child arrays stored as slots. See [`Slot`] for positions:
3932 ///
4033 /// - [`Codes`](Slot::Codes): Non-nullable `FixedSizeListArray<u8>` with
@@ -66,9 +59,6 @@ pub struct TurboQuantData {
6659 ///
6760 /// This is 0 for degenerate empty arrays.
6861 pub ( crate ) bit_width : u8 ,
69-
70- /// The stats for this array.
71- pub ( crate ) stats_set : ArrayStats ,
7262}
7363
7464impl TurboQuantData {
@@ -83,13 +73,13 @@ impl TurboQuantData {
8373 /// Returns an error if the provided components do not satisfy the invariants documented
8474 /// in [`new_unchecked`](Self::new_unchecked).
8575 pub fn try_new (
86- dtype : DType ,
76+ dtype : & DType ,
8777 codes : ArrayRef ,
8878 norms : ArrayRef ,
8979 centroids : ArrayRef ,
9080 rotation_signs : ArrayRef ,
9181 ) -> VortexResult < Self > {
92- Self :: validate ( & dtype, & codes, & norms, & centroids, & rotation_signs) ?;
82+ Self :: validate ( dtype, & codes, & norms, & centroids, & rotation_signs) ?;
9383
9484 // SAFETY: we validate that the inputs are valid above.
9585 Ok ( unsafe { Self :: new_unchecked ( dtype, codes, norms, centroids, rotation_signs) } )
@@ -115,14 +105,14 @@ impl TurboQuantData {
115105 ///
116106 /// Violating these invariants may produce incorrect results during decompression.
117107 pub unsafe fn new_unchecked (
118- dtype : DType ,
108+ dtype : & DType ,
119109 codes : ArrayRef ,
120110 norms : ArrayRef ,
121111 centroids : ArrayRef ,
122112 rotation_signs : ArrayRef ,
123113 ) -> Self {
124114 #[ cfg( debug_assertions) ]
125- Self :: validate ( & dtype, & codes, & norms, & centroids, & rotation_signs)
115+ Self :: validate ( dtype, & codes, & norms, & centroids, & rotation_signs)
126116 . vortex_expect ( "[Debug Assertion]: Invalid TurboQuantData parameters" ) ;
127117
128118 let dimension = dtype
@@ -147,11 +137,9 @@ impl TurboQuantData {
147137 slots[ Slot :: RotationSigns as usize ] = Some ( rotation_signs) ;
148138
149139 Self {
150- dtype,
151140 slots,
152141 dimension,
153142 bit_width,
154- stats_set : Default :: default ( ) ,
155143 }
156144 }
157145
0 commit comments