Skip to content

Commit be2a14b

Browse files
deprecate: execute_mask over to_mask (#7574)
deprecate to mask to allow execute_mask to take a context --------- Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent b213af1 commit be2a14b

97 files changed

Lines changed: 202 additions & 238 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

encodings/alp/src/alp/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ mod tests {
812812
.as_ref()
813813
.validity()
814814
.unwrap()
815-
.to_mask(result_primitive.as_ref().len(), &mut ctx)
815+
.execute_mask(result_primitive.as_ref().len(), &mut ctx)
816816
.unwrap()
817817
.value(idx);
818818
assert_eq!(

encodings/alp/src/alp/compress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ where
7979
let validity = values
8080
.array()
8181
.validity()?
82-
.to_mask(values.array().len(), ctx)?;
82+
.execute_mask(values.array().len(), ctx)?;
8383
// exceptional_positions may contain exceptions at invalid positions (which contain garbage
8484
// data). We remove null exceptions in order to keep the Patches small.
8585
let (valid_exceptional_positions, valid_exceptional_values): (Buffer<u64>, Buffer<T>) =

encodings/alp/src/alp_rd/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl VTable for ALPRD {
273273
let validity = left_parts
274274
.as_ref()
275275
.validity()?
276-
.to_mask(left_parts.as_ref().len(), ctx)?;
276+
.execute_mask(left_parts.as_ref().len(), ctx)?;
277277

278278
let decoded_array = if ptype == PType::F32 {
279279
PrimitiveArray::new(

encodings/datetime-parts/src/canonical.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use vortex_array::dtype::PType;
1212
use vortex_array::extension::datetime::TimeUnit;
1313
use vortex_array::extension::datetime::Timestamp;
1414
use vortex_array::match_each_integer_ptype;
15-
use vortex_array::validity::Validity;
1615
use vortex_buffer::BufferMut;
1716
use vortex_error::VortexExpect as _;
1817
use vortex_error::VortexResult;
@@ -96,11 +95,7 @@ pub fn decode_to_temporal(
9695
}
9796

9897
Ok(TemporalArray::new_timestamp(
99-
PrimitiveArray::new(
100-
values.freeze(),
101-
Validity::copy_from_array(&array.clone().into_array())?,
102-
)
103-
.into_array(),
98+
PrimitiveArray::new(values.freeze(), array.validity()?).into_array(),
10499
options.unit,
105100
options.tz.clone(),
106101
))

encodings/fastlanes/src/bitpacking/array/bitpack_compress.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ pub fn gather_patches(
206206
};
207207

208208
let array_len = parray.len();
209-
let validity_mask = parray.as_ref().validity()?.to_mask(parray.len(), ctx)?;
209+
let validity_mask = parray
210+
.as_ref()
211+
.validity()?
212+
.execute_mask(parray.len(), ctx)?;
210213

211214
let patches = if array_len < u8::MAX as usize {
212215
match_each_integer_ptype!(parray.ptype(), |T| {
@@ -316,7 +319,7 @@ fn bit_width_histogram_typed<T: NativePType + PrimInt>(
316319
let mut bit_widths = vec![0usize; size_of::<T>() * 8 + 1];
317320
match array
318321
.validity()?
319-
.to_mask(array.as_ref().len(), ctx)?
322+
.execute_mask(array.as_ref().len(), ctx)?
320323
.bit_buffer()
321324
{
322325
AllOr::All => {
@@ -477,7 +480,7 @@ mod test {
477480
.as_ref()
478481
.validity()
479482
.unwrap()
480-
.to_mask(compressed.as_ref().len(), &mut ctx)
483+
.execute_mask(compressed.as_ref().len(), &mut ctx)
481484
.unwrap()
482485
.to_bit_buffer()
483486
.set_indices()

encodings/fastlanes/src/bitpacking/array/bitpack_decompress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub(crate) fn unpack_into_primitive_builder<T: BitPackedUnpack>(
5858
// SAFETY: We later initialize the the uninitialized range of values with `copy_from_slice`.
5959
unsafe {
6060
// Append a dense null Mask.
61-
uninit_range.append_mask(array.validity()?.to_mask(array.as_ref().len(), ctx)?);
61+
uninit_range.append_mask(array.validity()?.execute_mask(array.as_ref().len(), ctx)?);
6262
}
6363

6464
// SAFETY: `decode_into` will initialize all values in this range.

encodings/fastlanes/src/for/array/for_decompress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub(crate) fn fused_decompress<
109109
let mut uninit_range = builder.uninit_range(bp.len());
110110
unsafe {
111111
// Append a dense null Mask.
112-
uninit_range.append_mask(bp.validity()?.to_mask(bp.as_ref().len(), ctx)?);
112+
uninit_range.append_mask(bp.validity()?.execute_mask(bp.as_ref().len(), ctx)?);
113113
}
114114

115115
// SAFETY: `decode_into` will initialize all values in this range.

encodings/fastlanes/src/rle/array/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ mod tests {
311311
let validity_mask = sliced_array
312312
.validity()
313313
.unwrap()
314-
.to_mask(
314+
.execute_mask(
315315
sliced_array.len(),
316316
&mut LEGACY_SESSION.create_execution_ctx(),
317317
)

encodings/fastlanes/src/rle/array/rle_decompress.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ use fastlanes::RLE;
55
use num_traits::AsPrimitive;
66
use num_traits::NumCast;
77
use vortex_array::ExecutionCtx;
8-
use vortex_array::IntoArray;
98
use vortex_array::arrays::PrimitiveArray;
109
use vortex_array::dtype::NativePType;
1110
use vortex_array::match_each_native_ptype;
1211
use vortex_array::match_each_unsigned_integer_ptype;
13-
use vortex_array::validity::Validity;
1412
use vortex_buffer::BufferMut;
1513
use vortex_error::VortexExpect;
1614
use vortex_error::VortexResult;
@@ -124,6 +122,6 @@ where
124122
buffer
125123
.freeze()
126124
.slice(offset_within_chunk..(offset_within_chunk + array.len())),
127-
Validity::copy_from_array(&array.clone().into_array())?,
125+
array.validity()?,
128126
))
129127
}

encodings/fsst/src/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ impl VTable for FSST {
301301
array
302302
.array()
303303
.validity()?
304-
.to_mask(array.array().len(), ctx)?,
304+
.execute_mask(array.array().len(), ctx)?,
305305
);
306306
Ok(())
307307
}

0 commit comments

Comments
 (0)