File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments