Skip to content

Commit

Permalink
Revert "fix: concat batches before writing to avoid small IO slow down (
Browse files Browse the repository at this point in the history
lancedb#2384)" (lancedb#2387)

This reverts commit 571a70a.
  • Loading branch information
chebbyChefNEQ authored May 23, 2024
1 parent 8a1388c commit 8c1ee00
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions rust/lance-index/src/vector/ivf/shuffler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use std::collections::HashMap;
use std::sync::Arc;

use arrow::compute::{concat_batches, sort_to_indices};
use arrow::compute::sort_to_indices;
use arrow_array::{cast::AsArray, types::UInt64Type, Array, RecordBatch, UInt32Array};
use arrow_schema::Field;
use futures::stream::repeat_with;
Expand Down Expand Up @@ -452,12 +452,7 @@ impl IvfShuffler {
)?;

for batches in shuffled {
if batches.is_empty() {
continue;
}
// concat to avoid slowdown due to small IOs
let batch = concat_batches(&batches[0].schema(), &batches)?;
file_writer.write(&[batch]).await?;
file_writer.write(&batches).await?;
}

file_writer.finish().await?;
Expand Down

0 comments on commit 8c1ee00

Please sign in to comment.