Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion rust/lance-index/src/vector/pq/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ impl ProductQuantizationStorage {
"Row ID column not found from PQ storage".to_string(),
));
};
let row_ids: Arc<UInt64Array> = row_ids
let mut row_ids: Arc<UInt64Array> = row_ids
.as_primitive_opt::<UInt64Type>()
.ok_or(Error::index(
"Row ID column is not of type UInt64".to_string(),
Expand Down Expand Up @@ -293,6 +293,11 @@ impl ProductQuantizationStorage {
.as_primitive::<UInt8Type>()
.clone()
.into();
// Refresh the stored row ids from the remapped batch. Without this
// the storage keeps the pre-remap (compacted-away) addresses while
// its codes are remapped, so search returns stale row ids and the
// take fails with "fragment ... does not exist".
row_ids = batch[ROW_ID].as_primitive::<UInt64Type>().clone().into();
}

let distance_type = match distance_type {
Expand Down
Loading
Loading