Skip to content

Commit c85c39c

Browse files
committed
Merge
Signed-off-by: Nicholas Gates <[email protected]>
2 parents bfd48ca + fed289c commit c85c39c

File tree

62 files changed

+2695
-781
lines changed

Some content is hidden

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

62 files changed

+2695
-781
lines changed

bench-vortex/src/realnest/gharchive.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ impl Benchmark for GithubArchive {
230230
fn data_url(&self) -> &Url {
231231
&self.data_url
232232
}
233+
234+
fn expected_row_counts(&self) -> Option<&[usize]> {
235+
Some(&[1, 2, 100, 10, 82468])
236+
}
233237
}
234238

235239
pub async fn register_table(

encodings/alp/src/alp/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ pub trait ALPFloat: private::Sealed + Float + Display + NativePType {
193193
}
194194

195195
fn decode_buffer(encoded: BufferMut<Self::ALPInt>, exponents: Exponents) -> BufferMut<Self> {
196-
encoded.map_each(move |encoded| Self::decode_single(encoded, exponents))
196+
encoded.map_each_in_place(move |encoded| Self::decode_single(encoded, exponents))
197197
}
198198

199199
#[inline(always)]

encodings/alp/src/alp_rd/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ pub fn alp_rd_decode<T: ALPRDFloat>(
311311
// Shift the left-parts and add in the right-parts.
312312
let mut index = 0;
313313
right_parts
314-
.map_each(|right| {
314+
.map_each_in_place(|right| {
315315
let left = values[index];
316316
index += 1;
317317
let left = <T as ALPRDFloat>::from_u16(left);

encodings/datetime-parts/src/canonical.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub fn decode_to_temporal(array: &DateTimePartsArray) -> TemporalArray {
5353
// are constant.
5454
let mut values: BufferMut<i64> = days_buf
5555
.into_buffer_mut::<i64>()
56-
.map_each(|d| d * 86_400 * divisor);
56+
.map_each_in_place(|d| d * 86_400 * divisor);
5757

5858
if let Some(seconds) = array.seconds().as_constant() {
5959
let seconds = seconds

encodings/fastlanes/src/bitpacking/compute/cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ mod tests {
7979

8080
let decoded = casted.to_primitive();
8181
assert_arrays_eq!(
82-
decoded,
82+
decoded.as_ref(),
8383
PrimitiveArray::from_iter([10u32, 20, 30, 40, 50, 60])
8484
);
8585
}

encodings/fastlanes/src/for/compress.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ fn decompress_primitive<T: NativePType + WrappingAdd + PrimInt>(
151151
values: BufferMut<T>,
152152
min: T,
153153
) -> Buffer<T> {
154-
values.map_each(move |v| v.wrapping_add(&min)).freeze()
154+
values
155+
.map_each_in_place(move |v| v.wrapping_add(&min))
156+
.freeze()
155157
}
156158

157159
#[cfg(test)]

encodings/fastlanes/src/rle/compress.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,13 @@ mod test {
285285
fn test_partial_last_chunk() {
286286
// Test array with partial last chunk (not divisible by 1024)
287287
let values: Buffer<u32> = (0..1500).map(|i| (i / 100) as u32).collect();
288-
let expected: Vec<u32> = (0..1500).map(|i| (i / 100) as u32).collect();
289288
let array = values.into_array();
290289

291290
let encoded = RLEArray::encode(&array.to_primitive()).unwrap();
292291
let decoded = encoded.to_primitive();
293292

294293
assert_eq!(encoded.len(), 1500);
295-
let expected_array = PrimitiveArray::from_iter(expected);
296-
assert_arrays_eq!(decoded, expected_array);
294+
assert_arrays_eq!(decoded, array);
297295
// 2 chunks: 1024 + 476 elements
298296
assert_eq!(encoded.values_idx_offsets().len(), 2);
299297
}
@@ -302,15 +300,13 @@ mod test {
302300
fn test_two_full_chunks() {
303301
// Array that spans exactly 2 chunks (2048 elements)
304302
let values: Buffer<u32> = (0..2048).map(|i| (i / 100) as u32).collect();
305-
let expected: Vec<u32> = (0..2048).map(|i| (i / 100) as u32).collect();
306303
let array = values.into_array();
307304

308305
let encoded = RLEArray::encode(&array.to_primitive()).unwrap();
309306
let decoded = encoded.to_primitive();
310307

311308
assert_eq!(encoded.len(), 2048);
312-
let expected_array = PrimitiveArray::from_iter(expected);
313-
assert_arrays_eq!(decoded, expected_array);
309+
assert_arrays_eq!(decoded, array);
314310
assert_eq!(encoded.values_idx_offsets().len(), 2);
315311
}
316312

encodings/zigzag/src/compress.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ fn zigzag_encode_primitive<T: ExternalZigZag + NativePType>(
3333
where
3434
<T as ExternalZigZag>::UInt: NativePType,
3535
{
36-
PrimitiveArray::new(values.map_each(|v| T::encode(v)).freeze(), validity)
36+
PrimitiveArray::new(
37+
values.map_each_in_place(|v| T::encode(v)).freeze(),
38+
validity,
39+
)
3740
}
3841

3942
pub fn zigzag_decode(parray: PrimitiveArray) -> PrimitiveArray {
@@ -57,7 +60,10 @@ fn zigzag_decode_primitive<T: ExternalZigZag + NativePType>(
5760
where
5861
<T as ExternalZigZag>::UInt: NativePType,
5962
{
60-
PrimitiveArray::new(values.map_each(|v| T::decode(v)).freeze(), validity)
63+
PrimitiveArray::new(
64+
values.map_each_in_place(|v| T::decode(v)).freeze(),
65+
validity,
66+
)
6167
}
6268

6369
#[cfg(test)]

vortex-array/src/arrays/bool/vtable/operator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl OperatorVTable<BoolVTable> for BoolVTable {
2727
// Note that validity already has the mask applied so we only need to apply it to bits.
2828
let bits = bits.filter(&mask);
2929

30-
Ok(BoolVector::new(bits, validity).into())
30+
Ok(BoolVector::try_new(bits, validity)?.into())
3131
}))
3232
}
3333
}

vortex-array/src/arrays/primitive/array/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl PrimitiveArray {
192192
{
193193
let validity = self.validity().clone();
194194
let buffer = match self.try_into_buffer_mut() {
195-
Ok(buffer_mut) => buffer_mut.map_each(f),
195+
Ok(buffer_mut) => buffer_mut.map_each_in_place(f),
196196
Err(parray) => BufferMut::<R>::from_iter(parray.buffer::<T>().iter().copied().map(f)),
197197
};
198198
PrimitiveArray::new(buffer.freeze(), validity)

0 commit comments

Comments
 (0)