Skip to content

Commit 1667614

Browse files
committed
Remove operators
Signed-off-by: Nicholas Gates <[email protected]>
1 parent c2e58dc commit 1667614

File tree

41 files changed

+206
-1292
lines changed

Some content is hidden

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

41 files changed

+206
-1292
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

encodings/alp/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ vortex-error = { workspace = true }
2828
vortex-fastlanes = { workspace = true }
2929
vortex-mask = { workspace = true }
3030
vortex-scalar = { workspace = true }
31+
vortex-session = { workspace = true }
3132
vortex-utils = { workspace = true }
3233
vortex-vector = { workspace = true }
3334

encodings/alp/src/alp/array.rs

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,15 +453,19 @@ impl VisitorVTable<ALPVTable> for ALPVTable {
453453
#[cfg(test)]
454454
mod tests {
455455
use std::f64::consts::PI;
456+
use std::sync::LazyLock;
456457

457458
use rstest::rstest;
458459
use vortex_array::arrays::PrimitiveArray;
459460
use vortex_array::vtable::ValidityHelper;
460461
use vortex_dtype::PTypeDowncast;
462+
use vortex_session::VortexSession;
461463
use vortex_vector::VectorOps;
462464

463465
use super::*;
464466

467+
static SESSION: LazyLock<VortexSession> = LazyLock::new(|| VortexSession::empty());
468+
465469
#[rstest]
466470
#[case(0)]
467471
#[case(1)]
@@ -476,7 +480,10 @@ mod tests {
476480
let values = PrimitiveArray::from_iter((0..size).map(|i| i as f32));
477481
let encoded = alp_encode(&values, None).unwrap();
478482

479-
let result_vector = encoded.to_array().execute().unwrap();
483+
let result_vector = encoded
484+
.to_array()
485+
.execute(&mut ExecutionCtx::new(SESSION.clone()))
486+
.unwrap();
480487
// Compare against the traditional array-based decompress path
481488
let expected = decompress_into_array(encoded);
482489

@@ -500,7 +507,10 @@ mod tests {
500507
let values = PrimitiveArray::from_iter((0..size).map(|i| i as f64));
501508
let encoded = alp_encode(&values, None).unwrap();
502509

503-
let result_vector = encoded.to_array().execute().unwrap();
510+
let result_vector = encoded
511+
.to_array()
512+
.execute(&mut ExecutionCtx::new(SESSION.clone()))
513+
.unwrap();
504514
// Compare against the traditional array-based decompress path
505515
let expected = decompress_into_array(encoded);
506516

@@ -530,7 +540,10 @@ mod tests {
530540
let encoded = alp_encode(&array, None).unwrap();
531541
assert!(encoded.patches().unwrap().array_len() > 0);
532542

533-
let result_vector = encoded.to_array().execute().unwrap();
543+
let result_vector = encoded
544+
.to_array()
545+
.execute(&mut ExecutionCtx::new(SESSION.clone()))
546+
.unwrap();
534547
// Compare against the traditional array-based decompress path
535548
let expected = decompress_into_array(encoded);
536549

@@ -558,7 +571,10 @@ mod tests {
558571
let array = PrimitiveArray::from_option_iter(values);
559572
let encoded = alp_encode(&array, None).unwrap();
560573

561-
let result_vector = encoded.to_array().execute().unwrap();
574+
let result_vector = encoded
575+
.to_array()
576+
.execute(&mut ExecutionCtx::new(SESSION.clone()))
577+
.unwrap();
562578
// Compare against the traditional array-based decompress path
563579
let expected = decompress_into_array(encoded);
564580

@@ -597,7 +613,10 @@ mod tests {
597613
let encoded = alp_encode(&array, None).unwrap();
598614
assert!(encoded.patches().unwrap().array_len() > 0);
599615

600-
let result_vector = encoded.to_array().execute().unwrap();
616+
let result_vector = encoded
617+
.to_array()
618+
.execute(&mut ExecutionCtx::new(SESSION.clone()))
619+
.unwrap();
601620
// Compare against the traditional array-based decompress path
602621
let expected = decompress_into_array(encoded);
603622

@@ -639,7 +658,9 @@ mod tests {
639658
let slice_len = slice_end - slice_start;
640659
let sliced_encoded = encoded.slice(slice_start..slice_end);
641660

642-
let result_vector = sliced_encoded.execute().unwrap();
661+
let result_vector = sliced_encoded
662+
.execute(&mut ExecutionCtx::new(SESSION.clone()))
663+
.unwrap();
643664
let result_primitive = result_vector.into_primitive().into_f64();
644665

645666
for idx in 0..slice_len {

encodings/fastlanes/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ vortex-dtype = { workspace = true }
3434
vortex-error = { workspace = true }
3535
vortex-mask = { workspace = true }
3636
vortex-scalar = { workspace = true }
37+
vortex-session = { workspace = true }
3738
vortex-utils = { workspace = true }
3839
vortex-vector = { workspace = true }
3940

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,20 +201,26 @@ pub fn count_exceptions(bit_width: u8, bit_width_freq: &[usize]) -> usize {
201201

202202
#[cfg(test)]
203203
mod tests {
204+
use std::sync::LazyLock;
205+
204206
use vortex_array::IntoArray;
205207
use vortex_array::assert_arrays_eq;
208+
use vortex_array::execution::ExecutionCtx;
206209
use vortex_array::validity::Validity;
207210
use vortex_buffer::Buffer;
208211
use vortex_buffer::BufferMut;
209212
use vortex_buffer::buffer;
210213
use vortex_dtype::Nullability;
214+
use vortex_session::VortexSession;
211215
use vortex_vector::VectorMutOps;
212216
use vortex_vector::VectorOps;
213217

214218
use super::*;
215219
use crate::BitPackedVTable;
216220
use crate::bitpack_compress::bitpack_encode;
217221

222+
static SESSION: LazyLock<VortexSession> = LazyLock::new(|| VortexSession::empty());
223+
218224
fn compression_roundtrip(n: usize) {
219225
let values = PrimitiveArray::from_iter((0..n).map(|i| (i % 2047) as u16));
220226
let compressed = BitPackedArray::encode(values.as_ref(), 11).unwrap();
@@ -531,7 +537,10 @@ mod tests {
531537
let unpacked_array = unpack_array(&bitpacked);
532538

533539
// Method 3: Using the execute() method (this is what would be used in production).
534-
let executed = bitpacked.into_array().execute().unwrap();
540+
let executed = bitpacked
541+
.into_array()
542+
.execute(&mut ExecutionCtx::new(SESSION.clone()))
543+
.unwrap();
535544

536545
// All three should produce the same length.
537546
assert_eq!(vector_result.len(), array.len(), "vector length mismatch");
@@ -551,7 +560,10 @@ mod tests {
551560

552561
// Verify that the execute() method works correctly by comparing with unpack_array.
553562
// We convert unpack_array result to a vector using execute() to compare.
554-
let unpacked_executed = unpacked_array.into_array().execute().unwrap();
563+
let unpacked_executed = unpacked_array
564+
.into_array()
565+
.execute(&mut ExecutionCtx::new(SESSION.clone()))
566+
.unwrap();
555567
match (&executed, &unpacked_executed) {
556568
(Vector::Primitive(exec_pv), Vector::Primitive(unpack_pv)) => {
557569
assert_eq!(
@@ -588,7 +600,9 @@ mod tests {
588600
let sliced_bp = sliced.as_::<BitPackedVTable>();
589601
let vector_result = unpack_to_primitive_vector(sliced_bp);
590602
let unpacked_array = unpack_array(sliced_bp);
591-
let executed = sliced.execute().unwrap();
603+
let executed = sliced
604+
.execute(&mut ExecutionCtx::new(SESSION.clone()))
605+
.unwrap();
592606

593607
assert_eq!(
594608
vector_result.len(),

0 commit comments

Comments
 (0)