Skip to content

Commit

Permalink
one read
Browse files Browse the repository at this point in the history
Signed-off-by: coldWater <[email protected]>
  • Loading branch information
forsaken628 committed Oct 12, 2024
1 parent ded1977 commit f315c1e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/query/service/src/spillers/spiller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ impl Spiller {
let mut file = tokio::fs::File::open(path).await?;
file.seek(io::SeekFrom::Start(data_range.start)).await?;

let mut data = Vec::new();
file.take(data_range.count() as u64)
.read_to_end(&mut data)
.await?;
let n = data_range.count();
let mut data = Vec::with_capacity(n);
unsafe { data.set_len(n) };
file.read_exact(&mut data).await?;

record_local_read_profile(&instant, data.len());
Ok(deserialize_block(columns_layout, &data))
Expand Down

0 comments on commit f315c1e

Please sign in to comment.