@@ -24,10 +24,7 @@ use sha2::{
24
24
} ;
25
25
use value:: {
26
26
heap_size:: HeapSize ,
27
- id_v6:: {
28
- DeveloperDocumentId ,
29
- VirtualTableNumberMap ,
30
- } ,
27
+ id_v6:: DeveloperDocumentId ,
31
28
utils:: display_sequence,
32
29
val,
33
30
ConvexObject ,
@@ -180,22 +177,12 @@ pub struct IndexRange {
180
177
}
181
178
182
179
impl IndexRange {
183
- pub fn compile (
184
- self ,
185
- indexed_fields : IndexedFields ,
186
- virtual_table_number_map : Option < VirtualTableNumberMap > ,
187
- ) -> anyhow:: Result < Interval > {
180
+ pub fn compile ( self , indexed_fields : IndexedFields ) -> anyhow:: Result < Interval > {
188
181
let index_name = self . index_name . clone ( ) ;
189
182
let SplitIndexRange {
190
183
equalities,
191
184
inequality,
192
- } = self . split ( ) ?. map_values ( |field, v| {
193
- if field == & * ID_FIELD_PATH {
194
- map_id_value_to_tablet ( v, virtual_table_number_map)
195
- } else {
196
- Ok ( v)
197
- }
198
- } ) ?;
185
+ } = self . split ( ) ?;
199
186
200
187
// Check that some permutation of the equality field paths + the (optional)
201
188
// inequality field path is a prefix of the indexed paths.
@@ -397,49 +384,6 @@ struct SplitIndexRange {
397
384
inequality : Option < IndexInequality > ,
398
385
}
399
386
400
- impl SplitIndexRange {
401
- pub fn map_values (
402
- self ,
403
- f : impl Fn ( & FieldPath , ConvexValue ) -> anyhow:: Result < ConvexValue > ,
404
- ) -> anyhow:: Result < SplitIndexRange > {
405
- let equalities = self
406
- . equalities
407
- . into_iter ( )
408
- . map ( |( field, value) | {
409
- let new_value = match value. 0 {
410
- Some ( value) => MaybeValue ( Some ( f ( & field, value) ?) ) ,
411
- None => MaybeValue ( None ) ,
412
- } ;
413
- anyhow:: Ok ( ( field, new_value) )
414
- } )
415
- . try_collect ( ) ?;
416
- let inequality = self
417
- . inequality
418
- . map ( |inequality| {
419
- let start = match inequality. start {
420
- Bound :: Unbounded => Bound :: Unbounded ,
421
- Bound :: Included ( value) => Bound :: Included ( f ( & inequality. field_path , value) ?) ,
422
- Bound :: Excluded ( value) => Bound :: Excluded ( f ( & inequality. field_path , value) ?) ,
423
- } ;
424
- let end = match inequality. end {
425
- Bound :: Unbounded => Bound :: Unbounded ,
426
- Bound :: Included ( value) => Bound :: Included ( f ( & inequality. field_path , value) ?) ,
427
- Bound :: Excluded ( value) => Bound :: Excluded ( f ( & inequality. field_path , value) ?) ,
428
- } ;
429
- anyhow:: Ok ( IndexInequality {
430
- field_path : inequality. field_path ,
431
- start,
432
- end,
433
- } )
434
- } )
435
- . transpose ( ) ?;
436
- Ok ( SplitIndexRange {
437
- equalities,
438
- inequality,
439
- } )
440
- }
441
- }
442
-
443
387
struct IndexInequality {
444
388
field_path : FieldPath ,
445
389
start : Bound < ConvexValue > ,
@@ -456,21 +400,6 @@ impl Display for QueryFields {
456
400
}
457
401
}
458
402
459
- fn map_id_value_to_tablet (
460
- value : ConvexValue ,
461
- virtual_table_number_map : Option < VirtualTableNumberMap > ,
462
- ) -> anyhow:: Result < ConvexValue > {
463
- let val = match ( & value, virtual_table_number_map) {
464
- ( ConvexValue :: String ( id) , Some ( virtual_table_number_map) ) => {
465
- let mapped =
466
- DeveloperDocumentId :: map_string_between_table_numbers ( id, virtual_table_number_map) ;
467
- val ! ( mapped)
468
- } ,
469
- _ => value,
470
- } ;
471
- Ok ( val)
472
- }
473
-
474
403
fn already_defined_bound_error (
475
404
bound_type : & str ,
476
405
field_path : & FieldPath ,
0 commit comments