@@ -19,6 +19,8 @@ use crate::Precision;
1919use crate :: ToCanonical ;
2020use crate :: arrays:: ChunkedData ;
2121use crate :: arrays:: PrimitiveData ;
22+ use crate :: arrays:: chunked:: array:: CHUNK_OFFSETS_SLOT ;
23+ use crate :: arrays:: chunked:: array:: CHUNKS_OFFSET ;
2224use crate :: arrays:: chunked:: compute:: kernel:: PARENT_KERNELS ;
2325use crate :: arrays:: chunked:: compute:: rules:: PARENT_RULES ;
2426use crate :: arrays:: chunked:: vtable:: canonical:: _canonicalize;
@@ -210,17 +212,17 @@ impl VTable for Chunked {
210212
211213 fn slot_name ( _array : ArrayView < ' _ , Self > , idx : usize ) -> String {
212214 match idx {
213- 0 => "chunk_offsets" . to_string ( ) ,
214- n => format ! ( "chunks[{}]" , n - 1 ) ,
215+ CHUNK_OFFSETS_SLOT => "chunk_offsets" . to_string ( ) ,
216+ n => format ! ( "chunks[{}]" , n - CHUNKS_OFFSET ) ,
215217 }
216218 }
217219
218220 fn with_slots ( array : & mut Self :: ArrayData , slots : Vec < Option < ArrayRef > > ) -> VortexResult < ( ) > {
219221 // Slots: chunk_offsets, then chunks...
220222 vortex_ensure ! ( !slots. is_empty( ) , "Chunked array needs at least one slot" ) ;
221223
222- let nchunks = slots. len ( ) - 1 ;
223- let chunk_offsets_ref = slots[ 0 ]
224+ let nchunks = slots. len ( ) - CHUNKS_OFFSET ;
225+ let chunk_offsets_ref = slots[ CHUNK_OFFSETS_SLOT ]
224226 . as_ref ( )
225227 . ok_or_else ( || vortex_err ! ( "chunk_offsets slot must not be None" ) ) ?;
226228 let chunk_offsets_buf = chunk_offsets_ref. to_primitive ( ) . to_buffer :: < u64 > ( ) ;
@@ -232,7 +234,7 @@ impl VTable for Chunked {
232234 chunk_offsets_buf. len( )
233235 ) ;
234236
235- let chunks: Vec < ArrayRef > = slots[ 1 ..]
237+ let chunks: Vec < ArrayRef > = slots[ CHUNKS_OFFSET ..]
236238 . iter ( )
237239 . map ( |s| {
238240 s. clone ( )
0 commit comments