diff --git a/rust/lance/src/index/vector/builder.rs b/rust/lance/src/index/vector/builder.rs index 1f812f2c1a9..681e37f8f7a 100644 --- a/rust/lance/src/index/vector/builder.rs +++ b/rust/lance/src/index/vector/builder.rs @@ -656,6 +656,10 @@ impl IvfIndexBuilder // for PQ, the PQ codes are transposed, so we need to transpose them back if matches!(Q::quantization_type(), QuantizationType::Product) { for batch in part_batches.iter_mut() { + if batch.num_rows() == 0 { + continue; + } + let codes = batch[PQ_CODE_COLUMN] .as_fixed_size_list() .values()