Skip to content

Commit

Permalink
refactor(query): impl in memory serialized page reader
Browse files Browse the repository at this point in the history
  • Loading branch information
zhang2014 committed Dec 1, 2024
1 parent e2bbd79 commit d874e68
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/query/storages/fuse/src/io/read/block/parquet/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@ impl UncompressedBuffer {

if size > buffer.capacity() {
// avoid reallocate
let mut new_buffer = vec![0; size];
let mut new_buffer = Vec::with_capacity(size);
std::mem::swap(buffer, &mut new_buffer);
} else if size > buffer.len() {
buffer.resize(size, 0);
} else {
buffer.truncate(size);
buffer.clear();
}
buffer
}
Expand Down

0 comments on commit d874e68

Please sign in to comment.