4
4
use std:: collections:: HashMap ;
5
5
use std:: sync:: Arc ;
6
6
7
- use arrow:: array:: AsArray ;
8
- use arrow_array:: { RecordBatch , UInt32Array , UInt64Array } ;
7
+ use arrow_array:: { RecordBatch , UInt64Array } ;
9
8
use futures:: prelude:: stream:: { StreamExt , TryStreamExt } ;
10
9
use futures:: { stream, FutureExt } ;
11
10
use itertools:: Itertools ;
@@ -16,15 +15,14 @@ use lance_core::{Error, Result, ROW_ID_FIELD};
16
15
use lance_encoding:: decoder:: { DecoderPlugins , FilterExpression } ;
17
16
use lance_file:: v2:: reader:: FileReaderOptions ;
18
17
use lance_file:: v2:: { reader:: FileReader , writer:: FileWriter } ;
19
- use lance_index:: vector:: flat:: storage:: FlatFloatStorage ;
20
18
use lance_index:: vector:: ivf:: storage:: IvfModel ;
21
19
use lance_index:: vector:: quantizer:: {
22
20
QuantizationMetadata , QuantizationType , QuantizerBuildParams ,
23
21
} ;
24
22
use lance_index:: vector:: storage:: STORAGE_METADATA_KEY ;
25
23
use lance_index:: vector:: v3:: shuffler:: IvfShufflerReader ;
26
24
use lance_index:: vector:: v3:: subindex:: SubIndexType ;
27
- use lance_index:: vector:: { VectorIndex , PART_ID_FIELD } ;
25
+ use lance_index:: vector:: VectorIndex ;
28
26
use lance_index:: {
29
27
pb,
30
28
vector:: {
@@ -485,7 +483,6 @@ impl<S: IvfSubIndex + 'static, Q: Quantization + 'static> IvfIndexBuilder<S, Q>
485
483
let column = self . column . clone ( ) ;
486
484
let store = self . store . clone ( ) ;
487
485
let temp_dir = self . temp_dir . clone ( ) ;
488
- let ivf = ivf. clone ( ) ;
489
486
let quantizer = quantizer. clone ( ) ;
490
487
let sub_index_params = sub_index_params. clone ( ) ;
491
488
async move {
@@ -507,9 +504,7 @@ impl<S: IvfSubIndex + 'static, Q: Quantization + 'static> IvfIndexBuilder<S, Q>
507
504
508
505
Self :: build_partition (
509
506
& temp_dir,
510
- column,
511
507
distance_type,
512
- & ivf,
513
508
quantizer,
514
509
sub_index_params,
515
510
batch,
@@ -535,18 +530,15 @@ impl<S: IvfSubIndex + 'static, Q: Quantization + 'static> IvfIndexBuilder<S, Q>
535
530
#[ allow( clippy:: too_many_arguments) ]
536
531
async fn build_partition (
537
532
temp_dir : & Path ,
538
- column : String ,
539
533
distance_type : DistanceType ,
540
- ivf : & IvfModel ,
541
534
quantizer : Q ,
542
535
sub_index_params : S :: BuildParams ,
543
536
batch : RecordBatch ,
544
537
part_id : usize ,
545
538
) -> Result < ( usize , usize ) > {
546
539
let local_store = ObjectStore :: local ( ) ;
547
540
// build quantized vector storage
548
- let storage =
549
- StorageBuilder :: new ( ivf, column. clone ( ) , distance_type, quantizer) . build ( & batch) ?;
541
+ let storage = StorageBuilder :: new ( distance_type, quantizer) . build ( & batch) ?;
550
542
551
543
let path = temp_dir. child ( format ! ( "storage_part{}" , part_id) ) ;
552
544
let batches = storage. to_batches ( ) ?;
@@ -774,6 +766,7 @@ impl<S: IvfSubIndex + 'static, Q: Quantization + 'static> IvfIndexBuilder<S, Q>
774
766
775
767
// take vectors from the dataset
776
768
// used for reading vectors from existing indices
769
+ #[ allow( dead_code) ]
777
770
async fn take_vectors (
778
771
dataset : & Arc < Dataset > ,
779
772
column : & str ,
0 commit comments