Skip to content

Commit 54419fb

Browse files
committed
fix
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
1 parent 4bee694 commit 54419fb

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

rust/lance/src/index/vector/builder.rs

+4-11
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use std::collections::HashMap;
55
use std::sync::Arc;
66

7-
use arrow::array::AsArray;
8-
use arrow_array::{RecordBatch, UInt32Array, UInt64Array};
7+
use arrow_array::{RecordBatch, UInt64Array};
98
use futures::prelude::stream::{StreamExt, TryStreamExt};
109
use futures::{stream, FutureExt};
1110
use itertools::Itertools;
@@ -16,15 +15,14 @@ use lance_core::{Error, Result, ROW_ID_FIELD};
1615
use lance_encoding::decoder::{DecoderPlugins, FilterExpression};
1716
use lance_file::v2::reader::FileReaderOptions;
1817
use lance_file::v2::{reader::FileReader, writer::FileWriter};
19-
use lance_index::vector::flat::storage::FlatFloatStorage;
2018
use lance_index::vector::ivf::storage::IvfModel;
2119
use lance_index::vector::quantizer::{
2220
QuantizationMetadata, QuantizationType, QuantizerBuildParams,
2321
};
2422
use lance_index::vector::storage::STORAGE_METADATA_KEY;
2523
use lance_index::vector::v3::shuffler::IvfShufflerReader;
2624
use lance_index::vector::v3::subindex::SubIndexType;
27-
use lance_index::vector::{VectorIndex, PART_ID_FIELD};
25+
use lance_index::vector::VectorIndex;
2826
use lance_index::{
2927
pb,
3028
vector::{
@@ -485,7 +483,6 @@ impl<S: IvfSubIndex + 'static, Q: Quantization + 'static> IvfIndexBuilder<S, Q>
485483
let column = self.column.clone();
486484
let store = self.store.clone();
487485
let temp_dir = self.temp_dir.clone();
488-
let ivf = ivf.clone();
489486
let quantizer = quantizer.clone();
490487
let sub_index_params = sub_index_params.clone();
491488
async move {
@@ -507,9 +504,7 @@ impl<S: IvfSubIndex + 'static, Q: Quantization + 'static> IvfIndexBuilder<S, Q>
507504

508505
Self::build_partition(
509506
&temp_dir,
510-
column,
511507
distance_type,
512-
&ivf,
513508
quantizer,
514509
sub_index_params,
515510
batch,
@@ -535,18 +530,15 @@ impl<S: IvfSubIndex + 'static, Q: Quantization + 'static> IvfIndexBuilder<S, Q>
535530
#[allow(clippy::too_many_arguments)]
536531
async fn build_partition(
537532
temp_dir: &Path,
538-
column: String,
539533
distance_type: DistanceType,
540-
ivf: &IvfModel,
541534
quantizer: Q,
542535
sub_index_params: S::BuildParams,
543536
batch: RecordBatch,
544537
part_id: usize,
545538
) -> Result<(usize, usize)> {
546539
let local_store = ObjectStore::local();
547540
// 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)?;
550542

551543
let path = temp_dir.child(format!("storage_part{}", part_id));
552544
let batches = storage.to_batches()?;
@@ -774,6 +766,7 @@ impl<S: IvfSubIndex + 'static, Q: Quantization + 'static> IvfIndexBuilder<S, Q>
774766

775767
// take vectors from the dataset
776768
// used for reading vectors from existing indices
769+
#[allow(dead_code)]
777770
async fn take_vectors(
778771
dataset: &Arc<Dataset>,
779772
column: &str,

0 commit comments

Comments
 (0)