Skip to content

Commit 8068211

Browse files
committed
wip
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 208c868 commit 8068211

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

encodings/alp/src/alp/decompress.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ fn decompress_chunked(
113113
let array_len = encoded.len();
114114
let patches_offset = patches.offset();
115115

116+
// We need to drop ALPArray here in case converting encoded buffer into
117+
// primitive didn't create a copy. In that case both alp_encoded and array
118+
// will hold a reference to the buffer we want to mutate.
119+
drop(array);
120+
116121
Ok(match_each_alp_float_ptype!(ptype, |T| {
117122
let patches_values = patches_values.as_slice::<T>();
118123
let mut alp_buffer = encoded.into_buffer_mut();
@@ -164,6 +169,11 @@ fn decompress_unchunked(
164169
) -> VortexResult<PrimitiveArray> {
165170
let encoded = array.to_primitive()?;
166171

172+
// We need to drop ALPArray here in case converting encoded buffer into
173+
// primitive didn't create a copy. In that case both alp_encoded and array
174+
// will hold a reference to the buffer we want to mutate.
175+
drop(array);
176+
167177
let validity = encoded.validity().clone();
168178
let ptype = dtype.as_ptype();
169179

0 commit comments

Comments
 (0)