@@ -21,7 +21,7 @@ use futures::TryStreamExt;
2121use lance_core:: {
2222 cache:: { CacheKey , LanceCache , WeakLanceCache } ,
2323 error:: LanceOptionExt ,
24- utils:: mask:: { RowIdTreeMap , RowAddrTreeMap } ,
24+ utils:: mask:: RowAddrTreeMap ,
2525 Error , Result , ROW_ID ,
2626} ;
2727use roaring:: RoaringBitmap ;
@@ -100,7 +100,7 @@ pub struct BitmapIndex {
100100 /// for quickly locating the row and reading it out
101101 index_map : BTreeMap < OrderableScalarValue , usize > ,
102102
103- null_map : Arc < RowIdTreeMap > ,
103+ null_map : Arc < RowAddrTreeMap > ,
104104
105105 value_type : DataType ,
106106
@@ -119,7 +119,7 @@ pub struct BitmapKey {
119119}
120120
121121impl CacheKey for BitmapKey {
122- type ValueType = RowIdTreeMap ;
122+ type ValueType = RowAddrTreeMap ;
123123
124124 fn key ( & self ) -> std:: borrow:: Cow < ' _ , str > {
125125 format ! ( "{}" , self . value. 0 ) . into ( )
@@ -129,7 +129,7 @@ impl CacheKey for BitmapKey {
129129impl BitmapIndex {
130130 fn new (
131131 index_map : BTreeMap < OrderableScalarValue , usize > ,
132- null_map : Arc < RowIdTreeMap > ,
132+ null_map : Arc < RowAddrTreeMap > ,
133133 value_type : DataType ,
134134 store : Arc < dyn IndexStore > ,
135135 index_cache : WeakLanceCache ,
@@ -160,7 +160,7 @@ impl BitmapIndex {
160160 let data_type = schema. fields [ 0 ] . data_type ( ) ;
161161 return Ok ( Arc :: new ( Self :: new (
162162 BTreeMap :: new ( ) ,
163- Arc :: new ( RowIdTreeMap :: default ( ) ) ,
163+ Arc :: new ( RowAddrTreeMap :: default ( ) ) ,
164164 data_type,
165165 store,
166166 WeakLanceCache :: from ( index_cache) ,
@@ -217,7 +217,7 @@ impl BitmapIndex {
217217 location : location ! ( ) ,
218218 } ) ?;
219219 let bitmap_bytes = binary_bitmaps. value ( 0 ) ;
220- let mut bitmap = RowIdTreeMap :: deserialize_from ( bitmap_bytes) . unwrap ( ) ;
220+ let mut bitmap = RowAddrTreeMap :: deserialize_from ( bitmap_bytes) . unwrap ( ) ;
221221
222222 // Apply fragment remapping if needed
223223 if let Some ( fri) = & frag_reuse_index {
@@ -243,7 +243,7 @@ impl BitmapIndex {
243243 & self ,
244244 key : & OrderableScalarValue ,
245245 metrics : Option < & dyn MetricsCollector > ,
246- ) -> Result < Arc < RowIdTreeMap > > {
246+ ) -> Result < Arc < RowAddrTreeMap > > {
247247 if key. 0 . is_null ( ) {
248248 return Ok ( self . null_map . clone ( ) ) ;
249249 }
@@ -278,7 +278,7 @@ impl BitmapIndex {
278278 location : location ! ( ) ,
279279 } ) ?;
280280 let bitmap_bytes = binary_bitmaps. value ( 0 ) ; // First (and only) row
281- let mut bitmap = RowIdTreeMap :: deserialize_from ( bitmap_bytes) . unwrap ( ) ;
281+ let mut bitmap = RowAddrTreeMap :: deserialize_from ( bitmap_bytes) . unwrap ( ) ;
282282
283283 if let Some ( fri) = & self . frag_reuse_index {
284284 bitmap = fri. remap_row_ids_tree_map ( & bitmap) ;
@@ -358,7 +358,7 @@ impl Index for BitmapIndex {
358358 }
359359
360360 let bitmap_bytes = bitmap_binary_array. value ( idx) ;
361- let mut bitmap = RowIdTreeMap :: deserialize_from ( bitmap_bytes) . unwrap ( ) ;
361+ let mut bitmap = RowAddrTreeMap :: deserialize_from ( bitmap_bytes) . unwrap ( ) ;
362362
363363 if let Some ( frag_reuse_index_ref) = self . frag_reuse_index . as_ref ( ) {
364364 bitmap = frag_reuse_index_ref. remap_row_ids_tree_map ( & bitmap) ;
@@ -436,7 +436,7 @@ impl ScalarIndex for BitmapIndex {
436436 metrics. record_comparisons ( keys. len ( ) ) ;
437437
438438 if keys. is_empty ( ) {
439- RowIdTreeMap :: default ( )
439+ RowAddrTreeMap :: default ( )
440440 } else {
441441 let mut bitmaps = Vec :: new ( ) ;
442442 for key in keys {
@@ -445,7 +445,7 @@ impl ScalarIndex for BitmapIndex {
445445 }
446446
447447 let bitmap_refs: Vec < _ > = bitmaps. iter ( ) . map ( |b| b. as_ref ( ) ) . collect ( ) ;
448- RowIdTreeMap :: union_all ( & bitmap_refs)
448+ RowAddrTreeMap :: union_all ( & bitmap_refs)
449449 }
450450 }
451451 SargableQuery :: IsIn ( values) => {
@@ -472,11 +472,11 @@ impl ScalarIndex for BitmapIndex {
472472 }
473473
474474 if bitmaps. is_empty ( ) {
475- RowIdTreeMap :: default ( )
475+ RowAddrTreeMap :: default ( )
476476 } else {
477- // Convert Arc<RowIdTreeMap > to &RowIdTreeMap for union_all
477+ // Convert Arc<RowAddrTreeMap > to &RowAddrTreeMap for union_all
478478 let bitmap_refs: Vec < _ > = bitmaps. iter ( ) . map ( |b| b. as_ref ( ) ) . collect ( ) ;
479- RowIdTreeMap :: union_all ( & bitmap_refs)
479+ RowAddrTreeMap :: union_all ( & bitmap_refs)
480480 }
481481 }
482482 SargableQuery :: IsNull ( ) => {
@@ -597,7 +597,7 @@ impl BitmapIndexPlugin {
597597 }
598598
599599 async fn write_bitmap_index (
600- state : HashMap < ScalarValue , RowIdTreeMap > ,
600+ state : HashMap < ScalarValue , RowAddrTreeMap > ,
601601 index_store : & dyn IndexStore ,
602602 value_type : & DataType ,
603603 ) -> Result < ( ) > {
@@ -661,7 +661,7 @@ impl BitmapIndexPlugin {
661661
662662 async fn do_train_bitmap_index (
663663 mut data_source : SendableRecordBatchStream ,
664- mut state : HashMap < ScalarValue , RowIdTreeMap > ,
664+ mut state : HashMap < ScalarValue , RowAddrTreeMap > ,
665665 index_store : & dyn IndexStore ,
666666 ) -> Result < ( ) > {
667667 let value_type = data_source. schema ( ) . field ( 0 ) . data_type ( ) . clone ( ) ;
@@ -687,7 +687,7 @@ impl BitmapIndexPlugin {
687687 index_store : & dyn IndexStore ,
688688 ) -> Result < ( ) > {
689689 // mapping from item to list of the row ids where it is present
690- let dictionary: HashMap < ScalarValue , RowIdTreeMap > = HashMap :: new ( ) ;
690+ let dictionary: HashMap < ScalarValue , RowAddrTreeMap > = HashMap :: new ( ) ;
691691
692692 Self :: do_train_bitmap_index ( data, dictionary, index_store) . await
693693 }
@@ -971,7 +971,7 @@ pub mod tests {
971971 . await
972972 . unwrap_or_else ( |_| panic ! ( "Key {} should exist" , key_val) ) ;
973973
974- // Convert RowIdTreeMap to a vector for easier assertion
974+ // Convert RowAddrTreeMap to a vector for easier assertion
975975 let row_ids: Vec < u64 > = bitmap. row_ids ( ) . unwrap ( ) . map ( u64:: from) . collect ( ) ;
976976
977977 // Verify length
0 commit comments